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

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Apr 26 15:32:47 EDT 2010


Author: martinl
Date: 2010-04-26 15:32:46 -0400 (Mon, 26 Apr 2010)
New Revision: 42039

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
Log:
wxGUI: use GdalSelect in menuform
(merge r42038 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py	2010-04-26 19:20:29 UTC (rev 42038)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py	2010-04-26 19:32:46 UTC (rev 42039)
@@ -33,6 +33,7 @@
 import wx
 import wx.combo
 import wx.lib.filebrowsebutton as filebrowse
+from wx.lib.newevent import NewEvent
 
 import globalvar
 
@@ -44,6 +45,8 @@
 import utils
 from preferences import globalSettings as UserSettings
 
+wxGdalSelect, EVT_GDALSELECT = NewEvent()
+
 class Select(wx.combo.ComboCtrl):
     def __init__(self, parent, id, size = globalvar.DIALOG_GSELECT_SIZE,
                  type = None, multiple = False, mapsets = None, exclude = [],
@@ -1061,25 +1064,8 @@
         path = event.GetString()
         if not path:
             return 
-
+        
         data = list()        
-        # if self.importType == 'dxf':
-        #     ret = gcmd.RunCommand('v.in.dxf',
-        #                           quiet = True,
-        #                           parent = self,
-        #                           read = True,
-        #                           flags = 'l',
-        #                           input = path)
-        #     if not ret:
-        #         self.list.LoadData()
-        #         self.btn_run.Enable(False)
-        #         return
-            
-        #     for line in ret.splitlines():
-        #         layerId = line.split(':')[0].split(' ')[1]
-        #         layerName = line.split(':')[1].strip()
-        #         grassName = utils.GetValidLayerName(layerName)
-        #         data.append((layerId, layerName.strip(), grassName.strip()))
         
         layerId = 1
         if self.format.GetStringSelection() == 'PostgreSQL':
@@ -1118,6 +1104,10 @@
                 data.append((layerId, layerName.strip(), grassName.strip()))
                 layerId += 1
         
+        evt = wxGdalSelect(dsn = dsn)
+        evt.SetId(self.input[self.dsnType][1].GetId())
+        wx.PostEvent(self.parent, evt)
+        
         if self.parent.GetName() == 'MultiImportDialog':
             self.parent.list.LoadData(data)
             if len(data) > 0:
@@ -1125,6 +1115,8 @@
             else:
                 self.parent.btn_run.Enable(False)
         
+        event.Skip()
+        
     def OnSetFormat(self, event):
         """!Format changed"""
         if self.dsnType not in ['file', 'db']:
@@ -1199,9 +1191,10 @@
         
         return self.input[self.dsnType][1].GetValue()
 
-    def SetDsnHandler(self):
-        """!Get DSN"""
-        
+    def GetDsnWin(self):
+        """!Get DSN windows"""
+        return self.input[self.dsnType][1]
+    
     def GetFormatExt(self):
         """!Get format extension"""
         return self.format.GetExtension(self.format.GetStringSelection())



More information about the grass-commit mailing list