Changeset 14395


Ignore:
Timestamp:
Dec 22, 2014, 12:02:27 AM (7 years ago)
Author:
mikedld
Message:

#5543: Add a warning panel with id of duplicate torrent (patch by rb07 + personal touch)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/session.cc

    r14394 r14395  
    1717#include <QDesktopServices>
    1818#include <QFile>
     19#include <QFileInfo>
    1920#include <QMessageBox>
    2021#include <QNetworkProxy>
     
    9293FileAdded::executed (int64_t tag, const QString& result, tr_variant * arguments)
    9394{
    94   Q_UNUSED (arguments);
    95 
    9695  if (tag != myTag)
    9796    return;
     
    9998  if (result == "success")
    10099    {
     100      tr_variant * dup;
     101      const char * str;
     102      if (tr_variantDictFindDict (arguments, TR_KEY_torrent_duplicate, &dup) &&
     103          tr_variantDictFindStr (dup, TR_KEY_name, &str, NULL))
     104        {
     105          const QString myFilename = QFileInfo (myName).fileName ();
     106          const QString name = QString::fromUtf8 (str);
     107          QMessageBox::warning (QApplication::activeWindow (),
     108                                tr ("Add Torrent"),
     109                                tr ("<p><b>Unable to add \"%1\".</b></p><p>It is a duplicate of \"%2\" which is already added.</p>").arg (myFilename).arg (name));
     110        }
     111
    101112      if (!myDelFile.isEmpty ())
    102113        {
Note: See TracChangeset for help on using the changeset viewer.