Skip to content

Commit

Permalink
wxGUI Set vector output format: fix check native format dsn (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmszi committed Mar 24, 2020
1 parent 854a8a4 commit 754b5a4
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions gui/wxpython/gui_core/gselect.py
Expand Up @@ -1656,23 +1656,25 @@ def _postInit(self, sourceType, data):
self.SetSourceType(sourceType)
self.source.SetSelection(self.sourceMap[sourceType])

dsn = os.path.expandvars(dsn) # v.external.out uses $HOME
# fill in default values
if sourceType == 'dir':
self.dirWidgets['format'].SetStringSelection(format)
self.dirWidgets['browse'].SetValue(dsn)
self.dirWidgets['options'].SetValue(options)
elif sourceType == 'db':
self.dbWidgets['format'].SetStringSelection(format)
self.dbWidgets['options'].SetValue(options)
name = self._getCurrentDbWidgetName()
if name == 'choice':
if dsn in self.dbWidgets[name].GetItems():
self.dbWidgets[name].SetStringSelection(dsn)
if 'topology' in data.keys():
self.dbWidgets['featType'].SetSelection(1)
else:
self.dbWidgets[name].SetValue(dsn)
# v.external.out does not return dsn for the native format
if dsn:
dsn = os.path.expandvars(dsn) # v.external.out uses $HOME
# fill in default values
if sourceType == 'dir':
self.dirWidgets['format'].SetStringSelection(format)
self.dirWidgets['browse'].SetValue(dsn)
self.dirWidgets['options'].SetValue(options)
elif sourceType == 'db':
self.dbWidgets['format'].SetStringSelection(format)
self.dbWidgets['options'].SetValue(options)
name = self._getCurrentDbWidgetName()
if name == 'choice':
if dsn in self.dbWidgets[name].GetItems():
self.dbWidgets[name].SetStringSelection(dsn)
if 'topology' in data.keys():
self.dbWidgets['featType'].SetSelection(1)
else:
self.dbWidgets[name].SetValue(dsn)

def _layout(self):
"""Layout"""
Expand Down Expand Up @@ -2747,7 +2749,7 @@ def _onClick(self, event):
win.Show()
except GException as e:
GMessage(parent=self.parent, message='{}'.format(e))

def SetData(self, vector, layer):
self.vector_map = vector
self.vector_layer = int(layer) # TODO: support layer names
Expand Down

0 comments on commit 754b5a4

Please sign in to comment.