[X2go-Commits] pyhoca-gui.git - master (branch) updated: 0.1.0.6-9-g31ac771

X2go dev team git-admin at x2go.org
Thu Jul 21 00:28:11 CEST 2011


The branch, master has been updated
       via  31ac7716441e4b3171556141e5f9b5fe9eb9c305 (commit)
      from  81d7b9b10739b9d8e316d3ed67cbb58d1372b551 (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 -----------------------------------------------------------------
commit 31ac7716441e4b3171556141e5f9b5fe9eb9c305
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Thu Jul 21 00:28:32 2011 +0200

    Provide complete list of compression methods, profile manager GUI improved.

-----------------------------------------------------------------------

Summary of changes:
 debian/changelog               |    1 +
 pyhoca/wxgui/profilemanager.py |   32 ++++++++++++++++++++++++++------
 2 files changed, 27 insertions(+), 6 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index f151394..c615e76 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@ pyhoca-gui (0.1.0.7-0~x2go1) UNRELEASED; urgency=low
       the GUI notification.
     - Add HOOK_session_startup_failed as a GUI notification (was: exception raisure), requires
       Python X2go >= 0.1.1.5.
+    - Provide complete list of compression methods, profile manager GUI improved.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Wed, 06 Jul 2011 22:17:10 +0200
 
diff --git a/pyhoca/wxgui/profilemanager.py b/pyhoca/wxgui/profilemanager.py
index 8b15ed1..b37b9e6 100644
--- a/pyhoca/wxgui/profilemanager.py
+++ b/pyhoca/wxgui/profilemanager.py
@@ -27,6 +27,7 @@ import locale
 
 import x2go.log as log
 import x2go.utils as utils
+import x2go.defaults as defaults
 from x2go import X2GOCLIENT_OS
 
 from x2go import defaults
@@ -93,9 +94,9 @@ class PyHocaGUI_ProfileManager(wx.Dialog):
             'OPENWITH': _(u'Open application chooser dialog'),
             'SAVEAS': _(u'Save incoming file as ...'),
         }
-        _compressions = ["4k-jpeg", "32k-jpeg", "64k-jpeg", "256k-jpeg", "2m-jpeg", "16m-jpeg"]
+        self._compressions = defaults.pack_methods_nx3_noqual
         self.compressionChoices = {}
-        for _comp in _compressions:
+        for _comp in self._compressions:
             self.compressionChoices[_comp] = _comp
 
         self.session_profiles = self._PyHocaGUI.session_profiles
@@ -272,6 +273,7 @@ class PyHocaGUI_ProfileManager(wx.Dialog):
         self.Bind(wx.EVT_CHECKBOX, self.OnUseSSHProxy, self.UseSSHProxy)
         self.Bind(wx.EVT_TEXT, self.OnUpdateSSHProxyTunnelFromHost, self.SSHProxyTunnelFromHost)
         self.Bind(wx.EVT_TEXT, self.OnUpdateSSHProxyTunnelFromPort, self.SSHProxyTunnelFromPort)
+        self.Bind(wx.EVT_COMBOBOX, self.OnCompressionSelected, self.Compression)
         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)
@@ -795,9 +797,15 @@ class PyHocaGUI_ProfileManager(wx.Dialog):
         else:
             _link_speed = self.profileManagerDefaults['speed']
         self.LinkSpeed.SetValue(_link_speed)
+        if '%s-%%' % self.profile_config['pack'] in self._compressions and self.profile_config['quality'] and (self.profile_config['quality'] in range(1,10)):
+            self.Compression.SetValue('%s-%%' % self.profile_config['pack'])
+            self.ImageQuality.SetValue(self.profile_config['quality'])
+            self.ImageQuality.Enable(True)
+        else:
+            self.Compression.SetValue(self.profile_config['pack'])
+            self.ImageQuality.SetValue(9)
+            self.ImageQuality.Enable(False)
 
-        self.Compression.SetValue(self.profile_config['pack'])
-        self.ImageQuality.SetValue(self.profile_config['quality'])
         self.DisplayTypeFullscreen.SetValue(self.profile_config['fullscreen'])
         self.DisplayTypeCustom.SetValue(not self.profile_config['fullscreen'])
         self.ScreenWidth.SetValue(self.profile_config['width'])
@@ -964,8 +972,11 @@ class PyHocaGUI_ProfileManager(wx.Dialog):
         _link_idx = self.LinkSpeed.GetValue()
         self.profile_config['speed'] = _link_idx
 
-        self.profile_config['pack'] = self.Compression.GetValue()
-        self.profile_config['quality'] = self.ImageQuality.GetValue()
+        self.profile_config['pack'] = self.Compression.GetValue().rstrip('-%')
+        if '%s-%%' % self.profile_config['pack'] in self._compressions:
+            self.profile_config['quality'] = self.ImageQuality.GetValue()
+        else:
+            self.profile_config['quality'] = 0
         self.profile_config['fullscreen'] = self.DisplayTypeFullscreen.GetValue()
         self.profile_config['width'] = self.ScreenWidth.GetValue()
         self.profile_config['height'] = self.ScreenHeight.GetValue()
@@ -1130,6 +1141,15 @@ class PyHocaGUI_ProfileManager(wx.Dialog):
 
         self.disable_EditConnected_options()
 
+    def OnCompressionSelected(self, event):
+
+        _pack = self.Compression.GetValue()
+        print _pack
+        if _pack.endswith('-%'):
+            self.ImageQuality.Enable(True)
+        else:
+            self.ImageQuality.Enable(False)
+
     def OnSSHKeyFileBrowse(self, event):
         sshdir = os.path.expanduser('~/.ssh')
         if not os.path.exists(sshdir):


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