grass icon indicating copy to clipboard operation
grass copied to clipboard

wxGUI/dbmgr: fix removing map table layer and layer related Browse data and Manage tables page (tab)

Open tmszi opened this issue 3 years ago • 0 comments
trafficstars

Describe the bug Removing map table layer don't work and related layer page (tab) on the Browse data and Manage tables page (tab) aren't deleted too.

To Reproduce Steps to reproduce the behavior:

  1. Launch Attribute Table Manager e.g g.gui.dbmgr geology
  2. Switch to Manage layers page (tab)
  3. Create new table with name e.g. test (right side on the Add layer page (tab))
  4. Add new layer with layer number 2, and choose test table from table choice widget and hit Add layer button
  5. On the Manage layers page (tab) switch to Remove layer page (tab)
  6. Choose layer 2 from Layer to remove ComboBox widget choices and hit Remove layer button
  7. See error
Traceback (most recent call last):
  File "/usr/lib64/grass83/gui/wxpython/dbmgr/base.py", line 3815, in OnDeleteLayer
    self.parentDialog.parentDbMgrBase.UpdateDialog(layer=layer)
  File "/usr/lib64/grass83/gui/wxpython/dbmgr/manager.py", line 253, in UpdateDialog
    DbMgrBase.UpdateDialog(self, layer=layer)
  File "/usr/lib64/grass83/gui/wxpython/dbmgr/base.py", line 860, in UpdateDialog
    self.pages["browse"].DeletePage(layer)
  File "/usr/lib64/grass83/gui/wxpython/dbmgr/base.py", line 1037, in DeletePage
    self.selLayer = self.layers[self.GetSelection()]
IndexError: list index out of range

Expected behavior Removing map table layer should be work without error message, and related layer page (tab) on the Browse data and Manage tables page (tab) be deleted too.

System description (please complete the following information):

  • Operating System: all
  • GRASS GIS version: all

tmszi avatar Jun 09 '22 14:06 tmszi