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

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


The branch, build-59a18b6e3b5d3f1dd8f07f26433d37fe5984a57d has been updated
       via  7773602142bdd6e45a9c20c5e08dc2f14dd3e585 (commit)
      from  b95ab3113e1fc16b3357e99371dd13792dabf0ee (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 ++
 debian/control                |    2 +-
 pyhoca/wxgui/frontend.py      |    6 ++--
 pyhoca/wxgui/menus_taskbar.py |   66 ++++++++++++++++++++++++-----------------
 4 files changed, 45 insertions(+), 31 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 13b5db2..34374b1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,8 @@ pyhoca-gui (0.2.1.1-0~x2go1) UNRELEASED; urgency=low
   * New upstream version (0.2.1.1):
     - Do not disable the session profile template when creating a session
       profile from an already existing session profile. (Fixes: #90).
+    - Use new feature in Python X2Go 0.2.1.1 that allows the differentiation
+      of sessions associated to different session profiles.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Thu, 13 Dec 2012 13:28:15 +0100
 
diff --git a/debian/control b/debian/control
index 9b8a7f7..3d1c1de 100644
--- a/debian/control
+++ b/debian/control
@@ -30,7 +30,7 @@ Architecture: all
 Depends: 
  ${misc:Depends},
  python,
- python-x2go (>=0.2.1.0-0~),
+ python-x2go (>=0.2.1.1-0~),
  python-argparse,
  python-notify,
  python-setproctitle,
diff --git a/pyhoca/wxgui/frontend.py b/pyhoca/wxgui/frontend.py
index 0c92f19..a77672b 100644
--- a/pyhoca/wxgui/frontend.py
+++ b/pyhoca/wxgui/frontend.py
@@ -885,7 +885,7 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
         session_name = self._eventid_sessionnames_map[evt.GetId()]
         self._disable_session_name(profile_name, session_name)
         if self._X2goClient__server_is_alive(session_uuid):
-            gevent.spawn(self._X2goClient__resume_session, session_name=session_name)
+            gevent.spawn(self._X2goClient__resume_session, session_name=session_name, match_profile_name=profile_name)
             self._X2goClient__list_sessions(session_uuid, refresh_cache=True)
         self._eventid_sessionnames_map = {}
 
@@ -901,7 +901,7 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
         session_uuid = self._X2goClient__client_registered_sessions_of_profile_name(profile_name)[0]
         session_name = self._eventid_sessionnames_map[evt.GetId()]
         self._disable_session_name(profile_name, session_name)
-        gevent.spawn(self._X2goClient__suspend_session, session_uuid, session_name=session_name)
+        gevent.spawn(self._X2goClient__suspend_session, session_uuid, session_name=session_name, match_profile_name=profile_name)
         self._eventid_sessionnames_map = {}
         if self.disconnect_on_suspend and self.get_session(session_uuid).has_terminal_session():
             self.OnServerDisconnect(evt)
@@ -918,7 +918,7 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
         session_uuid = self._X2goClient__client_registered_sessions_of_profile_name(profile_name)[0]
         session_name = self._eventid_sessionnames_map[evt.GetId()]
         self._disable_session_name(profile_name, session_name)
-        gevent.spawn(self._X2goClient__terminate_session, session_uuid, session_name=session_name)
+        gevent.spawn(self._X2goClient__terminate_session, session_uuid, session_name=session_name, match_profile_name=profile_name)
         self._eventid_sessionnames_map = {}
         if self.disconnect_on_terminate and self.get_session(session_uuid).has_terminal_session():
             self.OnServerDisconnect(evt)
diff --git a/pyhoca/wxgui/menus_taskbar.py b/pyhoca/wxgui/menus_taskbar.py
index 8fb35ab..e7c07cf 100644
--- a/pyhoca/wxgui/menus_taskbar.py
+++ b/pyhoca/wxgui/menus_taskbar.py
@@ -212,7 +212,7 @@ class PyHocaGUI_Menu_TaskbarSessionActions(wx.Menu):
             self._PyHocaGUI._eventid_sessionnames_map[ID_SUSPENDSESSION] = \
             self._PyHocaGUI._eventid_sessionnames_map[ID_TERMINATESESSION] = session_name
 
-        _s = self._PyHocaGUI.get_session_of_session_name(session_name, return_object=True)
+        _s = self._PyHocaGUI.get_session_of_session_name(session_name, return_object=True, match_profile_name=profile_name)
         _session_status = status
         if session_info is not None:
             _session_status = session_info.get_status()
@@ -423,7 +423,7 @@ def _generate_Menu_PublishedApplications(_PyHocaGUI, caller=None, profile_name=N
 
     """
     _lang = _PyHocaGUI.lang
-    _pubapp_session = _PyHocaGUI.get_session_of_session_name(session_name, return_object=True)
+    _pubapp_session = _PyHocaGUI.get_session_of_session_name(session_name, return_object=True, match_profile_name=profile_name)
     try:
         menu_map = _pubapp_session.get_published_applications(lang=_lang, max_no_submenus=_PyHocaGUI.args.published_applications_no_submenus)
     except AttributeError:
@@ -702,38 +702,50 @@ class PyHocaGUI_Menu_TaskbarSessionProfile(wx.Menu):
 
                     if _session_list_names:
 
-                        self.AppendSeparator()
-
+                        _session_list_matching_profile = []
                         for session_name in _session_list_names:
 
-                            session = self._PyHocaGUI.get_session_of_session_name(session_name, return_object=True)
+                            session = self._PyHocaGUI.get_session_of_session_name(session_name, return_object=True, match_profile_name=profile_name)
 
-                            _s_id = wx.NewId()
+                            if not session:
+                                continue
+                            else:
+                                _session_list_matching_profile.append(session)
 
-                            if _session_list[session_name].get_status() == 'R':
-                                state = _(u'Running')
-                            elif _session_list[session_name].get_status() == 'S':
-                                state = _(u'Suspended')
-                            _marker = ''
-                            if session and session.is_master_session():
-                                _marker = '(*)'
-                            if session:
-                                session_submenu = self.AppendMenu(id=_s_id, text=u'%s: »%s« %s' % (state, session_name, _marker),
-                                                                  submenu=PyHocaGUI_Menu_TaskbarSessionActions(self._PyHocaGUI, caller=self,
-                                                                                                               profile_name=profile_name,
-                                                                                                               session_name=session_name,
-                                                                                                               session_info=_session_list[session_name],
-                                                                                                              )
+                        if _session_list_matching_profile:
+
+                            self.AppendSeparator()
+
+                            for session in _session_list_matching_profile:
+
+                                session_name = session.get_session_name()
+
+                                _s_id = wx.NewId()
+
+                                if _session_list[session_name].get_status() == 'R':
+                                    state = _(u'Running')
+                                elif _session_list[session_name].get_status() == 'S':
+                                    state = _(u'Suspended')
+                                _marker = ''
+                                if session and session.is_master_session():
+                                    _marker = '(*)'
+                                if session:
+                                    session_submenu = self.AppendMenu(id=_s_id, text=u'%s: »%s« %s' % (state, session_name, _marker),
+                                                                      submenu=PyHocaGUI_Menu_TaskbarSessionActions(self._PyHocaGUI, caller=self,
+                                                                                                                   profile_name=profile_name,
+                                                                                                                   session_name=session_name,
+                                                                                                                   session_info=_session_list[session_name],
+                                                                                                                  )
                                                                  )
-                                if self._PyHocaGUI._temp_disabled_session_names.has_key(profile_name) and session_name in self._PyHocaGUI._temp_disabled_session_names[profile_name]:
-                                    session_submenu.Enable(False)
+                                    if self._PyHocaGUI._temp_disabled_session_names.has_key(profile_name) and session_name in self._PyHocaGUI._temp_disabled_session_names[profile_name]:
+                                        session_submenu.Enable(False)
 
-                        # redefine list of session names to decide if the clean all session menu item is not be shown
-                        _session_list_names = [ _s_name for _s_name in _session_list.keys() if not _session_list[_s_name].is_published_applications_provider() ]
+                            # redefine list of session names to decide if the clean all session menu item is not be shown
+                            _session_list_names = [ _s.get_session_name() for _s in _session_list_matching_profile if not _session_list[_s.get_session_name()].is_published_applications_provider() ]
 
-                        if _session_list_names:
-                            self.Append(id=ID_CLEANSESSIONS, text=_(u"&Clean all sessions"))
-                            self._PyHocaGUI.Bind(wx.EVT_MENU, self._PyHocaGUI.OnCleanSessions, id=ID_CLEANSESSIONS)
+                            if _session_list_names:
+                                self.Append(id=ID_CLEANSESSIONS, text=_(u"&Clean all sessions"))
+                                self._PyHocaGUI.Bind(wx.EVT_MENU, self._PyHocaGUI.OnCleanSessions, id=ID_CLEANSESSIONS)
 
                 if not self._PyHocaGUI.restricted_trayicon:
 


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