[GRASS-SVN] r54212 - in grass/trunk/gui/wxpython: core gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 5 08:34:49 PST 2012


Author: martinl
Date: 2012-12-05 08:34:48 -0800 (Wed, 05 Dec 2012)
New Revision: 54212

Modified:
   grass/trunk/gui/wxpython/core/utils.py
   grass/trunk/gui/wxpython/gui_core/dialogs.py
   grass/trunk/gui/wxpython/gui_core/gselect.py
Log:
wxGUI/import dialog: fix db source type
	     various minor issues


Modified: grass/trunk/gui/wxpython/core/utils.py
===================================================================
--- grass/trunk/gui/wxpython/core/utils.py	2012-12-05 15:30:22 UTC (rev 54211)
+++ grass/trunk/gui/wxpython/core/utils.py	2012-12-05 16:34:48 UTC (rev 54212)
@@ -710,6 +710,7 @@
                     'ODBC', 'ESRI Personal GeoDatabase',
                     'Rasterlite',
                     'PostGIS WKT Raster driver',
+                    'PostGIS Raster driver',
                     'CouchDB'):
             formats['database'].append(name)
         elif name in ('GeoJSON',

Modified: grass/trunk/gui/wxpython/gui_core/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/dialogs.py	2012-12-05 15:30:22 UTC (rev 54211)
+++ grass/trunk/gui/wxpython/gui_core/dialogs.py	2012-12-05 16:34:48 UTC (rev 54212)
@@ -1595,15 +1595,14 @@
         
         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)')]

Modified: grass/trunk/gui/wxpython/gui_core/gselect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/gselect.py	2012-12-05 15:30:22 UTC (rev 54211)
+++ grass/trunk/gui/wxpython/gui_core/gselect.py	2012-12-05 16:34:48 UTC (rev 54212)
@@ -1274,7 +1274,7 @@
 
         # 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 @@
         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 @@
     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 @@
             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]



More information about the grass-commit mailing list