Browse Source

Don't show added torrent notification during startup.

adaptive-webui-19844
sledgehammer999 9 years ago
parent
commit
0143799623
  1. 3
      src/base/bittorrent/session.cpp
  2. 1
      src/base/bittorrent/session.h
  3. 4
      src/gui/mainwindow.cpp
  4. 2
      src/gui/mainwindow.h

3
src/base/bittorrent/session.cpp

@ -2458,6 +2458,9 @@ void Session::createTorrentHandle(const libt::torrent_handle &nativeHandle)
// Send torrent addition signal // Send torrent addition signal
emit torrentAdded(torrent); emit torrentAdded(torrent);
// Send new torrent signal
if (!data.resumed)
emit torrentNew(torrent);
} }
void Session::handleAddTorrentAlert(libt::add_torrent_alert *p) void Session::handleAddTorrentAlert(libt::add_torrent_alert *p)

1
src/base/bittorrent/session.h

@ -285,6 +285,7 @@ namespace BitTorrent
void torrentsUpdated(); void torrentsUpdated();
void addTorrentFailed(const QString &error); void addTorrentFailed(const QString &error);
void torrentAdded(BitTorrent::TorrentHandle *const torrent); void torrentAdded(BitTorrent::TorrentHandle *const torrent);
void torrentNew(BitTorrent::TorrentHandle *const torrent);
void torrentAboutToBeRemoved(BitTorrent::TorrentHandle *const torrent); void torrentAboutToBeRemoved(BitTorrent::TorrentHandle *const torrent);
void torrentPaused(BitTorrent::TorrentHandle *const torrent); void torrentPaused(BitTorrent::TorrentHandle *const torrent);
void torrentResumed(BitTorrent::TorrentHandle *const torrent); void torrentResumed(BitTorrent::TorrentHandle *const torrent);

4
src/gui/mainwindow.cpp

@ -186,7 +186,7 @@ MainWindow::MainWindow(QWidget *parent)
// Creating Bittorrent session // Creating Bittorrent session
connect(BitTorrent::Session::instance(), SIGNAL(fullDiskError(BitTorrent::TorrentHandle *const, QString)), this, SLOT(fullDiskError(BitTorrent::TorrentHandle *const, QString))); connect(BitTorrent::Session::instance(), SIGNAL(fullDiskError(BitTorrent::TorrentHandle *const, QString)), this, SLOT(fullDiskError(BitTorrent::TorrentHandle *const, QString)));
connect(BitTorrent::Session::instance(), SIGNAL(addTorrentFailed(const QString &)), this, SLOT(addTorrentFailed(const QString &))); connect(BitTorrent::Session::instance(), SIGNAL(addTorrentFailed(const QString &)), this, SLOT(addTorrentFailed(const QString &)));
connect(BitTorrent::Session::instance(), SIGNAL(torrentAdded(BitTorrent::TorrentHandle *const)), this, SLOT(torrentAdded(BitTorrent::TorrentHandle *const))); connect(BitTorrent::Session::instance(), SIGNAL(torrentNew(BitTorrent::TorrentHandle *const)), this, SLOT(torrentNew(BitTorrent::TorrentHandle *const)));
connect(BitTorrent::Session::instance(), SIGNAL(torrentFinished(BitTorrent::TorrentHandle *const)), this, SLOT(finishedTorrent(BitTorrent::TorrentHandle *const))); connect(BitTorrent::Session::instance(), SIGNAL(torrentFinished(BitTorrent::TorrentHandle *const)), this, SLOT(finishedTorrent(BitTorrent::TorrentHandle *const)));
connect(BitTorrent::Session::instance(), SIGNAL(trackerAuthenticationRequired(BitTorrent::TorrentHandle *const)), this, SLOT(trackerAuthenticationRequired(BitTorrent::TorrentHandle *const))); connect(BitTorrent::Session::instance(), SIGNAL(trackerAuthenticationRequired(BitTorrent::TorrentHandle *const)), this, SLOT(trackerAuthenticationRequired(BitTorrent::TorrentHandle *const)));
connect(BitTorrent::Session::instance(), SIGNAL(downloadFromUrlFailed(QString, QString)), this, SLOT(handleDownloadFromUrlFailure(QString, QString))); connect(BitTorrent::Session::instance(), SIGNAL(downloadFromUrlFailed(QString, QString)), this, SLOT(handleDownloadFromUrlFailure(QString, QString)));
@ -723,7 +723,7 @@ void MainWindow::addTorrentFailed(const QString &error) const
} }
// called when a torrent was added // called when a torrent was added
void MainWindow::torrentAdded(BitTorrent::TorrentHandle *const torrent) const void MainWindow::torrentNew(BitTorrent::TorrentHandle *const torrent) const
{ {
if (isTorrentAddedNotificationsEnabled()) if (isTorrentAddedNotificationsEnabled())
showNotificationBaloon(tr("Torrent added"), tr("'%1' was added.", "e.g: xxx.avi was added.").arg(torrent->name())); showNotificationBaloon(tr("Torrent added"), tr("'%1' was added.", "e.g: xxx.avi was added.").arg(torrent->name()));

2
src/gui/mainwindow.h

@ -126,7 +126,7 @@ private slots:
void loadPreferences(bool configureSession = true); void loadPreferences(bool configureSession = true);
void addUnauthenticatedTracker(const QPair<BitTorrent::TorrentHandle*, QString> &tracker); void addUnauthenticatedTracker(const QPair<BitTorrent::TorrentHandle*, QString> &tracker);
void addTorrentFailed(const QString &error) const; void addTorrentFailed(const QString &error) const;
void torrentAdded(BitTorrent::TorrentHandle *const torrent) const; void torrentNew(BitTorrent::TorrentHandle *const torrent) const;
void finishedTorrent(BitTorrent::TorrentHandle *const torrent) const; void finishedTorrent(BitTorrent::TorrentHandle *const torrent) const;
void askRecursiveTorrentDownloadConfirmation(BitTorrent::TorrentHandle *const torrent); void askRecursiveTorrentDownloadConfirmation(BitTorrent::TorrentHandle *const torrent);
void optionsSaved(); void optionsSaved();

Loading…
Cancel
Save