[X2Go-Commits] pyhoca-gui.git - twofactorauth (branch) updated: 6ccfa2bba51f226738e667d1d4115427520ce1a5

X2Go dev team git-admin at x2go.org
Sat Sep 14 15:54:16 CEST 2013


The branch, twofactorauth has been updated
       via  6ccfa2bba51f226738e667d1d4115427520ce1a5 (commit)
      from  e8e6d2f60de431980a3b9a2ac8153dfe7c12c5c7 (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       |   45 ++++++++++++++++++++--------------------
 pyhoca/wxgui/menus_taskbar.py  |   13 ++++++++----
 pyhoca/wxgui/profilemanager.py |   17 +++++++++------
 3 files changed, 43 insertions(+), 32 deletions(-)

The diff of changes is:
diff --git a/pyhoca/wxgui/frontend.py b/pyhoca/wxgui/frontend.py
index 866ac84..bfbd4af 100644
--- a/pyhoca/wxgui/frontend.py
+++ b/pyhoca/wxgui/frontend.py
@@ -127,8 +127,8 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
         #    import x2go.X2goXServer as _xserver
         #    _xserver.startXserver(parent)
 
-        self._pyhoca_logger('PyHoca GUI is starting up', loglevel=x2go.loglevel_INFO, )
-        self._pyhoca_logger('registering PyHocaGUI control sessions', loglevel=x2go.loglevel_INFO, )
+        self._pyhoca_logger('PyHoca GUI is starting up', loglevel=x2go.log.loglevel_INFO, )
+        self._pyhoca_logger('registering PyHocaGUI control sessions', loglevel=x2go.log.loglevel_INFO, )
 
         #self._chooser_selected_profile_name = None
         self.taskbar = taskbar.PyHocaGUI_TaskBarIcon(self)
@@ -198,7 +198,7 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
         STILL UNDOCUMENTED
 
         """
-        self._pyhoca_logger('Exit application', x2go.loglevel_INFO, )
+        self._pyhoca_logger('Exit application', loglevel=x2go.log.loglevel_INFO, )
         self.taskbar.Close()
         self.notifier.Close()
         self.Exit()
@@ -263,7 +263,7 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
         if self._X2goClient__is_session_connected(session_uuid):
             self.notifier.send('%s - connect' % self.current_profile_name, 'Public SSH key authentication has been successful.', timeout=4000)
         else:
-            self._pyhoca_logger('public SSH key authentication to server failed, trying next auth-mechanism', x2go.loglevel_INFO, )
+            self._pyhoca_logger('public SSH key authentication to server failed, trying next auth-mechanism', loglevel=x2go.log.loglevel_INFO, )
 
 
     def OnSessionStart(self, evt):
@@ -360,32 +360,33 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
         STILL UNDOCUMENTED
 
         """
-        self._pyhoca_logger('adding new X2go session profile', x2go.loglevel_INFO, )
+        self._pyhoca_logger('adding new X2go session profile', loglevel=x2go.log.loglevel_INFO, )
         profilemanager.PyHocaGUI_ProfileManager(self, 'ADD')
 
-#    def OnProfileEdit(self, evt):
-#        """\
-#        STILL UNDOCUMENTED
-#
-#        """
-#        self._pyhoca_logger('Update Profile started', x2go.loglevel_INFO, )
-#        if self.selected_profile:
-#            profilemanager.PyHocaGUI_ProfileManager('EDIT', self._PyhocaGUI)
-#
-#    def OnProfileDelete(self, evt):
-#        """\
-#        STILL UNDOCUMENTED
-#
-#        """
-#        self._pyhoca_logger('deleting session profile ...', x2go.loglevel_INFO, )
-#
+    def OnProfileEdit(self, evt):
+        """\
+        STILL UNDOCUMENTED
+
+        """
+        self.current_profile_name = self._eventid_profilenames_map[evt.GetId()]
+        self._pyhoca_logger('editing session profile %s' % self.current_profile_name, loglevel=x2go.log.loglevel_INFO, )
+        profilemanager.PyHocaGUI_ProfileManager(self, 'EDIT', profile_name=self.current_profile_name)
+
+    def OnProfileDelete(self, evt):
+        """\
+        STILL UNDOCUMENTED
+
+        """
+        self.current_profile_name = self._eventid_profilenames_map[evt.GetId()]
+        self._pyhoca_logger('deleting session profile %s' % self.current_profile_name, loglevel=x2go.log.loglevel_INFO, )
+        profilemanager.PyHocaGUI_ProfileManager(self, 'DELETE', profile_name=self.current_profile_name)
 
     def OnListSessions(self, evt):
         """\
         STILL UNDOCUMENTED
 
         """
-        self._pyhoca_logger(',,List Sessions\'\' not implemented yet', x2go.loglevel_INFO, )
+        self._pyhoca_logger(',,List Sessions\'\' not implemented yet', loglevel=x2go.log.loglevel_INFO, )
 
     def OnClose(self, evt):
         """\
diff --git a/pyhoca/wxgui/menus_taskbar.py b/pyhoca/wxgui/menus_taskbar.py
index 947f08d..d804944 100644
--- a/pyhoca/wxgui/menus_taskbar.py
+++ b/pyhoca/wxgui/menus_taskbar.py
@@ -40,15 +40,20 @@ class PyHocaGUI_Menu_TaskbarManageProfile(wx.Menu):
 
         wx.Menu.__init__(self)
 
-        ID_DELPROFILE = wx.NewId()
         ID_EDITPROFILE = wx.NewId()
+        ID_DELETEPROFILE = wx.NewId()
 
+        # preparing profile_name information for the main PyHocaGUI instance
+        self._PyHocaGUI._eventid_profilenames_map[ID_EDITPROFILE] = \
+            self._PyHocaGUI._eventid_profilenames_map[ID_DELETEPROFILE] = profile_name
+
+        
         self.Append(text="Edit Profile", id=ID_EDITPROFILE)
         self.AppendSeparator()
-        self.Append(text="Delete Profile", id=ID_DELPROFILE)
+        self.Append(text="Delete Profile", id=ID_DELETEPROFILE)
 
-        #self.Bind(wx.EVT_MENU, self._PyHocaGUI.OnProfileEdit, id=ID_EDITPROFILE)
-        #self.Bind(wx.EVT_MENU, self._PyHocaGUI.OnProfileDelete, id=ID_DELPROFILE)
+        self.Bind(wx.EVT_MENU, self._PyHocaGUI.OnProfileEdit, id=ID_EDITPROFILE)
+        self.Bind(wx.EVT_MENU, self._PyHocaGUI.OnProfileDelete, id=ID_DELETEPROFILE)
 
 
 class PyHocaGUI_Menu_TaskbarOptionsManager(wx.Menu):
diff --git a/pyhoca/wxgui/profilemanager.py b/pyhoca/wxgui/profilemanager.py
index 36fd8eb..43243fd 100644
--- a/pyhoca/wxgui/profilemanager.py
+++ b/pyhoca/wxgui/profilemanager.py
@@ -19,9 +19,10 @@
 # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
 import wx
-import platform
+import os 
 
 import x2go.log as log
+from x2go import X2GOCLIENT_OS
 
 # begin wxGlade: extracode
 # end wxGlade
@@ -31,7 +32,7 @@ class PyHocaGUI_ProfileManager(wx.Frame):
     STILL UNDOCUMENTED
 
     """
-    def __init__(self, _PyHocaGUI, action, profile_id=None):
+    def __init__(self, _PyHocaGUI, action, profile_id=None, profile_name=None):
         """\
         STILL UNDOCUMENTED
 
@@ -52,7 +53,11 @@ class PyHocaGUI_ProfileManager(wx.Frame):
         self.session_profiles = self._PyHocaGUI.session_profiles
         self.action = action
 
-        self.profile_id = profile_id
+        if profile_id is not None:
+            self.profile_id = profile_id
+        elif profile_name is not None:
+            self.profile_id = self.session_profiles.check_profile_id_or_name(profile_name)
+
         if self.action == 'ADD':
             # this will create a default session profile
             self.profile_id = self.session_profiles.add_profile(self.profile_id)
@@ -78,11 +83,11 @@ class PyHocaGUI_ProfileManager(wx.Frame):
         self.ProfileLabel = wx.StaticText(self.X2goSessionTab, -1, "Profile name")
         self.ProfileName = wx.TextCtrl(self.X2goSessionTab, -1, "", size=wx.Size(200,20))
         if 'icon' in self.profile_config:
-            if platform.system() == 'Windows':
+            if X2GOCLIENT_OS == 'Windows':
                 path_to_icon = self.profile_config['icon'].replace(':','/usr/share/')
-            elif platform.system() == 'Linux':
+            elif X2GOCLIENT_OS == 'Linux':
                 path_to_icon = self.profile_config['icon'].replace(':','/usr/share/')
-            elif platform.system() == 'Mac':
+            elif X2GOCLIENT_OS == 'Mac':
                 path_to_icon = self.profile_config['icon'].replace(':','/usr/share/')
         self.IconButton = wx.BitmapButton(self.X2goSessionTab, -1, wx.Bitmap(path_to_icon, wx.BITMAP_TYPE_ANY))
         self.IconLabel = wx.StaticText(self.X2goSessionTab, -1, "<< Change Icon")


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