-
-
Notifications
You must be signed in to change notification settings - Fork 307
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/history: Create panel displaying info about command #3365
Conversation
452d3ce
to
a70f9c8
Compare
I would revise the JSON format, generally I would use lower case and leave formatting of time to GUI.
Then in the GUI the labels should be translatable. So for example JSON will have status "success" and GUI will use It would be better to have the command itself in a parsed format. Then regarding the dialog, wouldn't it be better to display the information within the history browser, e.g. at the bottom? What would be even nicer I think is to expand the command node and show the info below the command, but maybe we don't need to do this in this PR. |
Thanks Anna for review. Ok, I will focus more on a JSON file and incorporate suggested stuff.
Yes @petrasovaa , you are right, The Command Info dialog is quite hidden for users, to have the info directly accessible at the bottom of the History browser would be better. What do you think about the structure of the dialog content? Are two notebooks "General info" and "Region settings" okay, or would you devise something different? As I was thinking about your suggestions, I also tried to focus more on the better user experience and I think it would be also nice to have other functionalities as part of this PR:
I agree that expanding the command node is an interesting functionality for the next PR. |
I am not completely sure, I would perhaps merge it into one panel. Then place it at the bottom, similarly to how command console has it, and include a vertical scrollbar, so the region info would be hidden most of the time, which is fine. Eventually, it may be good to have an option (a button?) to set the region based on the command. It brings up a question when you rerun the command, whether it should rerun it with the same region or the current one (probably current one).
yes
AFAIU yes
I don't think you have to have that, the info will be empty, which is fine.
|
What about 3D mask? Make it sense to have it here as well as the attribute? |
I used g.region with the -g flag instead of the previously used -p flag. There's still some info about the projection but only "projection" and "zone" and both as integers ("datum" and "ellipsoid" are missing). I can drop it but I think that it is more consistent just to preserve the output from g.region as it is when it adds only these two extra info.. The JSON structure looks as follows now (the command itself will be parsed in the next step).
|
Yes, although it's low priority. I wonder if the GUI should show the info about mask only when it was active to keep the command info short and relevant. |
I have no idea why this even gets printed, but that's a separate issue. Maybe keep it in the JSON file, but I wouldn't display this information in the GUI to the user. |
I am sharing the picture of the current version of GUI (implementation itself works but the code needs some cleaning and refactoring): After clicking on the command, the info appears at the bottom part of the History pane. |
Looks good to me. Some info from the my quickly testing:
|
I didn't test, but it looks fine. I wouldn't spend too much time on the look of the GUI yet, it would be best to get this PR in and then see if we want to change the appearance. Thanks @tmszi for testing! |
To point 3 - I fixed it, but generally I was not much convinced about the solution I made (the new JSON file is created only when a user creates a new mapset) so yesterday I discussed it with @landam and we decided to automatically convert the plain text file to JSON file when launching a new command. This is however a bit problematic regarding the fact that we wanted to have the parsed command in a JSON file (as list - I think @petrasovaa suggested it), so whenever this conversion would happen it would require parsing all commands from old plain-text history log into lists. So, from this point of view, it would be better to preserve the logic of commands stored as strings in the JSON file similarly as in the plain text. So we will basically have two "read" methods (from JSON and from plain-text) but only one write method which will always write into JSON. I will change the current solution to this variant in a separate commit. Sounds good to me. Unrelated, but looking at the failed Python code quality test, it would be good to setup pre-commit so you avoid this. |
eaffce1
to
14e4a90
Compare
a53777f
to
322712c
Compare
The history log .wxgui_history is newly stored as a JSON file with command and command_info keys. When a new command is launched, it is stored as a new entry to a JSON file. The old plain text is preserved but not further used (we have two read methods but only one write method). The command info contains the following: runtime, timestamp, status (success, failed, aborted), if 2D/3D is set, and region settings. The History browser is newly the object of the Splitter window. At the upper part, there is a tree catalog with history commands, and at the bottom part, there is a panel displaying the command info. --------- Co-authored-by: lindakladivova <l.kladivova@seznam.cz> Co-authored-by: Anna Petrasova <kratochanna@gmail.com>
This PR implements new functionality to the History Browser panel, particularly showing info about a command from history through the new Command Info dialog.
The history log (.wxgui_history) is newly stored as a JSON file. It is backward compatible with the plain .wxgui_history. But in the case that a user creates a new mapset, a new history file is automatically created as a JSON file.
This PR further implements a new option in the context menu called "Show Info." "Show Info" displays a small dialog called Command info about the respective process stored in the JSON file.
JSON file stores the following info for each executed command:
Example of the JSON structure: