Skip to content

Commit

Permalink
wxGUI/dbmgr: fix showing attribute column menu (manual backport of #3098
Browse files Browse the repository at this point in the history
) (#3103)
  • Loading branch information
petrasovaa authored Jul 27, 2023
1 parent 0a236d9 commit a186f81
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions gui/wxpython/dbmgr/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,6 @@ def OnColumnMenu(self, event):
if not hasattr(self, "popupID"):
self.popupId = {'sortAsc': NewId(),
'sortDesc': NewId(),
'calculate': NewId(),
'area': NewId(),
'length': NewId(),
'compact': NewId(),
Expand All @@ -469,8 +468,10 @@ 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"))
Expand All @@ -490,7 +491,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 a186f81

Please sign in to comment.