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

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


The branch, build-59a18b6e3b5d3f1dd8f07f26433d37fe5984a57d has been updated
       via  c45da221e1643309bd6d64772b30d7ff7761618a (commit)
      from  a5e7fc0e0d950b243c3ad4e82d492d230b114883 (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:
 pyhoca/wxgui/frontend.py      |    2 ++
 pyhoca/wxgui/menus_taskbar.py |   18 ++++++++++++++----
 2 files changed, 16 insertions(+), 4 deletions(-)

The diff of changes is:
diff --git a/pyhoca/wxgui/frontend.py b/pyhoca/wxgui/frontend.py
index 4354b2f..9f0cb1c 100644
--- a/pyhoca/wxgui/frontend.py
+++ b/pyhoca/wxgui/frontend.py
@@ -557,6 +557,8 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
         self.notifier.send('%s - resume' % profile_name, 'Resuming X2go session...\n%s' % session_name, icon='session_resume', timeout=5000)
     def HOOK_on_session_has_resumed_by_other(self, session_uuid='UNKNOWN', profile_name='UNKNOWN', session_name='UNKNOWN'):
         self.notifier.send('%s - resume' % profile_name, 'Another client resumed X2go session\n%s' % session_name, icon='session_resume', timeout=5000)
+    def HOOK_on_found_session_running_after_connect(self, session_uuid='UNKNOWN', profile_name='UNKNOWN', session_name='UNKNOWN'):
+        gevent.spawn_later(5, self.notifier.send, '%s - running' % profile_name, 'Found already running session\n%s' %  session_name, icon='session_resume', timeout=5000)
     def HOOK_on_session_has_been_suspended(self, session_uuid='UNKNOWN', profile_name='UNKNOWN', session_name='UNKNOWN'):
         self.notifier.send('%s - suspend' % profile_name, 'X2go Session has been suspended\n%s' % session_name, icon='session_suspend', timeout=5000)
     def HOOK_on_session_has_terminated(self, session_uuid='UNKNOWN', profile_name='UNKNOWN', session_name='UNKNOWN'):
diff --git a/pyhoca/wxgui/menus_taskbar.py b/pyhoca/wxgui/menus_taskbar.py
index f7aae23..6d292b4 100644
--- a/pyhoca/wxgui/menus_taskbar.py
+++ b/pyhoca/wxgui/menus_taskbar.py
@@ -121,28 +121,37 @@ class PyHocaGUI_Menu_TaskbarSessionActions(wx.Menu):
 
         wx.Menu.__init__(self)
 
+        ID_TRANSFERSESSION = wx.NewId()
         ID_RESUMESESSION = wx.NewId()
         ID_SUSPENDSESSION = wx.NewId()
         ID_TERMINATESESSION = wx.NewId()
 
         # preparing profile_name information for the main PyHocaGUI instance
-        self._PyHocaGUI._eventid_profilenames_map[ID_RESUMESESSION] = \
+        self._PyHocaGUI._eventid_profilenames_map[ID_TRANSFERSESSION] = \
+            self._PyHocaGUI._eventid_profilenames_map[ID_RESUMESESSION] = \
             self._PyHocaGUI._eventid_profilenames_map[ID_SUSPENDSESSION] = \
             self._PyHocaGUI._eventid_profilenames_map[ID_TERMINATESESSION] = profile_name
 
         # preparing session_name information for the main PyHocaGUI instance
-        self._PyHocaGUI._eventid_sessionnames_map[ID_RESUMESESSION] = \
+        self._PyHocaGUI._eventid_sessionnames_map[ID_TRANSFERSESSION] = \
+            self._PyHocaGUI._eventid_sessionnames_map[ID_RESUMESESSION] = \
             self._PyHocaGUI._eventid_sessionnames_map[ID_SUSPENDSESSION] = \
             self._PyHocaGUI._eventid_sessionnames_map[ID_TERMINATESESSION] = session_name
 
+        print session_name, status
+
         if status == 'S':
             self.Append(text="Resume Session", id=ID_RESUMESESSION)
         elif status == 'R':
+            print self._PyHocaGUI.client_associated_sessions_of_profile_name(profile_name, return_session_names=True)
+            if not session_name in self._PyHocaGUI.client_associated_sessions_of_profile_name(profile_name, return_session_names=True):
+                self.Append(text="Transfer Session", id=ID_TRANSFERSESSION)
             self.Append(text="Suspend Session", id=ID_SUSPENDSESSION)
 
         self.Append(text="Terminate Session", id=ID_TERMINATESESSION)
 
         self._PyHocaGUI.Bind(wx.EVT_MENU, self._PyHocaGUI.OnSessionResume, id=ID_RESUMESESSION)
+        self._PyHocaGUI.Bind(wx.EVT_MENU, self._PyHocaGUI.OnSessionResume, id=ID_TRANSFERSESSION)
         self._PyHocaGUI.Bind(wx.EVT_MENU, self._PyHocaGUI.OnSessionSuspend, id=ID_SUSPENDSESSION)
         self._PyHocaGUI.Bind(wx.EVT_MENU, self._PyHocaGUI.OnSessionTerminate, id=ID_TERMINATESESSION)
 
@@ -180,8 +189,9 @@ class PyHocaGUI_Menu_TaskbarSessionProfile(wx.Menu):
         self.Append(id=ID_SESSIONSTART, text="Start &new Session")
         self.AppendSeparator()
 
-        _query_session_uuid = self._PyHocaGUI.client_connected_sessions_of_profile_name(profile_name)[0]
+        _query_session_uuid = self._PyHocaGUI.client_connected_sessions_of_profile_name(profile_name, return_objects=False)[0]
         _session_list = self._PyHocaGUI.list_sessions(_query_session_uuid)
+        print self._PyHocaGUI.list_sessions(_query_session_uuid, raw=True)
 
         if _session_list:
 
@@ -207,7 +217,7 @@ class PyHocaGUI_Menu_TaskbarSessionProfile(wx.Menu):
         self.Append(id=ID_EDITPROFILEWHILECONNECTED, text="Customize &profile")
         if current_profile_config['useexports']:
             _share_folder = self.Append(id=ID_SHARELOCALFOLDER, text="Share local &folder")
-            if not self._PyHocaGUI._X2goClient__client_associated_sessions_of_profile_name(profile_name):
+            if not self._PyHocaGUI._X2goClient__client_associated_sessions_of_profile_name(profile_name, return_objects=False):
                 _share_folder.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