Commit 58c989b2 authored by Joris Guisson's avatar Joris Guisson
Browse files

Show notification when torrents are opened silently, patch from Maarten De Meyer.

BUG: 260329
REVIEW: 107094
parent af84f663
......@@ -4,6 +4,7 @@ Changes in 4.4:
- Use translatable unit names in connections stats graph (305395)
- Make sure search engine selected entry is not cleared when defaults are added (306913)
- Reset filter when the filterbar is closed (305379)
- Show notification when torrents are opened silently (260329)
Changes in 4.3.1:
- Fix new custom groups not appearing in add to group submenu (307230)
......
......@@ -361,6 +361,8 @@ namespace kt
}
torrentAdded(tc);
if(silently)
emit openedSilently(tc);
return true;
}
......
......@@ -226,6 +226,7 @@ namespace kt
* Emitted when DHT is not enabled and a MagnetLink is being downloaded
*/
void dhtNotEnabled(const QString & msg);
void openedSilently(bt::TorrentInterface* tc);
private:
void rollback(const QList<bt::TorrentInterface*> & success);
......
......@@ -54,6 +54,12 @@ Comment[x-test]=xxKTorrentxx
Comment[zh_CN]=KTorrent
Comment[zh_TW]=KTorrent
[Event/TorrentSilentlyOpened]
Name=Torrent silently opened
Name[nl]=Torrent stilzwijgend geopend
Name[x-test]=xxTorrent silently openedxx
Action=Sound|Popup
[Event/TorrentStoppedByError]
Name=Torrent stopped by error
Name[ast]=Torrent paráu por fallos
......
......@@ -55,8 +55,10 @@ namespace kt
previousUploadHeight = 0;
queue_suspended = false;
menu = 0;
connect(core, SIGNAL(openedSilently(bt::TorrentInterface*)),
this, SLOT(torrentSilentlyOpened(bt::TorrentInterface* )));
connect(core, SIGNAL(finished(bt::TorrentInterface* )),
this, SLOT(finished(bt::TorrentInterface* )));
connect(core,SIGNAL(torrentStoppedByError(bt::TorrentInterface*, QString )),
......@@ -183,10 +185,20 @@ namespace kt
{
if (!Settings::showPopups())
return;
KNotification::event("DHTNotEnabled",msg,QPixmap(),mwnd);
}
void TrayIcon::torrentSilentlyOpened(bt::TorrentInterface* tc)
{
if (!Settings::showPopups())
return;
QString msg = i18n("<b>%1</b> was silently opened.",
tc->getDisplayName());
KNotification::event("TorrentSilentlyOpened",msg,QPixmap(),mwnd);
}
void TrayIcon::finished(bt::TorrentInterface* tc)
{
if (!Settings::showPopups())
......
......@@ -86,6 +86,12 @@ namespace kt
void showPassivePopup(const QString & msg, const QString & titile);
private slots:
/**
* Show a passive popup, that a torrent has been silently added.
* @param tc The torrent
*/
void torrentSilentlyOpened(bt::TorrentInterface* tc);
/**
* Show a passive popup, that the torrent has stopped downloading.
* @param tc The torrent
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment