Fix: unified ObservingLists dialog#2954
Conversation
|
Great PR! Please pay attention to the following items before merging: Files matching
Files matching
This is an automatically generated QA checklist based on modified files |
b59a6a7 to
384787f
Compare
|
@alex-w there is a mismatch in ObsListDialog LL 454ff vs. LL600ff when assigning type and objtype. I am not sure what the type/objtype now really should resemble. It is really problematic to cross-assign as is now done in LL454f. I also don't know why we store these in the JSON in the first place. This may also relate to #2802. The ObsList has entries "designation" and "nameI18n". I would never store an internationalized name in a list that we also redesigned so that users can exchange lists across (language) borders. Shall we develop format version 2.1 or (3.0): store "designation" and "name" (i.e., englishName), and find an i18n on the fly just for displaying? Yet another issue is star and DSO names: these are sky culture dependent. So, it may be OK to just use designation, and deal with a "name" entry for the human reader of the JSON file, but load/overwrite the name during loading from the designation. A small issue is the switching between normal and edit mode: I would like to hide the horizontal layouts. Those cannot be hidden, so I hide the buttons instead. If all buttons in a horizontalLayout are hidden, it vanishes. But I don't know how to accomplish that if there is a spacer included. |
|
@alex-w can you please look into these questions? |
|
@gzotti sorry for late answer. type/objtype is important to storing into JSON for correct finding of the object - for example B 10 can be deep-sky object and star. Localized name can be removed from JSON and we can storing into JSON designations of objects only (probably except the DSO without designations). English and localized names may be found on the fly. |
|
Yes, but I think it is inconsistent between importing old bookmarks and storing new objects! Or is it working correctly as it is now? |
Yeah, but in any way current observing lists are not compatible with old bookmarks |
|
Yes, the JSON formats are not the same, I know. I just saw that when loading a list there is a flip between objType and type. See ObsListDialog lines 452ff and compare to lines 607ff when importing bookmarks. Is this correct? It at least requires a note in the source code that whoever developed this originally knew what they were doing. My "Caveat" comment is that of a code reviewer indicating a possible source of error. |
Well, we should 2 important features: The current OL feature has a partially implemented of both tools. |
|
Currently both list formats have the too generic json extension, but importing the old format and adding missing data works well. However, this does not answer my question about the type/objType issue. The new format (without I18n names) could be named .ol3. The major task of this PR was to remove the separate edit dialog and the repeated need to load the JSON file, and making the code more readable. I think the current state is feature-equivalent w.r.t. the JSON files, i.e. has the same errors in data conversion. Now we should try to remove the errors in the conversions and file format. If this warrants a new format (version 3) with e.g. .ol3 ending, it's OK for me. |
The
.ol3 is OK for me too |
|
Oops, sorry, I forgot the very important note - by the fact we should have 2 data files: a) |
|
The current import can read old bookmarks.json format and new obslist.json formats. We can change or limit this to .ol3 files (new format only), but this is another PR. I am not sure after the month of waiting, but I think you can also import another obslist file (with several obslists) and import all lists. This still does not solve the type issue/bug. The PR is a branch in the main repo. Do you have time to take over and do what has to be done? I think the type/objType should be fixed first. If this requires a different file format again, this should be a well-designed one-last-time step, and then should not be changed. But I think it is not required to remain compatible with the 1.0-1.2 format 2.0 which effectively will have been used only for 6 months. |
- unified GUI (old ui files will be removed later) - moved methods from CreateEdit class to standard class - simplified common/util class (will be removed later) Todo: - Load JSON once - Work with sub-lists in memory - Write JSON on exit
- clearer variable names - start avoiding needless file IO - restructure GUI - obsolete edit dialog ready for removal Caveat: Many things don't work correctly now!
- UI elements renamed (final?) - removed excessive writing - removed old files - start testing
Avoid a type not found-error However, there is a mismatch between bookmarks and obsList handling!
- Also describe the current problem...
382a79d to
4dcb521
Compare
|
@alex-w please review this. As far as I can see it is feature equivalent to the old version, but has one dialog less. However, the type/objType mess is still here to be cleared up. Further, I18N names should be loaded on the fly, and never stored to (or at least never read from) JSON. New file endings can be introduced later. |
I tried run updated OL without old data - neither bookmarks or lists - and I got the crash. But I did not reproduced the crash later. After adding few objects into list I see something like: I agree - no need saving P.S. Probably |
|
The The item.objtype on the other hand could be a temporal variable for display purposes only. Here we may show the various subtypes like "Moon", "Cubewano", "Dark Nebula", "Spiral Galaxy", ... These have to be retrieved on-the-fly when loading the list into the TreeView. It may be allowed to store it into the JSON list (for reference when manually editing data lists later), even in translated form (because it is "write only"), however, it must never be evaluated during loading. @alex-w do you agree? And can you please check whether this interpretation of the items is correct? What is the purpose of the isVisibleMarker entry? When is it evaluated? Can it be toggled by the user? Why is that not just an entry with type=Marker? I had hoped to get that solved by January 5. To fix that finally still for 23.1, I suggest we concentrate on this one now for the weekend. |
Yes, I agree.
Let imagine that you find some object via SIMBAD and this object is not in Stellarium database - it will be added as custom object (type=Marker by the fact, but without visible marker) which you can add into OL (type=Marker, isVisibleMarker=false). Of course you can put markers on the sky and add some of them (or all) into OL (type=Marker, isVisibleMarker=true) too.
OK |
- also make method names clearer - also added some documentation
- renamed a few variables for clarity - now recreating localized names on list loading - Localized name entries stored for external use, but not read back
|
@alex-w can you repeat your tests please? The current solution allows editing in the same dialog by reconfiguring a few buttons. The currently edited list is stored (replaces the list state of before editing) when 'Save list' is pressed. The list JSON file is written on exiting Stellarium. I hope this works finally free from further major surprises... |
alex-w
left a comment
There was a problem hiding this comment.
Everything what I tested are works as expected
|
Hello @gzotti! Please check the fresh version (development snapshot) of Stellarium: |
|
Hello @gzotti! Please check the latest stable version of Stellarium: |
Description
The state of ObservingLists in 1.0 is functionally OK, but IMHO still not user friendly.
It is also not maintainer friendly
It should be enough to load the lists once and manipulate the copy kept in memory. Just occasionally, we need to store the list. Maybe even only write on exit? Probably a copy of the existing list should be added on loading, in case of program failure.
Fixes #2802 (issue)
Screenshots (if appropriate):
Type of change
How Has This Been Tested?
Test Configuration:
Checklist: