Fix issues editing artificial horizon.
This small MR fixes 2 issues related to editing of the Artificial Horizon feature.
How to reproduce the bugs
Using the master branch:
Start with no artificial horizons defined. That is, open KStars, go to Settings --> Artificial Horizon, and there should be nothing populating the table.
Make a first region
- Click on '+' Add Region.
- Click on Select Points from the SkyMap (button on far right)
- Make a Region with 5 points (you should have a checkbox now--if not add a point on the start until you do).
- Click on Apply
- You should see one region defined in the table, named 'Region 1'
Make a second region
- Click on '+' Add Region.
- Click on Select Points from the SkyMap (button on far right)
- Make a Region with 5 points (you should have a checkbox now--if not add a point on the start until you do).
- Click on Apply
- You should see two regions defined in the table, named 'Region 1' and 'Region 2' Click on Save Regions (the disk).
Bug 1
Quit KStars now, and relaunch, and look at Settings --> Artificial Horizon, you should see a 3rd region (named '0') in the table. https://photos.app.goo.gl/og4zSjWyZXruQmdK9
Bug 2
- Delete all the regions, and save.
- Restart make sure they're all really gone.
- Repeat the procedure above, starting from 'Start with no artificial horizons defined' through 'Click on Save Regions (the disk)'.
- At this point, click on Region 1 in the Regions Table and you should see it has 5 points (assuming you made it with 5),
- Click on Region 2, and you also see 5 points (assuming you made it that way).
- Now click on 'Region 1' again, and click '-' (Remove Region). Region 1 should go away.
- Now click on 'Region 2'. Note that it only has 4 points (or 1 fewer than you defined). It should still have 5 (or the same number you defined earlier).
Repeat all of the above using this MR. You should find that the issues are fixed.
Edited by Hy Murveit