-
-
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: easier switching between locations (GRASS GIS 8) #1598
wxGUI: easier switching between locations (GRASS GIS 8) #1598
Conversation
…to display a layer only if switching is successful.
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.
This is a great solution! Thanks so much @lindakladivova
gui/wxpython/datacatalog/tree.py
Outdated
| "To display this map switch to mapset <{1}> first." | ||
| "Map <{0}@{1}> is not in the current location. " | ||
| "Do you want to switch to the location '{2}'? " | ||
| "Your currently displayed layers will disappear." |
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.
The reason I used the word "disappear" in the original issue is that it expresses well the confusion a user may have when the layers are unloaded, i.e., something unexpected happened. Furthermore, "disappear" in this context may sound as "underlying data will be deleted". I don't have another suggestion at this point, but Perhaps mentioning again the reason for it in connection with the change in wording can bring some understanding.
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.
Maybe something along the lines "All current Map Displays will be closed"?
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.
|
Le 27 mai 2021 08:36:28 GMT+01:00, Linda Kladivova ***@***.***> a écrit :
> When switching to a map layer in a different location this message will appears:
>
> 
I am not sure about the formulation, maybe the button should named "Stay in current location"?
+1
|
| @@ -1838,30 +1860,30 @@ def SwitchMapset(self, grassdb, location, mapset, show_confirmation=False): | |||
| """ | |||
| Switch to location and mapset interactively. | |||
| """ | |||
| if can_switch_mapset_interactive(self, grassdb, location, mapset): | |||
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.
What is the reason for moving this if out of the function?
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.
The reason is that we display a layer only if a switching is successful. I had another idea how to solve this issue - make a optional argument display_layer for SwitchMapset method. But finally I realized that SwitchMapset is something not much related to displaying layer.
Now code also seems to me a bit clearer because SwitchMapset really switch in all cases.
Making a display_layer argument would be much shorter in code but I think not much meaningful in terms of logic.
Or we could return True or False from SwitchMapset but I am not sure If this function should return something, It is more of procedure. What do you think @petrasovaa ?
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.
I see. I would be in favor of returning true/false since we need to use can_switch_mapset_interactive anyway every time we want to switch it, so it may be better have it in the SwitchMapset method.
gui/wxpython/datacatalog/tree.py
Outdated
| "To display this map switch to mapset <{1}> first." | ||
| "Map <{0}@{1}> is not in the current location. " | ||
| "Do you want to switch to the location '{2}'? \n\n" | ||
| "All current Map Displays will be closed." |
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.
This looks like "will be closed in any case". I think the new paragraph needs to be between "...the current location" and "All current Map...".
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.
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.
That message sounds a bit intimidating to me... Can we say something like:
Map <bla> is not in the current location. To be able to display it you need to switch to <blabla> location.
Note that if you switch there all current Map Displays will be closed.
Do you want to switch anyway?
Too long? My intention is to "explain" in short that to display a map from a different location the user needs to switch there.
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.
I like your idea more Vero. It is true that it is quite long but we need to fully explain it. @petrasovaa, @wenzeslaus do you agree with that?
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.
That message sounds a bit intimidating to me... Can we say something like:
Map <bla> is not in the current location. To be able to display it you need to switch to <blabla> location. Note that if you switch there all current Map Displays will be closed. Do you want to switch anyway?Too long? My intention is to "explain" in short that to display a map from a different location the user needs to switch there.
I think @veroandreo 's formulation is a bit more appealing. However, I think the button labels are too wordy. What about Cancel (as default) and Switch?
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.


When switching to a map layer in a different location this message will appear: