Ver código fonte

wxGUI/dbmgr: disable fs option in attribute manager for Windows until better solution is found (merge from releasebranch, https://trac.osgeo.org/grass/changeset/53233)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@53245 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 12 anos atrás
pai
commit
37ccbedd0d
2 arquivos alterados com 21 adições e 27 exclusões
  1. 18 27
      gui/wxpython/dbmgr/base.py
  2. 3 0
      gui/wxpython/gui_core/preferences.py

+ 18 - 27
gui/wxpython/dbmgr/base.py

@@ -171,37 +171,28 @@ class VirtualAttributeList(wx.ListCtrl,
         # TODO: more effective way should be implemented...
         outFile = tempfile.NamedTemporaryFile(mode = 'w+b')
 
+        cmdParams = dict(quiet = True,
+                         parent = self,
+                         flags = 'c')
+        if sys.platform != "win32":
+            cmdParams.update(dict(sep = fs))
+
         if sql:
+            cmdParams.update(dict(sql = sql,
+                                  output = outFile.name,
+                                  overwrite = True))
             ret = RunCommand('db.select',
-                             overwrite = True,
-                             quiet = True,
-                             parent = self,
-                             flags = 'c',
-                             sep = fs,
-                             sql = sql,
-                             output = outFile.name)
+                             **cmdParams)
         else:
+            cmdParams.update(dict(map = self.mapDBInfo.map,
+                                  layer = layer,
+                                  where = where,
+                                  stdout = outFile))
             if columns:
-                ret = RunCommand('v.db.select',
-                                 quiet = True,
-                                 parent = self,
-                                 flags = 'c',
-                                 map = self.mapDBInfo.map,
-                                 layer = layer,
-                                 columns = ','.join(columns),
-                                 sep = fs,
-                                 where = where,
-                                 stdout = outFile)
-            else:
-                ret = RunCommand('v.db.select',
-                                 quiet = True,
-                                 parent = self,
-                                 flags = 'c',
-                                 map = self.mapDBInfo.map,
-                                 layer = layer,
-                                 sep = fs,
-                                 where = where,
-                                 stdout = outFile) 
+                cmdParams.update(dict(columns = ','.join(columns)))
+
+            ret = RunCommand('v.db.select',
+                             **cmdParams)
         
         # These two should probably be passed to init more cleanly
         # setting the numbers of items = number of elements in the dictionary

+ 3 - 0
gui/wxpython/gui_core/preferences.py

@@ -1143,6 +1143,9 @@ class PreferencesDialog(PreferencesBaseDialog):
 
         flexSizer.Add(label, proportion = 0, flag = wx.ALIGN_CENTER_VERTICAL)
         flexSizer.Add(separator, proportion = 0, flag = wx.ALIGN_RIGHT | wx.FIXED_MINSIZE)
+        if sys.platform == "win32":
+            label.Hide()
+            separator.Hide()
 
         # ask on delete record
         askOnDeleteRec = wx.CheckBox(parent = panel, id = wx.ID_ANY,