[X2Go-Commits] pyhoca-gui.git - build-59a18b6e3b5d3f1dd8f07f26433d37fe5984a57d (branch) updated: 0.1.0.10-18-g1e9ad84

X2Go dev team git-admin at x2go.org
Tue Aug 27 13:21:54 CEST 2013


The branch, build-59a18b6e3b5d3f1dd8f07f26433d37fe5984a57d has been updated
       via  1e9ad84f60aa19beb4540303414934d6bc213b3a (commit)
      from  367871d39ee8a270aed41f7ac0e16bc61d706470 (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 -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 debian/changelog              |    2 ++
 pyhoca/wxgui/frontend.py      |   14 ++++++++++++++
 pyhoca/wxgui/menus_taskbar.py |   40 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 56 insertions(+)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index eaeaf02..1312f46 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,6 +14,8 @@ pyhoca-gui (0.1.0.11-0~x2go1) UNRELEASED; urgency=low
     - Enable session profile submenus functionality to profile manager.
     - Rename single application OFFICE from Openoffice.org to Office (more
       generic name).
+    - Add extra menu: launch single application, once a session profile is
+      connected.
   * Depend on Python X2Go 0.1.1.9.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Wed, 09 Nov 2011 03:13:09 +0100
diff --git a/pyhoca/wxgui/frontend.py b/pyhoca/wxgui/frontend.py
index 6cd11e5..bba8e87 100644
--- a/pyhoca/wxgui/frontend.py
+++ b/pyhoca/wxgui/frontend.py
@@ -223,6 +223,7 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
         self._hide_notifications_map = {}
         self._eventid_profilenames_map = {}
         self._eventid_sessionnames_map = {}
+        self._eventid_applications_map = {}
         self._eventid_shared_folders_map = {}
         self._eventid_unshared_folders_map = {}
         self._temp_disabled_profile_names = []
@@ -488,6 +489,19 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
             gevent.spawn(self._X2goClient__start_session, session_uuid)
             _dummy = self._X2goClient__list_sessions(session_uuid, refresh_cache=True)
 
+    def OnApplicationStart(self, evt):
+        """\
+        STILL UNDOCUMENTED
+
+        """
+        self.current_profile_name = self._eventid_profilenames_map[evt.GetId()]
+        _application = self._eventid_applications_map[evt.GetId()]
+        _query_session = self._X2goClient__client_registered_sessions_of_profile_name(self.current_profile_name)[0]
+        session_uuid = self._X2goClient__register_session(profile_name=self.current_profile_name, cmd=_application)
+        if self._X2goClient__server_is_alive(session_uuid):
+            gevent.spawn(self._X2goClient__start_session, session_uuid)
+            _dummy = self._X2goClient__list_sessions(session_uuid, refresh_cache=True)
+
     def _disable_session_name(self, profile_name, session_name):
         if profile_name not in self._temp_disabled_session_names.keys():
             self._temp_disabled_session_names[profile_name] = []
diff --git a/pyhoca/wxgui/menus_taskbar.py b/pyhoca/wxgui/menus_taskbar.py
index 502f998..341e8fc 100644
--- a/pyhoca/wxgui/menus_taskbar.py
+++ b/pyhoca/wxgui/menus_taskbar.py
@@ -259,6 +259,36 @@ class PyHocaGUI_Menu_TaskbarProfileSharedFolders(wx.Menu):
         self._PyHocaGUI.Bind(wx.EVT_MENU, self._PyHocaGUI.OnUnshareAllLocalFolders, id=ID_UNSHAREALLLOCALFOLDERS)
 
 
+class PyHocaGUI_Menu_LaunchSingleApplication(wx.Menu):
+
+    def __init__(self, _PyHocaGUI, caller=None, profile_name=None):
+        """\
+        STILL UNDOCUMENTED
+
+        """
+        self._PyHocaGUI = _PyHocaGUI
+        self._pyhoca_logger = self._PyHocaGUI._pyhoca_logger
+
+        wx.Menu.__init__(self)
+
+        current_profile_config = self._PyHocaGUI.get_profile_config(profile_name)
+
+        _available_applications = {
+            'WWWBROWSER': _(u'Internet Browser'),
+            'MAILCLIENT': _(u'Email Client'),
+            'OFFICE': _(u'Office'), 
+            'TERMINAL': _(u'Terminal'), 
+            }
+
+        for application in current_profile_config['applications']:
+
+            _app_id = wx.NewId()
+            self._PyHocaGUI._eventid_profilenames_map[_app_id] = profile_name
+            self._PyHocaGUI._eventid_applications_map[_app_id] = application
+            self.Append(id=_app_id, text=_available_applications[application])
+            self._PyHocaGUI.Bind(wx.EVT_MENU, self._PyHocaGUI.OnApplicationStart, id=_app_id)
+
+
 class PyHocaGUI_Menu_TaskbarSessionProfile(wx.Menu):
     """\
     STILL UNDOCUMENTED
@@ -283,8 +313,12 @@ class PyHocaGUI_Menu_TaskbarSessionProfile(wx.Menu):
 
         current_profile_config = self._PyHocaGUI.get_profile_config(profile_name)
 
+        if current_profile_config['applications']:
+            ID_LAUNCHAPPLICATION = wx.NewId()
+
         # preparing profile_name information for the main PyHocaGUI instance
         self._PyHocaGUI._eventid_profilenames_map[ID_SESSIONSTART] = \
+            self._PyHocaGUI._eventid_profilenames_map[ID_LAUNCHAPPLICATION] = \
             self._PyHocaGUI._eventid_profilenames_map[ID_CLEANSESSIONS] = \
             self._PyHocaGUI._eventid_profilenames_map[ID_EDITPROFILEWHILECONNECTED] = \
             self._PyHocaGUI._eventid_profilenames_map[ID_SHARELOCALFOLDER] = \
@@ -292,6 +326,12 @@ class PyHocaGUI_Menu_TaskbarSessionProfile(wx.Menu):
             self._PyHocaGUI._eventid_profilenames_map[ID_DISCONNECT] = profile_name
 
         self.Append(id=ID_SESSIONSTART, text=_(u"Start &new Session"))
+
+        if current_profile_config['applications']:
+            self.AppendMenu(id=ID_LAUNCHAPPLICATION, text=_(u"Launch Single Application"),
+                            submenu=PyHocaGUI_Menu_LaunchSingleApplication(self._PyHocaGUI, caller=self, profile_name=profile_name)
+                           )
+
         self.AppendSeparator()
 
         _query_session_uuid = self._PyHocaGUI.client_connected_sessions_of_profile_name(profile_name, return_objects=False)[0]


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