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

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


The branch, build-59a18b6e3b5d3f1dd8f07f26433d37fe5984a57d has been updated
       via  8d7d3d5b54661c2b490171ae8f5b3c1f2fc44b76 (commit)
      from  7f23b7b0953b00384e7739aaec5350ae1c24f522 (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              |    1 +
 pyhoca/wxgui/frontend.py      |    5 ++++-
 pyhoca/wxgui/menus_taskbar.py |   35 ++++++++++++++++++++++-------------
 3 files changed, 27 insertions(+), 14 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 6290070..443408f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -79,6 +79,7 @@ pyhoca-gui (0.1.2.0-0~x2go1) UNRELEASED; urgency=low
     - Auto-resuming and auto-starting of sessions, as well as auto-connecting
       to session profiles has been moved into Python X2Go.
     - Do not let wx.EndBusyCursor crash the application on Windows.
+    - Add connect and exit menu items if in single-session-profile mode.
   * 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/wxgui/frontend.py b/pyhoca/wxgui/frontend.py
index 4774f89..d8c7d31 100644
--- a/pyhoca/wxgui/frontend.py
+++ b/pyhoca/wxgui/frontend.py
@@ -326,7 +326,10 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
                 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)
+                    if self.is_profile_connected(profile_name=self.args.session_profile):
+                        self.notifier.send(self.args.session_profile, _('Disconnecting and exiting...'), icon='application-exit', timeout=10000)
+                    else:
+                        self.notifier.send(self.args.session_profile, _('Exiting...'), icon='application-exit', timeout=10000)
             self._eventid_profilenames_map[evt.GetId()] = self.args.session_profile
             self.OnServerDisconnect(evt)
         self.WakeUpIdle()
diff --git a/pyhoca/wxgui/menus_taskbar.py b/pyhoca/wxgui/menus_taskbar.py
index d372be5..126de26 100644
--- a/pyhoca/wxgui/menus_taskbar.py
+++ b/pyhoca/wxgui/menus_taskbar.py
@@ -419,6 +419,7 @@ class PyHocaGUI_Menu_TaskbarSessionProfile(wx.Menu):
 
         wx.Menu.__init__(self)
 
+        ID_CONNECT=wx.NewId()
         ID_PUBAPPSESSIONSTART=wx.NewId()
         ID_SESSIONSTART=wx.NewId()
         ID_LAUNCHAPPLICATION = wx.NewId()
@@ -432,6 +433,12 @@ class PyHocaGUI_Menu_TaskbarSessionProfile(wx.Menu):
         if profile_name in self._PyHocaGUI._temp_disabled_profile_names:
             _connecting_info = self.Append(wx.NewId(), text=_(u'Currently connecting...'))
             _connecting_info.Enable(False)
+
+        elif self._PyHocaGUI.args.single_session_profile and not self._PyHocaGUI.is_profile_connected(profile_name=profile_name):
+            self._PyHocaGUI._eventid_profilenames_map[ID_CONNECT] = profile_name
+            self.Append(id=ID_CONNECT, text=_(u'Connect %s') % profile_name)
+            self._PyHocaGUI.Bind(wx.EVT_MENU, self._PyHocaGUI.OnSessionAuthenticate, id=ID_CONNECT)
+
         else:
 
             self._PyHocaGUI._eventid_profilenames_map[ID_SESSIONSTART] = profile_name
@@ -613,22 +620,24 @@ class PyHocaGUI_Menu_TaskbarSessionProfile(wx.Menu):
                 if not self._PyHocaGUI._X2goClient__client_associated_sessions_of_profile_name(profile_name=profile_name, return_objects=False):
                     _shared_folders.Enable(False)
 
-            self.AppendSeparator()
+        self.AppendSeparator()
 
-            if not self._PyHocaGUI.args.single_session_profile:
-                ID_DISCONNECT = wx.NewId()
-                self._PyHocaGUI._eventid_profilenames_map[ID_DISCONNECT] = profile_name
-                self.Append(id=ID_DISCONNECT, text=_(u"&Disconnect from Server"))
-                self._PyHocaGUI.Bind(wx.EVT_MENU, self._PyHocaGUI.OnServerDisconnect, id=ID_DISCONNECT)
+        if not self._PyHocaGUI.args.single_session_profile:
+            ID_DISCONNECT = wx.NewId()
+            self._PyHocaGUI._eventid_profilenames_map[ID_DISCONNECT] = profile_name
+            self.Append(id=ID_DISCONNECT, text=_(u"&Disconnect from Server"))
+            self._PyHocaGUI.Bind(wx.EVT_MENU, self._PyHocaGUI.OnServerDisconnect, id=ID_DISCONNECT)
+        else:
+            ID_EXIT = wx.NewId()
+            if self._PyHocaGUI.client_running_sessions_of_profile_name(profile_name=self._PyHocaGUI.args.session_profile):
+                self.Append(id=ID_EXIT, text=_(u"Suspend Sessions and E&xit"))
+            elif self._PyHocaGUI.is_profile_connected(profile_name=self._PyHocaGUI.args.session_profile):
+                self.Append(id=ID_EXIT, text=_(u"Disconnect and E&xit"))
             else:
-                ID_EXIT = wx.NewId()
-                if self._PyHocaGUI.client_running_sessions_of_profile_name(profile_name=self._PyHocaGUI.args.session_profile):
-                    self.Append(id=ID_EXIT, text=_(u"Suspend Sessions and E&xit"))
-                else:
-                    self.Append(id=ID_EXIT, text=_(u"Disconnect and E&xit"))
-                self._PyHocaGUI.Bind(wx.EVT_MENU, self._PyHocaGUI.OnTaskbarExit, id=ID_EXIT)
+                self.Append(id=ID_EXIT, text=_(u"E&xit"))
+            self._PyHocaGUI.Bind(wx.EVT_MENU, self._PyHocaGUI.OnTaskbarExit, id=ID_EXIT)
 
-            self._PyHocaGUI.current_profile_name = profile_name
+        self._PyHocaGUI.current_profile_name = profile_name
 
 
 class PyHocaGUI_Menu_TaskbarProfileNames(wx.Menu):


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