The branch, master has been updated via a4d4405105bf3221aa6abca05fc92862527b802a (commit) via ebe0667c3c2a115e5dbdb7b1d08152c166b871a8 (commit) from 6aa2c64cfd794a492ff85a4e52c3cee58b1175eb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a4d4405105bf3221aa6abca05fc92862527b802a Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue May 15 08:55:44 2012 +0200 fix for last commit commit ebe0667c3c2a115e5dbdb7b1d08152c166b871a8 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue May 15 08:50:19 2012 +0200 Do not crash if a provided system tray icon cannot be found. Use a fallback icon instead. ----------------------------------------------------------------------- Summary of changes: debian/changelog | 2 ++ pyhoca/wxgui/taskbar.py | 34 +++++++++++++++++++++------------- 2 files changed, 23 insertions(+), 13 deletions(-) The diff of changes is: diff --git a/debian/changelog b/debian/changelog index 6a933a3..e46a53e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -130,6 +130,8 @@ pyhoca-gui (0.1.2.0-0~x2go1) UNRELEASED; urgency=low that gets shown during application startup. - Only show splash if the splash image file does exist. - Fallback to default splash image if the custom splash does not exist. + - Do not crash if a provided system tray icon cannot be found. Use a + fallback icon instead. * Depend on Python X2Go 0.1.2.0. * Install GNOME icons via dh_links. * Install X2Go icons with explicit install paths. diff --git a/pyhoca/wxgui/taskbar.py b/pyhoca/wxgui/taskbar.py index 5aa0a4f..cafd03b 100644 --- a/pyhoca/wxgui/taskbar.py +++ b/pyhoca/wxgui/taskbar.py @@ -73,24 +73,23 @@ class PyHocaGUI_TaskBarIcon(wx.TaskBarIcon): self.tooltip = "" def SetIconConnecting(self, profile_name): - self.icon = self.MakeIcon(icon_name='pyhoca-trayicon') if x2go.X2GOCLIENT_OS == 'Windows': - icon_name = self._PyHocaGUI.tray_icon_connecting or self._PyHocaGUI.tray_icon or 'x2go-logo-ubuntu' - self.icon = self.MakeIcon(icon_name=icon_name) + icon_name = self._PyHocaGUI.tray_icon_connecting or self._PyHocaGUI.tray_icon + self.icon = self.MakeIcon(icon_name=icon_name, fallback_name='x2go-logo-ubuntu') self.SetIcon(self.icon, _(u"PyHoca-GUI\nConnecting you to ,,%s\'\'") % profile_name) else: - icon_name = self._PyHocaGUI.tray_icon_connecting or self._PyHocaGUI.tray_icon or 'pyhoca-trayicon' - self.icon = self.MakeIcon(icon_name=icon_name) + icon_name = self._PyHocaGUI.tray_icon_connecting or self._PyHocaGUI.tray_icon + self.icon = self.MakeIcon(icon_name=icon_name, fallback_name='pyhoca-trayicon') self.SetIcon(self.icon, _(u"PyHoca-GUI (Python X2goClient)\nCurrently connecting you to remote X2Go server ,,%s\'\'") % profile_name) def SetIconIdle(self): if x2go.X2GOCLIENT_OS == 'Windows': - icon_name = self._PyHocaGUI.tray_icon or 'x2go-logo-ubuntu' - self.icon = self.MakeIcon(icon_name=icon_name) + icon_name = self._PyHocaGUI.tray_icon + self.icon = self.MakeIcon(icon_name=icon_name, fallback_name='x2go-logo-ubuntu') self.SetIcon(self.icon, _(u"PyHoca-GUI\nConnecting you to X2Go...")) else: - icon_name = self._PyHocaGUI.tray_icon or 'pyhoca-trayicon' - self.icon = self.MakeIcon(icon_name=icon_name) + icon_name = self._PyHocaGUI.tray_icon + self.icon = self.MakeIcon(icon_name=icon_name, fallback_name='pyhoca-trayicon') self.SetIcon(self.icon, _(u"PyHoca-GUI (Python X2goClient)\nClient for connecting you to a remote X2Go server")) def CreateSessionManagerPopupMenu(self, evt): @@ -117,17 +116,26 @@ class PyHocaGUI_TaskBarIcon(wx.TaskBarIcon): self.menu_optionsmanager = self.PopupMenu(menus_taskbar.PyHocaGUI_Menu_TaskbarOptionsManager(self._PyHocaGUI, caller=self,)) return self.menu_optionsmanager - def MakeIcon(self, icon_name): + def MakeIcon(self, icon_name, fallback_name='pyhoca-trayicon'): """\ The various platforms have different requirements for the icon size... """ if "wxMSW" in wx.PlatformInfo: - img = wx.Image('%s/PyHoca/16x16/%s.png' % (_icons_location, icon_name)) + icon_size = '16x16' elif "wxGTK" in wx.PlatformInfo: - img = wx.Image('%s/PyHoca/22x22/%s.png' % (_icons_location, icon_name)) + icon_size = '22x22' elif "wxMAC" in wx.PlatformInfo: - img = wx.Image('%s/PyHoca/128x128/%s.png' % (_icons_location, icon_name)) + icon_size = '128x128' + + if icon_name is None: + icon_name = fallback_name + + icon_file = '%s/PyHoca/%s/%s.png' % (_icons_location, icon_size, icon_name) + if not (os.path.isfile(icon_file) or os.path.islink(icon_file)): + icon_file = '%s/PyHoca/%s/%s.png' % (_icons_location, icon_size, fallback_name) + + img = wx.Image(icon_file) icon = wx.IconFromBitmap(img.ConvertToBitmap()) return icon hooks/post-receive -- pyhoca-gui.git (Python X2Go Client (wxPython GUI)) This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "pyhoca-gui.git" (Python X2Go Client (wxPython GUI)).