[X2Go-Commits] [pyhoca-gui] 01/01: Make the published applications menu tree more robust against unknown icon image types.
git-admin at x2go.org
git-admin at x2go.org
Mon Jun 30 12:08:41 CEST 2014
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository pyhoca-gui.
commit 5c8bd2871e2abd62c58de3f199a15666efc91268
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Mon Jun 30 12:07:18 2014 +0200
Make the published applications menu tree more robust against unknown icon image types.
---
debian/changelog | 2 ++
pyhoca/wxgui/menus_taskbar.py | 15 ++++++++-------
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index d54f82f..b489363 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -63,6 +63,8 @@ pyhoca-gui (0.5.0.0-0x2go1) UNRELEASED; urgency=low
- Grey-out all SSH related options for DirectRDP sessions.
- Make the clipboard mode configurable through the session profile manager
window. (Fixes: #507).
+ - Make the published applications menu tree more robust against unknown
+ icon image types.
* debian/control:
+ Add D (bin:package pyhoca-gui): python-cups. (Fixes: #460).
diff --git a/pyhoca/wxgui/menus_taskbar.py b/pyhoca/wxgui/menus_taskbar.py
index 1829763..b4fb7cc 100644
--- a/pyhoca/wxgui/menus_taskbar.py
+++ b/pyhoca/wxgui/menus_taskbar.py
@@ -482,6 +482,7 @@ def _generate_Menu_PublishedApplications(_PyHocaGUI, caller=None, profile_name=N
_PyHocaGUI._eventid_pubapp_execmap[profile_name] = {}
+ nolog = wx.LogNull()
_wx_menu_map = {}
if menu_map[_lang].keys():
for cat in menu_map[_lang].keys():
@@ -500,17 +501,17 @@ def _generate_Menu_PublishedApplications(_PyHocaGUI, caller=None, profile_name=N
_menu_item.SetBitmap(wx.Bitmap(os.path.normpath('%s/PyHoca/%s/x2go-logo-grey.png' % (_icons_location, _icon_size))))
else:
_menu_entry_icon_decoded = base64.b64decode(_item['icon'])
- if not re.match('^<\?(xml|XML).*version=.*encoding=.*standalone=.*\?>.*', _menu_entry_icon_decoded.split('\n')[0]):
- _icon_image = wx.ImageFromStream(StringIO.StringIO(_menu_entry_icon_decoded))
- if x2go.defaults.X2GOCLIENT_OS == 'Windows':
- _icon_bitmap = wx.BitmapFromImage(_icon_image.Scale(16,16))
- else:
- _icon_bitmap = wx.BitmapFromImage(_icon_image.Scale(22,22))
- _menu_item.SetBitmap(_icon_bitmap)
+ _icon_image = wx.ImageFromStream(StringIO.StringIO(_menu_entry_icon_decoded))
+ if x2go.defaults.X2GOCLIENT_OS == 'Windows':
+ _icon_bitmap = wx.BitmapFromImage(_icon_image.Scale(16,16))
+ else:
+ _icon_bitmap = wx.BitmapFromImage(_icon_image.Scale(22,22))
+ _menu_item.SetBitmap(_icon_bitmap)
_wx_menu_map[_category_name_translator[cat][0]][0].AppendItem(_menu_item)
_PyHocaGUI.Bind(wx.EVT_MENU, _PyHocaGUI.OnPubAppExecution, id=_pubapp_id)
+ del nolog
return _wx_menu_map
--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/pyhoca-gui.git
More information about the x2go-commits
mailing list