mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-09 18:08:39 +00:00
Tweaks to TorrentNotification plugin.
This commit is contained in:
parent
3115498790
commit
2e489bb00b
1 changed files with 9 additions and 5 deletions
|
@ -72,16 +72,20 @@ class TorrentNotification:
|
||||||
def set_tray_flashing_on(self):
|
def set_tray_flashing_on(self):
|
||||||
if self.window.has_toplevel_focus() is not True:
|
if self.window.has_toplevel_focus() is not True:
|
||||||
self.interface.tray_icon.set_blinking(True)
|
self.interface.tray_icon.set_blinking(True)
|
||||||
|
|
||||||
|
|
||||||
def show_notification(self, event):
|
def show_notification(self, event):
|
||||||
import pynotify
|
import pynotify
|
||||||
|
|
||||||
file_info = self.interface.manager.get_torrent_file_info(event['unique_ID'])
|
file_info = self.interface.manager.get_torrent_file_info(event['unique_ID'])
|
||||||
self.filelist = ""
|
filelist = ""
|
||||||
for file in file_info:
|
for file in file_info[:10]:
|
||||||
self.filelist += file['path']+"\n"
|
filelist += file['path'] + "\n"
|
||||||
|
if len(file_info) > 10:
|
||||||
|
filelist += '...'
|
||||||
|
|
||||||
if pynotify.init("My Application Name"):
|
if pynotify.init("My Application Name"):
|
||||||
n = pynotify.Notification("Torrent complete", "Files:\n"+self.filelist)
|
n = pynotify.Notification("Torrent complete",
|
||||||
|
"Files:\n" + filelist)
|
||||||
n.show()
|
n.show()
|
||||||
else:
|
else:
|
||||||
print "there was a problem initializing the pynotify module"
|
print "there was a problem initializing the pynotify module"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue