comparison frontends/src/wix/main_window.py @ 1197:69ffe61240eb

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.
author Olly Betts <olly@survex.com>
date Tue, 09 Sep 2014 18:51:35 -0400
parents 75025461141f
children
comparison
equal deleted inserted replaced
1196:268278d9aef2 1197:69ffe61240eb
82 self.tools.Disable() 82 self.tools.Disable()
83 83
84 #tray icon 84 #tray icon
85 ticon = wx.Icon(os.path.join(self.media_dir, 'icons/crystal/32/tray_icon.xpm'), wx.BITMAP_TYPE_XPM) 85 ticon = wx.Icon(os.path.join(self.media_dir, 'icons/crystal/32/tray_icon.xpm'), wx.BITMAP_TYPE_XPM)
86 self.tray_icon = wx.TaskBarIcon() 86 self.tray_icon = wx.TaskBarIcon()
87 self.tray_icon.SetIcon(ticon, _("Wix jabber client")) 87 if ticon.IsOk():
88 self.tray_icon.SetIcon(ticon, _("Wix jabber client"))
88 wx.EVT_TASKBAR_LEFT_UP(self.tray_icon, self.onTrayClick) 89 wx.EVT_TASKBAR_LEFT_UP(self.tray_icon, self.onTrayClick)
89 90
90 91
91 #events 92 #events
92 self.Bind(wx.EVT_CLOSE, self.onClose, self) 93 self.Bind(wx.EVT_CLOSE, self.onClose, self)