1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-03-11 12:51:03 +00:00

Don't show added torrent notification during startup.

This commit is contained in:
sledgehammer999 2016-04-30 01:38:24 +03:00
parent ef6e848756
commit 0143799623
4 changed files with 7 additions and 3 deletions

View File

@ -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)

View File

@ -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);

View File

@ -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()));

View File

@ -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();