From 202ea95767c33b1256ed69671525c42e284913b1 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Tue, 9 Sep 2014 18:51:35 -0400 Subject: [PATCH] wix: Avoid setting a bad icon From 6fb18309a1d971235c0c3d568704fd91809d2d6e Mon Sep 17 00:00:00 2001 The code tries to load an icon from 'icons/crystal/32/tray_icon.xpm' (relative to self.media_dir), which is part of sat_media, released independently by upstream and not yet part of Debian. It then tries to set this invalid icon. With wxPython 2.8 these issues get quietly ignored, but wxPython 3.0 reports them. As a simple workaround I've just added a check that the icon is valid before setting it, so now you get a messagebox about the icon file not being found and then the app starts. Obviously it would be better to package sat_media so that the icon is available on the system. --- frontends/src/wix/main_window.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontends/src/wix/main_window.py b/frontends/src/wix/main_window.py index 35b2a67f..fd3d4ad3 100644 --- a/frontends/src/wix/main_window.py +++ b/frontends/src/wix/main_window.py @@ -84,7 +84,8 @@ class MainWindow(wx.Frame, QuickApp): #tray icon ticon = wx.Icon(os.path.join(self.media_dir, 'icons/crystal/32/tray_icon.xpm'), wx.BITMAP_TYPE_XPM) self.tray_icon = wx.TaskBarIcon() - self.tray_icon.SetIcon(ticon, _("Wix jabber client")) + if ticon.IsOk(): + self.tray_icon.SetIcon(ticon, _("Wix jabber client")) wx.EVT_TASKBAR_LEFT_UP(self.tray_icon, self.onTrayClick)