Skip to content

Commit

Permalink
wxGUI/vdigit: show error message dialog if no vector map is open for …
Browse files Browse the repository at this point in the history
…editing, after activate 'Z bulk-labeling of 3D lines' tool (#1877)

* wxGUI/vdigit: show error message dialog if no vector map is open for editing, after activate 'Z bulk-labeling of 3D lines' tool
  • Loading branch information
tmszi committed Oct 2, 2021
1 parent ca2d28a commit c84312a
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions gui/wxpython/vdigit/toolbars.py
Expand Up @@ -354,6 +354,21 @@ def _toolbarData(self):

return self._getToolbarData(data)

def _noVMapOpenForEditingErrDlg(self):
"""Show error message dialog if no vector map is open for editing
:return: True if no vector map is open for editing else None
"""
if not self.digit:
GError(
_(
"No vector map is open for editing. Please select first"
"a vector map from the combo box."
),
self.parent,
)
return True

def OnTool(self, event):
"""Tool selected -> untoggles previusly selected tool in
toolbar"""
Expand Down Expand Up @@ -687,8 +702,7 @@ def OnAdditionalToolMenu(self, event):

def OnCopy(self, event):
"""Copy selected features from (background) vector map"""
if not self.digit:
GError(_("No vector map open for editing."), self.parent)
if self._noVMapOpenForEditingErrDlg():
return

# select background map
Expand Down Expand Up @@ -847,6 +861,8 @@ def OnQuery(self, event):

def OnZBulk(self, event):
"""Z bulk-labeling selected lines/boundaries"""
if self._noVMapOpenForEditingErrDlg():
return
if not self.digit.IsVector3D():
GError(
parent=self.parent,
Expand Down

0 comments on commit c84312a

Please sign in to comment.