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.
This commit is contained in:
parent
ac37754d47
commit
202ea95767
1 changed files with 2 additions and 1 deletions
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue