-
-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wxGUI/Data catalog: distinguish label and name of nodes #783
wxGUI/Data catalog: distinguish label and name of nodes #783
Conversation
|
You need to rebase and solve conflict with master. When you are in this PR branch do something like (always read git status to check): |
64aafcc
to
23012a1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renaming map doesn't work.
|
You don't need to reload the entire tree to refresh the one layer. |
gui/wxpython/datacatalog/tree.py
Outdated
| if new_name: | ||
| self.Rename(old_name, new_name) | ||
| self.ReloadTreeItems() | ||
| except Exception as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which exception are you trying to catch here? Raised in _getNewMapName or Rename?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove it or explain why it needs to be there.
I have tried to use self.RefreshNode(self.selected_layer[0]) instead of self.ReloadTreeItems but it does not work. |
Would be probably nice to have one general function for reloading which will reload everything recursively according to type of a node parameter?... |
Reloading single layer is different than mapset/location/db. For this PR just change the node.label. We will address this in future differently. |
|
I had an idea to changed ReloadTreeItems() in create/rename/delete functions to self.Refresh(self.selected_"node"[0], recursive=True) but it does not work. Seems to me that refreshing is different from reloading and for reload, the function _initTreeItems is needed. |
Yes, that's different. I suggest to review in depth the implementation of TreeModel and TreeView and AbstractTreeViewMixin. Basically, refreshing just influences rendering of the nodes, reloading changes the actual underlying data model. |
wxGUI/datacatalog: node.label changed to node.data['name'] in tree.py.