[X2go-Commits] pyhoca-gui.git - master (branch) updated: 0.1.0.10-115-g1bafcdd

X2Go dev team git-admin at x2go.org
Sat Mar 17 19:14:20 CET 2012


The branch, master has been updated
       via  1bafcdd48927872f3c265a528ff31958e14f3c93 (commit)
      from  3b77e6c1a28fd9c752ca092fe56fa422743427b9 (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 1bafcdd48927872f3c265a528ff31958e14f3c93
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Sat Mar 17 19:14:13 2012 +0100

    Add support for published applications with no category submenus. Introduce cmd line option --published-applications-no-submenus <int>.

-----------------------------------------------------------------------

Summary of changes:
 debian/changelog              |    2 ++
 pyhoca-gui                    |    1 +
 pyhoca/wxgui/frontend.py      |   13 ++++++++++---
 pyhoca/wxgui/menus_taskbar.py |   19 +++++++++++++++----
 4 files changed, 28 insertions(+), 7 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 79526b5..582bc18 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -69,6 +69,8 @@ pyhoca-gui (0.1.2.0-0~x2go1) UNRELEASED; urgency=low
     - Update of en/de i18n files.
     - Fix disabling of published applications tick box in profile manager.
     - Show the detected GUI language in GUI output.
+    - Add support for published applications with no category submenus.
+      Introduce cmd line option --published-applications-no-submenus <int>.
   * 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-gui b/pyhoca-gui
index 7b8ccab..c831ab0 100755
--- a/pyhoca-gui
+++ b/pyhoca-gui
@@ -188,6 +188,7 @@ x2go_gui_options = [
                    {'args':['--disable-profilemanager'], 'default': False, 'action': 'store_true', 'help': 'disable the session profile manager window', },
                    {'args':['--display'], 'default': None, 'metavar': '<hostname>:<screennumber>', 'help': 'set the DISPLAY environment variable to <hostname>:<screennumber>', },
                    {'args':['--logon-window-position'], 'default': None, 'metavar': '<x-pos>x<y-pos>', 'help': 'give a custom position for the logon window, use negative values to position relative to right/bottom border', },
+                   {'args':['--published-applications-no-submenus'], 'default': 9, 'metavar': '<number>', 'help': 'the number of published applications that will be rendered without submenus', },
                  ]
 if _X2GOCLIENT_OS == 'Windows':
     x2go_gui_options.append(
diff --git a/pyhoca/wxgui/frontend.py b/pyhoca/wxgui/frontend.py
index 7597e5f..11fa4ca 100644
--- a/pyhoca/wxgui/frontend.py
+++ b/pyhoca/wxgui/frontend.py
@@ -320,10 +320,14 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
         self._pyhoca_logger('exit application', loglevel=x2go.log.loglevel_INFO, )
         if self.args.single_session_profile:
             if not x2go.defaults.X2GOCLIENT_OS == 'Windows':
-                self.notifier.send(self.args.session_profile, _('Suspending Sessions and Exiting...'), icon='application-exit', timeout=10000)
+                if self.client_running_sessions_of_profile_name(self.args.session_profile):
+                    self.notifier.send(self.args.session_profile, _('Suspending sessions and exiting...'), icon='application-exit', timeout=10000)
+                else:
+                    self.notifier.send(self.args.session_profile, _('Disconnecting and exiting...'), icon='application-exit', timeout=10000)
             self._eventid_profilenames_map[evt.GetId()] = self.args.session_profile
             self.OnServerDisconnect(evt)
-        self.Exit()
+        self.WakeUpIdle()
+        self.ExitMainLoop()
 
     def _start_on_connect(self, evt, session_uuid):
         if not self._X2goClient__list_sessions(session_uuid):
@@ -698,7 +702,10 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
                 self._hide_notifications_map[self.current_profile_name] = self._X2goClient__client_running_sessions_of_profile_name(self.current_profile_name, return_session_names=True)
 
         gevent.spawn(self._X2goClient__disconnect_profile, self.current_profile_name)
-        self.notifier.send(_(u'%s - disconnect') % self.current_profile_name, _(u'X2Go Profile is now disconnected.'), icon='auth_disconnect', timeout=4000)
+
+        if not self.args.single_session_profile:
+            self.notifier.send(_(u'%s - disconnect') % self.current_profile_name, _(u'X2Go Profile is now disconnected.'), icon='auth_disconnect', timeout=4000)
+
         if self.exit_on_disconnect:
             self._pyhoca_logger('Exiting %s because %s got disconnected.' % (self.appname, self.current_profile_name), loglevel=x2go.loglevel_NOTICE)
             self.WakeUpIdle()
diff --git a/pyhoca/wxgui/menus_taskbar.py b/pyhoca/wxgui/menus_taskbar.py
index 79b5b33..728d02a 100644
--- a/pyhoca/wxgui/menus_taskbar.py
+++ b/pyhoca/wxgui/menus_taskbar.py
@@ -341,7 +341,7 @@ def _generate_Menu_PublishedApplications(_PyHocaGUI, caller=None, profile_name=N
     """
     _lang = _PyHocaGUI.lang
     _pub_app_session = _PyHocaGUI.get_session_of_session_name(session_name, return_object=True)
-    menu_map = _pub_app_session.get_published_applications(lang=_lang)
+    menu_map = _pub_app_session.get_published_applications(lang=_lang, max_no_submenus=_PyHocaGUI.args.published_applications_no_submenus)
     if not menu_map.has_key(_lang):
         return {}
 
@@ -361,6 +361,7 @@ def _generate_Menu_PublishedApplications(_PyHocaGUI, caller=None, profile_name=N
         'System': (_(u'System'), os.path.normpath('%s/PyHoca/%s/applications-system.png' % (_icons_location, _icon_size), ), ),
         'Utilities': (_(u'Utilities'), os.path.normpath('%s/PyHoca/%s/applications-utilities.png' % (_icons_location, _icon_size), ), ),
         'Other Applications': (_(u'Other Applications'), os.path.normpath('%s/PyHoca/%s/applications-other.png' % (_icons_location, _icon_size), ), ),
+        'NO_SUBMENUS': ('NO_SUBMENUS', os.path.normpath('%s/PyHoca/%s/x2go-logo-grey.png' % (_icons_location, _icon_size), ), ),
     }
 
     _PyHocaGUI._eventid_pubapp_execmap[profile_name] = {}
@@ -390,8 +391,8 @@ def _generate_Menu_PublishedApplications(_PyHocaGUI, caller=None, profile_name=N
                         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)
 
+                _wx_menu_map[_category_name_translator[cat][0]][0].AppendItem(_menu_item)
                 _PyHocaGUI.Bind(wx.EVT_MENU, _PyHocaGUI.OnPubAppExecution, id=_pubapp_id)
 
     else:
@@ -462,11 +463,16 @@ class PyHocaGUI_Menu_TaskbarSessionProfile(wx.Menu):
                     _category_map = _generate_Menu_PublishedApplications(self._PyHocaGUI, caller=self, profile_name=profile_name, session_name=_pub_app_session.get_session_name())
                     _category_names = _category_map.keys()
                     _category_names.sort()
-                    for cat_name in _category_names:
+                    for cat_name in [ _cn for _cn in _category_names if _cn != 'NO_SUBMENUS' ]:
                         _submenu = self.AppendMenu(id=wx.NewId(), text=cat_name, submenu=_category_map[cat_name][0])
                         _submenu.SetBitmap(wx.Bitmap(_category_map[cat_name][1]))
                         if _session_name_disabled:
                             _submenu.Enable(False)
+                    if 'NO_SUBMENUS' in _category_names:
+                        for _menu_item in _category_map['NO_SUBMENUS'][0].GetMenuItems():
+                            _item = self.AppendItem(item=_menu_item)
+                            if _session_name_disabled:
+                                _item.Enable(False)
                     self.AppendSeparator()
 
                     ID_RESUMESESSION = wx.NewId()
@@ -513,11 +519,16 @@ class PyHocaGUI_Menu_TaskbarSessionProfile(wx.Menu):
                         _category_map = _generate_Menu_PublishedApplications(self._PyHocaGUI, caller=self, profile_name=profile_name, session_name=_pub_app_session.get_session_name())
                         _category_names = _category_map.keys()
                         _category_names.sort()
-                        for cat_name in _category_names:
+                        for cat_name in [ _cn for _cn in _category_names if _cn != 'NO_SUBMENUS' ]:
                             _submenu = self.AppendMenu(id=wx.NewId(), text=cat_name, submenu=_category_map[cat_name][0])
                             _submenu.SetBitmap(wx.Bitmap(_category_map[cat_name][1]))
                             if _session_name_disabled:
                                 _submenu.Enable(False)
+                        if 'NO_SUBMENUS' in _category_names:
+                            for _menu_item in _category_map['NO_SUBMENUS'][0].GetMenuItems():
+                                _item = self.AppendItem(item=_menu_item)
+                                if _session_name_disabled:
+                                    _item.Enable(False)
 
                         self.AppendSeparator()
 


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)).




More information about the x2go-commits mailing list