Skip to content

Comments

Reflect changes when current mapset/location is changed from menu#915

Closed
lindakarlovska wants to merge 1 commit intoOSGeo:masterfrom
lindakarlovska:wxGUI-reflect-changes-when-current-location-is-changed-from-menu
Closed

Reflect changes when current mapset/location is changed from menu#915
lindakarlovska wants to merge 1 commit intoOSGeo:masterfrom
lindakarlovska:wxGUI-reflect-changes-when-current-location-is-changed-from-menu

Conversation

@lindakarlovska
Copy link
Contributor

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.

@lindakarlovska lindakarlovska added bug Something isn't working GUI wxGUI related gsoc Reserved for Google Summer of Code student(s) labels Aug 19, 2020
@lindakarlovska lindakarlovska self-assigned this Aug 19, 2020
@lindakarlovska lindakarlovska marked this pull request as draft August 19, 2020 12:26
@lindakarlovska lindakarlovska marked this pull request as ready for review August 19, 2020 13:37
Comment on lines +1178 to +1180
self.datacatalog.changeLocation.emit(mapset=mapset,
location=location,
dbase=None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an obscure way of calling self.ChangeLocation() - datacatalog emits a signal and it's connected in lmgr/frame.py which calls ChangeLocation().

Comment on lines +1186 to +1188
self.datacatalog.tree.UpdateCurrentDbLocationMapsetNode()
self.datacatalog.tree.ExpandCurrentMapset()
self.datacatalog.tree.RefreshItems()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@petrasovaa
Copy link
Contributor

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.

@petrasovaa petrasovaa closed this Aug 20, 2020
@neteler neteler added this to the 8.0.0 milestone Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working gsoc Reserved for Google Summer of Code student(s) GUI wxGUI related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants