瀏覽代碼

wxGUI/import dialog: fix db source type
various minor issues


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@54212 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 12 年之前
父節點
當前提交
4a9e68b9a0
共有 3 個文件被更改,包括 12 次插入11 次删除
  1. 1 0
      gui/wxpython/core/utils.py
  2. 4 5
      gui/wxpython/gui_core/dialogs.py
  3. 7 6
      gui/wxpython/gui_core/gselect.py

+ 1 - 0
gui/wxpython/core/utils.py

@@ -710,6 +710,7 @@ def _parseFormats(output, writableOnly = False):
                     'ODBC', 'ESRI Personal GeoDatabase',
                     'Rasterlite',
                     'PostGIS WKT Raster driver',
+                    'PostGIS Raster driver',
                     'CouchDB'):
             formats['database'].append(name)
         elif name in ('GeoJSON',

+ 4 - 5
gui/wxpython/gui_core/dialogs.py

@@ -1595,15 +1595,14 @@ class ImportDialog(wx.Dialog):
         
         self.layerBox = wx.StaticBox(parent = self.panel, id = wx.ID_ANY)
         if self.importType == 'gdal':
-            self.layerBox.SetLabel(" %s " % _("List of raster layers"))
+            label = _("List of raster layers")
         elif self.importType == 'ogr':
-            self.layerBox.SetLabel(" %s " % _("List of vector layers"))
+            label = _("List of vector layers")
         else:
-            self.layerBox.SetLabel(_(" List of %s layers ") % self.importType.upper())
+            label = _("List of %s layers") % self.importType.upper()
+        self.layerBox.SetLabel(" %s - %s " % (label, _("right click to (un)select all")))
         
-        #
         # list of layers
-        #
         columns = [_('Layer id'),
                    _('Layer name'),
                    _('Name for output GRASS map (editable)')]

+ 7 - 6
gui/wxpython/gui_core/gselect.py

@@ -1274,7 +1274,7 @@ class GdalSelect(wx.Panel):
 
         # format
         self.format = FormatSelect(parent = self,
-                                   ogr = ogr)
+                                   ogr = ogr, size = (300, -1))
         self.format.Bind(wx.EVT_CHOICE, self.OnSetFormat)
         self.extension = wx.TextCtrl(parent = self, id = wx.ID_ANY)
         self.extension.Bind(wx.EVT_TEXT, self.OnSetExtension)
@@ -1367,7 +1367,6 @@ class GdalSelect(wx.Panel):
         inputSizer = wx.StaticBoxSizer(self.inputBox, wx.HORIZONTAL)
         
         self.dsnSizer = wx.GridBagSizer(vgap = 3, hgap = 3)
-        #self.dsnSizer.AddGrowableRow(0)
         self.dsnSizer.AddGrowableCol(3)
         
         row = 0
@@ -1643,7 +1642,8 @@ class GdalSelect(wx.Panel):
     def GetDsn(self):
         """!Get datasource name
         """
-        if self.format.GetStringSelection() == 'PostgreSQL':
+        if self.format.GetStringSelection() in ('PostgreSQL',
+                                                'PostGIS Raster driver'):
             dsn = 'PG:dbname=%s' % self.input[self.dsnType][1].GetStringSelection()
         else:
             dsn = self.input[self.dsnType][1].GetValue()
@@ -1779,16 +1779,17 @@ class GdalSelect(wx.Panel):
             pass
         
         else: # database
-            if format == 'SQLite' or format == 'Rasterlite':
+            if format in ('SQLite', 'Rasterlite'):
                 win = self.input['db-win']['file']
-            elif format == 'PostgreSQL' or format == 'PostGIS WKT Raster driver':
+            elif format in ('PostgreSQL', 'PostGIS WKT Raster driver',
+                            'PostGIS Raster driver'):
+                win = self.input['db-win']['choice']
                 # try to get list of PG databases
                 db = RunCommand('db.databases', quiet = True, read = True,
                                 driver = 'pg').splitlines()
                 if db is not None:
                     win.SetItems(sorted(db))
                 elif grass.find_program('psql', ['--help']):
-                    win = self.input['db-win']['choice']
                     if not win.GetItems():
                         p = grass.Popen(['psql', '-ltA'], stdout = grass.PIPE)
                         ret = p.communicate()[0]