[GRASS-SVN] r48007 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 31 14:39:39 EDT 2011


Author: martinl
Date: 2011-08-31 11:39:39 -0700 (Wed, 31 Aug 2011)
New Revision: 48007

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
Log:
wxGUI/GdalImport: reload layers also when format changed


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py	2011-08-31 18:25:23 UTC (rev 48006)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py	2011-08-31 18:39:39 UTC (rev 48007)
@@ -1418,11 +1418,20 @@
         
         if not path:
             return 
+
+        self._reloadLayers()
         
+        if event:
+            event.Skip()
+        
+    def _reloadLayers(self):
+        """!Reload list of layers"""
+        dsn = self._getDsn()
+        if not dsn:
+            return
+
         data = list()        
-        
         layerId = 1
-        dsn = self._getDsn()
         
         if self.dsnType == 'file':
             baseName = os.path.basename(dsn)
@@ -1467,9 +1476,6 @@
             else:
                 self.parent.btn_run.Enable(False)
         
-        if event:
-            event.Skip()
-        
     def OnSetFormat(self, event, format = None):
         """!Format changed"""
         if self.dsnType not in ['file', 'dir', 'db']:
@@ -1538,7 +1544,10 @@
                           flag = wx.ALIGN_CENTER_VERTICAL | wx.EXPAND,
                           pos = (0, 1))
         self.dsnSizer.Layout()
-
+        
+        # reload layers
+        self._reloadLayers()
+        
     def GetType(self):
         """!Get source type"""
         return self.dsnType



More information about the grass-commit mailing list