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

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


The branch, build-59a18b6e3b5d3f1dd8f07f26433d37fe5984a57d has been updated
       via  73ca9051b032b93911dde2d3abf1fa7033a76022 (commit)
      from  69deb8f819d4be557955e100c6a49c04af643037 (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      |   13 ++++++++++++-
 pyhoca/wxgui/menus_taskbar.py |   40 ++++++++++++++++++++++++++++++++++------
 3 files changed, 47 insertions(+), 7 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index eee2a37..32e85ff 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,7 @@ pyhoca-gui (0.1.0.9-0~x2go1) UNRELEASED; urgency=low
       SSH pubkey authentication. Speeds up appearance of password dialog box.
     - Profile manager: x2goclient compat fix, add auto-connect flag for shared
       folders.
+    - Add submenu support for sharing non-auto-connected shared folders.
   * Depend on python-x2go (>=0.1.1.7).
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Wed, 14 Sep 2011 21:49:08 +0200
diff --git a/pyhoca/wxgui/frontend.py b/pyhoca/wxgui/frontend.py
index a954ba1..e90bab8 100644
--- a/pyhoca/wxgui/frontend.py
+++ b/pyhoca/wxgui/frontend.py
@@ -223,6 +223,8 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
         self._hide_notifications_map = {}
         self._eventid_profilenames_map = {}
         self._eventid_sessionnames_map = {}
+        self._eventid_shared_folders_map = {}
+        self._eventid_unshared_folders_map = {}
         self._temp_disabled_profile_names = []
         self._temp_disabled_session_names = {}
 
@@ -611,7 +613,7 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
             except:
                 pass
 
-    def OnShareLocalFolder(self, evt):
+    def OnShareCustomLocalFolder(self, evt):
         """\
         STILL UNDOCUMENTED
 
@@ -637,6 +639,15 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
         self.current_profile_name = self._eventid_profilenames_map[evt.GetId()]
         self._X2goClient__unshare_all_local_folders_from_profile(profile_name=self.current_profile_name)
 
+    def OnShareLocalFolder(self, evt):
+        """\
+        STILL UNDOCUMENTED
+
+        """
+        self.current_profile_name = self._eventid_profilenames_map[evt.GetId()]
+        _share_folder = self._eventid_unshared_folders_map[evt.GetId()]
+        self._X2goClient__share_local_folder(profile_name=self.current_profile_name, local_path=_share_folder)
+
     def OnUnshareLocalFolder(self, evt):
         """\
         STILL UNDOCUMENTED
diff --git a/pyhoca/wxgui/menus_taskbar.py b/pyhoca/wxgui/menus_taskbar.py
index b0db6fd..ee63dbd 100644
--- a/pyhoca/wxgui/menus_taskbar.py
+++ b/pyhoca/wxgui/menus_taskbar.py
@@ -196,20 +196,47 @@ class PyHocaGUI_Menu_TaskbarProfileSharedFolders(wx.Menu):
 
         wx.Menu.__init__(self)
 
-        ID_SHARELOCALFOLDER = wx.NewId()
+        ID_SHARECUSTOMLOCALFOLDER = wx.NewId()
         ID_UNSHAREALLLOCALFOLDERS = wx.NewId()
 
         # preparing profile_name information for the main PyHocaGUI instance
-        self._PyHocaGUI._eventid_profilenames_map[ID_SHARELOCALFOLDER] = \
+        self._PyHocaGUI._eventid_profilenames_map[ID_SHARECUSTOMLOCALFOLDER] = \
             self._PyHocaGUI._eventid_profilenames_map[ID_UNSHAREALLLOCALFOLDERS] = profile_name
 
-        _share_folder = self.Append(id=ID_SHARELOCALFOLDER, text=_(u"&Share local folder"))
+        _share_folder = self.Append(id=ID_SHARECUSTOMLOCALFOLDER, text=_(u"&Share custom local folder"))
 
         self.AppendSeparator()
-        _shared_folders = self._PyHocaGUI._X2goClient__profile_get_shared_folders(profile_name=profile_name)
+
+        # FIXME: move this into python-x2go
+
+        _profile_config = self._PyHocaGUI.get_profile_config(profile_name)
+        _exported_folders = _profile_config['export'].replace(',', ';')
+        _exported_folders = _exported_folders.strip().strip('"').strip().strip(';').strip()
+        _exported_folders_list = _exported_folders.split(';')
+
+        _sharable_folders = []
+        _shared_folders = self._PyHocaGUI._X2goClient__profile_get_shared_folders(profile_name=profile_name) or []
+
+        for _folder in _exported_folders_list:
+            if ':' not in _folder: _folder = '%s:1' % _folder
+            _folder_path = _folder.split(':')[0]
+            _sharable_folders.append(_folder_path)
+
+        self._PyHocaGUI._eventid_unshared_folders_map={}
+        _unshared_folders = [ f for f in _sharable_folders if f not in _shared_folders ]
+
+        if _unshared_folders:
+            self.Append(id=wx.NewId(), text=_(u'Share:'))
+            for _unshared_folder in _unshared_folders:
+                ID_THISFOLDER = wx.NewId()
+                _unshared_folder_item = self.Append(id=ID_THISFOLDER, text="      %s" % _unshared_folder)
+                self._PyHocaGUI._eventid_profilenames_map[ID_THISFOLDER] = profile_name
+                self._PyHocaGUI._eventid_unshared_folders_map[ID_THISFOLDER] = _unshared_folder
+                self._PyHocaGUI.Bind(wx.EVT_MENU, self._PyHocaGUI.OnShareLocalFolder, id=ID_THISFOLDER)
+
+            self.AppendSeparator()
 
         if _shared_folders:
-            self._PyHocaGUI._eventid_shared_folders_map={}
             self.Append(id=wx.NewId(), text=_(u'Unshare:'))
             for _shared_folder in _shared_folders:
                 ID_THISFOLDER = wx.NewId()
@@ -217,13 +244,14 @@ class PyHocaGUI_Menu_TaskbarProfileSharedFolders(wx.Menu):
                 self._PyHocaGUI._eventid_profilenames_map[ID_THISFOLDER] = profile_name
                 self._PyHocaGUI._eventid_shared_folders_map[ID_THISFOLDER] = _shared_folder
                 self._PyHocaGUI.Bind(wx.EVT_MENU, self._PyHocaGUI.OnUnshareLocalFolder, id=ID_THISFOLDER)
+
             self.AppendSeparator()
 
         _unshare_folders = self.Append(id=ID_UNSHAREALLLOCALFOLDERS, text=_(u"Unshare &all local folders"))
         if not _shared_folders:
             _unshare_folders.Enable(False)
 
-        self._PyHocaGUI.Bind(wx.EVT_MENU, self._PyHocaGUI.OnShareLocalFolder, id=ID_SHARELOCALFOLDER)
+        self._PyHocaGUI.Bind(wx.EVT_MENU, self._PyHocaGUI.OnShareCustomLocalFolder, id=ID_SHARECUSTOMLOCALFOLDER)
         self._PyHocaGUI.Bind(wx.EVT_MENU, self._PyHocaGUI.OnUnshareAllLocalFolders, id=ID_UNSHAREALLLOCALFOLDERS)
 
 


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