From cc42d6256a305ea38a3e01fc3b8be454407eaf1d Mon Sep 17 00:00:00 2001 From: Tomas Zigo Date: Wed, 5 Nov 2025 20:50:23 +0100 Subject: [PATCH 1/7] wxGUI/dbmgr: add show/hide column functionality --- gui/wxpython/core/settings.py | 2 + gui/wxpython/dbmgr/base.py | 231 +++++++++++++++++++++++++++ gui/wxpython/gui_core/preferences.py | 27 ++++ 3 files changed, 260 insertions(+) diff --git a/gui/wxpython/core/settings.py b/gui/wxpython/core/settings.py index 4861e278830..9a6aa7b9793 100644 --- a/gui/wxpython/core/settings.py +++ b/gui/wxpython/core/settings.py @@ -257,6 +257,8 @@ def _defaultSettings(self): "encoding": { "value": "", }, + "enableHiddenCols": {"enabled": False}, + "hiddenCols": {}, }, # # Command diff --git a/gui/wxpython/dbmgr/base.py b/gui/wxpython/dbmgr/base.py index 5acddb8a92e..a77d9e66708 100644 --- a/gui/wxpython/dbmgr/base.py +++ b/gui/wxpython/dbmgr/base.py @@ -152,6 +152,187 @@ def __init__(self, parent, log, dbMgrData, layer, pages): self.Bind(wx.EVT_LIST_COL_CLICK, self.OnColumnSort) self.Bind(wx.EVT_LIST_COL_RIGHT_CLICK, self.OnColumnMenu) + def _colExist(self, colName): + """Checking if table column exist and update + hidden columns settings + + :param str colName: column name + + :return bool: True if column exist + """ + exist = colName in self.columns.keys() + if not exist: + self._updateHiddenColsSettings( + colName, + removeCol=True, + ) + return exist + + def _getHiddenColsSettings(self, currentVectMap=True): + """Get attribute table manager hidden columns settings + + :param bool currentVectMap: True for the getting current vector map + hidden columns settings or False for getting + all vector maps hidden columns settings for + the current mapset path + + :return dict: Current vector map hidden columns settings + or all vector maps hidden columns settings + for current mapset path + """ + UserSettings.ReadSettingsFile() + settings = UserSettings.Get(group="atm", key="hiddenCols") + if settings: + mapsetPath = self._getMapsetPath() + mapsetPathHiddenColsSettings = settings.get(mapsetPath) + if currentVectMap: + return mapsetPathHiddenColsSettings.get(self.dbMgrData["vectName"]) + return mapsetPathHiddenColsSettings + + def _getMapsetPath(self): + """Get mapset path""" + gisEnv = gs.gisenv() + return f"{gisEnv['GISDBASE']}/{gisEnv['LOCATION_NAME']}/{gisEnv['MAPSET']}" + + def _hideCol(self): + """Hide column""" + currentVectMapsHiddenColsSettings = self._getHiddenColsSettings() + if currentVectMapsHiddenColsSettings: + currentTableColsSettings = currentVectMapsHiddenColsSettings.get( + self.mapDBInfo.layers[self.layer]["table"] + ) + for colName in currentTableColsSettings: + if self._colExist(colName): + # Get column order + colOrder = self.GetColOrder(colName) + # Delete column data + self.DeleteColumnWithData(colOrder) + + def _showAllCols(self): + """Show all columns""" + self.Update() + + def _updateHiddenColsSettings( + self, + colName=None, + colOrder=None, + removeCol=False, + remove=False, + ): + """Update atribute table manager hidden columns settings + + :param str colName: column name, with default None value + :param int colOrder: column order, with default None value + :param bool removeCol: True for removing hidden column from the + settings, default value is False + :param bool remove: True for removing hidden column settings key, + default value is False + """ + hiddenColsKey = "hiddenCols" + atmKey = "atm" + curentTableHiddenCols = [] + otherTablesHiddenCols = {} + currentVectMapsHiddenColsSettings = None + + if not removeCol and not remove: + curentTableHiddenCols = [colName] + + allVectMapsHiddenColsSettings = self._getHiddenColsSettings( + currentVectMap=False + ) + if allVectMapsHiddenColsSettings: + currentVectMapsHiddenColsSettings = allVectMapsHiddenColsSettings.get( + self.dbMgrData["vectName"], + None, + ) + if currentVectMapsHiddenColsSettings: + # Update hidden col settings with existed hidden cols + currentVectMapTable = currentVectMapsHiddenColsSettings.pop( + self.mapDBInfo.layers[self.layer]["table"], {} + ) + curentTableHiddenCols.extend(currentVectMapTable) + otherTablesHiddenCols.update(currentVectMapsHiddenColsSettings) + + # Remove column if was dropped from the table + if removeCol: + curentTableHiddenCols.remove(colName) + + if remove: + if otherTablesHiddenCols: + # Remove current vector map table settings dict key + UserSettings.Append( + dict=UserSettings.userSettings, + group=atmKey, + key=hiddenColsKey, + subkey=[ + self._getMapsetPath(), + self.dbMgrData["vectName"], + ], + value=otherTablesHiddenCols, + ) + elif len( + [ + mapName + for mapName in allVectMapsHiddenColsSettings + if mapName != self.dbMgrData["vectName"] + ] + > 0 + ): + # Remove curent vector map settings dict key + del UserSettings.userSettings[atmKey][hiddenColsKey][ + self._getMapsetPath() + ][self.dbMgrData["vectName"]] + else: + # Remove current mapset path settings dict key + del UserSettings.userSettings[atmKey][hiddenColsKey][ + self._getMapsetPath() + ] + else: + # Append new hidden column + UserSettings.Append( + dict=UserSettings.userSettings, + group=atmKey, + key=hiddenColsKey, + subkey=[ + self._getMapsetPath(), + self.dbMgrData["vectName"], + ], + value=dict( + {self.mapDBInfo.layers[self.layer]["table"]: curentTableHiddenCols}, + **otherTablesHiddenCols, + ), + ) + + jsonSettings = {} + UserSettings.ReadSettingsFile(settings=jsonSettings) + jsonSettings[atmKey][hiddenColsKey] = UserSettings.Get( + group=atmKey, + key=hiddenColsKey, + settings_type="user", + ) + UserSettings.SaveToFile(settings=jsonSettings) + + def GetColOrder(self, colName): + """Get column order + + :param str colName: column name + + :return int: columnn order + """ + return { + self.GetColumn(colIdx).GetText(): colIdx + for colIdx in range(self.GetColumnCount()) + }.pop(colName, None) + + def DeleteColumnWithData(self, colOrder): + """Delete column with data + + :param int colOrder: column order + """ + for row in range(self.GetItemCount()): + del self.itemDataMap[row][colOrder] + self.DeleteColumn(colOrder) + def Update(self, mapDBInfo=None): """Update list according new mapDBInfo description""" if mapDBInfo: @@ -368,6 +549,14 @@ def LoadData(self, layer, columns=None, where=None, sql=None): self.SetColumnWidth(col=i, width=width) i += 1 + # Hide column + if UserSettings.Get( + group="atm", + key="enableHiddenCols", + subkey="enabled", + ): + self._hideCol() + self.SendSizeEvent() self.log.write(_("Number of loaded records: %d") % self.GetItemCount()) @@ -490,6 +679,11 @@ def OnGetItemText(self, item, col): def OnColumnMenu(self, event): """Column heading right mouse button -> pop-up menu""" self._col = event.GetColumn() + enableHiddenCols = UserSettings.Get( + group="atm", + key="enableHiddenCols", + subkey="enabled", + ) popupMenu = Menu() @@ -509,6 +703,13 @@ def OnColumnMenu(self, event): "calculator": NewId(), "stats": NewId(), } + if enableHiddenCols: + self.popupId.update( + { + "hideCol": NewId(), + "showAllCols": NewId(), + } + ) popupMenu.Append(self.popupId["sortAsc"], _("Sort ascending")) popupMenu.Append(self.popupId["sortDesc"], _("Sort descending")) @@ -520,6 +721,14 @@ def OnColumnMenu(self, event): ) popupMenu.Append(self.popupId["calculator"], _("Field calculator")) popupMenu.AppendSeparator() + if enableHiddenCols: + catKeyCol = self.GetMapCatKeyColumn() + if self._col != catKeyCol["index"]: + popupMenu.Append(self.popupId["hideCol"], _("Hide column")) + currentVectMapHiddenCols = self._getHiddenColsSettings() + if currentVectMapHiddenCols: + popupMenu.Append(self.popupId["showAllCols"], _("Show all columns")) + popupMenu.AppendSeparator() popupMenu.Append(self.popupId["stats"], _("Statistics")) if not self.pages["manageTable"]: @@ -553,6 +762,12 @@ def OnColumnMenu(self, event): self.Bind(wx.EVT_MENU, self.OnColumnSortAsc, id=self.popupId["sortAsc"]) self.Bind(wx.EVT_MENU, self.OnColumnSortDesc, id=self.popupId["sortDesc"]) self.Bind(wx.EVT_MENU, self.OnFieldCalculator, id=self.popupId["calculator"]) + if enableHiddenCols: + self.Bind(wx.EVT_MENU, self.OnHideColumn, id=self.popupId["hideCol"]) + if currentVectMapHiddenCols: + self.Bind( + wx.EVT_MENU, self.OnShowColumn, id=self.popupId["showAllCols"] + ) self.Bind(wx.EVT_MENU, self.OnFieldStatistics, id=self.popupId["stats"]) if not self.pages["manageTable"]: self.Bind(wx.EVT_MENU, self.OnAddColumn, id=self.popupId["addCol"]) @@ -685,6 +900,22 @@ def OnAddColumn(self, event): ) dlg.Destroy() + def OnHideColumn(self, event): + """Hide column""" + # Get column order + colOrder = self.GetColOrder(colName=self.GetColumn(self._col).GetText()) + + self._updateHiddenColsSettings( + colName=self.GetColumn(self._col).GetText(), + colOrder=self._col, + ) + self.DeleteColumnWithData(colOrder) + + def OnShowColumn(self, event): + """Show column""" + self._updateHiddenColsSettings(remove=True) + self._showAllCols() + def SortItems(self, sorter=cmp): """Sort items""" wx.BeginBusyCursor() diff --git a/gui/wxpython/gui_core/preferences.py b/gui/wxpython/gui_core/preferences.py index b9b02be99ac..38a5a549d57 100644 --- a/gui/wxpython/gui_core/preferences.py +++ b/gui/wxpython/gui_core/preferences.py @@ -471,6 +471,33 @@ def _createGeneralPage(self, notebook): ) border.Add(sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=3) # + # Attribute manager settings + # + box = StaticBox( + parent=panel, + id=wx.ID_ANY, + label=" %s " % _("Attribute table manager settings"), + ) + sizer = wx.StaticBoxSizer(box, wx.VERTICAL) + hiddenColumnsAttributeManager = wx.CheckBox( + parent=panel, + label=_("Enable hide/show column"), + name="IsChecked", + ) + hiddenColumnsAttributeManager.SetValue( + self.settings.Get(group="atm", key="enableHiddenCols", subkey="enabled") + ) + self.winId["atm:enableHiddenCols:enabled"] = ( + hiddenColumnsAttributeManager.GetId() + ) + sizer.Add( + hiddenColumnsAttributeManager, + proportion=1, + flag=wx.ALL | wx.EXPAND, + border=5, + ) + border.Add(sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=3) + # # workspace # box = StaticBox( From 8bab487c02fb06df3948a5ea08cd266eb1264c3c Mon Sep 17 00:00:00 2001 From: Tomas Zigo Date: Sat, 22 Aug 2026 06:15:15 +0200 Subject: [PATCH 2/7] Enable hidden columns functionality by default --- gui/wxpython/core/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/wxpython/core/settings.py b/gui/wxpython/core/settings.py index 9a6aa7b9793..12d90caed3f 100644 --- a/gui/wxpython/core/settings.py +++ b/gui/wxpython/core/settings.py @@ -257,7 +257,7 @@ def _defaultSettings(self): "encoding": { "value": "", }, - "enableHiddenCols": {"enabled": False}, + "enableHiddenCols": {"enabled": True}, "hiddenCols": {}, }, # From 01309248930a0310669716259d49751f696547b1 Mon Sep 17 00:00:00 2001 From: Tomas Zigo Date: Sat, 22 Aug 2026 06:27:35 +0200 Subject: [PATCH 3/7] Move enable show / hide columns settings widget into dbmgr GUI --- gui/wxpython/dbmgr/base.py | 43 +++++++++++++++++++--------- gui/wxpython/dbmgr/manager.py | 27 +++++++++++++++++ gui/wxpython/gui_core/preferences.py | 27 ----------------- 3 files changed, 57 insertions(+), 40 deletions(-) diff --git a/gui/wxpython/dbmgr/base.py b/gui/wxpython/dbmgr/base.py index a77d9e66708..b5d86a6aab4 100644 --- a/gui/wxpython/dbmgr/base.py +++ b/gui/wxpython/dbmgr/base.py @@ -208,7 +208,7 @@ def _hideCol(self): # Delete column data self.DeleteColumnWithData(colOrder) - def _showAllCols(self): + def ShowAllCols(self): """Show all columns""" self.Update() @@ -914,7 +914,7 @@ def OnHideColumn(self, event): def OnShowColumn(self, event): """Show column""" self._updateHiddenColsSettings(remove=True) - self._showAllCols() + self.ShowAllCols() def SortItems(self, sorter=cmp): """Sort items""" @@ -1404,14 +1404,18 @@ def AddLayer(self, layer, pos=-1): ) listSizer = wx.StaticBoxSizer(listBox, wx.VERTICAL) - win = VirtualAttributeList(panel, self.log, self.dbMgrData, layer, self.pages) - if win.IsEmpty(): + self.virtualAttributeListWin = VirtualAttributeList( + panel, self.log, self.dbMgrData, layer, self.pages + ) + if self.virtualAttributeListWin.IsEmpty(): panel.Destroy() return False self.layers.append(layer) - win.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnDataItemActivated) + self.virtualAttributeListWin.Bind( + wx.EVT_LIST_ITEM_ACTIVATED, self.OnDataItemActivated + ) self.layerPage[layer] = {"browsePage": panel.GetId()} @@ -1439,16 +1443,29 @@ def AddLayer(self, layer, pos=-1): sqlSizer = wx.StaticBoxSizer(sqlBox, wx.VERTICAL) - win.Bind(wx.EVT_COMMAND_RIGHT_CLICK, self.OnDataRightUp) # wxMSW - win.Bind(wx.EVT_RIGHT_UP, self.OnDataRightUp) # wxGTK + self.virtualAttributeListWin.Bind( + wx.EVT_COMMAND_RIGHT_CLICK, self.OnDataRightUp + ) # wxMSW + self.virtualAttributeListWin.Bind(wx.EVT_RIGHT_UP, self.OnDataRightUp) # wxGTK if UserSettings.Get(group="atm", key="leftDbClick", subkey="selection") == 0: - win.Bind(wx.EVT_LEFT_DCLICK, self.OnDataItemEdit) - win.Bind(wx.EVT_COMMAND_LEFT_DCLICK, self.OnDataItemEdit) + self.virtualAttributeListWin.Bind(wx.EVT_LEFT_DCLICK, self.OnDataItemEdit) + self.virtualAttributeListWin.Bind( + wx.EVT_COMMAND_LEFT_DCLICK, self.OnDataItemEdit + ) else: - win.Bind(wx.EVT_LEFT_DCLICK, self.OnDataDrawSelected) - win.Bind(wx.EVT_COMMAND_LEFT_DCLICK, self.OnDataDrawSelected) + self.virtualAttributeListWin.Bind( + wx.EVT_LEFT_DCLICK, self.OnDataDrawSelected + ) + self.virtualAttributeListWin.Bind( + wx.EVT_COMMAND_LEFT_DCLICK, self.OnDataDrawSelected + ) - listSizer.Add(win, proportion=1, flag=wx.EXPAND | wx.ALL, border=3) + listSizer.Add( + self.virtualAttributeListWin, + proportion=1, + flag=wx.EXPAND | wx.ALL, + border=3, + ) # sql statement box sqlNtb = GNotebook( @@ -1588,7 +1605,7 @@ def AddLayer(self, layer, pos=-1): sqlNtb.Bind(wx.EVT_SIZE, self.OnSqlQuerySizeWrap(layer)) - self.layerPage[layer]["data"] = win.GetId() + self.layerPage[layer]["data"] = self.virtualAttributeListWin.GetId() self.layerPage[layer]["sqlNtb"] = sqlNtb.GetId() self.layerPage[layer]["whereColumn"] = sqlWhereColumn.GetId() self.layerPage[layer]["whereOperator"] = sqlWhereCond.GetId() diff --git a/gui/wxpython/dbmgr/manager.py b/gui/wxpython/dbmgr/manager.py index 584dd713413..877dd6ea28e 100644 --- a/gui/wxpython/dbmgr/manager.py +++ b/gui/wxpython/dbmgr/manager.py @@ -34,6 +34,7 @@ else: import wx.lib.flatnotebook as FN +from core.settings import UserSettings from core.gcmd import GMessage from dbmgr.base import DbMgrBase from gui_core.widgets import GNotebook @@ -146,6 +147,16 @@ def __init__( else: wx.CallAfter(self.notebook.SetSelection, 0) # select browse tab + # checkbox + self.checkHiddenCols = wx.CheckBox( + parent=self.panel, + label=_("Enable hide / show columns"), + ) + self.checkHiddenCols.SetValue( + UserSettings.Get(group="atm", key="enableHiddenCols", subkey="enabled") + ) + self.Bind(wx.EVT_CHECKBOX, self.OnCheckHiddenCols, self.checkHiddenCols) + # buttons self.btnClose = CloseButton(parent=self.panel) self.btnClose.SetToolTip(_("Close Attribute Table Manager")) @@ -188,6 +199,7 @@ def _layout(self): btnSizer.Add(self.btnClose, proportion=1, flag=wx.ALL, border=5) mainSizer.Add(self.notebook, proportion=1, flag=wx.EXPAND) + mainSizer.Add(self.checkHiddenCols, flag=wx.ALL, border=5) mainSizer.Add(btnSizer, flag=wx.ALIGN_RIGHT | wx.ALL, border=5) self.panel.SetAutoLayout(True) @@ -208,6 +220,21 @@ def OnCloseWindow(self, event): event.Skip() + def OnCheckHiddenCols(self, event): + checkbox = event.GetEventObject() + isChecked = checkbox.GetValue() + UserSettings.Set( + group="atm", + key="enableHiddenCols", + subkey="enabled", + value=checkbox.GetValue(), + ) + UserSettings.SaveToFile() + if isChecked: + self.OnReloadData(event=None) + else: + self.pages["browse"].virtualAttributeListWin.ShowAllCols() + def OnReloadData(self, event): """Reload data""" if self.pages["browse"]: diff --git a/gui/wxpython/gui_core/preferences.py b/gui/wxpython/gui_core/preferences.py index 38a5a549d57..b9b02be99ac 100644 --- a/gui/wxpython/gui_core/preferences.py +++ b/gui/wxpython/gui_core/preferences.py @@ -471,33 +471,6 @@ def _createGeneralPage(self, notebook): ) border.Add(sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=3) # - # Attribute manager settings - # - box = StaticBox( - parent=panel, - id=wx.ID_ANY, - label=" %s " % _("Attribute table manager settings"), - ) - sizer = wx.StaticBoxSizer(box, wx.VERTICAL) - hiddenColumnsAttributeManager = wx.CheckBox( - parent=panel, - label=_("Enable hide/show column"), - name="IsChecked", - ) - hiddenColumnsAttributeManager.SetValue( - self.settings.Get(group="atm", key="enableHiddenCols", subkey="enabled") - ) - self.winId["atm:enableHiddenCols:enabled"] = ( - hiddenColumnsAttributeManager.GetId() - ) - sizer.Add( - hiddenColumnsAttributeManager, - proportion=1, - flag=wx.ALL | wx.EXPAND, - border=5, - ) - border.Add(sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=3) - # # workspace # box = StaticBox( From fd11f548143bb4590f5792377b8ad7b4e89cb172 Mon Sep 17 00:00:00 2001 From: Tomas Zigo Date: Sat, 22 Aug 2026 06:30:37 +0200 Subject: [PATCH 4/7] Fix condition syntax --- gui/wxpython/dbmgr/base.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gui/wxpython/dbmgr/base.py b/gui/wxpython/dbmgr/base.py index b5d86a6aab4..5ef2f00c20c 100644 --- a/gui/wxpython/dbmgr/base.py +++ b/gui/wxpython/dbmgr/base.py @@ -270,12 +270,14 @@ def _updateHiddenColsSettings( ], value=otherTablesHiddenCols, ) - elif len( - [ - mapName - for mapName in allVectMapsHiddenColsSettings - if mapName != self.dbMgrData["vectName"] - ] + elif ( + len( + [ + mapName + for mapName in allVectMapsHiddenColsSettings + if mapName != self.dbMgrData["vectName"] + ] + ) > 0 ): # Remove curent vector map settings dict key From 0e3fceae6cb4b42948408fadbea8b3e861d2f3fc Mon Sep 17 00:00:00 2001 From: Tomas Zigo Date: Sat, 22 Aug 2026 06:57:06 +0200 Subject: [PATCH 5/7] Override SortListItems() method to refresh number of current columns required by listmix.ColumnSorterMixin() class instance --- gui/wxpython/dbmgr/base.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/gui/wxpython/dbmgr/base.py b/gui/wxpython/dbmgr/base.py index 5ef2f00c20c..baf4e41a944 100644 --- a/gui/wxpython/dbmgr/base.py +++ b/gui/wxpython/dbmgr/base.py @@ -972,6 +972,21 @@ def _updateColSortFlag(self): """ self._colSortFlag.extend([0] * (len(self.columns) - len(self._colSortFlag))) + def RefreshListMixColsLength(self): + currentVectMapsHiddenColsSettings = self._getHiddenColsSettings() + if currentVectMapsHiddenColsSettings: + currentTableColsSettings = currentVectMapsHiddenColsSettings.get( + self.mapDBInfo.layers[self.layer]["table"] + ) + listmix.ColumnSorterMixin.SetColumnCount( + self, + len(self.columns) - len(currentTableColsSettings), + ) + + def SortListItems(self, *args, **kwargs): + self.RefreshListMixColsLength() + return super().SortListItems(*args, **kwargs) + class DbMgrBase: def __init__( From bdaf857dd3e915ef46eea0ab4d50bf49b6cec093 Mon Sep 17 00:00:00 2001 From: Tomas Zigo Date: Sat, 22 Aug 2026 07:17:43 +0200 Subject: [PATCH 6/7] Fix condition if column order is None --- gui/wxpython/dbmgr/base.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/gui/wxpython/dbmgr/base.py b/gui/wxpython/dbmgr/base.py index baf4e41a944..f89e2d7d4e1 100644 --- a/gui/wxpython/dbmgr/base.py +++ b/gui/wxpython/dbmgr/base.py @@ -205,8 +205,9 @@ def _hideCol(self): if self._colExist(colName): # Get column order colOrder = self.GetColOrder(colName) - # Delete column data - self.DeleteColumnWithData(colOrder) + if colOrder: + # Delete column data + self.DeleteColumnWithData(colOrder) def ShowAllCols(self): """Show all columns""" @@ -906,12 +907,12 @@ def OnHideColumn(self, event): """Hide column""" # Get column order colOrder = self.GetColOrder(colName=self.GetColumn(self._col).GetText()) - - self._updateHiddenColsSettings( - colName=self.GetColumn(self._col).GetText(), - colOrder=self._col, - ) - self.DeleteColumnWithData(colOrder) + if colOrder: + self._updateHiddenColsSettings( + colName=self.GetColumn(self._col).GetText(), + colOrder=self._col, + ) + self.DeleteColumnWithData(colOrder) def OnShowColumn(self, event): """Show column""" From 24ee96199d6e9fc28149c8dbdaab8c6fb72fcc3d Mon Sep 17 00:00:00 2001 From: Tomas Zigo Date: Sat, 22 Aug 2026 07:20:26 +0200 Subject: [PATCH 7/7] Fix getting current vect map hidden columns settings condition --- gui/wxpython/dbmgr/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/wxpython/dbmgr/base.py b/gui/wxpython/dbmgr/base.py index f89e2d7d4e1..dc21eab50e6 100644 --- a/gui/wxpython/dbmgr/base.py +++ b/gui/wxpython/dbmgr/base.py @@ -185,7 +185,7 @@ def _getHiddenColsSettings(self, currentVectMap=True): if settings: mapsetPath = self._getMapsetPath() mapsetPathHiddenColsSettings = settings.get(mapsetPath) - if currentVectMap: + if currentVectMap and mapsetPathHiddenColsSettings: return mapsetPathHiddenColsSettings.get(self.dbMgrData["vectName"]) return mapsetPathHiddenColsSettings