[GRASS-SVN] r42243 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed May 12 10:46:25 EDT 2010


Author: martinl
Date: 2010-05-12 10:46:25 -0400 (Wed, 12 May 2010)
New Revision: 42243

Modified:
   grass/trunk/gui/wxpython/gui_modules/gselect.py
Log:
wxGUI: more fixes in ImportDialog


Modified: grass/trunk/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gselect.py	2010-05-12 14:30:00 UTC (rev 42242)
+++ grass/trunk/gui/wxpython/gui_modules/gselect.py	2010-05-12 14:46:25 UTC (rev 42243)
@@ -1049,6 +1049,7 @@
         inputSizer = wx.StaticBoxSizer(self.inputBox, wx.HORIZONTAL)
         
         self.dsnSizer = wx.GridBagSizer(vgap=3, hgap=3)
+        self.dsnSizer.AddGrowableRow(1)
         self.dsnSizer.AddGrowableCol(1)
         
         self.dsnSizer.Add(item=self.dsnText,
@@ -1062,6 +1063,7 @@
                           flag=wx.ALIGN_CENTER_VERTICAL,
                           pos = (1, 0))
         self.dsnSizer.Add(item=self.format,
+                          flag = wx.ALIGN_CENTER_VERTICAL,
                           pos = (1, 1))
         
         inputSizer.Add(item=self.dsnSizer, proportion=1,
@@ -1108,23 +1110,31 @@
         elif sel == self.sourceMap['pro']: # protocol
             self.dsnType = 'pro'
         
-        win = self.input[self.dsnType][1]
-        self.dsnSizer.Add(item=self.input[self.dsnType][1],
-                          flag = wx.ALIGN_CENTER_VERTICAL | wx.EXPAND,
-                          pos = (0, 1))
-        win.SetValue('')
+        self.dsnText.SetLabel(self.input[self.dsnType][0])
         if self.parent.GetName() == 'MultiImportDialog':
             self.parent.list.DeleteAllItems()
-        win.Show()
-        
-        self.dsnText.SetLabel(self.input[self.dsnType][0])
-        self.format.SetItems(self.input[self.dsnType][2])
+        self.format.SetItems(self.input[self.dsnType][2])        
+
         if sel in (self.sourceMap['file'],
                    self.sourceMap['dir']):
+            win = self.input[self.dsnType][1]
+            self.dsnSizer.Add(item=self.input[self.dsnType][1],
+                              flag = wx.ALIGN_CENTER_VERTICAL | wx.EXPAND,
+                              pos = (0, 1))
+            win.SetValue('')
+            win.Show()
+            
             if not self.ogr:
                 self.format.SetStringSelection('GeoTIFF')
             else:
                 self.format.SetStringSelection('ESRI Shapefile')
+        elif sel == self.sourceMap['pro']:
+            win = self.input[self.dsnType][1]
+            self.dsnSizer.Add(item=self.input[self.dsnType][1],
+                              flag = wx.ALIGN_CENTER_VERTICAL | wx.EXPAND,
+                              pos = (0, 1))
+            win.SetValue('')
+            win.Show()
         
         self.dsnSizer.Layout()
         
@@ -1218,9 +1228,9 @@
                                               changeCallback=self.OnSetDsn,
                                               fileMask = format)
         else: # database
-            if format == 'SQLite':
+            if format == 'SQLite' or format == 'Rasterlite':
                 win = self.input['db-win']['file']
-            elif format == 'PostgreSQL':
+            elif format == 'PostgreSQL' or format == 'PostGIS WKT Raster driver':
                 if grass.find_program('psql'):
                     win = self.input['db-win']['choice']
                     if not win.GetItems():



More information about the grass-commit mailing list