|
@@ -34,6 +34,7 @@ import glob
|
|
|
import wx
|
|
|
import wx.combo
|
|
|
import wx.lib.filebrowsebutton as filebrowse
|
|
|
+from wx.lib.newevent import NewEvent
|
|
|
|
|
|
import globalvar
|
|
|
|
|
@@ -45,6 +46,8 @@ import gcmd
|
|
|
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 = [],
|
|
@@ -1102,25 +1105,8 @@ class GdalSelect(wx.Panel):
|
|
|
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':
|
|
@@ -1159,6 +1145,10 @@ class GdalSelect(wx.Panel):
|
|
|
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:
|
|
@@ -1166,6 +1156,8 @@ class GdalSelect(wx.Panel):
|
|
|
else:
|
|
|
self.parent.btn_run.Enable(False)
|
|
|
|
|
|
+ event.Skip()
|
|
|
+
|
|
|
def OnSetFormat(self, event):
|
|
|
"""!Format changed"""
|
|
|
if self.dsnType not in ['file', 'db']:
|
|
@@ -1240,9 +1232,10 @@ class GdalSelect(wx.Panel):
|
|
|
|
|
|
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())
|