Skip to content

Commit

Permalink
wxGUI/import_export: fix validation input map name (overwrite flag) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tmszi committed Dec 29, 2020
1 parent c6c4e82 commit 6b1d355
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions gui/wxpython/modules/import_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ def __init__(self, parent, giface, itype,
key='overwrite',
subkey='enabled'))
self.overwrite.Bind(wx.EVT_CHECKBOX, self.OnCheckOverwrite)
if UserSettings.Get(group='cmd', key='overwrite',
subkey='enabled'):
self.list.validate = False

self.add = wx.CheckBox(parent=self.panel, id=wx.ID_ANY)
self.closeOnFinish = wx.CheckBox(parent=self.panel, id=wx.ID_ANY,
Expand Down Expand Up @@ -255,9 +258,7 @@ def _nameValidationFailed(self, layers_list):
def _validateOutputMapName(self):
"""Enable/disable output map name validation according the
overwrite state"""
if not self.overwrite.IsChecked() or not \
UserSettings.Get(group='cmd', key='overwrite',
subkey='enabled'):
if not self.overwrite.IsChecked():
if not self.list.GetValidator().\
Validate(win=self.list, validate_all=True):
return False
Expand Down

0 comments on commit 6b1d355

Please sign in to comment.