[X2Go-Commits] pyhoca-gui.git - twofactorauth (branch) updated: 0.0.29.0-45-g0a828a9

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


The branch, twofactorauth has been updated
       via  0a828a95ecb575bddbfede95bdafc81609fd9784 (commit)
      from  15bcec4580e243d4339ea2741ebc66a443d7f7a9 (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/printingprefs.py |   25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

The diff of changes is:
diff --git a/pyhoca/wxgui/printingprefs.py b/pyhoca/wxgui/printingprefs.py
index 1444f7c..80c3db0 100644
--- a/pyhoca/wxgui/printingprefs.py
+++ b/pyhoca/wxgui/printingprefs.py
@@ -69,18 +69,24 @@ class PyHocaGUI_PrintingPreferences(wx.Dialog):
         if self.mode != 'edit':
             self._availablePrintActions['DIALOG'] = _(u'<Select a print action here>')
 
+	self._availablePrinters = {}          
         if _X2GOCLIENT_OS != "Windows":
             # initialize CUPS config API and retrieve a list of local print queues
             cups.setUser(_CURRENT_LOCAL_USER)
             cups_connection = cups.Connection()
             cups_printers = cups_connection.getPrinters()
-            self._availablePrinters = {}
             for p in cups_printers.keys():
                 self._availablePrinters.update({ p: '%s (%s)' % (p, cups_printers[p]['printer-info']), })
             self._defaultPrinter = cups_connection.getDefault()
         else:
             # initialize win32print API and retrieve a list of local print queues
-            pass
+            win32_printers = win32print.EnumPrinters(win32print.PRINTER_ENUM_LOCAL)
+	    for p in win32_printers:
+                if p[3]:
+                    self._availablePrinters.update({p[2]: '%s (%s)' % (p[2], p[3]), })
+		else:
+                    self._availablePrinters.update({p[2]: '%s' % p[2], })
+		self._defaultPrinter = win32print.GetDefaultPrinter()
 
         self.client_printing = self._PyHocaGUI.client_printing
 
@@ -139,10 +145,13 @@ class PyHocaGUI_PrintingPreferences(wx.Dialog):
 
     def __set_properties(self):
 
-        _textfield_height = 22
+        _textfield_height = self.PdfViewCmdBrowseButton.GetBestSize().GetHeight()-2
         self.PrintActionLabel.SetMinSize((-1, 16))
-        self.PrintAction.SetMinSize((-1, _textfield_height))
+        self.PrintAction.SetMinSize((-1, _textfield_height+4))
+	self.PdfViewCmdBrowseButton.SetMinSize(self.PdfViewCmdBrowseButton.GetBestSize())
+       	self.PdfSaveToFolderBrowseButton.SetMinSize(self.PdfSaveToFolderBrowseButton.GetBestSize())
         self.OKButton.SetMinSize((-1, 30))
+	self.ApplyButton.SetMinSize((-1, 30))
         self.CancelButton.SetMinSize((-1, 30))
 
     def __do_layout(self):
@@ -300,8 +309,12 @@ class PyHocaGUI_PrintingPreferences(wx.Dialog):
         if dlg.ShowModal() == wx.ID_OK:
             # This returns a Python list of files that were selected.
             _save_to_folder = dlg.GetPath()
-            if _save_to_folder.startswith(_LOCAL_HOME):
-                _save_to_folder = re.sub('^%s\/' % _LOCAL_HOME, '', _save_to_folder)
+            if _X2GOCLIENT_OS != 'Windows':
+	    	if _save_to_folder.startswith(_LOCAL_HOME):
+                    _save_to_folder = re.sub('^%s\/' % _LOCAL_HOME, '', _save_to_folder)
+	    else:
+	    	if os.path.normpath(_save_to_folder).lower().startswith(os.path.normpath(_LOCAL_HOME).lower()):
+		    _save_to_folder = re.sub('^%s\\\\' % os.path.normpath(_LOCAL_HOME).replace('\\', '\\\\'), '', _save_to_folder, flags=re.IGNORECASE)
             self.PdfSaveToFolder.SetValue(_save_to_folder)
 
     def __validate(self):


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