From 2e489bb00baa93d282be322431e074daa5c450eb Mon Sep 17 00:00:00 2001 From: Alex Dedul Date: Mon, 16 Jul 2007 12:05:24 +0000 Subject: [PATCH] Tweaks to TorrentNotification plugin. --- plugins/TorrentNotification/__init__.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/plugins/TorrentNotification/__init__.py b/plugins/TorrentNotification/__init__.py index ce1fe3b7e..cd4d2a342 100644 --- a/plugins/TorrentNotification/__init__.py +++ b/plugins/TorrentNotification/__init__.py @@ -72,16 +72,20 @@ class TorrentNotification: def set_tray_flashing_on(self): if self.window.has_toplevel_focus() is not True: self.interface.tray_icon.set_blinking(True) - def show_notification(self, event): import pynotify + file_info = self.interface.manager.get_torrent_file_info(event['unique_ID']) - self.filelist = "" - for file in file_info: - self.filelist += file['path']+"\n" + filelist = "" + for file in file_info[:10]: + filelist += file['path'] + "\n" + if len(file_info) > 10: + filelist += '...' + 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() else: print "there was a problem initializing the pynotify module"