On Sat, 2008-03-01 at 18:14 +0100, Jérôme Chabod wrote:
> Hello,
> 
> Could you try if this patch solves you problem? It will disable the 
> trayicon if an error occured durring import.
> 
> Jérôme

Thanks for the patch. I had to add a couple things to make it work. I've
attached the updated patch. (I added the top level directory so I could
use it from the rpm spec file. Let me know if you'd like the spec file
too.)

Bill
Index: src/gpodder/gui.py
===================================================================
--- gpodder-0.11.0/src/gpodder/gui.py  (révision 595)
+++ gpodder-0.11.0/src/gpodder/gui.py  (copie de travail)
@@ -39,8 +39,14 @@
 from gpodder import sync
 from gpodder import download
 from gpodder import SimpleGladeApp
-from gpodder import trayicon
-
+from gpodder.liblogger import log
+try:
+    from gpodder import trayicon
+    have_trayicon = True
+except Exception, exc:
+    log("Warning: Enable to import trayicon. %s" % exc)
+    have_trayicon = False
+
 from libpodcasts import podcastChannel
 from libpodcasts import channels_to_model
 from libpodcasts import load_channels
@@ -1221,7 +1226,7 @@
     def show_hide_tray_icon(self):
         gl = gPodderLib()

-        if gl.config.display_tray_icon and self.tray_icon is None:
+        if gl.config.display_tray_icon and have_trayicon and self.tray_icon is None:
             self.tray_icon = trayicon.GPodderStatusIcon(self, scalable_dir)
         elif not gl.config.display_tray_icon and self.tray_icon is not None:
             self.tray_icon.set_visible(False)
_______________________________________________
gpodder-devel mailing list
gpodder-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/gpodder-devel

Reply via email to