Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix check wxGUI Set vector output format native format dsn #450

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions gui/wxpython/gui_core/gselect.py
Original file line number Diff line number Diff line change
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