Sorry, forget the previous patch (it contains my patch for human readable files) and use this one instead.

Jérôme

Jérôme Chabod a écrit :
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
 


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



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