Reflect changes when current mapset/location is changed from menu#915
Conversation
| self.datacatalog.changeLocation.emit(mapset=mapset, | ||
| location=location, | ||
| dbase=None) |
There was a problem hiding this comment.
This is an obscure way of calling self.ChangeLocation() - datacatalog emits a signal and it's connected in lmgr/frame.py which calls ChangeLocation().
| self.datacatalog.tree.UpdateCurrentDbLocationMapsetNode() | ||
| self.datacatalog.tree.ExpandCurrentMapset() | ||
| self.datacatalog.tree.RefreshItems() |
There was a problem hiding this comment.
Layer manager shouldn't be calling methods of tree directly like that, this would at least need to be wrapped in some function in tree.py or catalog.py, and it's code duplication with code in tree.py.
|
We thought about this more and decided that we take a different approach, which I implemented in #919. The advantage there is switching mapset is taken outside of layer manager and thanks to signals implemented in giface, layer manager doesn't need to know much about datacatalog, so it decouples the GUI objects. When any object decides to switch mapset, it switches the mapset with the mapset_changed_interactive function, which in turn emits signal, which any GUI class with giface can connect and react on it. |
There are several actions that need to be synced in GUI and datacatalog. This PR solves the case when the current mapset/location is changed from menu.