Selecting a new default location results in "New Location"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Stellarium |
Fix Released
|
Low
|
Bogdan Marinov |
Bug Description
In the Location window, clicking on the "Use as default [location]" checkbox changes the value of the "Name/City:" field to "New Location". This is also reflected in the location display in the bottom bar.
To reproduce:
1. Open the location window.
2. Select in the list a city different from the current default location.
3. (At this point the "Name" field should correctly display the name of the city.)
4. Click on the "Use as default" checkbox.
5. The "Name" field and the location display in the bottom bar at this point will change to "New Location". Nevertheless, the default location in the configuration file is set to the correct name, so restarting Stellarium will result with the correct location used and displayed at the start.
6. If at this point a user uses the "Save configuration" button in the Configuration window, "New Location, Country-
Originally reported by Khalid AlAjaji on the mailing list:
http://
Related branches
Changed in stellarium: | |
status: | Fix Committed → Fix Released |
The problem seems to stem from the behavior of the "Uses as default" checkbox - when it is checked, it is disabled. Apparently at some point Qt decided that disabled controls can't hold input focus, so the focus is passed to the next controls in the "tab stop" order. These are the "Delete" and "Add to list" buttons (tab stop numbers 3 and 4), but for locations in the default list, they are also disabled at this point. Thus, the focus is set to tab stop number 5, the "Latitude" spin box. The spin box for some reason interprets receiving the focus as having its value changed and triggers the LocationDialog: :valueChanged( ) slot, which overwrites the Name field with "New Location".
Possible solutions: :disconnectSign als() and connectSignals() before and after disabling the checkbox.
a) use LocationDialog:
b) modify the custom AngleSpinBox code or just use in LocationDialog another type of signal that is not triggered by receiving the focus.
c) change the tab stop order.