[X2Go-Commits] pyhoca-gui.git - twofactorauth (branch) updated: 0.1.0.10-260-gbe50c57

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


The branch, twofactorauth has been updated
       via  be50c57fb436994ff63a2b6c26341e7f145d4516 (commit)
      from  638212166a275728ef6086256eb3488f9ef68777 (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 ++
 pyhoca/wxgui/profilemanager.py |   73 +++++++++++++++++++++++++---------------
 2 files changed, 48 insertions(+), 27 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 6348f07..2cc7c6c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -142,6 +142,8 @@ pyhoca-gui (0.1.2.0-0~x2go1) UNRELEASED; urgency=low
     - Update man page.
     - Let logon and session title window appear at top of screen for pyhoca-gui
       running within a Ubuntu Unity session.
+    - Make auto-detected keyboard setup (i.e. usage of x2gosetkeyboard) configurable
+      in the profile manager.
   * 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/profilemanager.py b/pyhoca/wxgui/profilemanager.py
index c0ad95a..8789778 100644
--- a/pyhoca/wxgui/profilemanager.py
+++ b/pyhoca/wxgui/profilemanager.py
@@ -135,9 +135,6 @@ class PyHocaGUI_ProfileManager(wx.Dialog):
         elif self.action in ("ADD", "ADD_EXPLICITLY"):
             self.profile_config = self.session_profiles.default_profile_config()
             # allow localization of the default keyboard settings
-            self.profile_config['type'] = _(u'<xkbtype>')
-            self.profile_config['layout'] = _(u'<xkblayout>')
-            self.profile_config['variant'] = _(u'<xkbvariant>')
             self.profile_name = self.profile_config['name'] = profile_name
 
         # we create a backup dict of our profile_config immediately (for being able to reset erroneously made changes)
@@ -261,7 +258,9 @@ class PyHocaGUI_ProfileManager(wx.Dialog):
         self.ScreenHeight = wx.SpinCtrl(self.tab_Settings, -1, "600", min=500, max=3000)
         self.SetDisplayDPI = wx.CheckBox(self.tab_Settings, -1, _(u"Set display DPI")+':')
         self.DisplayDPI = wx.SpinCtrl(self.tab_Settings, -1, "96", min=32, max=512)
-        self.CurrentKeyBoard = wx.CheckBox(self.tab_Settings, -1, _(u"Keep current keyboard settings"))
+        self.DontSetKeyboard = wx.RadioButton(self.tab_Settings, -1, label=_(u"Do not set (use server-side tools to configure the keyboard)"), style=wx.RB_GROUP)
+        self.AutoSetKeyboard = wx.RadioButton(self.tab_Settings, -1, label=_(u"Automatically detect and use client-side keyboard configuration inside the session"))
+        self.CustomSetKeyboard = wx.RadioButton(self.tab_Settings, -1, label=_(u"Use custom keyboard settings as provided below") + ':')
         self.KeyboardModelLabel = wx.StaticText(self.tab_Settings, -1, _(u"Keyboard model")+':')
         self.KeyboardModel = wx.TextCtrl(self.tab_Settings, -1, "")
         self.KeyboardLayoutLabel = wx.StaticText(self.tab_Settings, -1, _(u"Layout")+':')
@@ -330,7 +329,9 @@ class PyHocaGUI_ProfileManager(wx.Dialog):
         self.Bind(wx.EVT_RADIOBUTTON, self.OnSetDisplayFullscreen, self.DisplayTypeFullscreen)
         self.Bind(wx.EVT_RADIOBUTTON, self.OnSetDisplayCustom, self.DisplayTypeCustom)
         self.Bind(wx.EVT_CHECKBOX, self.OnSetDisplayDPI, self.SetDisplayDPI)
-        self.Bind(wx.EVT_CHECKBOX, self.OnKeepKeyboard, self.CurrentKeyBoard)
+        self.Bind(wx.EVT_RADIOBUTTON, self.OnSetKeyboard, self.DontSetKeyboard)
+        self.Bind(wx.EVT_RADIOBUTTON, self.OnSetKeyboard, self.AutoSetKeyboard)
+        self.Bind(wx.EVT_RADIOBUTTON, self.OnSetKeyboard, self.CustomSetKeyboard)
         self.Bind(wx.EVT_CHECKBOX, self.OnSoundEnable, self.EnableSound)
         self.Bind(wx.EVT_CHECKBOX, self.OnDefaultSoundPort, self.DefaultSoundPort)
         self.Bind(wx.EVT_RADIOBUTTON, self.OnPulseAudio, self.PulseAudio)
@@ -627,9 +628,11 @@ class PyHocaGUI_ProfileManager(wx.Dialog):
 
         sizer_4_2 = wx.StaticBoxSizer(self.staticbox_Keyboard, wx.VERTICAL)
         sizer_4_2_1 = wx.BoxSizer(wx.VERTICAL)
-        sizer_4_2_1_1 = wx.BoxSizer(wx.HORIZONTAL)
-        sizer_4_2_1_1.Add(self.CurrentKeyBoard, flag=wx.ALIGN_TOP)
-        sizer_4_2_1_1.Add((0, 32))
+        sizer_4_2_1_1 = wx.BoxSizer(wx.VERTICAL)
+        sizer_4_2_1_1.Add(self.DontSetKeyboard, )
+        sizer_4_2_1_1.Add(self.AutoSetKeyboard, )
+        sizer_4_2_1_1.Add(self.CustomSetKeyboard, )
+        sizer_4_2_1_1.Add((0,8))
         sizer_4_2_1_2 = wx.BoxSizer(wx.HORIZONTAL)
         sizer_4_2_1_2.Add((32,0))
         sizer_4_2_1_2_1 = wx.GridBagSizer(hgap=2, vgap=2)
@@ -960,12 +963,26 @@ class PyHocaGUI_ProfileManager(wx.Dialog):
         else:
             self.DisplayDPI.Enable(True)
 
-        # TODO Fill in the actual DPI
-        self.CurrentKeyBoard.SetValue(not self.profile_config['usekbd'])
-        self.KeyboardModel.SetValue(self.profile_config['type'])
-        self.KeyboardLayout.SetValue(self.profile_config['layout'])
-        self.KeyboardVariant.SetValue(self.profile_config['variant'])
-        if self.CurrentKeyBoard.GetValue():
+        if self.profile_config['usekbd']:
+            self.DontSetKeyboard.SetValue(False)
+            if self.profile_config['type'] == 'auto':
+                self.AutoSetKeyboard.SetValue(True)
+                self.CustomSetKeyboard.SetValue(False)
+            else:
+                self.AutoSetKeyboard.SetValue(False)
+                self.CustomSetKeyboard.SetValue(True)
+        else:
+            self.DontSetKeyboard.SetValue(True)
+        if self.profile_config['type'] == 'auto':
+            self.KeyboardModel.SetValue(_(u'<xkbtype>'))
+            self.KeyboardLayout.SetValue(_(u'<xkblayout>'))
+            self.KeyboardVariant.SetValue(_(u'<xkbvariant>'))
+        else:
+            self.KeyboardModel.SetValue(self.profile_config['type'])
+            self.KeyboardLayout.SetValue(self.profile_config['layout'])
+            self.KeyboardVariant.SetValue(self.profile_config['variant'])
+
+        if self.DontSetKeyboard.GetValue() or self.AutoSetKeyboard.GetValue():
             self.KeyboardModelLabel.Enable(False)
             self.KeyboardLayoutLabel.Enable(False)
             self.KeyboardVariantLabel.Enable(False)
@@ -1169,10 +1186,12 @@ class PyHocaGUI_ProfileManager(wx.Dialog):
         self.profile_config['setdpi'] = self.SetDisplayDPI.GetValue()
         self.profile_config['dpi'] = self.DisplayDPI.GetValue()
 
-        self.profile_config['usekbd'] = not self.CurrentKeyBoard.GetValue()
-        self.profile_config['type'] = self.KeyboardModel.GetValue()
-        self.profile_config['layout'] = self.KeyboardLayout.GetValue()
-        self.profile_config['variant'] = self.KeyboardVariant.GetValue()
+        self.profile_config['usekbd'] = self.CustomSetKeyboard.GetValue() or self.AutoSetKeyboard.GetValue()
+        self.profile_config['type'] = self.AutoSetKeyboard.GetValue() and "auto" or self.KeyboardModel.GetValue()
+        self.profile_config['layout'] = self.AutoSetKeyboard.GetValue() and "null" or self.KeyboardLayout.GetValue()
+        self.profile_config['variant'] = self.AutoSetKeyboard.GetValue() and "null" or self.KeyboardVariant.GetValue()
+        if self.profile_config['layout'] == "null": self.profile_config['layout'] = ""
+        if self.profile_config['variant'] == "null": self.profile_config['variant'] = ""
 
         self.profile_config['sound'] = self.EnableSound.GetValue()
         self.profile_config['defsndport'] = self.DefaultSoundPort.GetValue()
@@ -1478,21 +1497,21 @@ class PyHocaGUI_ProfileManager(wx.Dialog):
     def OnUpdateSSHProxyTunnelFromPort(self, event):
         self.SSHPort.SetValue(self.SSHProxyTunnelFromPort.GetValue())
 
-    def OnKeepKeyboard(self, event):
-        if self.CurrentKeyBoard.GetValue():
-            self.KeyboardModelLabel.Enable(False)
-            self.KeyboardLayoutLabel.Enable(False)
-            self.KeyboardVariantLabel.Enable(False)
-            self.KeyboardLayout.Enable(False)
-            self.KeyboardModel.Enable(False)
-            self.KeyboardVariant.Enable(False)
-        else:
+    def OnSetKeyboard(self, event):
+        if self.CustomSetKeyboard.GetValue():
             self.KeyboardModelLabel.Enable(True)
             self.KeyboardLayoutLabel.Enable(True)
             self.KeyboardVariantLabel.Enable(True)
             self.KeyboardLayout.Enable(True)
             self.KeyboardModel.Enable(True)
             self.KeyboardVariant.Enable(True)
+        else:
+            self.KeyboardModelLabel.Enable(False)
+            self.KeyboardLayoutLabel.Enable(False)
+            self.KeyboardVariantLabel.Enable(False)
+            self.KeyboardLayout.Enable(False)
+            self.KeyboardModel.Enable(False)
+            self.KeyboardVariant.Enable(False)
 
     def OnSoundEnable(self, event): # wxGlade: X2goMaintProfile.<event_handler>
         if self.EnableSound.GetValue():


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