wxGUI/dbmgr: fix removing map table layer and layer related Browse data and Manage tables page (tab)#2422
Conversation
gui/wxpython/dbmgr/base.py
Outdated
| return False | ||
|
|
||
| GNotebook.DeleteNBPage(self, self.layers.index(layer)) | ||
| GNotebook.DeletePage(self, self.layers.index(layer)) |
There was a problem hiding this comment.
Could you please comment on this more? The new code uses directly the method of the FlatNotebook, but why? Is something wrong about GNotebook's implementation? Wouldn't it be possibly better to adjust the code of this function to work with the GNotebook's version of DeletNBPage?
There was a problem hiding this comment.
NotebookController base class, InsertPage method has 2 way how to insert page:
grass/gui/wxpython/gui_core/widgets.py
Lines 143 to 154 in 120f198
- Insert page with name param
- Insert page without name param (this is preferred way in Attribute Table Manager code)
grass/gui/wxpython/dbmgr/base.py
Lines 1173 to 1178 in 120f198
NotebookController base class, inside DeletePage method is called method GetPageIndexByName which is not return page index (return -1) if page was inserted without name param.
grass/gui/wxpython/gui_core/widgets.py
Lines 156 to 169 in 120f198
FlatNotebookController class, GetPageIndexByName method
grass/gui/wxpython/gui_core/widgets.py
Lines 258 to 264 in 120f198
GNotebook class, method DeleteNBPage implementation allow delete page which was inserted with name param only.
a4419dd to
327d334
Compare
|
Rebase 327d334. |
|
@petrasovaa I refactored the use of |
With 086b5b2 I refactor |
petrasovaa
left a comment
There was a problem hiding this comment.
Thank you, I think this is better!
…ta and Manage tables page (tab) (OSGeo#2422)
…ta and Manage tables page (tab) (OSGeo#2422)
…ta and Manage tables page (tab) (OSGeo#2422)
…ta and Manage tables page (tab) (OSGeo#2422)
…ta and Manage tables page (tab) (OSGeo#2422)
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:
g.gui.dbmgr geologyExpected 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):