Hello Thomas,

I understand the reason of you patch, what I don't understand is what it brakes Shane gpodder.

Only for the fun:
I would have solve this problem another way (see patch in attachment): have a show_message method in gPodder class which override the base method, and either send a systray notification or call the base class method.

Shane could at least try this patch and tell us if it solves something.

Thomas Perl a écrit :
The reason for the patch is that it failed when showing a message from
other dialogs than the main window (because show_message is in
GladeWidget and only the subclass "gPodder" has a "tray_icon" and
"minimized" attribute.

So, when using show_message in the preferences dialog, you can't access
the "tray_icon" and "minimized" attribute, because they are simply not
there.
This should pose no problem, because the only case when a non-main
window window opens a dialog is when gPodder is not minimized (except
for when you open the preferences dialog via the tray icon).


Thomas

_______________________________________________
gpodder-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/gpodder-devel

Index: doc/man/gpodder.1
===================================================================
--- doc/man/gpodder.1	(révision 560)
+++ doc/man/gpodder.1	(copie de travail)
@@ -1,41 +0,0 @@
-.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.36.
-.TH GPODDER "1" "January 2008" "gpodder 0.10.4" "User Commands"
-.SH NAME
-gpodder \- A Media aggregator and Podcast catcher
-.SH SYNOPSIS
-.B gpodder
-[\fIoptions\fR]
-.SH DESCRIPTION
-gPodder enables you to subscribe to RSS feeds and download
-podcast episodes from these feeds. gPodder can operate in
-GUI mode and in CLI mode. Downloaded podcasts can either
-be synchronized to portable MP3 players (including iPods)
-or played back on the user's desktop.
-.SH OPTIONS
-.TP
-\fB\-\-version\fR
-show program's version number and exit
-.TP
-\fB\-h\fR, \fB\-\-help\fR
-show this help message and exit
-.TP
-\fB\-v\fR, \fB\-\-verbose\fR
-Print debugging output to stdout
-.TP
-\fB\-t\fR, \fB\-\-local\fR
-Run local version in current directory
-.TP
-\fB\-l\fR, \fB\-\-list\fR
-List all channel subscriptions
-.TP
-\fB\-r\fR, \fB\-\-run\fR
-Update channel list, download new podcasts
-.TP
-\fB\-u\fR, \fB\-\-update\fR
-Update channel list and exit
-.TP
-\fB\-a\fR URL, \fB\-\-add\fR=\fIURL\fR
-Subscribe to channel from URL
-.TP
-\fB\-d\fR URL, \fB\-\-delete\fR=\fIURL\fR
-Delete channel specified by URL
Index: src/gpodder/libpodcasts.py
===================================================================
--- src/gpodder/libpodcasts.py	(révision 560)
+++ src/gpodder/libpodcasts.py	(copie de travail)
@@ -198,7 +198,8 @@
         
     def get_filename( self):
         """Return the MD5 sum of the channel URL"""
-        return md5.new( self.url).hexdigest()
+        #return md5.new( self.url).hexdigest()
+	return self.get_title()
 
     filename = property(fget=get_filename)
 
@@ -585,15 +586,13 @@
     def is_locked(self):
         return libgpodder.gPodderLib().history_is_locked(self.url)
 
-    def delete_from_disk(self):
-        try:
-            self.channel.delete_episode_by_url(self.url)
-        except:
-            log('Cannot delete episode from disk: %s', self.title, traceback=True, sender=self)
+    def delete_from_disk( self):
+        self.channel.delete_episode_by_url( self.url)
 
     def local_filename( self):
         extension = util.file_extension_from_url( self.url)
-        return os.path.join( self.channel.save_dir, md5.new( self.url).hexdigest() + extension)
+        # return os.path.join( self.channel.save_dir, md5.new( self.url).hexdigest() + extension)
+	return os.path.join( self.channel.save_dir,self.published + extension)
 
     def sync_filename( self):
         if libgpodder.gPodderLib().config.custom_sync_name_enabled:
@@ -729,7 +728,6 @@
             except: 
                 exctype, value = sys.exc_info()[:2]
                 log( 'Could not convert icon file "%s", error was "%s"', channel.cover_file, value )
-                util.delete_file(channel.cover_file)
 
         if not channel_cover_found:
             iconsize = gtk.icon_size_from_name('channel-icon')
Index: src/gpodder/gui.py
===================================================================
--- src/gpodder/gui.py	(révision 560)
+++ src/gpodder/gui.py	(copie de travail)
@@ -95,12 +95,6 @@
         util.idle_add(self.show_message, message, title)
 
     def show_message( self, message, title = None):
-        if hasattr(self, 'tray_icon') and hasattr(self, 'minimized') and self.tray_icon and self.minimized:
-            if title is None:
-                title = 'gPodder'
-            self.tray_icon.send_notification(message, title)            
-            return
-
         dlg = gtk.MessageDialog( GladeWidget.gpodder_main_window, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_OK)
 
         if title:
@@ -314,6 +308,15 @@
                 self.delete_episode_list(old_episodes, confirm=False)
                 self.updateComboBox()
 
+    def show_message( self, message, title = None):
+        # override base method. Pass the message to tray icon if needed
+        if self.tray_icon and self.minimized:
+            if title is None:
+                title = 'gPodder'
+            self.tray_icon.send_notification(message, title)            
+        else:
+            # call base class
+            GladeWidget.send_notification(self, message, title) 
 
     def treeview_channels_query_tooltip(self, treeview, x, y, keyboard_tooltip, tooltip):
         # FIXME: Do not hardcode treeview header height
_______________________________________________
gpodder-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/gpodder-devel

Reply via email to