Skip to content

Commit

Permalink
wxGUI: fix showing attribute column menu (OSGeo#3098)
Browse files Browse the repository at this point in the history
  • Loading branch information
petrasovaa authored Jul 27, 2023
1 parent f46ae17 commit 1f4d57a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gui/wxpython/dbmgr/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,6 @@ def OnColumnMenu(self, event):
self.popupId = {
"sortAsc": NewId(),
"sortDesc": NewId(),
"calculate": NewId(),
"area": NewId(),
"length": NewId(),
"compact": NewId(),
Expand All @@ -499,8 +498,9 @@ def OnColumnMenu(self, event):
popupMenu.Append(self.popupId["sortDesc"], _("Sort descending"))
popupMenu.AppendSeparator()
subMenu = Menu()
popupMenu.AppendMenu(
self.popupId["calculate"], _("Calculate (only numeric columns)"), subMenu
subMenuItem = popupMenu.AppendSubMenu(
subMenu,
_("Calculate (only numeric columns)"),
)
popupMenu.Append(self.popupId["calculator"], _("Field calculator"))
popupMenu.AppendSeparator()
Expand All @@ -519,7 +519,7 @@ def OnColumnMenu(self, event):
if not self.dbMgrData["editable"] or self.columns[
self.GetColumn(self._col).GetText()
]["ctype"] not in (int, float):
popupMenu.Enable(self.popupId["calculate"], False)
subMenuItem.Enable(False)

subMenu.Append(self.popupId["area"], _("Area size"))
subMenu.Append(self.popupId["length"], _("Line length"))
Expand Down

0 comments on commit 1f4d57a

Please sign in to comment.