Merge lp:~stellarium/stellarium/tz into lp:stellarium
- tz
- Merge into trunk
Status: | Merged | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 8767 | ||||||||||||||||||||||||||||||||
Proposed branch: | lp:~stellarium/stellarium/tz | ||||||||||||||||||||||||||||||||
Merge into: | lp:stellarium | ||||||||||||||||||||||||||||||||
Diff against target: |
4888 lines (+670/-3318) 38 files modified
CMakeLists.txt (+0/-1) cmake/default_config.ini.cmake (+0/-1) data/gui/normalStyle.css (+6/-1) data/zone.tab (+0/-399) plugins/EquationOfTime/CMakeLists.txt (+1/-1) plugins/EquationOfTime/src/EquationOfTime.cpp (+1/-42) plugins/EquationOfTime/src/EquationOfTime.hpp (+0/-6) plugins/Observability/src/Observability.cpp (+1/-2) plugins/RemoteControl/src/MainService.cpp (+1/-1) plugins/Satellites/src/Satellites.cpp (+1/-1) plugins/Satellites/src/gui/SatellitesDialog.cpp (+1/-1) plugins/TimeZoneConfiguration/CMakeLists.txt (+0/-19) plugins/TimeZoneConfiguration/src/CMakeLists.txt (+0/-35) plugins/TimeZoneConfiguration/src/TimeZoneConfiguration.cpp (+0/-127) plugins/TimeZoneConfiguration/src/TimeZoneConfiguration.hpp (+0/-82) plugins/TimeZoneConfiguration/src/gui/DefineTimeZoneWindow.cpp (+0/-541) plugins/TimeZoneConfiguration/src/gui/DefineTimeZoneWindow.hpp (+0/-73) plugins/TimeZoneConfiguration/src/gui/TimeZoneConfigurationWindow.cpp (+0/-285) plugins/TimeZoneConfiguration/src/gui/TimeZoneConfigurationWindow.hpp (+0/-82) plugins/TimeZoneConfiguration/src/gui/defineTimeZone.ui (+0/-621) plugins/TimeZoneConfiguration/src/gui/timeZoneConfigurationWindow.ui (+0/-585) po/stellarium/POTFILES.in (+0/-5) src/core/StelApp.cpp (+0/-4) src/core/StelCore.cpp (+118/-4) src/core/StelCore.hpp (+17/-1) src/core/StelLocaleMgr.cpp (+34/-93) src/core/StelLocaleMgr.hpp (+4/-39) src/core/StelLocationMgr.cpp (+2/-0) src/gui/AstroCalcDialog.cpp (+12/-11) src/gui/BookmarksDialog.cpp (+2/-2) src/gui/ConfigurationDialog.cpp (+1/-1) src/gui/DateTimeDialog.cpp (+5/-4) src/gui/LocationDialog.cpp (+114/-3) src/gui/LocationDialog.hpp (+14/-1) src/gui/StelGuiItems.cpp (+14/-2) src/gui/configurationDialog.ui (+94/-70) src/gui/locationDialogGui.ui (+226/-171) src/scripting/StelMainScriptAPI.cpp (+1/-1) |
||||||||||||||||||||||||||||||||
To merge this branch: | bzr merge lp:~stellarium/stellarium/tz | ||||||||||||||||||||||||||||||||
Related bugs: |
|
||||||||||||||||||||||||||||||||
Related blueprints: |
Dynamic time zones
(High)
Time zone management
(High)
Time zone hopping
(Medium)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
gzotti | Approve | ||
Alexander Wolf | Needs Information | ||
Review via email: mp+309092@code.launchpad.net |
Commit message
Description of the change
Added time zone support
gzotti (georg-zotti) wrote : | # |
I very much welcome a thorough re-work on the timezone issues, the many bug and wishlist items speak for themselves.
I had no time for a thorough test so far. Do you want to merge now and run public testing for a few weeks on the new trunk betas (and of course fix a few rounds in trunk), or have some testers on this branch and merge only when all is done? Can you publish betas from this branch?
I think some extra TZ settings options can be built into the main program's location panel. (This can become a bit larger. Also the map is very small on FullHD and higher-resolution screens.) There is no use to have a plugin when you must have it activated anyway for really basic operations. The configuration panel is more easily reached in this way.
Some things that can hopefully solved with IANA's TZ database:
DST rules for "Continent/City" timezones. In various countries, DST was introduced at some point in the 20th century. (e.g. WW1, WW2, energy crisis in the 1970s). It would be great if all times can be produced here.
Timezones were introduced around 1886, but not everywhere. Some standardisations were available previously (e.g. Railway time). The current 1886 limit may need a second thought.
Some useful options:
Have a tick (default=active) "System Defaults". This uses time zone of configured location.
Use system settings, but disable DST.
Set timezone as UT offset (15 minute steps)
Use Local Mean Solar Time. This should be default until 1885 (or we find some other meaningful date?).
Use Local True Solar Time (i.e. also add Equation of Time!) This may be useful for historical research. LTST use should be marked somehow in the bottom bar.
In any case, UT+HH:MM should be visible in the bottom toolbar like it is now. Maybe print TZ name or "LMST" in addition?
- 8775. By Alexander Wolf
-
Updates and improvements
Alexander Wolf (alexwolf) wrote : | # |
I prefer merge it in trunk and allow to testing it by wide circle of users.
I've added LTST also and allows to enabling/disabling DST.
Adding of full list of all exists time zones is... difficult, because in this case we should implement own tool to manage all them.
Please check last changes.
- 8776. By Alexander Wolf
-
Cosmetic fixes
- 8777. By Alexander Wolf
-
Cosmetic fix
- 8778. By Alexander Wolf
-
Another cosmetic fix - let's hide combobox for TZ when we use time zones from locations
gzotti (georg-zotti) wrote : | # |
LTST is great! However, it should be marked in the bottom status line, else just UT+HH:MM looks like LMST. ALso, the last change, hiding the combobox, is more confusing than helpful. I suggest the timezone combo should be visible (so that you can see what has been found for the city), but unclickable when time from location is active.
When I switch from LMST back to zone time (or activate default) it seems the LMST longitude offset is not set back, or even all auto-zone lookup fails, it seems to keep LMST offset when I select a city.
Disabling DST seems OK for now.
Alexander Wolf (alexwolf) wrote : | # |
Please use tooltip with info for LMST/LTST and current time zone name. Or you meant that I should remove UTC+XX:XX data and use LMST/LTST instead?
I'll check switching from LMST - it should be work correct.
Alexander Wolf (alexwolf) wrote : | # |
I can introduce additional UTC+XX:XX time zones with 15-min. step also - should be the range UTC-12:00 -- UTC+12:00?
gzotti (georg-zotti) wrote : | # |
Don't forget that tooltips sometimes don't work. Win7/NVidia OpenGL frequently just has no tooltips. (This was my default until recently!)
Optimal would be to see "UT+HH:MM", "UT+HH:MM (LMST)" or "UT+HH:MM (LTST)"
gzotti (georg-zotti) wrote : | # |
> I can introduce additional UTC+XX:XX time zones with 15-min. step also -
> should be the range UTC-12:00 -- UTC+12:00?
According to https:/
this should even go up to UT+14:00.
Not sure: Half-hour offsets seem frequent, but there are only very few 15-min offsets (Nepal, Australia). Make all, or only the particular actually existing zones? Can you filter the existing zone offsets from the IANA list?
Alexander Wolf (alexwolf) wrote : | # |
OK for the tooltip problem.
For time zones in format UTC+HH:MM - we are have them in this format already. Please see bottom of the list.
gzotti (georg-zotti) wrote : | # |
Ah yes. OK, Zone list seems complete.
When I am in "Custom zone" mode and select a zone, then disable custom zone, the combo is hidden and correct zone is used. When I then select a neighbour town, it goes back to some other zone. Not even the previously selected!
Example: I set Vienna, but custom zone America/
- 8779. By Alexander Wolf
-
Cosmetic fixes
- 8780. By Alexander Wolf
-
Cosmetic fix
Alexander Wolf (alexwolf) wrote : | # |
Please check it again.
gzotti (georg-zotti) wrote : | # |
New observations: Immediately after start, tooltip timezone string is not set under some circumstances. Yes, when ini:localisatio
I call the location panel. custom timezone disabled, DST enabled. Displayed time zone: Local Mean Solar Time. This is wrong. It could be UTC+2:00?
Still my time is correctly displayed as UTC+2:00, not LMST.
When I click on my city in the list, all is OK.
This may have to do with an "unnamed" location (just long/Lat). My startup location is not in the site list. Maybe better always store time_zone?
The "Bogota" problem is however solved. ... No, now sometimes it's the other way! Custom tz disabled, I select a city, and TZ goes to previously selected Europe/Vienna. I have to enable custom zone and disable it again to switch to the correct one. I have not found a pattern yet to trigger this confusing behaviour.
When I click a location on the map, accurate country-based timezone is not found automatically, of course. But you could simply suggest a UT+XX zone from Longitude/15, this should fit a first guess.
I have auto-location from IP query disabled. Does this also deliver a timezone?
Maybe add the longitude time offset (LMST) and equation of time value (LTST) in the tooltip? My preference would be "UT+HH:MM", "UT+HH:MM (LMST)" or "UT+HH:MM (LTST)" in the time string directly (avoid problems with tooltips not working).
Alexander Wolf (alexwolf) wrote : | # |
Sorry, but your location was defined by user and he don't have info about time zone - LMST is good solution for guessing here. It's correct behaviour.
>My startup location is not in the site list. Maybe better always store time_zone?
No, because this will cause the old behaviour but with new mistakes.
> I have auto-location from IP query disabled. Does this also deliver a timezone?
Yes.
> My preference would be "UT+HH:MM", "UT+HH:MM (LMST)" or "UT+HH:MM (LTST)"
Please give use case, when it may be useful.
- 8781. By Alexander Wolf
-
Cosmetic fix
- 8782. By Alexander Wolf
-
fixed stupid bug
- 8783. By Alexander Wolf
-
added alias 'auto' for LMST
Alexander Wolf (alexwolf) wrote : | # |
Please check it again.
gzotti (georg-zotti) wrote : | # |
> Sorry, but your location was defined by user and he don't have info about time
> zone - LMST is good solution for guessing here. It's correct behaviour.
>
> >My startup location is not in the site list. Maybe better always store
> time_zone?
>
> No, because this will cause the old behaviour but with new mistakes.
I expect tons of misunderstanding. But this is what user testing is all about, let's see then how useful it feels after a few weeks.
> > My preference would be "UT+HH:MM", "UT+HH:MM (LMST)" or "UT+HH:MM (LTST)"
>
> Please give use case, when it may be useful.
Where is it not useful? This mode is mostly for users with advanced requirements (but not necessarily expert astronomers, but maybe historians of science) who understand the difference but e.g. want to be sure it is computed correctly, they don't make a mistake in their thoughts, or want to explain the difference to others.
Alexander Wolf (alexwolf) wrote : | # |
Well, let's try public testing :)
gzotti (georg-zotti) wrote : | # |
When I go back to my stored location, "Use custom timezone" is disabled, but the correct TZ shown.
After restarting Stellarium, you are using correct UT+2, but location panel indicates LMST.
This is confusing. I had stored a location with custom TZ Europe/Vienna plus active DST (resulting in UTC+2). However, after reverting to default location the previously stored TZ is not again stored in config.ini, so I assume the UTC+2 comes from system settings. Still, the location panel shows LMST.
Maybe you must remember custom time zone from startup to be able to reset properly to startup location/TZ.
LMST/LTST display is fine now!
OK, I expect some user questions/
Alexander Wolf (alexwolf) wrote : | # |
Please send me your user_locations.txt file for playing.
Preview Diff
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2016-10-14 14:15:29 +0000 |
3 | +++ CMakeLists.txt 2016-10-25 16:10:21 +0000 |
4 | @@ -254,7 +254,6 @@ |
5 | ADD_PLUGIN(Supernovae 1) |
6 | ADD_PLUGIN(TextUserInterface 1) |
7 | ADD_PLUGIN(TelescopeControl 1) |
8 | -ADD_PLUGIN(TimeZoneConfiguration 1) |
9 | |
10 | ########## Static plugins need to define includes and libraries |
11 | ########## for the compilation of Stellarium itself |
12 | |
13 | === modified file 'cmake/default_config.ini.cmake' |
14 | --- cmake/default_config.ini.cmake 2016-10-10 13:50:34 +0000 |
15 | +++ cmake/default_config.ini.cmake 2016-10-25 16:10:21 +0000 |
16 | @@ -55,7 +55,6 @@ |
17 | sky_culture = western |
18 | sky_locale = system |
19 | app_locale = system |
20 | -time_zone = system_default |
21 | time_display_format = system_default |
22 | date_display_format = yyyymmdd |
23 | |
24 | |
25 | === modified file 'data/gui/normalStyle.css' |
26 | --- data/gui/normalStyle.css 2015-09-03 21:24:13 +0000 |
27 | +++ data/gui/normalStyle.css 2016-10-25 16:10:21 +0000 |
28 | @@ -230,7 +230,7 @@ |
29 | background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 rgb(183, 184, 185), stop: 1 rgb(111, 113, 114)); |
30 | } |
31 | |
32 | -QPushButton::Disabled { |
33 | +QPushButton::disabled { |
34 | color: #f0f0f0; |
35 | } |
36 | |
37 | @@ -718,6 +718,11 @@ |
38 | padding-left: 3px; |
39 | } |
40 | |
41 | +QComboBox:disabled, QSpinBox:disabled { |
42 | + color: #f0f0f0; |
43 | +} |
44 | + |
45 | + |
46 | QProgressBar { |
47 | border: 1px solid rgba(102, 102, 128, 50%); |
48 | border-radius: 2px; |
49 | |
50 | === removed file 'data/zone.tab' |
51 | --- data/zone.tab 2005-03-11 01:52:16 +0000 |
52 | +++ data/zone.tab 1970-01-01 00:00:00 +0000 |
53 | @@ -1,399 +0,0 @@ |
54 | -# @(#)zone.tab 1.27 |
55 | -# |
56 | -# TZ zone descriptions |
57 | -# |
58 | -# From Paul Eggert <eggert@twinsun.com> (1996-08-05): |
59 | -# |
60 | -# This file contains a table with the following columns: |
61 | -# 1. ISO 3166 2-character country code. See the file `iso3166.tab'. |
62 | -# 2. Latitude and longitude of the zone's principal location |
63 | -# in ISO 6709 sign-degrees-minutes-seconds format, |
64 | -# either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS, |
65 | -# first latitude (+ is north), then longitude (+ is east). |
66 | -# 3. Zone name used in value of TZ environment variable. |
67 | -# 4. Comments; present if and only if the country has multiple rows. |
68 | -# |
69 | -# Columns are separated by a single tab. |
70 | -# The table is sorted first by country, then an order within the country that |
71 | -# (1) makes some geographical sense, and |
72 | -# (2) puts the most populous zones first, where that does not contradict (1). |
73 | -# |
74 | -# Lines beginning with `#' are comments. |
75 | -# |
76 | -#country- |
77 | -#code coordinates TZ comments |
78 | -AD +4230+00131 Europe/Andorra |
79 | -AE +2518+05518 Asia/Dubai |
80 | -AF +3431+06912 Asia/Kabul |
81 | -AG +1703-06148 America/Antigua |
82 | -AI +1812-06304 America/Anguilla |
83 | -AL +4120+01950 Europe/Tirane |
84 | -AM +4011+04430 Asia/Yerevan |
85 | -AN +1211-06900 America/Curacao |
86 | -AO -0848+01314 Africa/Luanda |
87 | -AQ -7750+16636 Antarctica/McMurdo McMurdo Station, Ross Island |
88 | -AQ -9000+00000 Antarctica/South_Pole Amundsen-Scott Station, South Pole |
89 | -AQ -6448-06406 Antarctica/Palmer Palmer Station, Anvers Island |
90 | -AQ -6736+06253 Antarctica/Mawson Mawson Station, Holme Bay |
91 | -AQ -6835+07758 Antarctica/Davis Davis Station, Vestfold Hills |
92 | -AQ -6617+11031 Antarctica/Casey Casey Station, Bailey Peninsula |
93 | -AQ -7824+10654 Antarctica/Vostok Vostok Station, S Magnetic Pole |
94 | -AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville Base, Terre Adelie |
95 | -AQ -690022+0393524 Antarctica/Syowa Syowa Station, E Ongul I |
96 | -AR -3436-05827 America/Buenos_Aires E Argentina (BA, DF, SC, TF) |
97 | -AR -3124-06411 America/Cordoba most locations (CB,CC,CH,CN,ER,FM,LP,LR,MN,NQ,RN,SA,SE,SF,SJ,SL,TM) |
98 | -AR -2411-06518 America/Jujuy Jujuy (JY) |
99 | -AR -2828-06547 America/Catamarca Catamarca (CT) |
100 | -AR -3253-06849 America/Mendoza Mendoza (MZ) |
101 | -AS -1416-17042 Pacific/Pago_Pago |
102 | -AT +4813+01620 Europe/Vienna |
103 | -AU -3133+15905 Australia/Lord_Howe Lord Howe Island |
104 | -AU -4253+14719 Australia/Hobart Tasmania |
105 | -AU -3749+14458 Australia/Melbourne Victoria |
106 | -AU -3352+15113 Australia/Sydney New South Wales - most locations |
107 | -AU -3157+14127 Australia/Broken_Hill New South Wales - Yancowinna |
108 | -AU -2728+15302 Australia/Brisbane Queensland - most locations |
109 | -AU -2016+14900 Australia/Lindeman Queensland - Holiday Islands |
110 | -AU -3455+13835 Australia/Adelaide South Australia |
111 | -AU -1228+13050 Australia/Darwin Northern Territory |
112 | -AU -3157+11551 Australia/Perth Western Australia |
113 | -AW +1230-06858 America/Aruba |
114 | -AZ +4023+04951 Asia/Baku |
115 | -BA +4352+01825 Europe/Sarajevo |
116 | -BB +1306-05937 America/Barbados |
117 | -BD +2343+09025 Asia/Dhaka |
118 | -BE +5050+00420 Europe/Brussels |
119 | -BF +1222-00131 Africa/Ouagadougou |
120 | -BG +4241+02319 Europe/Sofia |
121 | -BH +2623+05035 Asia/Bahrain |
122 | -BI -0323+02922 Africa/Bujumbura |
123 | -BJ +0629+00237 Africa/Porto-Novo |
124 | -BM +3217-06446 Atlantic/Bermuda |
125 | -BN +0456+11455 Asia/Brunei |
126 | -BO -1630-06809 America/La_Paz |
127 | -BR -0351-03225 America/Noronha Atlantic islands |
128 | -BR -0127-04829 America/Belem Amapa, E Para |
129 | -BR -0343-03830 America/Fortaleza NE Brazil (MA, PI, CE, RN, PR) |
130 | -BR -0803-03454 America/Recife Pernambuco |
131 | -BR -0712-04812 America/Araguaina Tocantins |
132 | -BR -0940-03543 America/Maceio Alagoas, Sergipe |
133 | -BR -2332-04637 America/Sao_Paulo S & SE Brazil (BA, GO, DF, MG, ES, RJ, SP, PR, SC, RS) |
134 | -BR -1535-05605 America/Cuiaba Mato Grosso, Mato Grosso do Sul |
135 | -BR -0846-06354 America/Porto_Velho W Para, Rondonia |
136 | -BR +0249-06040 America/Boa_Vista Roraima |
137 | -BR -0308-06001 America/Manaus E Amazonas |
138 | -BR -0640-06952 America/Eirunepe W Amazonas |
139 | -BR -0958-06748 America/Rio_Branco Acre |
140 | -BS +2505-07721 America/Nassau |
141 | -BT +2728+08939 Asia/Thimphu |
142 | -BW -2545+02555 Africa/Gaborone |
143 | -BY +5354+02734 Europe/Minsk |
144 | -BZ +1730-08812 America/Belize |
145 | -CA +4734-05243 America/St_Johns Newfoundland Island |
146 | -CA +4439-06336 America/Halifax Atlantic Time - Nova Scotia (most places), NB, W Labrador, E Quebec & PEI |
147 | -CA +4612-05957 America/Glace_Bay Atlantic Time - Nova Scotia - places that did not observe DST 1966-1971 |
148 | -CA +5320-06025 America/Goose_Bay Atlantic Time - E Labrador |
149 | -CA +4531-07334 America/Montreal Eastern Time - Ontario & Quebec - most locations |
150 | -CA +4901-08816 America/Nipigon Eastern Time - Ontario & Quebec - places that did not observe DST 1967-1973 |
151 | -CA +4823-08915 America/Thunder_Bay Eastern Time - Thunder Bay, Ontario |
152 | -CA +6608-06544 America/Pangnirtung Eastern Standard Time - Pangnirtung, Nunavut |
153 | -CA +6344-06828 America/Iqaluit Eastern Standard Time - east Nunavut |
154 | -CA +6245-09210 America/Rankin_Inlet Eastern Standard Time - central Nunavut |
155 | -CA +4953-09709 America/Winnipeg Central Time - Manitoba & west Ontario |
156 | -CA +4843-09429 America/Rainy_River Central Time - Rainy River & Fort Frances, Ontario |
157 | -CA +6903-10505 America/Cambridge_Bay Central Time - west Nunavut |
158 | -CA +5024-10439 America/Regina Central Standard Time - Saskatchewan - most locations |
159 | -CA +5017-10750 America/Swift_Current Central Standard Time - Saskatchewan - midwest |
160 | -CA +5333-11328 America/Edmonton Mountain Time - Alberta, east British Columbia & west Saskatchewan |
161 | -CA +6227-11421 America/Yellowknife Mountain Time - central Northwest Territories |
162 | -CA +6825-11330 America/Inuvik Mountain Time - west Northwest Territories |
163 | -CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia |
164 | -CA +4916-12307 America/Vancouver Pacific Time - west British Columbia |
165 | -CA +6043-13503 America/Whitehorse Pacific Time - south Yukon |
166 | -CA +6404-13925 America/Dawson Pacific Time - north Yukon |
167 | -CC -1210+09655 Indian/Cocos |
168 | -CD -0418+01518 Africa/Kinshasa west Dem. Rep. of Congo |
169 | -CD -1140+02728 Africa/Lubumbashi east Dem. Rep. of Congo |
170 | -CF +0422+01835 Africa/Bangui |
171 | -CG -0416+01517 Africa/Brazzaville |
172 | -CH +4723+00832 Europe/Zurich |
173 | -CI +0519-00402 Africa/Abidjan |
174 | -CK -2114-15946 Pacific/Rarotonga |
175 | -CL -3327-07040 America/Santiago most locations |
176 | -CL -2710-10927 Pacific/Easter Easter Island & Sala y Gomez |
177 | -CM +0403+00942 Africa/Douala |
178 | -CN +3114+12128 Asia/Shanghai east China - Beijing, Guangdong, Shanghai, etc. |
179 | -CN +4545+12641 Asia/Harbin Heilongjiang |
180 | -CN +2934+10635 Asia/Chongqing central China - Gansu, Guizhou, Sichuan, Yunnan, etc. |
181 | -CN +4348+08735 Asia/Urumqi Tibet & most of Xinjiang Uyghur |
182 | -CN +3929+07559 Asia/Kashgar southwest Xinjiang Uyghur |
183 | -CO +0436-07405 America/Bogota |
184 | -CR +0956-08405 America/Costa_Rica |
185 | -CU +2308-08222 America/Havana |
186 | -CV +1455-02331 Atlantic/Cape_Verde |
187 | -CX -1025+10543 Indian/Christmas |
188 | -CY +3510+03322 Asia/Nicosia |
189 | -CZ +5005+01426 Europe/Prague |
190 | -DE +5230+01322 Europe/Berlin |
191 | -DJ +1136+04309 Africa/Djibouti |
192 | -DK +5540+01235 Europe/Copenhagen |
193 | -DM +1518-06124 America/Dominica |
194 | -DO +1828-06954 America/Santo_Domingo |
195 | -DZ +3647+00303 Africa/Algiers |
196 | -EC -0210-07950 America/Guayaquil mainland |
197 | -EC -0054-08936 Pacific/Galapagos Galapagos Islands |
198 | -EE +5925+02445 Europe/Tallinn |
199 | -EG +3003+03115 Africa/Cairo |
200 | -EH +2709-01312 Africa/El_Aaiun |
201 | -ER +1520+03853 Africa/Asmera |
202 | -ES +4024-00341 Europe/Madrid mainland |
203 | -ES +3553-00519 Africa/Ceuta Ceuta & Melilla |
204 | -ES +2806-01524 Atlantic/Canary Canary Islands |
205 | -ET +0902+03842 Africa/Addis_Ababa |
206 | -FI +6010+02458 Europe/Helsinki |
207 | -FJ -1808+17825 Pacific/Fiji |
208 | -FK -5142-05751 Atlantic/Stanley |
209 | -FM +0931+13808 Pacific/Yap Yap |
210 | -FM +0725+15147 Pacific/Truk Truk (Chuuk) |
211 | -FM +0658+15813 Pacific/Ponape Ponape (Pohnpei) |
212 | -FM +0519+16259 Pacific/Kosrae Kosrae |
213 | -FO +6201-00646 Atlantic/Faeroe |
214 | -FR +4852+00220 Europe/Paris |
215 | -GA +0023+00927 Africa/Libreville |
216 | -GB +512830-0001845 Europe/London Great Britain |
217 | -GB +5435-00555 Europe/Belfast Northern Ireland |
218 | -GD +1203-06145 America/Grenada |
219 | -GE +4143+04449 Asia/Tbilisi |
220 | -GF +0456-05220 America/Cayenne |
221 | -GH +0533-00013 Africa/Accra |
222 | -GI +3608-00521 Europe/Gibraltar |
223 | -GL +6411-05144 America/Godthab most locations |
224 | -GL +7646-01840 America/Danmarkshavn east coast, north of Scoresbysund |
225 | -GL +7030-02215 America/Scoresbysund Scoresbysund / Ittoqqortoormiit |
226 | -GL +7634-06847 America/Thule Thule / Pituffik |
227 | -GM +1328-01639 Africa/Banjul |
228 | -GN +0931-01343 Africa/Conakry |
229 | -GP +1614-06132 America/Guadeloupe |
230 | -GQ +0345+00847 Africa/Malabo |
231 | -GR +3758+02343 Europe/Athens |
232 | -GS -5416-03632 Atlantic/South_Georgia |
233 | -GT +1438-09031 America/Guatemala |
234 | -GU +1328+14445 Pacific/Guam |
235 | -GW +1151-01535 Africa/Bissau |
236 | -GY +0648-05810 America/Guyana |
237 | -HK +2217+11409 Asia/Hong_Kong |
238 | -HN +1406-08713 America/Tegucigalpa |
239 | -HR +4548+01558 Europe/Zagreb |
240 | -HT +1832-07220 America/Port-au-Prince |
241 | -HU +4730+01905 Europe/Budapest |
242 | -ID -0610+10648 Asia/Jakarta Java & Sumatra |
243 | -ID -0002+10920 Asia/Pontianak west & central Borneo |
244 | -ID -0507+11924 Asia/Makassar east & south Borneo, Celebes, Bali, Nusa Tengarra, west Timor |
245 | -ID -0232+14042 Asia/Jayapura Irian Jaya & the Moluccas |
246 | -IE +5320-00615 Europe/Dublin |
247 | -IL +3146+03514 Asia/Jerusalem |
248 | -IN +2232+08822 Asia/Calcutta |
249 | -IO -0720+07225 Indian/Chagos |
250 | -IQ +3321+04425 Asia/Baghdad |
251 | -IR +3540+05126 Asia/Tehran |
252 | -IS +6409-02151 Atlantic/Reykjavik |
253 | -IT +4154+01229 Europe/Rome |
254 | -JM +1800-07648 America/Jamaica |
255 | -JO +3157+03556 Asia/Amman |
256 | -JP +353916+1394441 Asia/Tokyo |
257 | -KE -0117+03649 Africa/Nairobi |
258 | -KG +4254+07436 Asia/Bishkek |
259 | -KH +1133+10455 Asia/Phnom_Penh |
260 | -KI +0125+17300 Pacific/Tarawa Gilbert Islands |
261 | -KI -0308-17105 Pacific/Enderbury Phoenix Islands |
262 | -KI +0152-15720 Pacific/Kiritimati Line Islands |
263 | -KM -1141+04316 Indian/Comoro |
264 | -KN +1718-06243 America/St_Kitts |
265 | -KP +3901+12545 Asia/Pyongyang |
266 | -KR +3733+12658 Asia/Seoul |
267 | -KW +2920+04759 Asia/Kuwait |
268 | -KY +1918-08123 America/Cayman |
269 | -KZ +4315+07657 Asia/Almaty most locations |
270 | -KZ +4448+06528 Asia/Qyzylorda Qyzylorda (Kyzylorda, Kzyl-Orda) |
271 | -KZ +5017+05710 Asia/Aqtobe Aqtobe (Aktobe) |
272 | -KZ +4431+05016 Asia/Aqtau Atyrau (Atirau, Gur'yev), Mangghystau (Mankistau) |
273 | -KZ +5113+05121 Asia/Oral West Kazakhstan |
274 | -LA +1758+10236 Asia/Vientiane |
275 | -LB +3353+03530 Asia/Beirut |
276 | -LC +1401-06100 America/St_Lucia |
277 | -LI +4709+00931 Europe/Vaduz |
278 | -LK +0656+07951 Asia/Colombo |
279 | -LR +0618-01047 Africa/Monrovia |
280 | -LS -2928+02730 Africa/Maseru |
281 | -LT +5441+02519 Europe/Vilnius |
282 | -LU +4936+00609 Europe/Luxembourg |
283 | -LV +5657+02406 Europe/Riga |
284 | -LY +3254+01311 Africa/Tripoli |
285 | -MA +3339-00735 Africa/Casablanca |
286 | -MC +4342+00723 Europe/Monaco |
287 | -MD +4700+02850 Europe/Chisinau |
288 | -MG -1855+04731 Indian/Antananarivo |
289 | -MH +0709+17112 Pacific/Majuro most locations |
290 | -MH +0905+16720 Pacific/Kwajalein Kwajalein |
291 | -MK +4159+02126 Europe/Skopje |
292 | -ML +1239-00800 Africa/Bamako southwest Mali |
293 | -ML +1446-00301 Africa/Timbuktu northeast Mali |
294 | -MM +1647+09610 Asia/Rangoon |
295 | -MN +4755+10653 Asia/Ulaanbaatar most locations |
296 | -MN +4801+09139 Asia/Hovd Bayan-Olgiy, Govi-Altai, Hovd, Uvs, Zavkhan |
297 | -MN +4804+11430 Asia/Choibalsan Dornod, Sukhbaatar |
298 | -MO +2214+11335 Asia/Macau |
299 | -MP +1512+14545 Pacific/Saipan |
300 | -MQ +1436-06105 America/Martinique |
301 | -MR +1806-01557 Africa/Nouakchott |
302 | -MS +1644-06213 America/Montserrat |
303 | -MT +3554+01431 Europe/Malta |
304 | -MU -2010+05730 Indian/Mauritius |
305 | -MV +0410+07330 Indian/Maldives |
306 | -MW -1547+03500 Africa/Blantyre |
307 | -MX +1924-09909 America/Mexico_City Central Time - most locations |
308 | -MX +2105-08646 America/Cancun Central Time - Quintana Roo |
309 | -MX +2058-08937 America/Merida Central Time - Campeche, Yucatan |
310 | -MX +2540-10019 America/Monterrey Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas |
311 | -MX +2313-10625 America/Mazatlan Mountain Time - S Baja, Nayarit, Sinaloa |
312 | -MX +2838-10605 America/Chihuahua Mountain Time - Chihuahua |
313 | -MX +2904-11058 America/Hermosillo Mountain Standard Time - Sonora |
314 | -MX +3232-11701 America/Tijuana Pacific Time |
315 | -MY +0310+10142 Asia/Kuala_Lumpur peninsular Malaysia |
316 | -MY +0133+11020 Asia/Kuching Sabah & Sarawak |
317 | -MZ -2558+03235 Africa/Maputo |
318 | -NA -2234+01706 Africa/Windhoek |
319 | -NC -2216+16530 Pacific/Noumea |
320 | -NE +1331+00207 Africa/Niamey |
321 | -NF -2903+16758 Pacific/Norfolk |
322 | -NG +0627+00324 Africa/Lagos |
323 | -NI +1209-08617 America/Managua |
324 | -NL +5222+00454 Europe/Amsterdam |
325 | -NO +5955+01045 Europe/Oslo |
326 | -NP +2743+08519 Asia/Katmandu |
327 | -NR -0031+16655 Pacific/Nauru |
328 | -NU -1901+16955 Pacific/Niue |
329 | -NZ -3652+17446 Pacific/Auckland most locations |
330 | -NZ -4355-17630 Pacific/Chatham Chatham Islands |
331 | -OM +2336+05835 Asia/Muscat |
332 | -PA +0858-07932 America/Panama |
333 | -PE -1203-07703 America/Lima |
334 | -PF -1732-14934 Pacific/Tahiti Society Islands |
335 | -PF -0900-13930 Pacific/Marquesas Marquesas Islands |
336 | -PF -2308-13457 Pacific/Gambier Gambier Islands |
337 | -PG -0930+14710 Pacific/Port_Moresby |
338 | -PH +1435+12100 Asia/Manila |
339 | -PK +2452+06703 Asia/Karachi |
340 | -PL +5215+02100 Europe/Warsaw |
341 | -PM +4703-05620 America/Miquelon |
342 | -PN -2504-13005 Pacific/Pitcairn |
343 | -PR +182806-0660622 America/Puerto_Rico |
344 | -PS +3130+03428 Asia/Gaza |
345 | -PT +3843-00908 Europe/Lisbon mainland |
346 | -PT +3238-01654 Atlantic/Madeira Madeira Islands |
347 | -PT +3744-02540 Atlantic/Azores Azores |
348 | -PW +0720+13429 Pacific/Palau |
349 | -PY -2516-05740 America/Asuncion |
350 | -QA +2517+05132 Asia/Qatar |
351 | -RE -2052+05528 Indian/Reunion |
352 | -RO +4426+02606 Europe/Bucharest |
353 | -RU +5443+02030 Europe/Kaliningrad Moscow-01 - Kaliningrad |
354 | -RU +5545+03735 Europe/Moscow Moscow+00 - west Russia |
355 | -RU +5312+05009 Europe/Samara Moscow+01 - Caspian Sea |
356 | -RU +5651+06036 Asia/Yekaterinburg Moscow+02 - Urals |
357 | -RU +5500+07324 Asia/Omsk Moscow+03 - west Siberia |
358 | -RU +5502+08255 Asia/Novosibirsk Moscow+03 - Novosibirsk |
359 | -RU +5601+09250 Asia/Krasnoyarsk Moscow+04 - Yenisei River |
360 | -RU +5216+10420 Asia/Irkutsk Moscow+05 - Lake Baikal |
361 | -RU +6200+12940 Asia/Yakutsk Moscow+06 - Lena River |
362 | -RU +4310+13156 Asia/Vladivostok Moscow+07 - Amur River |
363 | -RU +4658+14242 Asia/Sakhalin Moscow+07 - Sakhalin Island |
364 | -RU +5934+15048 Asia/Magadan Moscow+08 - Magadan |
365 | -RU +5301+15839 Asia/Kamchatka Moscow+09 - Kamchatka |
366 | -RU +6445+17729 Asia/Anadyr Moscow+10 - Bering Sea |
367 | -RW -0157+03004 Africa/Kigali |
368 | -SA +2438+04643 Asia/Riyadh |
369 | -SB -0932+16012 Pacific/Guadalcanal |
370 | -SC -0440+05528 Indian/Mahe |
371 | -SD +1536+03232 Africa/Khartoum |
372 | -SE +5920+01803 Europe/Stockholm |
373 | -SG +0117+10351 Asia/Singapore |
374 | -SH -1555-00542 Atlantic/St_Helena |
375 | -SI +4603+01431 Europe/Ljubljana |
376 | -SJ +7800+01600 Arctic/Longyearbyen Svalbard |
377 | -SJ +7059-00805 Atlantic/Jan_Mayen Jan Mayen |
378 | -SK +4809+01707 Europe/Bratislava |
379 | -SL +0830-01315 Africa/Freetown |
380 | -SM +4355+01228 Europe/San_Marino |
381 | -SN +1440-01726 Africa/Dakar |
382 | -SO +0204+04522 Africa/Mogadishu |
383 | -SR +0550-05510 America/Paramaribo |
384 | -ST +0020+00644 Africa/Sao_Tome |
385 | -SV +1342-08912 America/El_Salvador |
386 | -SY +3330+03618 Asia/Damascus |
387 | -SZ -2618+03106 Africa/Mbabane |
388 | -TC +2128-07108 America/Grand_Turk |
389 | -TD +1207+01503 Africa/Ndjamena |
390 | -TF -492110+0701303 Indian/Kerguelen |
391 | -TG +0608+00113 Africa/Lome |
392 | -TH +1345+10031 Asia/Bangkok |
393 | -TJ +3835+06848 Asia/Dushanbe |
394 | -TK -0922-17114 Pacific/Fakaofo |
395 | -TL -0833+12535 Asia/Dili |
396 | -TM +3757+05823 Asia/Ashgabat |
397 | -TN +3648+01011 Africa/Tunis |
398 | -TO -2110+17510 Pacific/Tongatapu |
399 | -TR +4101+02858 Europe/Istanbul |
400 | -TT +1039-06131 America/Port_of_Spain |
401 | -TV -0831+17913 Pacific/Funafuti |
402 | -TW +2503+12130 Asia/Taipei |
403 | -TZ -0648+03917 Africa/Dar_es_Salaam |
404 | -UA +5026+03031 Europe/Kiev most locations |
405 | -UA +4837+02218 Europe/Uzhgorod Ruthenia |
406 | -UA +4750+03510 Europe/Zaporozhye Zaporozh'ye, E Lugansk |
407 | -UA +4457+03406 Europe/Simferopol central Crimea |
408 | -UG +0019+03225 Africa/Kampala |
409 | -UM +1700-16830 Pacific/Johnston Johnston Atoll |
410 | -UM +2813-17722 Pacific/Midway Midway Islands |
411 | -UM +1917+16637 Pacific/Wake Wake Island |
412 | -US +404251-0740023 America/New_York Eastern Time |
413 | -US +421953-0830245 America/Detroit Eastern Time - Michigan - most locations |
414 | -US +381515-0854534 America/Louisville Eastern Time - Kentucky - Louisville area |
415 | -US +364947-0845057 America/Kentucky/Monticello Eastern Time - Kentucky - Wayne County |
416 | -US +394606-0860929 America/Indianapolis Eastern Standard Time - Indiana - most locations |
417 | -US +382232-0862041 America/Indiana/Marengo Eastern Standard Time - Indiana - Crawford County |
418 | -US +411745-0863730 America/Indiana/Knox Eastern Standard Time - Indiana - Starke County |
419 | -US +384452-0850402 America/Indiana/Vevay Eastern Standard Time - Indiana - Switzerland County |
420 | -US +415100-0873900 America/Chicago Central Time |
421 | -US +450628-0873651 America/Menominee Central Time - Michigan - Wisconsin border |
422 | -US +470659-1011757 America/North_Dakota/Center Central Time - North Dakota - Oliver County |
423 | -US +394421-1045903 America/Denver Mountain Time |
424 | -US +433649-1161209 America/Boise Mountain Time - south Idaho & east Oregon |
425 | -US +364708-1084111 America/Shiprock Mountain Time - Navajo |
426 | -US +332654-1120424 America/Phoenix Mountain Standard Time - Arizona |
427 | -US +340308-1181434 America/Los_Angeles Pacific Time |
428 | -US +611305-1495401 America/Anchorage Alaska Time |
429 | -US +581807-1342511 America/Juneau Alaska Time - Alaska panhandle |
430 | -US +593249-1394338 America/Yakutat Alaska Time - Alaska panhandle neck |
431 | -US +643004-1652423 America/Nome Alaska Time - west Alaska |
432 | -US +515248-1763929 America/Adak Aleutian Islands |
433 | -US +211825-1575130 Pacific/Honolulu Hawaii |
434 | -UY -3453-05611 America/Montevideo |
435 | -UZ +3940+06648 Asia/Samarkand west Uzbekistan |
436 | -UZ +4120+06918 Asia/Tashkent east Uzbekistan |
437 | -VA +4154+01227 Europe/Vatican |
438 | -VC +1309-06114 America/St_Vincent |
439 | -VE +1030-06656 America/Caracas |
440 | -VG +1827-06437 America/Tortola |
441 | -VI +1821-06456 America/St_Thomas |
442 | -VN +1045+10640 Asia/Saigon |
443 | -VU -1740+16825 Pacific/Efate |
444 | -WF -1318-17610 Pacific/Wallis |
445 | -WS -1350-17144 Pacific/Apia |
446 | -YE +1245+04512 Asia/Aden |
447 | -YT -1247+04514 Indian/Mayotte |
448 | -YU +4450+02030 Europe/Belgrade |
449 | -ZA -2615+02800 Africa/Johannesburg |
450 | -ZM -1525+02817 Africa/Lusaka |
451 | -ZW -1750+03103 Africa/Harare |
452 | -XX 0+0 Etc/UTC |
453 | \ No newline at end of file |
454 | |
455 | === modified file 'plugins/EquationOfTime/CMakeLists.txt' |
456 | --- plugins/EquationOfTime/CMakeLists.txt 2015-10-28 14:52:25 +0000 |
457 | +++ plugins/EquationOfTime/CMakeLists.txt 2016-10-25 16:10:21 +0000 |
458 | @@ -1,6 +1,6 @@ |
459 | SET(EQUATIONOFTIME_MAJOR "0") |
460 | SET(EQUATIONOFTIME_MINOR "1") |
461 | -SET(EQUATIONOFTIME_PATCH "3") |
462 | +SET(EQUATIONOFTIME_PATCH "4") |
463 | SET(EQUATIONOFTIME_VERSION "${EQUATIONOFTIME_MAJOR}.${EQUATIONOFTIME_MINOR}.${EQUATIONOFTIME_PATCH}") |
464 | |
465 | IF(APPLE) |
466 | |
467 | === modified file 'plugins/EquationOfTime/src/EquationOfTime.cpp' |
468 | --- plugins/EquationOfTime/src/EquationOfTime.cpp 2015-10-28 14:52:25 +0000 |
469 | +++ plugins/EquationOfTime/src/EquationOfTime.cpp 2016-10-25 16:10:21 +0000 |
470 | @@ -33,9 +33,6 @@ |
471 | #include "EquationOfTime.hpp" |
472 | #include "EquationOfTimeWindow.hpp" |
473 | |
474 | -//#include "sidereal_time.h" |
475 | -#include "precession.h" |
476 | - |
477 | #include <QFontMetrics> |
478 | #include <QSettings> |
479 | #include <QPixmap> |
480 | @@ -123,7 +120,7 @@ |
481 | sPainter.setFont(font); |
482 | |
483 | QString timeText; |
484 | - double eqTime = getSolutionEquationOfTime(core->getJDE()); |
485 | + double eqTime = core->getSolutionEquationOfTime(core->getJDE()); |
486 | |
487 | if (getFlagInvertedValue()) |
488 | eqTime *= -1; |
489 | @@ -215,44 +212,6 @@ |
490 | conf->endGroup(); |
491 | } |
492 | |
493 | -double EquationOfTime::getSolutionEquationOfTime(const double JDE) const |
494 | -{ |
495 | - StelCore* core = StelApp::getInstance().getCore(); |
496 | - |
497 | - double tau = (JDE - 2451545.0)/365250.0; |
498 | - double sunMeanLongitude = 280.4664567 + tau*(360007.6892779 + tau*(0.03032028 + tau*(1./49931. - tau*(1./15300. - tau/2000000.)))); |
499 | - |
500 | - // reduce the angle |
501 | - sunMeanLongitude = std::fmod(sunMeanLongitude, 360.); |
502 | - // force it to be the positive remainder, so that 0 <= angle < 360 |
503 | - sunMeanLongitude = std::fmod(sunMeanLongitude + 360., 360.); |
504 | - |
505 | - Vec3d pos = GETSTELMODULE(StelObjectMgr)->searchByName("Sun")->getEquinoxEquatorialPos(core); |
506 | - double ra, dec; |
507 | - StelUtils::rectToSphe(&ra, &dec, pos); |
508 | - |
509 | - // covert radians to degrees and reduce the angle |
510 | - double alpha = std::fmod(ra*180./M_PI, 360.); |
511 | - // force it to be the positive remainder, so that 0 <= angle < 360 |
512 | - alpha = std::fmod(alpha + 360., 360.); |
513 | - |
514 | - double deltaPsi, deltaEps; |
515 | - getNutationAngles(JDE, &deltaPsi, &deltaEps); // these are radians! |
516 | - //double equation = 4*(sunMeanLongitude - 0.0057183 - alpha + get_nutation_longitude(JDE)*cos(get_mean_ecliptical_obliquity(JDE))); |
517 | - double equation = 4*(sunMeanLongitude - 0.0057183 - alpha + deltaPsi*180./M_PI*cos(getPrecessionAngleVondrakEpsilon(JDE))); |
518 | - // The equation of time is always smaller 20 minutes in absolute value |
519 | - if (qAbs(equation)>20) |
520 | - { |
521 | - // If absolute value of the equation of time appears to be too large, add 24 hours (1440 minutes) to or subtract it from our result |
522 | - if (equation>0.) |
523 | - equation -= 1440.; |
524 | - else |
525 | - equation += 1440.; |
526 | - } |
527 | - |
528 | - return equation; |
529 | -} |
530 | - |
531 | void EquationOfTime::updateMessageText() |
532 | { |
533 | messageEquation = q_("Equation of Time"); |
534 | |
535 | === modified file 'plugins/EquationOfTime/src/EquationOfTime.hpp' |
536 | --- plugins/EquationOfTime/src/EquationOfTime.hpp 2015-10-28 14:52:25 +0000 |
537 | +++ plugins/EquationOfTime/src/EquationOfTime.hpp 2016-10-25 16:10:21 +0000 |
538 | @@ -86,12 +86,6 @@ |
539 | //! Save the settings to the main configuration file. |
540 | void saveSettingsToConfig(void); |
541 | |
542 | - //! Get solution of equation of time |
543 | - //! Source: J. Meeus "Astronomical Algorithms" (2nd ed., with corrections as of August 10, 2009) p.183-187. |
544 | - //! @param JDE JD in Dynamical Time (previously called Ephemeris Time) |
545 | - //! @return time in minutes |
546 | - double getSolutionEquationOfTime(const double JDE) const; |
547 | - |
548 | //! Is plugin enabled? |
549 | bool isEnabled() const |
550 | { |
551 | |
552 | === modified file 'plugins/Observability/src/Observability.cpp' |
553 | --- plugins/Observability/src/Observability.cpp 2016-07-21 22:45:43 +0000 |
554 | +++ plugins/Observability/src/Observability.cpp 2016-10-25 16:10:21 +0000 |
555 | @@ -287,8 +287,7 @@ |
556 | double currheight = (6371.+(core->getCurrentLocation().altitude)/1000.)/UA; |
557 | double currJD = core->getJD(); |
558 | double currJDint; |
559 | -// GMTShift = StelUtils::getGMTShiftFromQT(currJD)/24.0; |
560 | - GMTShift = StelApp::getInstance().getLocaleMgr().getGMTShift(currJD)/24.0; |
561 | + GMTShift = core->getUTCOffset(currJD)/24.0; |
562 | |
563 | |
564 | double currLocalT = 24.*modf(currJD + GMTShift,&currJDint); |
565 | |
566 | === modified file 'plugins/RemoteControl/src/MainService.cpp' |
567 | --- plugins/RemoteControl/src/MainService.cpp 2016-06-03 17:40:43 +0000 |
568 | +++ plugins/RemoteControl/src/MainService.cpp 2016-10-25 16:10:21 +0000 |
569 | @@ -163,7 +163,7 @@ |
570 | double jday = core->getJD(); |
571 | double deltaT = core->getDeltaT() * StelCore::JD_SECOND; |
572 | |
573 | - double gmtShift = localeMgr->getGMTShift(jday) / 24.0; |
574 | + double gmtShift = core->getUTCOffset(jday) / 24.0; |
575 | |
576 | QString utcIso = StelUtils::julianDayToISO8601String(jday,true).append('Z'); |
577 | QString localIso = StelUtils::julianDayToISO8601String(jday+gmtShift,true); |
578 | |
579 | === modified file 'plugins/Satellites/src/Satellites.cpp' |
580 | --- plugins/Satellites/src/Satellites.cpp 2016-09-17 09:48:40 +0000 |
581 | +++ plugins/Satellites/src/Satellites.cpp 2016-10-25 16:10:21 +0000 |
582 | @@ -1689,7 +1689,7 @@ |
583 | if (angle>angle0 && (v<1) && lat>5*M_PI/180) |
584 | { |
585 | IridiumFlaresPrediction flare; |
586 | - flare.datetime = StelUtils::julianDayToISO8601String(currentJD+dt+StelUtils::getGMTShiftFromQT(currentJD+dt)/24.f); |
587 | + flare.datetime = StelUtils::julianDayToISO8601String(currentJD+dt+StelApp::getInstance().getCore()->getUTCOffset(currentJD+dt)/24.f); |
588 | flare.satellite = sat.data()->getEnglishName(); |
589 | flare.azimuth = lon; |
590 | flare.altitude = lat; |
591 | |
592 | === modified file 'plugins/Satellites/src/gui/SatellitesDialog.cpp' |
593 | --- plugins/Satellites/src/gui/SatellitesDialog.cpp 2016-05-22 13:40:10 +0000 |
594 | +++ plugins/Satellites/src/gui/SatellitesDialog.cpp 2016-10-25 16:10:21 +0000 |
595 | @@ -997,7 +997,7 @@ |
596 | QString date = modelIndex.sibling(modelIndex.row(), IridiumFlaresDate).data().toString(); |
597 | bool ok; |
598 | double JD = StelUtils::getJulianDayFromISO8601String(date.left(10) + "T" + date.right(8), &ok); |
599 | - JD -= StelUtils::getGMTShiftFromQT(JD)/24.; |
600 | + JD -= StelApp::getInstance().getCore()->getUTCOffset(JD)/24.; |
601 | |
602 | StelObjectMgr* objectMgr = GETSTELMODULE(StelObjectMgr); |
603 | if (objectMgr->findAndSelectI18n(name) || objectMgr->findAndSelect(name)) |
604 | |
605 | === removed directory 'plugins/TimeZoneConfiguration' |
606 | === removed file 'plugins/TimeZoneConfiguration/CMakeLists.txt' |
607 | --- plugins/TimeZoneConfiguration/CMakeLists.txt 2015-10-20 17:16:34 +0000 |
608 | +++ plugins/TimeZoneConfiguration/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
609 | @@ -1,19 +0,0 @@ |
610 | - |
611 | -SET(TIME_ZONE_CONFIGURATION_MAJOR "0") |
612 | -SET(TIME_ZONE_CONFIGURATION_MINOR "0") |
613 | -SET(TIME_ZONE_CONFIGURATION_PATCH "4") |
614 | -SET(TIME_ZONE_CONFIGURATION_VERSION "${TIME_ZONE_CONFIGURATION_MAJOR}.${TIME_ZONE_CONFIGURATION_MINOR}.${TIME_ZONE_CONFIGURATION_PATCH}") |
615 | - |
616 | -IF(APPLE) |
617 | - SET(CMAKE_INSTALL_PREFIX $ENV{HOME}/Library/Application\ Support/Stellarium) |
618 | -ElSE(APPLE) |
619 | - SET(CMAKE_INSTALL_PREFIX $ENV{HOME}/.stellarium) |
620 | -ENDIF(APPLE) |
621 | - |
622 | -ADD_DEFINITIONS(-DTIME_ZONE_CONFIGURATION_VERSION="${TIME_ZONE_CONFIGURATION_VERSION}") |
623 | - |
624 | -ADD_SUBDIRECTORY( src ) |
625 | - |
626 | -INSTALL(FILES DESTINATION "modules/TimeZoneConfiguration") |
627 | - |
628 | - |
629 | |
630 | === removed directory 'plugins/TimeZoneConfiguration/src' |
631 | === removed file 'plugins/TimeZoneConfiguration/src/CMakeLists.txt' |
632 | --- plugins/TimeZoneConfiguration/src/CMakeLists.txt 2015-10-20 17:16:34 +0000 |
633 | +++ plugins/TimeZoneConfiguration/src/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
634 | @@ -1,35 +0,0 @@ |
635 | - |
636 | -INCLUDE_DIRECTORIES( |
637 | - . |
638 | - gui |
639 | - ${CMAKE_BINARY_DIR} |
640 | - ${CMAKE_BINARY_DIR}/plugins/TimeZoneConfiguration/src |
641 | - ${CMAKE_BINARY_DIR}/plugins/TimeZoneConfiguration/src/gui |
642 | -) |
643 | - |
644 | -LINK_DIRECTORIES(/src) |
645 | - |
646 | -SET(TimeZoneConfiguration_SRCS |
647 | - TimeZoneConfiguration.hpp |
648 | - TimeZoneConfiguration.cpp |
649 | - gui/TimeZoneConfigurationWindow.hpp |
650 | - gui/TimeZoneConfigurationWindow.cpp |
651 | - gui/DefineTimeZoneWindow.hpp |
652 | - gui/DefineTimeZoneWindow.cpp |
653 | -) |
654 | - |
655 | -SET(TimeZoneConfiguration_UIS |
656 | - gui/timeZoneConfigurationWindow.ui |
657 | - gui/defineTimeZone.ui |
658 | -) |
659 | - |
660 | -QT5_WRAP_UI(TimeZoneConfiguration_UIS_H ${TimeZoneConfiguration_UIS}) |
661 | - |
662 | -SET(extLinkerOption ${OPENGL_LIBRARIES}) |
663 | - |
664 | -ADD_LIBRARY(TimeZoneConfiguration-static STATIC ${TimeZoneConfiguration_SRCS} ${TimeZoneConfiguration_RES_CXX} ${TimeZoneConfiguration_UIS_H}) |
665 | -QT5_USE_MODULES(TimeZoneConfiguration-static Core Network Gui Widgets) |
666 | -SET_TARGET_PROPERTIES(TimeZoneConfiguration-static PROPERTIES OUTPUT_NAME "TimeZoneConfiguration") |
667 | -TARGET_LINK_LIBRARIES(TimeZoneConfiguration-static ${extLinkerOption}) |
668 | -SET_TARGET_PROPERTIES(TimeZoneConfiguration-static PROPERTIES COMPILE_FLAGS "-DQT_STATICPLUGIN") |
669 | -ADD_DEPENDENCIES(AllStaticPlugins TimeZoneConfiguration-static) |
670 | |
671 | === removed file 'plugins/TimeZoneConfiguration/src/TimeZoneConfiguration.cpp' |
672 | --- plugins/TimeZoneConfiguration/src/TimeZoneConfiguration.cpp 2014-04-15 19:00:10 +0000 |
673 | +++ plugins/TimeZoneConfiguration/src/TimeZoneConfiguration.cpp 1970-01-01 00:00:00 +0000 |
674 | @@ -1,127 +0,0 @@ |
675 | -/* |
676 | - * Time zone configuration plug-in for Stellarium |
677 | - * |
678 | - * Copyright (C) 2010 Bogdan Marinov |
679 | - * |
680 | - * This program is free software; you can redistribute it and/or |
681 | - * modify it under the terms of the GNU General Public License |
682 | - * as published by the Free Software Foundation; either version 2 |
683 | - * of the License, or (at your option) any later version. |
684 | - * |
685 | - * This program is distributed in the hope that it will be useful, |
686 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
687 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
688 | - * GNU General Public License for more details. |
689 | - * |
690 | - * You should have received a copy of the GNU General Public License |
691 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
692 | - */ |
693 | - |
694 | -#include "TimeZoneConfiguration.hpp" |
695 | -#include "TimeZoneConfigurationWindow.hpp" |
696 | - |
697 | -#include "StelApp.hpp" |
698 | -#include "StelLocaleMgr.hpp" |
699 | -#include "StelModule.hpp" |
700 | - |
701 | -#include <QSettings> |
702 | - |
703 | -StelModule* TimeZoneConfigurationStelPluginInterface::getStelModule() const |
704 | -{ |
705 | - return new TimeZoneConfiguration(); |
706 | -} |
707 | - |
708 | -StelPluginInfo TimeZoneConfigurationStelPluginInterface::getPluginInfo() const |
709 | -{ |
710 | - // Allow to load the resources when used as a static plugin |
711 | - //Q_INIT_RESOURCE(TimeZoneConfiguration); |
712 | - |
713 | - StelPluginInfo info; |
714 | - info.id = "TimeZoneConfiguration"; |
715 | - info.displayedName = N_("Time Zone"); |
716 | - info.authors = "Bogdan Marinov"; |
717 | - info.contact = "http://stellarium.org"; |
718 | - info.description = N_("A convenient interface for some of the more obscure options in Stellarium's configuration file. Allows setting the time zone and changing the way the time and the date are displayed in the bottom bar."); |
719 | - info.version = TIME_ZONE_CONFIGURATION_VERSION; |
720 | - return info; |
721 | -} |
722 | - |
723 | -TimeZoneConfiguration::TimeZoneConfiguration() |
724 | -{ |
725 | - setObjectName("TimeZoneConfiguration"); |
726 | - mainWindow = new TimeZoneConfigurationWindow(); |
727 | - // |
728 | -} |
729 | - |
730 | -TimeZoneConfiguration::~TimeZoneConfiguration() |
731 | -{ |
732 | - // |
733 | -} |
734 | - |
735 | -void TimeZoneConfiguration::init() |
736 | -{ |
737 | - // |
738 | -} |
739 | - |
740 | -void TimeZoneConfiguration::deinit() |
741 | -{ |
742 | - delete mainWindow; |
743 | -} |
744 | - |
745 | -double TimeZoneConfiguration::getCallOrder(StelModuleActionName) const |
746 | -{ |
747 | - return 0.; |
748 | -} |
749 | - |
750 | -void TimeZoneConfiguration::update(double) |
751 | -{ |
752 | - // |
753 | -} |
754 | - |
755 | -bool TimeZoneConfiguration::configureGui(bool show) |
756 | -{ |
757 | - if (show) |
758 | - mainWindow->setVisible(true); |
759 | - |
760 | - return true; |
761 | -} |
762 | - |
763 | -void TimeZoneConfiguration::setTimeZone(QString timeZoneString) |
764 | -{ |
765 | - if (timeZoneString.isEmpty()) |
766 | - { |
767 | - return; |
768 | - } |
769 | - //TODO: Validation? |
770 | - qDebug() << "Setting \"localization/time_zone\" to" << timeZoneString; |
771 | - |
772 | - QSettings * settings = StelApp::getInstance().getSettings(); |
773 | - Q_ASSERT(settings); |
774 | - |
775 | - settings->setValue("localization/time_zone", timeZoneString); |
776 | - settings->sync(); |
777 | -} |
778 | - |
779 | -QString TimeZoneConfiguration::readTimeZone() |
780 | -{ |
781 | - QSettings * settings = StelApp::getInstance().getSettings(); |
782 | - Q_ASSERT(settings); |
783 | - |
784 | - return settings->value("localization/time_zone").toString(); |
785 | -} |
786 | - |
787 | -void TimeZoneConfiguration::saveDisplayFormats() |
788 | -{ |
789 | - QSettings * settings = StelApp::getInstance().getSettings(); |
790 | - Q_ASSERT(settings); |
791 | - |
792 | - StelLocaleMgr & localeManager = StelApp::getInstance().getLocaleMgr(); |
793 | - |
794 | - QString timeDisplayFormat = localeManager.getTimeFormatStr(); |
795 | - settings->setValue("localization/time_display_format", timeDisplayFormat); |
796 | - |
797 | - QString dateDisplayFormat = localeManager.getDateFormatStr(); |
798 | - settings->setValue("localization/date_display_format", dateDisplayFormat); |
799 | - |
800 | - settings->sync(); |
801 | -} |
802 | |
803 | === removed file 'plugins/TimeZoneConfiguration/src/TimeZoneConfiguration.hpp' |
804 | --- plugins/TimeZoneConfiguration/src/TimeZoneConfiguration.hpp 2015-02-18 22:21:55 +0000 |
805 | +++ plugins/TimeZoneConfiguration/src/TimeZoneConfiguration.hpp 1970-01-01 00:00:00 +0000 |
806 | @@ -1,82 +0,0 @@ |
807 | -/* |
808 | - * Time zone configuration plug-in for Stellarium |
809 | - * |
810 | - * Copyright (C) 2010 Bogdan Marinov |
811 | - * |
812 | - * This program is free software; you can redistribute it and/or |
813 | - * modify it under the terms of the GNU General Public License |
814 | - * as published by the Free Software Foundation; either version 2 |
815 | - * of the License, or (at your option) any later version. |
816 | - * |
817 | - * This program is distributed in the hope that it will be useful, |
818 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
819 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
820 | - * GNU General Public License for more details. |
821 | - * |
822 | - * You should have received a copy of the GNU General Public License |
823 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
824 | - */ |
825 | - |
826 | - #ifndef _TIME_ZONE_CONFIGURATION_HPP_ |
827 | - #define _TIME_ZONE_CONFIGURATION_HPP_ |
828 | - |
829 | -#include "StelGui.hpp" |
830 | -#include "StelModule.hpp" |
831 | - |
832 | -#include <QString> |
833 | - |
834 | -class TimeZoneConfigurationWindow; |
835 | - |
836 | -class TimeZoneConfiguration : public StelModule |
837 | -{ |
838 | - Q_OBJECT |
839 | - |
840 | -public: |
841 | - TimeZoneConfiguration(); |
842 | - ~TimeZoneConfiguration(); |
843 | - |
844 | - virtual void init(); |
845 | - virtual void deinit(); |
846 | - virtual void update(double deltaTime); |
847 | - //virtual void draw(StelCore *core); |
848 | - virtual double getCallOrder(StelModuleActionName actionName) const; |
849 | - virtual bool configureGui(bool show); |
850 | - |
851 | - //! Sets the time zone field in Stellarium's configuration file. |
852 | - //! To work, timeZoneString should be a valid value of the TZ environmental |
853 | - //! variable according to the POSIX format. |
854 | - //! (See http://www.gnu.org/s/libc/manual/html_node/TZ-Variable.html) |
855 | - //! Note that Microsoft Windows may use a truncated version of the TZ |
856 | - //! format. |
857 | - //! For now, Stellarium needs to be restarted for the new settings to take |
858 | - //! effect. |
859 | - void setTimeZone(QString timeZoneString); |
860 | - |
861 | - //! Reads the time zone field in Stellarium's configuration file. |
862 | - //! \returns the contents of the "localization/time_zone" field in |
863 | - //! Stellarium's configuration file. |
864 | - QString readTimeZone(); |
865 | - |
866 | - //! Saves the formats used to display date and time in the bottom bar. |
867 | - void saveDisplayFormats(); |
868 | - |
869 | -private: |
870 | - TimeZoneConfigurationWindow * mainWindow; |
871 | -}; |
872 | - |
873 | - |
874 | -#include <QObject> |
875 | -#include "StelPluginInterface.hpp" |
876 | - |
877 | -//! This class is used by Qt to manage a plug-in interface |
878 | -class TimeZoneConfigurationStelPluginInterface : public QObject, public StelPluginInterface |
879 | -{ |
880 | - Q_OBJECT |
881 | - Q_PLUGIN_METADATA(IID StelPluginInterface_iid) |
882 | - Q_INTERFACES(StelPluginInterface) |
883 | -public: |
884 | - virtual StelModule* getStelModule() const; |
885 | - virtual StelPluginInfo getPluginInfo() const; |
886 | -}; |
887 | - |
888 | - #endif //_TIME_ZONE_CONFIGURATION_HPP_ |
889 | |
890 | === removed directory 'plugins/TimeZoneConfiguration/src/gui' |
891 | === removed file 'plugins/TimeZoneConfiguration/src/gui/DefineTimeZoneWindow.cpp' |
892 | --- plugins/TimeZoneConfiguration/src/gui/DefineTimeZoneWindow.cpp 2016-01-22 11:05:08 +0000 |
893 | +++ plugins/TimeZoneConfiguration/src/gui/DefineTimeZoneWindow.cpp 1970-01-01 00:00:00 +0000 |
894 | @@ -1,541 +0,0 @@ |
895 | -/* |
896 | - * Time zone configuration plug-in for Stellarium |
897 | - * |
898 | - * Copyright (C) 2010 Bogdan Marinov |
899 | - * |
900 | - * This program is free software; you can redistribute it and/or |
901 | - * modify it under the terms of the GNU General Public License |
902 | - * as published by the Free Software Foundation; either version 2 |
903 | - * of the License, or (at your option) any later version. |
904 | - * |
905 | - * This program is distributed in the hope that it will be useful, |
906 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
907 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
908 | - * GNU General Public License for more details. |
909 | - * |
910 | - * You should have received a copy of the GNU General Public License |
911 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
912 | - */ |
913 | - |
914 | -#include "TimeZoneConfigurationWindow.hpp" |
915 | -#include "DefineTimeZoneWindow.hpp" |
916 | -#include "ui_defineTimeZone.h" |
917 | -#include "StelApp.hpp" |
918 | -#include "StelTranslator.hpp" |
919 | - |
920 | -#include <cmath> |
921 | -#include <QRegExpValidator> |
922 | - |
923 | -DefineTimeZoneWindow::DefineTimeZoneWindow() |
924 | -{ |
925 | - ui = new Ui_defineTimeZoneForm(); |
926 | - dialogName = "TimeZoneConfigurationDefineTimeZone"; |
927 | - timeZoneNameValidator = new QRegExpValidator(QRegExp("[^:\\d,+-/]{3,}"), this); |
928 | -} |
929 | - |
930 | -DefineTimeZoneWindow::~DefineTimeZoneWindow() |
931 | -{ |
932 | - delete ui; |
933 | - delete timeZoneNameValidator; |
934 | -} |
935 | - |
936 | -void DefineTimeZoneWindow::retranslate() |
937 | -{ |
938 | - if (dialog) |
939 | - { |
940 | - ui->retranslateUi(dialog); |
941 | - int startDateMonthIndex = ui->comboBoxDstStartDateMonth->currentIndex(); |
942 | - int startDayIndex = ui->comboBoxDstStartDay->currentIndex(); |
943 | - int startMonthIndex = ui->comboBoxDstStartMonth->currentIndex(); |
944 | - int startWeekIndex = ui->comboBoxDstStartWeek->currentIndex(); |
945 | - int endDateMonthIndex = ui->comboBoxDstEndDateMonth->currentIndex(); |
946 | - int endDayIndex = ui->comboBoxDstEndDay->currentIndex(); |
947 | - int endMonthIndex = ui->comboBoxDstEndMonth->currentIndex(); |
948 | - int endWeekIndex = ui->comboBoxDstEndWeek->currentIndex(); |
949 | - populateDateLists(); |
950 | - ui->comboBoxDstStartDateMonth->setCurrentIndex(startDateMonthIndex); |
951 | - ui->comboBoxDstStartDay->setCurrentIndex(startDayIndex); |
952 | - ui->comboBoxDstStartMonth->setCurrentIndex(startMonthIndex); |
953 | - ui->comboBoxDstStartWeek->setCurrentIndex(startWeekIndex); |
954 | - ui->comboBoxDstEndDateMonth->setCurrentIndex(endDateMonthIndex); |
955 | - ui->comboBoxDstEndDay->setCurrentIndex(endDayIndex); |
956 | - ui->comboBoxDstEndMonth->setCurrentIndex(endMonthIndex); |
957 | - ui->comboBoxDstEndWeek->setCurrentIndex(endWeekIndex); |
958 | - } |
959 | -} |
960 | - |
961 | -void DefineTimeZoneWindow::createDialogContent() |
962 | -{ |
963 | - ui->setupUi(dialog); |
964 | - connect(&StelApp::getInstance(), SIGNAL(languageChanged()), |
965 | - this, SLOT(retranslate())); |
966 | - |
967 | - connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); |
968 | - connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint))); |
969 | - connect(ui->pushButtonUseDefinition, SIGNAL(clicked()), |
970 | - this, SLOT(useDefinition())); |
971 | - |
972 | - connect(ui->doubleSpinBoxOffset, SIGNAL(valueChanged(double)), |
973 | - this, SLOT(updateDstOffset(double))); |
974 | - |
975 | - connect(ui->comboBoxDstStartDateMonth, SIGNAL(currentIndexChanged(int)), |
976 | - this, SLOT(updateDayNumberMaximumDstStart(int))); |
977 | - connect(ui->comboBoxDstEndDateMonth, SIGNAL(currentIndexChanged(int)), |
978 | - this, SLOT(updateDayNumberMaximumDstEnd(int))); |
979 | - |
980 | - ui->lineEditName->setValidator(timeZoneNameValidator); |
981 | - ui->lineEditNameDst->setValidator(timeZoneNameValidator); |
982 | - |
983 | - resetWindowState(); |
984 | -} |
985 | - |
986 | -void DefineTimeZoneWindow::useDefinition() |
987 | -{ |
988 | - QString definition; |
989 | - QString timeZoneName = ui->lineEditName->text(); |
990 | - if (timeZoneName.length() < 3) |
991 | - { |
992 | - return; |
993 | - } |
994 | - definition.append(timeZoneName); |
995 | - definition.append(TimeZoneConfigurationWindow::getTzOffsetStringFrom(ui->doubleSpinBoxOffset)); |
996 | - |
997 | - //Daylight saving time |
998 | - if (ui->checkBoxDst->isChecked()) |
999 | - { |
1000 | - QString dstTimeZoneName = ui->lineEditNameDst->text(); |
1001 | - if (dstTimeZoneName.length() < 3 || dstTimeZoneName == timeZoneName) |
1002 | - { |
1003 | - return; |
1004 | - } |
1005 | - //The name is the minimum required for DST |
1006 | - definition.append(dstTimeZoneName); |
1007 | - |
1008 | - //The offset is not necessary |
1009 | - if (ui->checkBoxOffsetDst->isChecked()) |
1010 | - { |
1011 | - definition.append(TimeZoneConfigurationWindow::getTzOffsetStringFrom(ui->doubleSpinBoxOffsetDst)); |
1012 | - } |
1013 | - |
1014 | - if (ui->groupBoxDstStart->isChecked() && ui->groupBoxDstEnd->isChecked()) |
1015 | - { |
1016 | - if (ui->radioButtonDstStartDate->isChecked()) |
1017 | - { |
1018 | - const int month = ui->comboBoxDstStartDateMonth->currentIndex() + 1; |
1019 | - const int day = ui->spinBoxDstStartDateDay->value(); |
1020 | - QDate startDate; |
1021 | - if (month == 2 && day == 29) |
1022 | - { |
1023 | - //Leap year: day is indexed between 0 and 365 |
1024 | - startDate.setDate(2000, month, day); |
1025 | - definition.append(QString(",%1").arg(startDate.dayOfYear() - 1)); |
1026 | - } |
1027 | - else |
1028 | - { |
1029 | - startDate.setDate(2010, month, day); |
1030 | - definition.append(QString(",J%1").arg(startDate.dayOfYear())); |
1031 | - } |
1032 | - } |
1033 | - else //Day of week |
1034 | - { |
1035 | - //Day of the week: 0-6, 0 is Sunday |
1036 | - int day = ui->comboBoxDstStartDay->currentIndex(); |
1037 | - //Week ordinal number: 1-5, 5 is "last" |
1038 | - int week = ui->comboBoxDstStartWeek->currentIndex() + 1; |
1039 | - //Month: 1-12 |
1040 | - int month = ui->comboBoxDstStartMonth->currentIndex() + 1; |
1041 | - |
1042 | - definition.append(QString(",M%1.%2.%3").arg(month).arg(week).arg(day)); |
1043 | - } |
1044 | - |
1045 | - if (ui->checkBoxDstStartTime->isChecked()) |
1046 | - { |
1047 | - definition.append(ui->timeEditDstStart->time().toString("'/'hh:mm:ss")); |
1048 | - } |
1049 | - |
1050 | - if (ui->radioButtonDstEndDate->isChecked()) |
1051 | - { |
1052 | - const int month = ui->comboBoxDstEndDateMonth->currentIndex() + 1; |
1053 | - const int day = ui->spinBoxDstEndDateDay->value(); |
1054 | - QDate endDate; |
1055 | - if (month == 2 && day == 29) |
1056 | - { |
1057 | - //Leap year: day is indexed between 0 and 365 |
1058 | - endDate.setDate(2000, month, day); |
1059 | - definition.append(QString(",%1").arg(endDate.dayOfYear() - 1)); |
1060 | - } |
1061 | - else |
1062 | - { |
1063 | - endDate.setDate(2010, month, day); |
1064 | - definition.append(QString(",J%1").arg(endDate.dayOfYear())); |
1065 | - } |
1066 | - } |
1067 | - else //Day of week |
1068 | - { |
1069 | - //Day of the week: 0-6, 0 is Sunday |
1070 | - int day = ui->comboBoxDstEndDay->currentIndex(); |
1071 | - //Week ordinal number: 1-5, 5 is "last" |
1072 | - int week = ui->comboBoxDstEndWeek->currentIndex() + 1; |
1073 | - //Month: 1-12 |
1074 | - int month = ui->comboBoxDstEndMonth->currentIndex() + 1; |
1075 | - |
1076 | - definition.append(QString(",M%1.%2.%3").arg(month).arg(week).arg(day)); |
1077 | - } |
1078 | - |
1079 | - if (ui->checkBoxDstEndTime->isChecked()) |
1080 | - { |
1081 | - definition.append(ui->timeEditDstEnd->time().toString("'/'hh:mm:ss")); |
1082 | - } |
1083 | - } |
1084 | - } |
1085 | - |
1086 | - emit timeZoneDefined(definition); |
1087 | - close(); |
1088 | -} |
1089 | - |
1090 | -void DefineTimeZoneWindow::updateDstOffset(double normalOffset) |
1091 | -{ |
1092 | - if (ui->checkBoxOffsetDst->isChecked()) |
1093 | - return; |
1094 | - |
1095 | - //By default, the DST offset is +1 hour the normal offset |
1096 | - ui->doubleSpinBoxOffsetDst->setValue(normalOffset + 1.0); |
1097 | -} |
1098 | - |
1099 | -void DefineTimeZoneWindow::resetWindowState() |
1100 | -{ |
1101 | - populateDateLists(); |
1102 | - |
1103 | - //Default section |
1104 | - ui->lineEditName->clear(); |
1105 | - ui->lineEditNameDst->clear(); |
1106 | - |
1107 | - ui->doubleSpinBoxOffset->setValue(0.0); |
1108 | - //(indirectly sets doubleSpinBoxOffsetDst) |
1109 | - |
1110 | - ui->checkBoxDst->setChecked(false); |
1111 | - ui->frameDst->setVisible(false); |
1112 | - |
1113 | - ui->checkBoxOffsetDst->setChecked(false); |
1114 | - ui->doubleSpinBoxOffsetDst->setEnabled(false); |
1115 | - |
1116 | - ui->groupBoxDstStart->setChecked(false); |
1117 | - //(indirectly sets the other one) |
1118 | - |
1119 | - ui->radioButtonDstStartDay->setChecked(true); |
1120 | - ui->radioButtonDstEndDay->setChecked(true); |
1121 | - |
1122 | - ui->spinBoxDstStartDateDay->setValue(1); |
1123 | - ui->spinBoxDstEndDateDay->setValue(1); |
1124 | - ui->comboBoxDstStartDateMonth->setCurrentIndex(0); |
1125 | - ui->comboBoxDstEndDateMonth->setCurrentIndex(0); |
1126 | - |
1127 | - ui->checkBoxDstStartTime->setChecked(false); |
1128 | - ui->timeEditDstStart->setEnabled(false); |
1129 | - ui->timeEditDstStart->setTime(QTime(2, 0, 0, 0)); |
1130 | - ui->checkBoxDstEndTime->setChecked(false); |
1131 | - ui->timeEditDstEnd->setEnabled(false); |
1132 | - ui->timeEditDstEnd->setTime(QTime(2, 0, 0, 0)); |
1133 | -} |
1134 | - |
1135 | -void DefineTimeZoneWindow::populateDateLists() |
1136 | -{ |
1137 | - QStringList monthList; |
1138 | - monthList.append(q_("January")); |
1139 | - monthList.append(q_("February")); |
1140 | - monthList.append(q_("March")); |
1141 | - monthList.append(q_("April")); |
1142 | - monthList.append(q_("May")); |
1143 | - monthList.append(q_("June")); |
1144 | - monthList.append(q_("July")); |
1145 | - monthList.append(q_("August")); |
1146 | - monthList.append(q_("September")); |
1147 | - monthList.append(q_("October")); |
1148 | - monthList.append(q_("November")); |
1149 | - monthList.append(q_("December")); |
1150 | - |
1151 | - ui->comboBoxDstStartMonth->clear(); |
1152 | - ui->comboBoxDstStartMonth->addItems(monthList); |
1153 | - ui->comboBoxDstEndMonth->clear(); |
1154 | - ui->comboBoxDstEndMonth->addItems(monthList); |
1155 | - ui->comboBoxDstStartDateMonth->clear(); |
1156 | - ui->comboBoxDstStartDateMonth->addItems(monthList); |
1157 | - ui->comboBoxDstEndDateMonth->clear(); |
1158 | - ui->comboBoxDstEndDateMonth->addItems(monthList); |
1159 | - |
1160 | - QStringList weekList; |
1161 | - weekList.append(q_("First week")); |
1162 | - weekList.append(q_("Second week")); |
1163 | - weekList.append(q_("Third week")); |
1164 | - weekList.append(q_("Fourth week")); |
1165 | - weekList.append(q_("Last week")); |
1166 | - |
1167 | - ui->comboBoxDstStartWeek->clear(); |
1168 | - ui->comboBoxDstStartWeek->addItems(weekList); |
1169 | - ui->comboBoxDstEndWeek->clear(); |
1170 | - ui->comboBoxDstEndWeek->addItems(weekList); |
1171 | - |
1172 | - //Starts from Sunday deliberately |
1173 | - QStringList dayList; |
1174 | - dayList.append(q_("Sunday")); |
1175 | - dayList.append(q_("Monday")); |
1176 | - dayList.append(q_("Tuesday")); |
1177 | - dayList.append(q_("Wednesday")); |
1178 | - dayList.append(q_("Thursday")); |
1179 | - dayList.append(q_("Friday")); |
1180 | - dayList.append(q_("Saturday")); |
1181 | - |
1182 | - ui->comboBoxDstStartDay->clear(); |
1183 | - ui->comboBoxDstStartDay->addItems(dayList); |
1184 | - ui->comboBoxDstEndDay->clear(); |
1185 | - ui->comboBoxDstEndDay->addItems(dayList); |
1186 | -} |
1187 | -void DefineTimeZoneWindow::updateDayNumberMaximum(int monthIndex, QSpinBox *spinBoxDay) |
1188 | -{ |
1189 | - int maximum = 31; |
1190 | - switch (monthIndex) |
1191 | - { |
1192 | - case 0: //January |
1193 | - case 2: //March |
1194 | - case 4: //May |
1195 | - case 6: //July |
1196 | - case 7: //August |
1197 | - case 9: //October |
1198 | - case 11: //December |
1199 | - maximum = 31; |
1200 | - break; |
1201 | - case 3: //April |
1202 | - case 5: //June |
1203 | - case 8: //September |
1204 | - case 10: //November |
1205 | - maximum = 30; |
1206 | - break; |
1207 | - case 1: //February |
1208 | - maximum = 29; |
1209 | - break; |
1210 | - default: |
1211 | - ;// |
1212 | - } |
1213 | - |
1214 | - if (spinBoxDay->value() > maximum) |
1215 | - spinBoxDay->setValue(maximum); |
1216 | - spinBoxDay->setRange(1, maximum); |
1217 | -} |
1218 | - |
1219 | -void DefineTimeZoneWindow::updateDayNumberMaximumDstStart(int monthIndex) |
1220 | -{ |
1221 | - updateDayNumberMaximum(monthIndex, ui->spinBoxDstStartDateDay); |
1222 | -} |
1223 | - |
1224 | -void DefineTimeZoneWindow::updateDayNumberMaximumDstEnd(int monthIndex) |
1225 | -{ |
1226 | - updateDayNumberMaximum(monthIndex, ui->spinBoxDstEndDateDay); |
1227 | -} |
1228 | - |
1229 | -bool DefineTimeZoneWindow::readDstEndpoint(const QString& string, |
1230 | - DstEndpoint endpoint) |
1231 | -{ |
1232 | - QGroupBox* groupBox = 0; |
1233 | - QRadioButton* radioButtonDay = 0; |
1234 | - QRadioButton* radioButtonDate = 0; |
1235 | - QCheckBox* checkBoxTime = 0; |
1236 | - QComboBox* comboBoxWeek = 0; |
1237 | - QComboBox* comboBoxMonth = 0; |
1238 | - QComboBox* comboBoxDay = 0; |
1239 | - QTimeEdit* timeEdit = 0; |
1240 | - |
1241 | - if (endpoint == DstStart) |
1242 | - { |
1243 | - groupBox = ui->groupBoxDstStart; |
1244 | - radioButtonDay = ui->radioButtonDstStartDay; |
1245 | - radioButtonDate = ui->radioButtonDstStartDate; |
1246 | - checkBoxTime = ui->checkBoxDstStartTime; |
1247 | - comboBoxWeek = ui->comboBoxDstStartWeek; |
1248 | - comboBoxMonth = ui->comboBoxDstStartMonth; |
1249 | - comboBoxDay = ui->comboBoxDstStartDay; |
1250 | - timeEdit = ui->timeEditDstStart; |
1251 | - } |
1252 | - else |
1253 | - { |
1254 | - groupBox = ui->groupBoxDstEnd; |
1255 | - radioButtonDay = ui->radioButtonDstEndDay; |
1256 | - radioButtonDate = ui->radioButtonDstEndDate; |
1257 | - checkBoxTime = ui->checkBoxDstEndTime; |
1258 | - comboBoxWeek = ui->comboBoxDstEndWeek; |
1259 | - comboBoxMonth = ui->comboBoxDstEndMonth; |
1260 | - comboBoxDay = ui->comboBoxDstEndDay; |
1261 | - timeEdit = ui->timeEditDstEnd; |
1262 | - } |
1263 | - |
1264 | - QRegExp endPointFormat("(J\\d{1,3}|\\d{1,3}|M\\d{1,2}\\.\\d\\.\\d)(?:\\/(\\d{1,2}(?:\\:(?:\\d{1,2})(?:\\:(?:\\d{1,2}))?)?))?"); |
1265 | - if (!endPointFormat.exactMatch(string)) |
1266 | - return false; |
1267 | - |
1268 | - if (endPointFormat.captureCount() == 2) |
1269 | - { |
1270 | - QString timeString = endPointFormat.cap(2).trimmed(); |
1271 | - if (!timeString.isEmpty()) |
1272 | - { |
1273 | - int hours, minutes, seconds; |
1274 | - TimeZoneConfigurationWindow::readTzTimeString(timeString, |
1275 | - hours, |
1276 | - minutes, |
1277 | - seconds); |
1278 | - QTime time(hours, minutes, seconds); |
1279 | - if (time.isValid()) |
1280 | - { |
1281 | - checkBoxTime->setChecked(true); |
1282 | - timeEdit->setTime(time); |
1283 | - } |
1284 | - else |
1285 | - return false; |
1286 | - } |
1287 | - } |
1288 | - |
1289 | - QString date = endPointFormat.cap(1); |
1290 | - if (date.startsWith('J')) |
1291 | - { |
1292 | - int julianDay = date.mid(1).toInt(); |
1293 | - if (julianDay < 1 || julianDay > 365) |
1294 | - return false; |
1295 | - |
1296 | - radioButtonDate->setChecked(true); |
1297 | - setEndPointDate(julianDay, false, endpoint); |
1298 | - } |
1299 | - else if (date.startsWith('M')) |
1300 | - { |
1301 | - QStringList list = date.mid(1).split('.'); |
1302 | - if (list.count() != 3) |
1303 | - return false; |
1304 | - |
1305 | - int month = list[0].toInt(); |
1306 | - if (month < 1 || month > 12) |
1307 | - return false; |
1308 | - int week = list[1].toInt(); |
1309 | - if (week < 1 || week > 5) |
1310 | - return false; |
1311 | - int day = list[2].toInt(); |
1312 | - if (day < 0 || day > 6) |
1313 | - return false; |
1314 | - |
1315 | - radioButtonDay->setChecked(true); |
1316 | - comboBoxMonth->setCurrentIndex(month - 1); |
1317 | - comboBoxWeek->setCurrentIndex(week - 1); |
1318 | - comboBoxDay->setCurrentIndex(day); |
1319 | - } |
1320 | - else |
1321 | - { |
1322 | - int julianDay = date.toInt(); |
1323 | - if (julianDay < 0 || julianDay > 365) |
1324 | - return false; |
1325 | - |
1326 | - radioButtonDate->setChecked(true); |
1327 | - setEndPointDate(julianDay+1, true, endpoint); |
1328 | - } |
1329 | - |
1330 | - groupBox->setChecked(true); |
1331 | - return true; |
1332 | -} |
1333 | - |
1334 | -void DefineTimeZoneWindow::setEndPointDate(int ordinalDate, |
1335 | - bool leapYear, |
1336 | - DstEndpoint endpoint) |
1337 | -{ |
1338 | - QSpinBox* spinBoxDateDay = 0; |
1339 | - QComboBox* comboBoxDateMonth = 0; |
1340 | - if (endpoint == DstStart) |
1341 | - { |
1342 | - spinBoxDateDay = ui->spinBoxDstStartDateDay; |
1343 | - comboBoxDateMonth = ui->comboBoxDstStartDateMonth; |
1344 | - } |
1345 | - else |
1346 | - { |
1347 | - spinBoxDateDay = ui->spinBoxDstEndDateDay; |
1348 | - comboBoxDateMonth = ui->comboBoxDstEndDateMonth; |
1349 | - } |
1350 | - |
1351 | - int monthLength[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; |
1352 | - if (leapYear) |
1353 | - monthLength[1] = 29; |
1354 | - for (int i = 0; i < 12; i++) |
1355 | - { |
1356 | - if (ordinalDate <= monthLength[i]) |
1357 | - { |
1358 | - spinBoxDateDay->setValue(ordinalDate); |
1359 | - comboBoxDateMonth->setCurrentIndex(i); |
1360 | - break; |
1361 | - } |
1362 | - else |
1363 | - { |
1364 | - ordinalDate -= monthLength[i]; |
1365 | - } |
1366 | - } |
1367 | -} |
1368 | - |
1369 | -void DefineTimeZoneWindow::setTimeZone(QString tzString) |
1370 | -{ |
1371 | - if (dialog == NULL) //As initialized in StelDialog |
1372 | - return; |
1373 | - |
1374 | - if (tzString.isEmpty()) |
1375 | - return; |
1376 | - |
1377 | - //TZ variable format: |
1378 | - // - name |
1379 | - // - signed offset |
1380 | - // The following is optional: |
1381 | - // - DST name |
1382 | - // - DST signed offset |
1383 | - // - DST beginning |
1384 | - // - DST end |
1385 | - QRegExp tzFormat("^([^:\\d,+-/]{3,})([+-]?[\\d:]+)(?:([^:\\d,+-/]{3,})((?:[+-]?[\\d:]+)?),([JM\\d\\./:]+),([JM\\d\\./:]+))?$"); |
1386 | - if (!tzFormat.exactMatch(tzString)) |
1387 | - return; |
1388 | - |
1389 | - double offset = TimeZoneConfigurationWindow::readTzOffsetString(tzFormat.cap(2)); |
1390 | - if (fabs(offset) >= 24) |
1391 | - return; |
1392 | - |
1393 | - QString name = tzFormat.cap(1).trimmed(); |
1394 | - if (name.isEmpty()) |
1395 | - return; |
1396 | - |
1397 | - ui->lineEditName->setText(name); |
1398 | - ui->doubleSpinBoxOffset->setValue(offset); |
1399 | - |
1400 | - //TODO: Clean this up. The offset and the end point are not obligatory? |
1401 | - int count = tzFormat.captureCount(); |
1402 | - if (count > 2) |
1403 | - { |
1404 | - QString dstName = tzFormat.cap(3).trimmed(); |
1405 | - if (dstName.isEmpty()) |
1406 | - return; |
1407 | - QString dstOffsetString = tzFormat.cap(4).trimmed(); |
1408 | - if (!dstOffsetString.isEmpty()) |
1409 | - { |
1410 | - double dstOffset = TimeZoneConfigurationWindow::readTzOffsetString(dstOffsetString); |
1411 | - if (fabs(dstOffset) >= 24) |
1412 | - return; |
1413 | - |
1414 | - ui->checkBoxOffsetDst->setChecked(true); |
1415 | - ui->doubleSpinBoxOffsetDst->setValue(dstOffset); |
1416 | - } |
1417 | - else |
1418 | - { |
1419 | - ui->checkBoxOffsetDst->setChecked(false); |
1420 | - ui->doubleSpinBoxOffsetDst->setValue(offset + 1); |
1421 | - } |
1422 | - |
1423 | - QString dstStartString = tzFormat.cap(5).trimmed(); |
1424 | - if (!readDstEndpoint(dstStartString, DstStart)) |
1425 | - return; |
1426 | - QString dstEndString = tzFormat.cap(6).trimmed(); |
1427 | - if (!readDstEndpoint(dstEndString, DstEnd)) |
1428 | - return; |
1429 | - |
1430 | - ui->checkBoxDst->setChecked(true); |
1431 | - ui->lineEditNameDst->setText(dstName); |
1432 | - } |
1433 | - |
1434 | - |
1435 | -} |
1436 | |
1437 | === removed file 'plugins/TimeZoneConfiguration/src/gui/DefineTimeZoneWindow.hpp' |
1438 | --- plugins/TimeZoneConfiguration/src/gui/DefineTimeZoneWindow.hpp 2012-02-13 18:59:16 +0000 |
1439 | +++ plugins/TimeZoneConfiguration/src/gui/DefineTimeZoneWindow.hpp 1970-01-01 00:00:00 +0000 |
1440 | @@ -1,73 +0,0 @@ |
1441 | -/* |
1442 | - * Time zone configuration plug-in for Stellarium |
1443 | - * |
1444 | - * Copyright (C) 2010 Bogdan Marinov |
1445 | - * |
1446 | - * This program is free software; you can redistribute it and/or |
1447 | - * modify it under the terms of the GNU General Public License |
1448 | - * as published by the Free Software Foundation; either version 2 |
1449 | - * of the License, or (at your option) any later version. |
1450 | - * |
1451 | - * This program is distributed in the hope that it will be useful, |
1452 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1453 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1454 | - * GNU General Public License for more details. |
1455 | - * |
1456 | - * You should have received a copy of the GNU General Public License |
1457 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1458 | - */ |
1459 | - |
1460 | -#ifndef _DEFINE_TIME_ZONE_HPP_ |
1461 | -#define _DEFINE_TIME_ZONE_HPP_ |
1462 | - |
1463 | -#include "StelDialog.hpp" |
1464 | - |
1465 | -class Ui_defineTimeZoneForm; |
1466 | -class QRegExpValidator; |
1467 | -class QSpinBox; |
1468 | - |
1469 | -class DefineTimeZoneWindow : public StelDialog |
1470 | -{ |
1471 | - Q_OBJECT |
1472 | - |
1473 | -public: |
1474 | - DefineTimeZoneWindow(); |
1475 | - ~DefineTimeZoneWindow(); |
1476 | - |
1477 | - //! Fills the fields of the form with the time zone described in the string. |
1478 | - //! Call after createDialogContent() or setVisible() to avoid a crash. |
1479 | - void setTimeZone(QString timeZoneString); |
1480 | - |
1481 | -public slots: |
1482 | - void retranslate(); |
1483 | - |
1484 | -signals: |
1485 | - void timeZoneDefined(QString timeZoneString); |
1486 | - |
1487 | -protected: |
1488 | - void createDialogContent(); |
1489 | - |
1490 | -private: |
1491 | - Ui_defineTimeZoneForm * ui; |
1492 | - |
1493 | - QRegExpValidator * timeZoneNameValidator; |
1494 | - |
1495 | - void resetWindowState(); |
1496 | - void populateDateLists(); |
1497 | - |
1498 | - void updateDayNumberMaximum(int monthIndex, QSpinBox * spinBoxDay); |
1499 | - |
1500 | - enum DstEndpoint {DstStart, DstEnd}; |
1501 | - //! \returns false if #string is not a valid TZ DST end point description. |
1502 | - bool readDstEndpoint(const QString& string, DstEndpoint endpoint); |
1503 | - void setEndPointDate(int ordinalDate, bool leapYear, DstEndpoint endpoint); |
1504 | - |
1505 | -private slots: |
1506 | - void useDefinition(); |
1507 | - void updateDstOffset(double normalOffset); |
1508 | - void updateDayNumberMaximumDstStart(int monthIndex); |
1509 | - void updateDayNumberMaximumDstEnd(int monthIndex); |
1510 | -}; |
1511 | - |
1512 | - |
1513 | -#endif //_DEFINE_TIME_ZONE_HPP_ |
1514 | |
1515 | === removed file 'plugins/TimeZoneConfiguration/src/gui/TimeZoneConfigurationWindow.cpp' |
1516 | --- plugins/TimeZoneConfiguration/src/gui/TimeZoneConfigurationWindow.cpp 2016-01-22 11:05:08 +0000 |
1517 | +++ plugins/TimeZoneConfiguration/src/gui/TimeZoneConfigurationWindow.cpp 1970-01-01 00:00:00 +0000 |
1518 | @@ -1,285 +0,0 @@ |
1519 | -/* |
1520 | - * Time zone configuration plug-in for Stellarium |
1521 | - * |
1522 | - * Copyright (C) 2010 Bogdan Marinov |
1523 | - * |
1524 | - * This program is free software; you can redistribute it and/or |
1525 | - * modify it under the terms of the GNU General Public License |
1526 | - * as published by the Free Software Foundation; either version 2 |
1527 | - * of the License, or (at your option) any later version. |
1528 | - * |
1529 | - * This program is distributed in the hope that it will be useful, |
1530 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1531 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1532 | - * GNU General Public License for more details. |
1533 | - * |
1534 | - * You should have received a copy of the GNU General Public License |
1535 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1536 | - */ |
1537 | - |
1538 | -#include "TimeZoneConfiguration.hpp" |
1539 | -#include "TimeZoneConfigurationWindow.hpp" |
1540 | -#include "DefineTimeZoneWindow.hpp" |
1541 | -#include "ui_timeZoneConfigurationWindow.h" |
1542 | - |
1543 | -#include "StelApp.hpp" |
1544 | -#include "StelLocaleMgr.hpp" |
1545 | -#include "StelModuleMgr.hpp" |
1546 | - |
1547 | -TimeZoneConfigurationWindow::TimeZoneConfigurationWindow() |
1548 | -{ |
1549 | - ui = new Ui_timeZoneConfigurationWindowForm(); |
1550 | - dialogName = "TimeZoneConfiguration"; |
1551 | - timeZoneConfiguration = GETSTELMODULE(TimeZoneConfiguration); |
1552 | - defineTimeZoneWindow = NULL; |
1553 | -} |
1554 | - |
1555 | -TimeZoneConfigurationWindow::~TimeZoneConfigurationWindow() |
1556 | -{ |
1557 | - delete ui; |
1558 | - if (defineTimeZoneWindow) |
1559 | - delete defineTimeZoneWindow; |
1560 | -} |
1561 | - |
1562 | -void TimeZoneConfigurationWindow::retranslate() |
1563 | -{ |
1564 | - if (dialog) |
1565 | - { |
1566 | - ui->retranslateUi(dialog); |
1567 | - updateAboutText(); |
1568 | - } |
1569 | -} |
1570 | - |
1571 | -void TimeZoneConfigurationWindow::createDialogContent() |
1572 | -{ |
1573 | - ui->setupUi(dialog); |
1574 | - |
1575 | - connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); |
1576 | - connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); |
1577 | - connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint))); |
1578 | - connect(ui->pushButtonSave, SIGNAL(clicked()), this, SLOT(saveTimeZoneSettings())); |
1579 | - connect(ui->pushButtonEditTimeZone, SIGNAL(clicked()), this, SLOT(openDefineTimeZoneWindow())); |
1580 | - |
1581 | - connect(ui->radioButtonTimeDefault, SIGNAL(toggled(bool)), this, SLOT(setTimeFormat(bool))); |
1582 | - connect(ui->radioButtonTime12Hour, SIGNAL(toggled(bool)), this, SLOT(setTimeFormat(bool))); |
1583 | - connect(ui->radioButtonTime24Hour, SIGNAL(toggled(bool)), this, SLOT(setTimeFormat(bool))); |
1584 | - |
1585 | - connect(ui->radioButtonDateDefault, SIGNAL(toggled(bool)), this, SLOT(setDateFormat(bool))); |
1586 | - connect(ui->radioButtonDateDMY, SIGNAL(toggled(bool)), this, SLOT(setDateFormat(bool))); |
1587 | - connect(ui->radioButtonDateMDY, SIGNAL(toggled(bool)), this, SLOT(setDateFormat(bool))); |
1588 | - connect(ui->radioButtonDateYMD, SIGNAL(toggled(bool)), this, SLOT(setDateFormat(bool))); |
1589 | - |
1590 | - updateDisplayFormatSwitches(); |
1591 | - |
1592 | - QString currentTimeZoneString = timeZoneConfiguration->readTimeZone(); |
1593 | - //ui->lineEditCurrent->setText(currentTimeZoneString); |
1594 | - ui->lineEditUserDefined->setText(currentTimeZoneString); |
1595 | - ui->frameUserDefined->setEnabled(false); |
1596 | - |
1597 | - if (currentTimeZoneString.startsWith("SCT")) |
1598 | - { |
1599 | - if (currentTimeZoneString == "SCT+0") |
1600 | - { |
1601 | - ui->radioButtonUtc->setChecked(true); |
1602 | - } |
1603 | - else |
1604 | - { |
1605 | - ui->radioButtonOffset->setChecked(true); |
1606 | - double offset = readTzOffsetString(currentTimeZoneString.mid(3)); |
1607 | - ui->doubleSpinBoxOffset->setValue(offset); |
1608 | - } |
1609 | - } |
1610 | - else if (currentTimeZoneString == "system_default") |
1611 | - { |
1612 | - ui->radioButtonLocalSettings->setChecked(true); |
1613 | - } |
1614 | - else |
1615 | - { |
1616 | - ui->radioButtonUserDefined->setChecked(true); |
1617 | - } |
1618 | - |
1619 | - updateAboutText(); |
1620 | -} |
1621 | - |
1622 | -void TimeZoneConfigurationWindow::updateAboutText() |
1623 | -{ |
1624 | - ui->labelTitle->setText(q_("Time Zone plug-in")); |
1625 | - QString version = QString(q_("Version %1")).arg(TIME_ZONE_CONFIGURATION_VERSION); |
1626 | - ui->labelVersion->setText(version); |
1627 | -} |
1628 | - |
1629 | -void TimeZoneConfigurationWindow::saveTimeZoneSettings() |
1630 | -{ |
1631 | - QString timeZoneString; |
1632 | - if (ui->radioButtonUtc->isChecked()) |
1633 | - { |
1634 | - timeZoneString = "SCT+0";//"Stellarium Custom Time" :) |
1635 | - } |
1636 | - else if (ui->radioButtonOffset->isChecked()) |
1637 | - { |
1638 | - timeZoneString = QString("SCT").append(getTzOffsetStringFrom(ui->doubleSpinBoxOffset)); |
1639 | - } |
1640 | - else if (ui->radioButtonUserDefined->isChecked()) |
1641 | - { |
1642 | - timeZoneString = ui->lineEditUserDefined->text(); |
1643 | - } |
1644 | - else |
1645 | - { |
1646 | - timeZoneString = "system_default"; |
1647 | - } |
1648 | - |
1649 | - timeZoneConfiguration->setTimeZone(timeZoneString); |
1650 | -} |
1651 | - |
1652 | -void TimeZoneConfigurationWindow::openDefineTimeZoneWindow() |
1653 | -{ |
1654 | - dialog->setEnabled(false); |
1655 | - |
1656 | - if (defineTimeZoneWindow == NULL) |
1657 | - { |
1658 | - defineTimeZoneWindow = new DefineTimeZoneWindow(); |
1659 | - connect(defineTimeZoneWindow, SIGNAL(timeZoneDefined(QString)), this, SLOT(timeZoneDefined(QString))); |
1660 | - connect(defineTimeZoneWindow, SIGNAL(visibleChanged(bool)), this, SLOT(closeDefineTimeZoneWindow(bool))); |
1661 | - } |
1662 | - |
1663 | - defineTimeZoneWindow->setVisible(true); |
1664 | - defineTimeZoneWindow->setTimeZone(ui->lineEditUserDefined->text()); |
1665 | -} |
1666 | - |
1667 | -void TimeZoneConfigurationWindow::closeDefineTimeZoneWindow(bool show) |
1668 | -{ |
1669 | - if (show) |
1670 | - return; |
1671 | - |
1672 | - disconnect(defineTimeZoneWindow, SIGNAL(timeZoneDefined(QString)), this, SLOT(timeZoneDefined(QString))); |
1673 | - disconnect(defineTimeZoneWindow, SIGNAL(visibleChanged(bool)), this, SLOT(closeDefineTimeZoneWindow(bool))); |
1674 | - delete defineTimeZoneWindow; |
1675 | - defineTimeZoneWindow = NULL; |
1676 | - |
1677 | - dialog->setEnabled(true); |
1678 | -} |
1679 | - |
1680 | -void TimeZoneConfigurationWindow::timeZoneDefined(QString timeZoneDefinition) |
1681 | -{ |
1682 | - ui->lineEditUserDefined->setText(timeZoneDefinition); |
1683 | -} |
1684 | - |
1685 | -double TimeZoneConfigurationWindow::readTzOffsetString(const QString& string) |
1686 | -{ |
1687 | - const QChar signChar = string.at(0); |
1688 | - //Offset is POSIX style: UTF - local time = offset, |
1689 | - //so invert the sign: |
1690 | - const int sign = (signChar == '-') ? 1 : -1; |
1691 | - int hours, minutes, seconds; |
1692 | - readTzTimeString((signChar.isDigit()) ? string : string.mid(1), |
1693 | - hours, minutes, seconds); |
1694 | - const double offset = sign * (hours + floor(((minutes * 60 + seconds)/3600.0) * 100) / 100.0);//Round to the second digit |
1695 | - return offset; |
1696 | -} |
1697 | - |
1698 | -void TimeZoneConfigurationWindow::readTzTimeString(const QString& string, |
1699 | - int& hours, |
1700 | - int& minutes, |
1701 | - int& seconds) |
1702 | -{ |
1703 | - hours = 0; |
1704 | - minutes = 0; |
1705 | - seconds = 0; |
1706 | - |
1707 | - QRegExp tzTimeFormat("(\\d{1,2})(?:\\:(\\d{1,2})(?:\\:(\\d{1,2}))?)?"); |
1708 | - if (!tzTimeFormat.exactMatch(string)) |
1709 | - return; |
1710 | - |
1711 | - int count = tzTimeFormat.captureCount(); |
1712 | - switch (count) |
1713 | - { |
1714 | - case 3: |
1715 | - seconds = tzTimeFormat.cap(3).toInt(); |
1716 | - //Fallthrough! |
1717 | - case 2: |
1718 | - minutes = tzTimeFormat.cap(2).toInt(); |
1719 | - //Fallthrough! |
1720 | - case 1: |
1721 | - default: |
1722 | - hours = tzTimeFormat.cap(1).toInt(); |
1723 | - } |
1724 | -} |
1725 | - |
1726 | -QString TimeZoneConfigurationWindow::getTzOffsetStringFrom(QDoubleSpinBox * spinBox) |
1727 | -{ |
1728 | - Q_ASSERT(spinBox); |
1729 | - |
1730 | - int offset = spinBox->value() * 3600; |
1731 | - //Offset is POSIX style: UTC - local time = offset, |
1732 | - //so invert the sign: |
1733 | - QChar offsetSign = (offset > 0) ? '-' : '+'; |
1734 | - offset = abs(offset); |
1735 | - int offsetSeconds = offset % 60; offset /= 60.; |
1736 | - int offsetMinutes = offset % 60; offset /= 60.; |
1737 | - int offsetHours = offset; |
1738 | - |
1739 | - return QString("%1%2:%3:%4").arg(offsetSign).arg(offsetHours, 2, 10, QChar('0')).arg(offsetMinutes, 2, 10, QChar('0')).arg(offsetSeconds, 2, 10, QChar('0')); |
1740 | -} |
1741 | - |
1742 | -void TimeZoneConfigurationWindow::updateDisplayFormatSwitches() |
1743 | -{ |
1744 | - StelLocaleMgr & localeManager = StelApp::getInstance().getLocaleMgr(); |
1745 | - |
1746 | - QString timeFormat = localeManager.getTimeFormatStr(); |
1747 | - if (timeFormat == "12h") |
1748 | - ui->radioButtonTime12Hour->setChecked(true); |
1749 | - else if (timeFormat == "24h") |
1750 | - ui->radioButtonTime24Hour->setChecked(true); |
1751 | - else |
1752 | - ui->radioButtonTimeDefault->setChecked(true); |
1753 | - |
1754 | - QString dateFormat = localeManager.getDateFormatStr(); |
1755 | - if (dateFormat == "yyyymmdd") |
1756 | - ui->radioButtonDateYMD->setChecked(true); |
1757 | - else if (dateFormat == "ddmmyyyy") |
1758 | - ui->radioButtonDateDMY->setChecked(true); |
1759 | - else if (dateFormat == "mmddyyyy") |
1760 | - ui->radioButtonDateMDY->setChecked(true); |
1761 | - else |
1762 | - ui->radioButtonDateDefault->setChecked(true); |
1763 | -} |
1764 | - |
1765 | -void TimeZoneConfigurationWindow::setTimeFormat(bool) |
1766 | -{ |
1767 | - //TODO: This will break if the settings' format is changed. |
1768 | - //It's a pity StelLocaleMgr::sTimeFormatToString() is private... |
1769 | - QString selectedFormat; |
1770 | - if (ui->radioButtonTime12Hour->isChecked()) |
1771 | - selectedFormat = "12h"; |
1772 | - else if (ui->radioButtonTime24Hour->isChecked()) |
1773 | - selectedFormat = "24h"; |
1774 | - else |
1775 | - selectedFormat = "system_default"; |
1776 | - |
1777 | - StelLocaleMgr & localeManager = StelApp::getInstance().getLocaleMgr(); |
1778 | - if (selectedFormat == localeManager.getTimeFormatStr()) |
1779 | - return; |
1780 | - localeManager.setTimeFormatStr(selectedFormat); |
1781 | - timeZoneConfiguration->saveDisplayFormats(); |
1782 | -} |
1783 | - |
1784 | -void TimeZoneConfigurationWindow::setDateFormat(bool) |
1785 | -{ |
1786 | - //TODO: This will break if the settings' format is changed. |
1787 | - //It's a pity StelLocaleMgr::sDateFormatToString() is private... |
1788 | - QString selectedFormat; |
1789 | - if (ui->radioButtonDateYMD->isChecked()) |
1790 | - selectedFormat = "yyyymmdd"; |
1791 | - else if (ui->radioButtonDateDMY->isChecked()) |
1792 | - selectedFormat = "ddmmyyyy"; |
1793 | - else if (ui->radioButtonDateMDY->isChecked()) |
1794 | - selectedFormat = "mmddyyyy"; |
1795 | - else |
1796 | - selectedFormat = "system_default"; |
1797 | - |
1798 | - StelLocaleMgr & localeManager = StelApp::getInstance().getLocaleMgr(); |
1799 | - if (selectedFormat == localeManager.getDateFormatStr()) |
1800 | - return; |
1801 | - localeManager.setDateFormatStr(selectedFormat); |
1802 | - timeZoneConfiguration->saveDisplayFormats(); |
1803 | -} |
1804 | |
1805 | === removed file 'plugins/TimeZoneConfiguration/src/gui/TimeZoneConfigurationWindow.hpp' |
1806 | --- plugins/TimeZoneConfiguration/src/gui/TimeZoneConfigurationWindow.hpp 2012-02-13 18:59:16 +0000 |
1807 | +++ plugins/TimeZoneConfiguration/src/gui/TimeZoneConfigurationWindow.hpp 1970-01-01 00:00:00 +0000 |
1808 | @@ -1,82 +0,0 @@ |
1809 | -/* |
1810 | - * Time zone configuration plug-in for Stellarium |
1811 | - * |
1812 | - * Copyright (C) 2010 Bogdan Marinov |
1813 | - * |
1814 | - * This program is free software; you can redistribute it and/or |
1815 | - * modify it under the terms of the GNU General Public License |
1816 | - * as published by the Free Software Foundation; either version 2 |
1817 | - * of the License, or (at your option) any later version. |
1818 | - * |
1819 | - * This program is distributed in the hope that it will be useful, |
1820 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1821 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1822 | - * GNU General Public License for more details. |
1823 | - * |
1824 | - * You should have received a copy of the GNU General Public License |
1825 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1826 | - */ |
1827 | - |
1828 | -#ifndef _TIME_ZONE_CONFIGURATION_WINDOW_HPP_ |
1829 | -#define _TIME_ZONE_CONFIGURATION_WINDOW_HPP_ |
1830 | - |
1831 | -#include "StelDialog.hpp" |
1832 | - |
1833 | -#include <QString> |
1834 | -#include <QDoubleSpinBox> |
1835 | - |
1836 | -class Ui_timeZoneConfigurationWindowForm; |
1837 | -class TimeZoneConfiguration; |
1838 | -class DefineTimeZoneWindow; |
1839 | - |
1840 | -//! Main window of the Time Zone configuration plug-in. |
1841 | -class TimeZoneConfigurationWindow : public StelDialog |
1842 | -{ |
1843 | - Q_OBJECT |
1844 | - |
1845 | -public: |
1846 | - TimeZoneConfigurationWindow(); |
1847 | - ~TimeZoneConfigurationWindow(); |
1848 | - |
1849 | - //! Parses an offset string in the format [+|-]hh[:mm[:ss]]. |
1850 | - //! \returns a fraction of hours. The sign is inverted, |
1851 | - //! as in the TZ format offset = (UTC - local time), |
1852 | - //! and the traditional offset = (local time - UTC). |
1853 | - static double readTzOffsetString(const QString& string); |
1854 | - |
1855 | - //! Parses a time string in the format hh[:mm[:ss]] to separate values. |
1856 | - //! Used both by readTzOffsetString() and in DefineTimeZoneWindow. |
1857 | - static void readTzTimeString(const QString& string, int& hour, int& minutes, int& seconds); |
1858 | - |
1859 | - //! Converts a decimal fraction of hours to a string containing a signed |
1860 | - //! offset in the format used in the TZ variable. |
1861 | - //! The sign is inverted, as in the TZ format offset = (UTC - local time), |
1862 | - //! not the traditional offset = (local time - UTC). |
1863 | - static QString getTzOffsetStringFrom(QDoubleSpinBox * spinBox); |
1864 | - |
1865 | -public slots: |
1866 | - void retranslate(); |
1867 | - |
1868 | -protected: |
1869 | - void createDialogContent(); |
1870 | - |
1871 | -private: |
1872 | - Ui_timeZoneConfigurationWindowForm * ui; |
1873 | - DefineTimeZoneWindow * defineTimeZoneWindow; |
1874 | - TimeZoneConfiguration * timeZoneConfiguration; |
1875 | - |
1876 | - void updateAboutText(); |
1877 | - |
1878 | -private slots: |
1879 | - void saveTimeZoneSettings(); |
1880 | - void openDefineTimeZoneWindow(); |
1881 | - void closeDefineTimeZoneWindow(bool); |
1882 | - void timeZoneDefined(QString timeZoneDefinition); |
1883 | - |
1884 | - void setTimeFormat(bool); |
1885 | - void setDateFormat(bool); |
1886 | - void updateDisplayFormatSwitches(); |
1887 | -}; |
1888 | - |
1889 | - |
1890 | -#endif //_TIME_ZONE_CONFIGURATION_WINDOW_HPP_ |
1891 | |
1892 | === removed file 'plugins/TimeZoneConfiguration/src/gui/defineTimeZone.ui' |
1893 | --- plugins/TimeZoneConfiguration/src/gui/defineTimeZone.ui 2011-11-17 16:55:28 +0000 |
1894 | +++ plugins/TimeZoneConfiguration/src/gui/defineTimeZone.ui 1970-01-01 00:00:00 +0000 |
1895 | @@ -1,621 +0,0 @@ |
1896 | -<?xml version="1.0" encoding="UTF-8"?> |
1897 | -<ui version="4.0"> |
1898 | - <class>defineTimeZoneForm</class> |
1899 | - <widget class="QWidget" name="defineTimeZoneForm"> |
1900 | - <property name="geometry"> |
1901 | - <rect> |
1902 | - <x>0</x> |
1903 | - <y>0</y> |
1904 | - <width>450</width> |
1905 | - <height>474</height> |
1906 | - </rect> |
1907 | - </property> |
1908 | - <layout class="QVBoxLayout" name="verticalLayout"> |
1909 | - <property name="spacing"> |
1910 | - <number>0</number> |
1911 | - </property> |
1912 | - <property name="margin"> |
1913 | - <number>0</number> |
1914 | - </property> |
1915 | - <item> |
1916 | - <widget class="BarFrame" name="TitleBar"> |
1917 | - <property name="sizePolicy"> |
1918 | - <sizepolicy hsizetype="Expanding" vsizetype="Minimum"> |
1919 | - <horstretch>0</horstretch> |
1920 | - <verstretch>0</verstretch> |
1921 | - </sizepolicy> |
1922 | - </property> |
1923 | - <property name="minimumSize"> |
1924 | - <size> |
1925 | - <width>0</width> |
1926 | - <height>25</height> |
1927 | - </size> |
1928 | - </property> |
1929 | - <property name="maximumSize"> |
1930 | - <size> |
1931 | - <width>16777215</width> |
1932 | - <height>30</height> |
1933 | - </size> |
1934 | - </property> |
1935 | - <property name="focusPolicy"> |
1936 | - <enum>Qt::NoFocus</enum> |
1937 | - </property> |
1938 | - <property name="autoFillBackground"> |
1939 | - <bool>false</bool> |
1940 | - </property> |
1941 | - <property name="frameShape"> |
1942 | - <enum>QFrame::StyledPanel</enum> |
1943 | - </property> |
1944 | - <layout class="QHBoxLayout"> |
1945 | - <property name="spacing"> |
1946 | - <number>6</number> |
1947 | - </property> |
1948 | - <property name="leftMargin"> |
1949 | - <number>0</number> |
1950 | - </property> |
1951 | - <property name="topMargin"> |
1952 | - <number>0</number> |
1953 | - </property> |
1954 | - <property name="rightMargin"> |
1955 | - <number>4</number> |
1956 | - </property> |
1957 | - <property name="bottomMargin"> |
1958 | - <number>0</number> |
1959 | - </property> |
1960 | - <item> |
1961 | - <spacer name="leftSpacer"> |
1962 | - <property name="orientation"> |
1963 | - <enum>Qt::Horizontal</enum> |
1964 | - </property> |
1965 | - <property name="sizeHint" stdset="0"> |
1966 | - <size> |
1967 | - <width>40</width> |
1968 | - <height>20</height> |
1969 | - </size> |
1970 | - </property> |
1971 | - </spacer> |
1972 | - </item> |
1973 | - <item> |
1974 | - <widget class="QLabel" name="stelWindowTitle"> |
1975 | - <property name="text"> |
1976 | - <string>Define a time zone</string> |
1977 | - </property> |
1978 | - </widget> |
1979 | - </item> |
1980 | - <item> |
1981 | - <spacer name="rightSpacer"> |
1982 | - <property name="orientation"> |
1983 | - <enum>Qt::Horizontal</enum> |
1984 | - </property> |
1985 | - <property name="sizeHint" stdset="0"> |
1986 | - <size> |
1987 | - <width>40</width> |
1988 | - <height>20</height> |
1989 | - </size> |
1990 | - </property> |
1991 | - </spacer> |
1992 | - </item> |
1993 | - <item> |
1994 | - <widget class="QPushButton" name="closeStelWindow"> |
1995 | - <property name="minimumSize"> |
1996 | - <size> |
1997 | - <width>16</width> |
1998 | - <height>16</height> |
1999 | - </size> |
2000 | - </property> |
2001 | - <property name="maximumSize"> |
2002 | - <size> |
2003 | - <width>16</width> |
2004 | - <height>16</height> |
2005 | - </size> |
2006 | - </property> |
2007 | - <property name="focusPolicy"> |
2008 | - <enum>Qt::NoFocus</enum> |
2009 | - </property> |
2010 | - <property name="text"> |
2011 | - <string/> |
2012 | - </property> |
2013 | - </widget> |
2014 | - </item> |
2015 | - </layout> |
2016 | - </widget> |
2017 | - </item> |
2018 | - <item> |
2019 | - <widget class="QGroupBox" name="groupBoxTimeZone"> |
2020 | - <property name="title"> |
2021 | - <string>Time zone</string> |
2022 | - </property> |
2023 | - <layout class="QVBoxLayout" name="verticalLayoutTimeZone"> |
2024 | - <property name="margin"> |
2025 | - <number>0</number> |
2026 | - </property> |
2027 | - <item> |
2028 | - <layout class="QHBoxLayout" name="horizontalLayoutName"> |
2029 | - <item> |
2030 | - <widget class="QLabel" name="labelName"> |
2031 | - <property name="text"> |
2032 | - <string>Timezone name:</string> |
2033 | - </property> |
2034 | - </widget> |
2035 | - </item> |
2036 | - <item> |
2037 | - <spacer name="horizontalSpacerName"> |
2038 | - <property name="orientation"> |
2039 | - <enum>Qt::Horizontal</enum> |
2040 | - </property> |
2041 | - <property name="sizeHint" stdset="0"> |
2042 | - <size> |
2043 | - <width>40</width> |
2044 | - <height>20</height> |
2045 | - </size> |
2046 | - </property> |
2047 | - </spacer> |
2048 | - </item> |
2049 | - <item> |
2050 | - <widget class="QLineEdit" name="lineEditName"/> |
2051 | - </item> |
2052 | - </layout> |
2053 | - </item> |
2054 | - <item> |
2055 | - <layout class="QHBoxLayout" name="horizontalLayoutOffset"> |
2056 | - <item> |
2057 | - <widget class="QLabel" name="labelOffset"> |
2058 | - <property name="text"> |
2059 | - <string>Offset from UTC (hours):</string> |
2060 | - </property> |
2061 | - </widget> |
2062 | - </item> |
2063 | - <item> |
2064 | - <spacer name="horizontalSpacer"> |
2065 | - <property name="orientation"> |
2066 | - <enum>Qt::Horizontal</enum> |
2067 | - </property> |
2068 | - <property name="sizeHint" stdset="0"> |
2069 | - <size> |
2070 | - <width>40</width> |
2071 | - <height>20</height> |
2072 | - </size> |
2073 | - </property> |
2074 | - </spacer> |
2075 | - </item> |
2076 | - <item> |
2077 | - <widget class="QDoubleSpinBox" name="doubleSpinBoxOffset"> |
2078 | - <property name="wrapping"> |
2079 | - <bool>true</bool> |
2080 | - </property> |
2081 | - <property name="minimum"> |
2082 | - <double>-24.000000000000000</double> |
2083 | - </property> |
2084 | - <property name="maximum"> |
2085 | - <double>24.000000000000000</double> |
2086 | - </property> |
2087 | - <property name="singleStep"> |
2088 | - <double>0.250000000000000</double> |
2089 | - </property> |
2090 | - </widget> |
2091 | - </item> |
2092 | - </layout> |
2093 | - </item> |
2094 | - <item> |
2095 | - <widget class="QCheckBox" name="checkBoxDst"> |
2096 | - <property name="text"> |
2097 | - <string>Daylight saving time (summer time)</string> |
2098 | - </property> |
2099 | - </widget> |
2100 | - </item> |
2101 | - <item> |
2102 | - <widget class="QFrame" name="frameDst"> |
2103 | - <layout class="QVBoxLayout" name="verticalLayoutDst"> |
2104 | - <property name="spacing"> |
2105 | - <number>0</number> |
2106 | - </property> |
2107 | - <property name="margin"> |
2108 | - <number>0</number> |
2109 | - </property> |
2110 | - <item> |
2111 | - <widget class="QFrame" name="frame"> |
2112 | - <layout class="QVBoxLayout" name="verticalLayoutDstMain"> |
2113 | - <property name="margin"> |
2114 | - <number>0</number> |
2115 | - </property> |
2116 | - <item> |
2117 | - <layout class="QHBoxLayout" name="horizontalLayoutNameDst"> |
2118 | - <item> |
2119 | - <widget class="QLabel" name="labelNameDst"> |
2120 | - <property name="sizePolicy"> |
2121 | - <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> |
2122 | - <horstretch>0</horstretch> |
2123 | - <verstretch>0</verstretch> |
2124 | - </sizepolicy> |
2125 | - </property> |
2126 | - <property name="text"> |
2127 | - <string>DST timezone name:</string> |
2128 | - </property> |
2129 | - </widget> |
2130 | - </item> |
2131 | - <item> |
2132 | - <spacer name="horizontalSpacerNameDst"> |
2133 | - <property name="orientation"> |
2134 | - <enum>Qt::Horizontal</enum> |
2135 | - </property> |
2136 | - <property name="sizeHint" stdset="0"> |
2137 | - <size> |
2138 | - <width>40</width> |
2139 | - <height>20</height> |
2140 | - </size> |
2141 | - </property> |
2142 | - </spacer> |
2143 | - </item> |
2144 | - <item> |
2145 | - <widget class="QLineEdit" name="lineEditNameDst"/> |
2146 | - </item> |
2147 | - </layout> |
2148 | - </item> |
2149 | - <item> |
2150 | - <layout class="QHBoxLayout" name="horizontalLayoutOffsetDst"> |
2151 | - <item> |
2152 | - <widget class="QCheckBox" name="checkBoxOffsetDst"> |
2153 | - <property name="text"> |
2154 | - <string>DST offset from UTC (hours):</string> |
2155 | - </property> |
2156 | - </widget> |
2157 | - </item> |
2158 | - <item> |
2159 | - <spacer name="horizontalSpacerOffsetDst"> |
2160 | - <property name="orientation"> |
2161 | - <enum>Qt::Horizontal</enum> |
2162 | - </property> |
2163 | - <property name="sizeHint" stdset="0"> |
2164 | - <size> |
2165 | - <width>0</width> |
2166 | - <height>0</height> |
2167 | - </size> |
2168 | - </property> |
2169 | - </spacer> |
2170 | - </item> |
2171 | - <item> |
2172 | - <widget class="QDoubleSpinBox" name="doubleSpinBoxOffsetDst"> |
2173 | - <property name="wrapping"> |
2174 | - <bool>true</bool> |
2175 | - </property> |
2176 | - <property name="minimum"> |
2177 | - <double>-24.000000000000000</double> |
2178 | - </property> |
2179 | - <property name="maximum"> |
2180 | - <double>24.000000000000000</double> |
2181 | - </property> |
2182 | - <property name="singleStep"> |
2183 | - <double>0.250000000000000</double> |
2184 | - </property> |
2185 | - </widget> |
2186 | - </item> |
2187 | - </layout> |
2188 | - </item> |
2189 | - </layout> |
2190 | - </widget> |
2191 | - </item> |
2192 | - <item> |
2193 | - <widget class="QGroupBox" name="groupBoxDstStart"> |
2194 | - <property name="title"> |
2195 | - <string>Daylight saving time start</string> |
2196 | - </property> |
2197 | - <property name="checkable"> |
2198 | - <bool>true</bool> |
2199 | - </property> |
2200 | - <property name="checked"> |
2201 | - <bool>false</bool> |
2202 | - </property> |
2203 | - <layout class="QGridLayout" name="gridLayoutDstStart"> |
2204 | - <property name="margin"> |
2205 | - <number>0</number> |
2206 | - </property> |
2207 | - <item row="1" column="0" colspan="2"> |
2208 | - <widget class="QRadioButton" name="radioButtonDstStartDay"> |
2209 | - <property name="text"> |
2210 | - <string>Day:</string> |
2211 | - </property> |
2212 | - </widget> |
2213 | - </item> |
2214 | - <item row="1" column="5"> |
2215 | - <widget class="QComboBox" name="comboBoxDstStartMonth"/> |
2216 | - </item> |
2217 | - <item row="4" column="0" colspan="2"> |
2218 | - <widget class="QCheckBox" name="checkBoxDstStartTime"> |
2219 | - <property name="text"> |
2220 | - <string>Time of change:</string> |
2221 | - </property> |
2222 | - </widget> |
2223 | - </item> |
2224 | - <item row="4" column="2" colspan="4"> |
2225 | - <widget class="QTimeEdit" name="timeEditDstStart"> |
2226 | - <property name="wrapping"> |
2227 | - <bool>true</bool> |
2228 | - </property> |
2229 | - <property name="time"> |
2230 | - <time> |
2231 | - <hour>2</hour> |
2232 | - <minute>0</minute> |
2233 | - <second>0</second> |
2234 | - </time> |
2235 | - </property> |
2236 | - <property name="displayFormat"> |
2237 | - <string notr="true">HH:mm:ss</string> |
2238 | - </property> |
2239 | - </widget> |
2240 | - </item> |
2241 | - <item row="2" column="0" colspan="2"> |
2242 | - <widget class="QRadioButton" name="radioButtonDstStartDate"> |
2243 | - <property name="text"> |
2244 | - <string>Date:</string> |
2245 | - </property> |
2246 | - </widget> |
2247 | - </item> |
2248 | - <item row="2" column="2" colspan="4"> |
2249 | - <widget class="QFrame" name="frameDstStartDate"> |
2250 | - <layout class="QHBoxLayout" name="horizontalLayout"> |
2251 | - <property name="margin"> |
2252 | - <number>0</number> |
2253 | - </property> |
2254 | - <item> |
2255 | - <widget class="QSpinBox" name="spinBoxDstStartDateDay"/> |
2256 | - </item> |
2257 | - <item> |
2258 | - <widget class="QComboBox" name="comboBoxDstStartDateMonth"/> |
2259 | - </item> |
2260 | - </layout> |
2261 | - </widget> |
2262 | - </item> |
2263 | - <item row="1" column="3" colspan="2"> |
2264 | - <widget class="QComboBox" name="comboBoxDstStartWeek"/> |
2265 | - </item> |
2266 | - <item row="1" column="2"> |
2267 | - <widget class="QComboBox" name="comboBoxDstStartDay"/> |
2268 | - </item> |
2269 | - </layout> |
2270 | - </widget> |
2271 | - </item> |
2272 | - <item> |
2273 | - <widget class="QGroupBox" name="groupBoxDstEnd"> |
2274 | - <property name="title"> |
2275 | - <string>Daylight saving time end</string> |
2276 | - </property> |
2277 | - <property name="checkable"> |
2278 | - <bool>true</bool> |
2279 | - </property> |
2280 | - <property name="checked"> |
2281 | - <bool>false</bool> |
2282 | - </property> |
2283 | - <layout class="QGridLayout" name="gridLayout_4"> |
2284 | - <property name="margin"> |
2285 | - <number>0</number> |
2286 | - </property> |
2287 | - <item row="1" column="0" colspan="2"> |
2288 | - <widget class="QRadioButton" name="radioButtonDstEndDay"> |
2289 | - <property name="text"> |
2290 | - <string>Day:</string> |
2291 | - </property> |
2292 | - </widget> |
2293 | - </item> |
2294 | - <item row="1" column="5"> |
2295 | - <widget class="QComboBox" name="comboBoxDstEndMonth"/> |
2296 | - </item> |
2297 | - <item row="4" column="0" colspan="2"> |
2298 | - <widget class="QCheckBox" name="checkBoxDstEndTime"> |
2299 | - <property name="text"> |
2300 | - <string>Time of change:</string> |
2301 | - </property> |
2302 | - </widget> |
2303 | - </item> |
2304 | - <item row="4" column="2" colspan="4"> |
2305 | - <widget class="QTimeEdit" name="timeEditDstEnd"> |
2306 | - <property name="wrapping"> |
2307 | - <bool>true</bool> |
2308 | - </property> |
2309 | - <property name="time"> |
2310 | - <time> |
2311 | - <hour>2</hour> |
2312 | - <minute>0</minute> |
2313 | - <second>0</second> |
2314 | - </time> |
2315 | - </property> |
2316 | - <property name="displayFormat"> |
2317 | - <string notr="true">HH:mm:ss</string> |
2318 | - </property> |
2319 | - </widget> |
2320 | - </item> |
2321 | - <item row="3" column="0" colspan="2"> |
2322 | - <widget class="QRadioButton" name="radioButtonDstEndDate"> |
2323 | - <property name="text"> |
2324 | - <string>Date:</string> |
2325 | - </property> |
2326 | - </widget> |
2327 | - </item> |
2328 | - <item row="3" column="2" colspan="4"> |
2329 | - <widget class="QFrame" name="frameDstEndDate"> |
2330 | - <layout class="QHBoxLayout" name="horizontalLayoutDstEndDate"> |
2331 | - <property name="margin"> |
2332 | - <number>0</number> |
2333 | - </property> |
2334 | - <item> |
2335 | - <widget class="QSpinBox" name="spinBoxDstEndDateDay"/> |
2336 | - </item> |
2337 | - <item> |
2338 | - <widget class="QComboBox" name="comboBoxDstEndDateMonth"/> |
2339 | - </item> |
2340 | - </layout> |
2341 | - </widget> |
2342 | - </item> |
2343 | - <item row="1" column="3" colspan="2"> |
2344 | - <widget class="QComboBox" name="comboBoxDstEndWeek"/> |
2345 | - </item> |
2346 | - <item row="1" column="2"> |
2347 | - <widget class="QComboBox" name="comboBoxDstEndDay"/> |
2348 | - </item> |
2349 | - </layout> |
2350 | - </widget> |
2351 | - </item> |
2352 | - </layout> |
2353 | - </widget> |
2354 | - </item> |
2355 | - <item> |
2356 | - <spacer name="verticalSpacer"> |
2357 | - <property name="orientation"> |
2358 | - <enum>Qt::Vertical</enum> |
2359 | - </property> |
2360 | - <property name="sizeHint" stdset="0"> |
2361 | - <size> |
2362 | - <width>20</width> |
2363 | - <height>40</height> |
2364 | - </size> |
2365 | - </property> |
2366 | - </spacer> |
2367 | - </item> |
2368 | - <item> |
2369 | - <widget class="QPushButton" name="pushButtonUseDefinition"> |
2370 | - <property name="text"> |
2371 | - <string>Use this definition</string> |
2372 | - </property> |
2373 | - </widget> |
2374 | - </item> |
2375 | - </layout> |
2376 | - </widget> |
2377 | - </item> |
2378 | - </layout> |
2379 | - </widget> |
2380 | - <customwidgets> |
2381 | - <customwidget> |
2382 | - <class>BarFrame</class> |
2383 | - <extends>QFrame</extends> |
2384 | - <header>Dialog.hpp</header> |
2385 | - <container>1</container> |
2386 | - </customwidget> |
2387 | - </customwidgets> |
2388 | - <tabstops> |
2389 | - <tabstop>lineEditName</tabstop> |
2390 | - <tabstop>doubleSpinBoxOffset</tabstop> |
2391 | - <tabstop>checkBoxDst</tabstop> |
2392 | - <tabstop>lineEditNameDst</tabstop> |
2393 | - <tabstop>checkBoxOffsetDst</tabstop> |
2394 | - <tabstop>doubleSpinBoxOffsetDst</tabstop> |
2395 | - <tabstop>radioButtonDstStartDay</tabstop> |
2396 | - <tabstop>groupBoxDstStart</tabstop> |
2397 | - <tabstop>comboBoxDstStartDay</tabstop> |
2398 | - <tabstop>comboBoxDstStartWeek</tabstop> |
2399 | - <tabstop>comboBoxDstStartMonth</tabstop> |
2400 | - <tabstop>radioButtonDstStartDate</tabstop> |
2401 | - <tabstop>spinBoxDstStartDateDay</tabstop> |
2402 | - <tabstop>comboBoxDstStartDateMonth</tabstop> |
2403 | - <tabstop>checkBoxDstStartTime</tabstop> |
2404 | - <tabstop>timeEditDstStart</tabstop> |
2405 | - <tabstop>groupBoxDstEnd</tabstop> |
2406 | - <tabstop>radioButtonDstEndDay</tabstop> |
2407 | - <tabstop>comboBoxDstEndDay</tabstop> |
2408 | - <tabstop>comboBoxDstEndWeek</tabstop> |
2409 | - <tabstop>comboBoxDstEndMonth</tabstop> |
2410 | - <tabstop>radioButtonDstEndDate</tabstop> |
2411 | - <tabstop>spinBoxDstEndDateDay</tabstop> |
2412 | - <tabstop>comboBoxDstEndDateMonth</tabstop> |
2413 | - <tabstop>checkBoxDstEndTime</tabstop> |
2414 | - <tabstop>timeEditDstEnd</tabstop> |
2415 | - <tabstop>pushButtonUseDefinition</tabstop> |
2416 | - </tabstops> |
2417 | - <resources/> |
2418 | - <connections> |
2419 | - <connection> |
2420 | - <sender>checkBoxDst</sender> |
2421 | - <signal>toggled(bool)</signal> |
2422 | - <receiver>frameDst</receiver> |
2423 | - <slot>setVisible(bool)</slot> |
2424 | - <hints> |
2425 | - <hint type="sourcelabel"> |
2426 | - <x>230</x> |
2427 | - <y>125</y> |
2428 | - </hint> |
2429 | - <hint type="destinationlabel"> |
2430 | - <x>228</x> |
2431 | - <y>316</y> |
2432 | - </hint> |
2433 | - </hints> |
2434 | - </connection> |
2435 | - <connection> |
2436 | - <sender>checkBoxOffsetDst</sender> |
2437 | - <signal>toggled(bool)</signal> |
2438 | - <receiver>doubleSpinBoxOffsetDst</receiver> |
2439 | - <slot>setEnabled(bool)</slot> |
2440 | - <hints> |
2441 | - <hint type="sourcelabel"> |
2442 | - <x>172</x> |
2443 | - <y>186</y> |
2444 | - </hint> |
2445 | - <hint type="destinationlabel"> |
2446 | - <x>348</x> |
2447 | - <y>188</y> |
2448 | - </hint> |
2449 | - </hints> |
2450 | - </connection> |
2451 | - <connection> |
2452 | - <sender>checkBoxDstEndTime</sender> |
2453 | - <signal>toggled(bool)</signal> |
2454 | - <receiver>timeEditDstEnd</receiver> |
2455 | - <slot>setEnabled(bool)</slot> |
2456 | - <hints> |
2457 | - <hint type="sourcelabel"> |
2458 | - <x>95</x> |
2459 | - <y>427</y> |
2460 | - </hint> |
2461 | - <hint type="destinationlabel"> |
2462 | - <x>362</x> |
2463 | - <y>430</y> |
2464 | - </hint> |
2465 | - </hints> |
2466 | - </connection> |
2467 | - <connection> |
2468 | - <sender>checkBoxDstStartTime</sender> |
2469 | - <signal>toggled(bool)</signal> |
2470 | - <receiver>timeEditDstStart</receiver> |
2471 | - <slot>setEnabled(bool)</slot> |
2472 | - <hints> |
2473 | - <hint type="sourcelabel"> |
2474 | - <x>115</x> |
2475 | - <y>298</y> |
2476 | - </hint> |
2477 | - <hint type="destinationlabel"> |
2478 | - <x>187</x> |
2479 | - <y>294</y> |
2480 | - </hint> |
2481 | - </hints> |
2482 | - </connection> |
2483 | - <connection> |
2484 | - <sender>groupBoxDstStart</sender> |
2485 | - <signal>toggled(bool)</signal> |
2486 | - <receiver>groupBoxDstEnd</receiver> |
2487 | - <slot>setChecked(bool)</slot> |
2488 | - <hints> |
2489 | - <hint type="sourcelabel"> |
2490 | - <x>117</x> |
2491 | - <y>243</y> |
2492 | - </hint> |
2493 | - <hint type="destinationlabel"> |
2494 | - <x>123</x> |
2495 | - <y>362</y> |
2496 | - </hint> |
2497 | - </hints> |
2498 | - </connection> |
2499 | - <connection> |
2500 | - <sender>groupBoxDstEnd</sender> |
2501 | - <signal>toggled(bool)</signal> |
2502 | - <receiver>groupBoxDstStart</receiver> |
2503 | - <slot>setChecked(bool)</slot> |
2504 | - <hints> |
2505 | - <hint type="sourcelabel"> |
2506 | - <x>301</x> |
2507 | - <y>354</y> |
2508 | - </hint> |
2509 | - <hint type="destinationlabel"> |
2510 | - <x>295</x> |
2511 | - <y>286</y> |
2512 | - </hint> |
2513 | - </hints> |
2514 | - </connection> |
2515 | - </connections> |
2516 | -</ui> |
2517 | |
2518 | === removed file 'plugins/TimeZoneConfiguration/src/gui/timeZoneConfigurationWindow.ui' |
2519 | --- plugins/TimeZoneConfiguration/src/gui/timeZoneConfigurationWindow.ui 2013-12-23 00:22:34 +0000 |
2520 | +++ plugins/TimeZoneConfiguration/src/gui/timeZoneConfigurationWindow.ui 1970-01-01 00:00:00 +0000 |
2521 | @@ -1,585 +0,0 @@ |
2522 | -<?xml version="1.0" encoding="UTF-8"?> |
2523 | -<ui version="4.0"> |
2524 | - <class>timeZoneConfigurationWindowForm</class> |
2525 | - <widget class="QWidget" name="timeZoneConfigurationWindowForm"> |
2526 | - <property name="geometry"> |
2527 | - <rect> |
2528 | - <x>0</x> |
2529 | - <y>0</y> |
2530 | - <width>448</width> |
2531 | - <height>480</height> |
2532 | - </rect> |
2533 | - </property> |
2534 | - <layout class="QVBoxLayout" name="verticalLayout"> |
2535 | - <property name="spacing"> |
2536 | - <number>0</number> |
2537 | - </property> |
2538 | - <property name="leftMargin"> |
2539 | - <number>0</number> |
2540 | - </property> |
2541 | - <property name="topMargin"> |
2542 | - <number>0</number> |
2543 | - </property> |
2544 | - <property name="rightMargin"> |
2545 | - <number>0</number> |
2546 | - </property> |
2547 | - <property name="bottomMargin"> |
2548 | - <number>0</number> |
2549 | - </property> |
2550 | - <item> |
2551 | - <widget class="BarFrame" name="TitleBar"> |
2552 | - <property name="sizePolicy"> |
2553 | - <sizepolicy hsizetype="Expanding" vsizetype="Minimum"> |
2554 | - <horstretch>0</horstretch> |
2555 | - <verstretch>0</verstretch> |
2556 | - </sizepolicy> |
2557 | - </property> |
2558 | - <property name="minimumSize"> |
2559 | - <size> |
2560 | - <width>0</width> |
2561 | - <height>25</height> |
2562 | - </size> |
2563 | - </property> |
2564 | - <property name="maximumSize"> |
2565 | - <size> |
2566 | - <width>16777215</width> |
2567 | - <height>30</height> |
2568 | - </size> |
2569 | - </property> |
2570 | - <property name="focusPolicy"> |
2571 | - <enum>Qt::NoFocus</enum> |
2572 | - </property> |
2573 | - <property name="autoFillBackground"> |
2574 | - <bool>false</bool> |
2575 | - </property> |
2576 | - <property name="frameShape"> |
2577 | - <enum>QFrame::StyledPanel</enum> |
2578 | - </property> |
2579 | - <layout class="QHBoxLayout"> |
2580 | - <property name="spacing"> |
2581 | - <number>6</number> |
2582 | - </property> |
2583 | - <property name="leftMargin"> |
2584 | - <number>0</number> |
2585 | - </property> |
2586 | - <property name="topMargin"> |
2587 | - <number>0</number> |
2588 | - </property> |
2589 | - <property name="rightMargin"> |
2590 | - <number>4</number> |
2591 | - </property> |
2592 | - <property name="bottomMargin"> |
2593 | - <number>0</number> |
2594 | - </property> |
2595 | - <item> |
2596 | - <spacer name="leftSpacer"> |
2597 | - <property name="orientation"> |
2598 | - <enum>Qt::Horizontal</enum> |
2599 | - </property> |
2600 | - <property name="sizeHint" stdset="0"> |
2601 | - <size> |
2602 | - <width>40</width> |
2603 | - <height>20</height> |
2604 | - </size> |
2605 | - </property> |
2606 | - </spacer> |
2607 | - </item> |
2608 | - <item> |
2609 | - <widget class="QLabel" name="stelWindowTitle"> |
2610 | - <property name="text"> |
2611 | - <string>Time zone</string> |
2612 | - </property> |
2613 | - </widget> |
2614 | - </item> |
2615 | - <item> |
2616 | - <spacer name="rightSpacer"> |
2617 | - <property name="orientation"> |
2618 | - <enum>Qt::Horizontal</enum> |
2619 | - </property> |
2620 | - <property name="sizeHint" stdset="0"> |
2621 | - <size> |
2622 | - <width>40</width> |
2623 | - <height>20</height> |
2624 | - </size> |
2625 | - </property> |
2626 | - </spacer> |
2627 | - </item> |
2628 | - <item> |
2629 | - <widget class="QPushButton" name="closeStelWindow"> |
2630 | - <property name="minimumSize"> |
2631 | - <size> |
2632 | - <width>16</width> |
2633 | - <height>16</height> |
2634 | - </size> |
2635 | - </property> |
2636 | - <property name="maximumSize"> |
2637 | - <size> |
2638 | - <width>16</width> |
2639 | - <height>16</height> |
2640 | - </size> |
2641 | - </property> |
2642 | - <property name="focusPolicy"> |
2643 | - <enum>Qt::NoFocus</enum> |
2644 | - </property> |
2645 | - <property name="text"> |
2646 | - <string/> |
2647 | - </property> |
2648 | - </widget> |
2649 | - </item> |
2650 | - </layout> |
2651 | - </widget> |
2652 | - </item> |
2653 | - <item> |
2654 | - <widget class="QTabWidget" name="tabWidget"> |
2655 | - <widget class="QWidget" name="tabTimeZone"> |
2656 | - <attribute name="title"> |
2657 | - <string>Time zone</string> |
2658 | - </attribute> |
2659 | - <layout class="QVBoxLayout" name="verticalLayoutTimeZone"> |
2660 | - <property name="spacing"> |
2661 | - <number>0</number> |
2662 | - </property> |
2663 | - <property name="leftMargin"> |
2664 | - <number>0</number> |
2665 | - </property> |
2666 | - <property name="topMargin"> |
2667 | - <number>0</number> |
2668 | - </property> |
2669 | - <property name="rightMargin"> |
2670 | - <number>0</number> |
2671 | - </property> |
2672 | - <property name="bottomMargin"> |
2673 | - <number>0</number> |
2674 | - </property> |
2675 | - <item> |
2676 | - <widget class="QGroupBox" name="groupBoxTimeZone"> |
2677 | - <property name="minimumSize"> |
2678 | - <size> |
2679 | - <width>0</width> |
2680 | - <height>400</height> |
2681 | - </size> |
2682 | - </property> |
2683 | - <property name="title"> |
2684 | - <string>Time zone</string> |
2685 | - </property> |
2686 | - <layout class="QGridLayout" name="gridLayoutCurrent"> |
2687 | - <property name="leftMargin"> |
2688 | - <number>0</number> |
2689 | - </property> |
2690 | - <property name="topMargin"> |
2691 | - <number>0</number> |
2692 | - </property> |
2693 | - <property name="rightMargin"> |
2694 | - <number>0</number> |
2695 | - </property> |
2696 | - <property name="bottomMargin"> |
2697 | - <number>0</number> |
2698 | - </property> |
2699 | - <property name="verticalSpacing"> |
2700 | - <number>8</number> |
2701 | - </property> |
2702 | - <item row="0" column="0" colspan="2"> |
2703 | - <widget class="QLabel" name="labelTimeZoneInfo"> |
2704 | - <property name="text"> |
2705 | - <string>By default, the time displayed in Stellarium is interpreted as the local time in the system's time zone, not in the displayed location's time zone. This behaviour can be changed by changing Stellarium's global time zone settings.</string> |
2706 | - </property> |
2707 | - <property name="wordWrap"> |
2708 | - <bool>true</bool> |
2709 | - </property> |
2710 | - </widget> |
2711 | - </item> |
2712 | - <item row="1" column="0" colspan="2"> |
2713 | - <widget class="QRadioButton" name="radioButtonLocalSettings"> |
2714 | - <property name="text"> |
2715 | - <string>Use system settings (default)</string> |
2716 | - </property> |
2717 | - </widget> |
2718 | - </item> |
2719 | - <item row="2" column="0" colspan="2"> |
2720 | - <widget class="QRadioButton" name="radioButtonUtc"> |
2721 | - <property name="text"> |
2722 | - <string>Universal Coordinated Time (UTC)</string> |
2723 | - </property> |
2724 | - </widget> |
2725 | - </item> |
2726 | - <item row="3" column="0"> |
2727 | - <widget class="QRadioButton" name="radioButtonOffset"> |
2728 | - <property name="text"> |
2729 | - <string>Offset from UTC (hours):</string> |
2730 | - </property> |
2731 | - </widget> |
2732 | - </item> |
2733 | - <item row="3" column="1"> |
2734 | - <widget class="QDoubleSpinBox" name="doubleSpinBoxOffset"> |
2735 | - <property name="wrapping"> |
2736 | - <bool>true</bool> |
2737 | - </property> |
2738 | - <property name="decimals"> |
2739 | - <number>2</number> |
2740 | - </property> |
2741 | - <property name="minimum"> |
2742 | - <double>-24.000000000000000</double> |
2743 | - </property> |
2744 | - <property name="maximum"> |
2745 | - <double>24.000000000000000</double> |
2746 | - </property> |
2747 | - <property name="singleStep"> |
2748 | - <double>0.250000000000000</double> |
2749 | - </property> |
2750 | - </widget> |
2751 | - </item> |
2752 | - <item row="4" column="0" colspan="2"> |
2753 | - <widget class="QLabel" name="labelOffset"> |
2754 | - <property name="text"> |
2755 | - <string>(offset = local time - UTC time)</string> |
2756 | - </property> |
2757 | - <property name="alignment"> |
2758 | - <set>Qt::AlignCenter</set> |
2759 | - </property> |
2760 | - </widget> |
2761 | - </item> |
2762 | - <item row="5" column="0"> |
2763 | - <widget class="QRadioButton" name="radioButtonUserDefined"> |
2764 | - <property name="text"> |
2765 | - <string>User-defined:</string> |
2766 | - </property> |
2767 | - </widget> |
2768 | - </item> |
2769 | - <item row="5" column="1"> |
2770 | - <widget class="QFrame" name="frameUserDefined"> |
2771 | - <layout class="QHBoxLayout" name="horizontalLayout"> |
2772 | - <property name="leftMargin"> |
2773 | - <number>0</number> |
2774 | - </property> |
2775 | - <property name="topMargin"> |
2776 | - <number>0</number> |
2777 | - </property> |
2778 | - <property name="rightMargin"> |
2779 | - <number>0</number> |
2780 | - </property> |
2781 | - <property name="bottomMargin"> |
2782 | - <number>0</number> |
2783 | - </property> |
2784 | - <item> |
2785 | - <widget class="QLineEdit" name="lineEditUserDefined"/> |
2786 | - </item> |
2787 | - <item> |
2788 | - <widget class="QPushButton" name="pushButtonEditTimeZone"> |
2789 | - <property name="text"> |
2790 | - <string notr="true">...</string> |
2791 | - </property> |
2792 | - </widget> |
2793 | - </item> |
2794 | - </layout> |
2795 | - </widget> |
2796 | - </item> |
2797 | - <item row="7" column="0" colspan="2"> |
2798 | - <widget class="QPushButton" name="pushButtonSave"> |
2799 | - <property name="text"> |
2800 | - <string>Save settings</string> |
2801 | - </property> |
2802 | - </widget> |
2803 | - </item> |
2804 | - <item row="8" column="0" colspan="2"> |
2805 | - <widget class="QLabel" name="labelRestart"> |
2806 | - <property name="text"> |
2807 | - <string>Any changes will take effect the next time Stellarium is started.</string> |
2808 | - </property> |
2809 | - <property name="alignment"> |
2810 | - <set>Qt::AlignCenter</set> |
2811 | - </property> |
2812 | - <property name="wordWrap"> |
2813 | - <bool>true</bool> |
2814 | - </property> |
2815 | - </widget> |
2816 | - </item> |
2817 | - <item row="9" column="0" colspan="2"> |
2818 | - <spacer name="verticalSpacerTimeZone"> |
2819 | - <property name="orientation"> |
2820 | - <enum>Qt::Vertical</enum> |
2821 | - </property> |
2822 | - <property name="sizeHint" stdset="0"> |
2823 | - <size> |
2824 | - <width>0</width> |
2825 | - <height>0</height> |
2826 | - </size> |
2827 | - </property> |
2828 | - </spacer> |
2829 | - </item> |
2830 | - </layout> |
2831 | - </widget> |
2832 | - </item> |
2833 | - </layout> |
2834 | - </widget> |
2835 | - <widget class="QWidget" name="tabDisplayFormats"> |
2836 | - <attribute name="title"> |
2837 | - <string>Display formats</string> |
2838 | - </attribute> |
2839 | - <layout class="QVBoxLayout" name="verticalLayoutTabTimeFormat"> |
2840 | - <property name="spacing"> |
2841 | - <number>0</number> |
2842 | - </property> |
2843 | - <property name="leftMargin"> |
2844 | - <number>0</number> |
2845 | - </property> |
2846 | - <property name="topMargin"> |
2847 | - <number>0</number> |
2848 | - </property> |
2849 | - <property name="rightMargin"> |
2850 | - <number>0</number> |
2851 | - </property> |
2852 | - <property name="bottomMargin"> |
2853 | - <number>0</number> |
2854 | - </property> |
2855 | - <item> |
2856 | - <widget class="QGroupBox" name="groupBoxDisplayFormats"> |
2857 | - <property name="title"> |
2858 | - <string>Display formats</string> |
2859 | - </property> |
2860 | - <property name="alignment"> |
2861 | - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> |
2862 | - </property> |
2863 | - <layout class="QVBoxLayout" name="verticalLayout_4"> |
2864 | - <property name="leftMargin"> |
2865 | - <number>0</number> |
2866 | - </property> |
2867 | - <property name="topMargin"> |
2868 | - <number>0</number> |
2869 | - </property> |
2870 | - <property name="rightMargin"> |
2871 | - <number>0</number> |
2872 | - </property> |
2873 | - <property name="bottomMargin"> |
2874 | - <number>0</number> |
2875 | - </property> |
2876 | - <item> |
2877 | - <widget class="QLabel" name="labelDisplayFormats"> |
2878 | - <property name="text"> |
2879 | - <string>These settings control the way time and date are displayed in the bottom bar.</string> |
2880 | - </property> |
2881 | - <property name="wordWrap"> |
2882 | - <bool>true</bool> |
2883 | - </property> |
2884 | - </widget> |
2885 | - </item> |
2886 | - <item> |
2887 | - <widget class="QGroupBox" name="groupBoxTimeFormat"> |
2888 | - <property name="title"> |
2889 | - <string>Time display format</string> |
2890 | - </property> |
2891 | - <layout class="QVBoxLayout" name="verticalLayoutTimeFormat"> |
2892 | - <property name="leftMargin"> |
2893 | - <number>0</number> |
2894 | - </property> |
2895 | - <property name="topMargin"> |
2896 | - <number>0</number> |
2897 | - </property> |
2898 | - <property name="rightMargin"> |
2899 | - <number>0</number> |
2900 | - </property> |
2901 | - <property name="bottomMargin"> |
2902 | - <number>0</number> |
2903 | - </property> |
2904 | - <item> |
2905 | - <widget class="QRadioButton" name="radioButtonTimeDefault"> |
2906 | - <property name="text"> |
2907 | - <string>System default</string> |
2908 | - </property> |
2909 | - </widget> |
2910 | - </item> |
2911 | - <item> |
2912 | - <widget class="QRadioButton" name="radioButtonTime12Hour"> |
2913 | - <property name="text"> |
2914 | - <string>12-hour format</string> |
2915 | - </property> |
2916 | - </widget> |
2917 | - </item> |
2918 | - <item> |
2919 | - <widget class="QRadioButton" name="radioButtonTime24Hour"> |
2920 | - <property name="text"> |
2921 | - <string>24-hour format</string> |
2922 | - </property> |
2923 | - </widget> |
2924 | - </item> |
2925 | - </layout> |
2926 | - </widget> |
2927 | - </item> |
2928 | - <item> |
2929 | - <widget class="QGroupBox" name="groupBoxDateFormat"> |
2930 | - <property name="title"> |
2931 | - <string>Date display format</string> |
2932 | - </property> |
2933 | - <layout class="QVBoxLayout" name="verticalLayoutDateFormat"> |
2934 | - <property name="leftMargin"> |
2935 | - <number>0</number> |
2936 | - </property> |
2937 | - <property name="topMargin"> |
2938 | - <number>0</number> |
2939 | - </property> |
2940 | - <property name="rightMargin"> |
2941 | - <number>0</number> |
2942 | - </property> |
2943 | - <property name="bottomMargin"> |
2944 | - <number>0</number> |
2945 | - </property> |
2946 | - <item> |
2947 | - <widget class="QRadioButton" name="radioButtonDateDefault"> |
2948 | - <property name="text"> |
2949 | - <string>System default</string> |
2950 | - </property> |
2951 | - </widget> |
2952 | - </item> |
2953 | - <item> |
2954 | - <widget class="QRadioButton" name="radioButtonDateYMD"> |
2955 | - <property name="text"> |
2956 | - <string>yyyy-mm-dd (ISO 8601)</string> |
2957 | - </property> |
2958 | - </widget> |
2959 | - </item> |
2960 | - <item> |
2961 | - <widget class="QRadioButton" name="radioButtonDateDMY"> |
2962 | - <property name="text"> |
2963 | - <string>dd-mm-yyyy</string> |
2964 | - </property> |
2965 | - </widget> |
2966 | - </item> |
2967 | - <item> |
2968 | - <widget class="QRadioButton" name="radioButtonDateMDY"> |
2969 | - <property name="text"> |
2970 | - <string>mm-dd-yyyy</string> |
2971 | - </property> |
2972 | - </widget> |
2973 | - </item> |
2974 | - </layout> |
2975 | - </widget> |
2976 | - </item> |
2977 | - </layout> |
2978 | - </widget> |
2979 | - </item> |
2980 | - <item> |
2981 | - <spacer name="verticalSpacerDisplayFormats"> |
2982 | - <property name="orientation"> |
2983 | - <enum>Qt::Vertical</enum> |
2984 | - </property> |
2985 | - <property name="sizeHint" stdset="0"> |
2986 | - <size> |
2987 | - <width>0</width> |
2988 | - <height>0</height> |
2989 | - </size> |
2990 | - </property> |
2991 | - </spacer> |
2992 | - </item> |
2993 | - </layout> |
2994 | - </widget> |
2995 | - <widget class="QWidget" name="tabAbout"> |
2996 | - <attribute name="title"> |
2997 | - <string comment="tab in plugin windows">About</string> |
2998 | - </attribute> |
2999 | - <layout class="QVBoxLayout" name="verticalLayout_3"> |
3000 | - <item> |
3001 | - <widget class="QLabel" name="labelTitle"> |
3002 | - <property name="styleSheet"> |
3003 | - <string notr="true">QLabel { |
3004 | - font: bold 18pt ; |
3005 | -}</string> |
3006 | - </property> |
3007 | - <property name="text"> |
3008 | - <string notr="true">Time Zone plug-in</string> |
3009 | - </property> |
3010 | - </widget> |
3011 | - </item> |
3012 | - <item> |
3013 | - <widget class="QLabel" name="labelVersion"> |
3014 | - <property name="text"> |
3015 | - <string notr="true">Version %1</string> |
3016 | - </property> |
3017 | - </widget> |
3018 | - </item> |
3019 | - <item> |
3020 | - <widget class="QLabel" name="labelCopyright"> |
3021 | - <property name="text"> |
3022 | - <string notr="true">Copyright &copy; 2010 Bogdan Marinov</string> |
3023 | - </property> |
3024 | - <property name="textFormat"> |
3025 | - <enum>Qt::RichText</enum> |
3026 | - </property> |
3027 | - </widget> |
3028 | - </item> |
3029 | - <item> |
3030 | - <widget class="QLabel" name="labelLicense"> |
3031 | - <property name="sizePolicy"> |
3032 | - <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> |
3033 | - <horstretch>0</horstretch> |
3034 | - <verstretch>0</verstretch> |
3035 | - </sizepolicy> |
3036 | - </property> |
3037 | - <property name="text"> |
3038 | - <string notr="true">This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. |
3039 | - |
3040 | -This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
3041 | - |
3042 | -You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.</string> |
3043 | - </property> |
3044 | - <property name="alignment"> |
3045 | - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> |
3046 | - </property> |
3047 | - <property name="wordWrap"> |
3048 | - <bool>true</bool> |
3049 | - </property> |
3050 | - <property name="textInteractionFlags"> |
3051 | - <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set> |
3052 | - </property> |
3053 | - </widget> |
3054 | - </item> |
3055 | - </layout> |
3056 | - </widget> |
3057 | - </widget> |
3058 | - </item> |
3059 | - </layout> |
3060 | - </widget> |
3061 | - <customwidgets> |
3062 | - <customwidget> |
3063 | - <class>BarFrame</class> |
3064 | - <extends>QFrame</extends> |
3065 | - <header>Dialog.hpp</header> |
3066 | - <container>1</container> |
3067 | - </customwidget> |
3068 | - </customwidgets> |
3069 | - <tabstops> |
3070 | - <tabstop>tabWidget</tabstop> |
3071 | - <tabstop>radioButtonLocalSettings</tabstop> |
3072 | - <tabstop>radioButtonUtc</tabstop> |
3073 | - <tabstop>radioButtonOffset</tabstop> |
3074 | - <tabstop>doubleSpinBoxOffset</tabstop> |
3075 | - <tabstop>radioButtonUserDefined</tabstop> |
3076 | - <tabstop>lineEditUserDefined</tabstop> |
3077 | - <tabstop>pushButtonEditTimeZone</tabstop> |
3078 | - <tabstop>pushButtonSave</tabstop> |
3079 | - <tabstop>radioButtonTimeDefault</tabstop> |
3080 | - <tabstop>radioButtonTime12Hour</tabstop> |
3081 | - <tabstop>radioButtonTime24Hour</tabstop> |
3082 | - <tabstop>radioButtonDateDefault</tabstop> |
3083 | - <tabstop>radioButtonDateYMD</tabstop> |
3084 | - <tabstop>radioButtonDateDMY</tabstop> |
3085 | - <tabstop>radioButtonDateMDY</tabstop> |
3086 | - </tabstops> |
3087 | - <resources/> |
3088 | - <connections> |
3089 | - <connection> |
3090 | - <sender>radioButtonUserDefined</sender> |
3091 | - <signal>toggled(bool)</signal> |
3092 | - <receiver>frameUserDefined</receiver> |
3093 | - <slot>setEnabled(bool)</slot> |
3094 | - <hints> |
3095 | - <hint type="sourcelabel"> |
3096 | - <x>79</x> |
3097 | - <y>404</y> |
3098 | - </hint> |
3099 | - <hint type="destinationlabel"> |
3100 | - <x>296</x> |
3101 | - <y>404</y> |
3102 | - </hint> |
3103 | - </hints> |
3104 | - </connection> |
3105 | - </connections> |
3106 | -</ui> |
3107 | |
3108 | === modified file 'po/stellarium/POTFILES.in' |
3109 | --- po/stellarium/POTFILES.in 2016-10-22 13:40:38 +0000 |
3110 | +++ po/stellarium/POTFILES.in 2016-10-25 16:10:21 +0000 |
3111 | @@ -85,11 +85,6 @@ |
3112 | plugins/TelescopeControl/src/ui_telescopeConfigurationDialog.h |
3113 | plugins/TelescopeControl/src/ui_telescopeDialog.h |
3114 | plugins/TelescopeControl/src/ui_storedPointsDialog.h |
3115 | -plugins/TimeZoneConfiguration/src/TimeZoneConfiguration.cpp |
3116 | -plugins/TimeZoneConfiguration/src/gui/DefineTimeZoneWindow.cpp |
3117 | -plugins/TimeZoneConfiguration/src/gui/TimeZoneConfigurationWindow.cpp |
3118 | -plugins/TimeZoneConfiguration/src/ui_defineTimeZone.h |
3119 | -plugins/TimeZoneConfiguration/src/ui_timeZoneConfigurationWindow.h |
3120 | plugins/TextUserInterface/src/TextUserInterface.cpp |
3121 | plugins/TextUserInterface/src/TuiNodeBool.cpp |
3122 | plugins/TextUserInterface/src/TuiNodeColor.cpp |
3123 | |
3124 | === modified file 'src/core/StelApp.cpp' |
3125 | --- src/core/StelApp.cpp 2016-10-03 16:08:03 +0000 |
3126 | +++ src/core/StelApp.cpp 2016-10-25 16:10:21 +0000 |
3127 | @@ -124,10 +124,6 @@ |
3128 | Q_IMPORT_PLUGIN(SolarSystemEditorStelPluginInterface) |
3129 | #endif |
3130 | |
3131 | -#ifdef USE_STATIC_PLUGIN_TIMEZONECONFIGURATION |
3132 | -Q_IMPORT_PLUGIN(TimeZoneConfigurationStelPluginInterface) |
3133 | -#endif |
3134 | - |
3135 | #ifdef USE_STATIC_PLUGIN_METEORSHOWERS |
3136 | Q_IMPORT_PLUGIN(MeteorShowersStelPluginInterface) |
3137 | #endif |
3138 | |
3139 | === modified file 'src/core/StelCore.cpp' |
3140 | --- src/core/StelCore.cpp 2016-10-09 05:03:17 +0000 |
3141 | +++ src/core/StelCore.cpp 2016-10-25 16:10:21 +0000 |
3142 | @@ -45,6 +45,7 @@ |
3143 | #include <QSettings> |
3144 | #include <QDebug> |
3145 | #include <QMetaEnum> |
3146 | +#include <QTimeZone> |
3147 | |
3148 | #include <iostream> |
3149 | #include <fstream> |
3150 | @@ -78,7 +79,8 @@ |
3151 | , JD(0.,0.) |
3152 | , presetSkyTime(0.) |
3153 | , milliSecondsOfLastJDUpdate(0.) |
3154 | - , jdOfLastJDUpdate(0.) |
3155 | + , jdOfLastJDUpdate(0.) |
3156 | + , flagUseDST(true) |
3157 | , deltaTCustomNDot(-26.0) |
3158 | , deltaTCustomYear(1820.0) |
3159 | , de430Available(false) |
3160 | @@ -118,7 +120,8 @@ |
3161 | currentProjectorParams.devicePixelsPerPixel = StelApp::getInstance().getDevicePixelsPerPixel(); |
3162 | |
3163 | flagUseNutation=conf->value("astro/flag_nutation", true).toBool(); |
3164 | - flagUseTopocentricCoordinates=conf->value("astro/flag_topocentric_coordinates", true).toBool(); |
3165 | + flagUseTopocentricCoordinates=conf->value("astro/flag_topocentric_coordinates", true).toBool(); |
3166 | + flagUseDST=conf->value("localization/flag_dst", true).toBool(); |
3167 | } |
3168 | |
3169 | |
3170 | @@ -164,6 +167,8 @@ |
3171 | } |
3172 | position = new StelObserver(location); |
3173 | |
3174 | + setCurrentTimeZone(conf->value("localization/time_zone", getCurrentLocation().timeZone).toString()); |
3175 | + |
3176 | // Delta-T stuff |
3177 | // Define default algorithm for time correction (Delta T) |
3178 | QString tmpDT = conf->value("navigation/time_correction_algorithm", "EspenakMeeus").toString(); |
3179 | @@ -194,7 +199,7 @@ |
3180 | setInitTodayTime(QTime::fromString(conf->value("navigation/today_time", "22:00").toString())); |
3181 | startupTimeMode = conf->value("navigation/startup_time_mode", "actual").toString().toLower(); |
3182 | if (startupTimeMode=="preset") |
3183 | - setJD(presetSkyTime - StelUtils::getGMTShiftFromQT(presetSkyTime) * JD_HOUR); |
3184 | + setJD(presetSkyTime - getUTCOffset(presetSkyTime) * JD_HOUR); |
3185 | else if (startupTimeMode=="today") |
3186 | setTodayTime(getInitTodayTime()); |
3187 | |
3188 | @@ -1136,6 +1141,115 @@ |
3189 | } |
3190 | } |
3191 | |
3192 | +float StelCore::getUTCOffset(const double JD) const |
3193 | +{ |
3194 | + int year, month, day, hour, minute, second; |
3195 | + StelUtils::getDateFromJulianDay(JD, &year, &month, &day); |
3196 | + StelUtils::getTimeFromJulianDay(JD, &hour, &minute, &second); |
3197 | + // as analogous to second statement in getJDFromDate, nkerr |
3198 | + if ( year <= 0 ) |
3199 | + { |
3200 | + year = year - 1; |
3201 | + } |
3202 | + //getTime/DateFromJulianDay returns UTC time, not local time |
3203 | + QDateTime universal(QDate(year, month, day), QTime(hour, minute, second), Qt::UTC); |
3204 | + if (!universal.isValid()) |
3205 | + { |
3206 | + //qWarning() << "JD " << QString("%1").arg(JD) << " out of bounds of QT help with GMT shift, using current datetime"; |
3207 | + // Assumes the GMT shift was always the same before year -4710 |
3208 | + universal = QDateTime(QDate(-4710, month, day), QTime(hour, minute, second), Qt::UTC); |
3209 | + } |
3210 | + |
3211 | + StelLocation loc = getCurrentLocation(); |
3212 | + QString tzName = getCurrentTimeZone(); |
3213 | + |
3214 | + int shiftInSeconds = 0; |
3215 | + if (tzName=="system_default") |
3216 | + { |
3217 | + QDateTime local = universal.toLocalTime(); |
3218 | + //Both timezones should be interpreted as UTC because secsTo() converts both |
3219 | + //times to UTC if their zones have different daylight saving time rules. |
3220 | + local.setTimeSpec(Qt::UTC); |
3221 | + shiftInSeconds = universal.secsTo(local); |
3222 | + } |
3223 | + else |
3224 | + { |
3225 | + QTimeZone* tz = new QTimeZone(tzName.toUtf8()); |
3226 | + if (tz->isValid() && loc.planetName=="Earth" && year>=1886) |
3227 | + { |
3228 | + if (getUseDST()) |
3229 | + shiftInSeconds = tz->offsetFromUtc(universal); |
3230 | + else |
3231 | + shiftInSeconds = tz->standardTimeOffset(universal); |
3232 | + } |
3233 | + else |
3234 | + shiftInSeconds = (loc.longitude/15.f)*3600.f; // Local Mean Solar Time |
3235 | + |
3236 | + if (tzName=="LTST") |
3237 | + shiftInSeconds += getSolutionEquationOfTime(JD)*60; |
3238 | + |
3239 | + } |
3240 | + |
3241 | + float shiftInHours = shiftInSeconds / 3600.0f; |
3242 | + return shiftInHours; |
3243 | +} |
3244 | + |
3245 | +QString StelCore::getCurrentTimeZone() const |
3246 | +{ |
3247 | + return currentTimeZone; |
3248 | +} |
3249 | + |
3250 | +void StelCore::setCurrentTimeZone(const QString& tz) |
3251 | +{ |
3252 | + currentTimeZone = tz; |
3253 | +} |
3254 | + |
3255 | +bool StelCore::getUseDST() const |
3256 | +{ |
3257 | + return flagUseDST; |
3258 | +} |
3259 | + |
3260 | +void StelCore::setUseDST(const bool b) |
3261 | +{ |
3262 | + flagUseDST = b; |
3263 | + StelApp::getInstance().getSettings()->setValue("localization/flag_dst", b); |
3264 | +} |
3265 | + |
3266 | +double StelCore::getSolutionEquationOfTime(const double JDE) const |
3267 | +{ |
3268 | + double tau = (JDE - 2451545.0)/365250.0; |
3269 | + double sunMeanLongitude = 280.4664567 + tau*(360007.6892779 + tau*(0.03032028 + tau*(1./49931. - tau*(1./15300. - tau/2000000.)))); |
3270 | + |
3271 | + // reduce the angle |
3272 | + sunMeanLongitude = std::fmod(sunMeanLongitude, 360.); |
3273 | + // force it to be the positive remainder, so that 0 <= angle < 360 |
3274 | + sunMeanLongitude = std::fmod(sunMeanLongitude + 360., 360.); |
3275 | + |
3276 | + Vec3d pos = GETSTELMODULE(StelObjectMgr)->searchByName("Sun")->getEquinoxEquatorialPos(this); |
3277 | + double ra, dec; |
3278 | + StelUtils::rectToSphe(&ra, &dec, pos); |
3279 | + |
3280 | + // covert radians to degrees and reduce the angle |
3281 | + double alpha = std::fmod(ra*180./M_PI, 360.); |
3282 | + // force it to be the positive remainder, so that 0 <= angle < 360 |
3283 | + alpha = std::fmod(alpha + 360., 360.); |
3284 | + |
3285 | + double deltaPsi, deltaEps; |
3286 | + getNutationAngles(JDE, &deltaPsi, &deltaEps); // these are radians! |
3287 | + //double equation = 4*(sunMeanLongitude - 0.0057183 - alpha + get_nutation_longitude(JDE)*cos(get_mean_ecliptical_obliquity(JDE))); |
3288 | + double equation = 4*(sunMeanLongitude - 0.0057183 - alpha + deltaPsi*180./M_PI*cos(getPrecessionAngleVondrakEpsilon(JDE))); |
3289 | + // The equation of time is always smaller 20 minutes in absolute value |
3290 | + if (qAbs(equation)>20) |
3291 | + { |
3292 | + // If absolute value of the equation of time appears to be too large, add 24 hours (1440 minutes) to or subtract it from our result |
3293 | + if (equation>0.) |
3294 | + equation -= 1440.; |
3295 | + else |
3296 | + equation += 1440.; |
3297 | + } |
3298 | + |
3299 | + return equation; |
3300 | +} |
3301 | |
3302 | //! Set stellarium time to current real world time |
3303 | void StelCore::setTimeNow() |
3304 | @@ -1150,7 +1264,7 @@ |
3305 | { |
3306 | dt.setTime(target); |
3307 | // don't forget to adjust for timezone / daylight savings. |
3308 | - double JD = StelUtils::qDateTimeToJd(dt)-(StelUtils::getGMTShiftFromQT(StelUtils::getJDFromSystem()) * JD_HOUR); |
3309 | + double JD = StelUtils::qDateTimeToJd(dt)-(getUTCOffset(StelUtils::getJDFromSystem()) * JD_HOUR); |
3310 | setJD(JD); |
3311 | } |
3312 | else |
3313 | |
3314 | === modified file 'src/core/StelCore.hpp' |
3315 | --- src/core/StelCore.hpp 2016-10-09 05:03:17 +0000 |
3316 | +++ src/core/StelCore.hpp 2016-10-25 16:10:21 +0000 |
3317 | @@ -274,6 +274,11 @@ |
3318 | //! Get the informations on the current location |
3319 | const StelLocation& getCurrentLocation() const; |
3320 | |
3321 | + float getUTCOffset(const double JD) const; |
3322 | + |
3323 | + QString getCurrentTimeZone() const; |
3324 | + void setCurrentTimeZone(const QString& tz); |
3325 | + |
3326 | const QSharedPointer<class Planet> getCurrentPlanet() const; |
3327 | |
3328 | //! Unfortunately we also need this. |
3329 | @@ -430,6 +435,14 @@ |
3330 | //! It is still frequently used in the literature. |
3331 | double getJDE() const; |
3332 | |
3333 | + //! Get solution of equation of time |
3334 | + //! Source: J. Meeus "Astronomical Algorithms" (2nd ed., with corrections as of August 10, 2009) p.183-187. |
3335 | + //! @param JDE JD in Dynamical Time (previously called Ephemeris Time) |
3336 | + //! @return time in minutes |
3337 | + double getSolutionEquationOfTime(const double JDE) const; |
3338 | + |
3339 | + bool getUseDST() const; |
3340 | + void setUseDST(const bool b); |
3341 | |
3342 | //! Set the current date in Modified Julian Day (UT). |
3343 | //! MJD is simply JD-2400000.5, getting rid of large numbers and starting days at midnight. |
3344 | @@ -727,13 +740,16 @@ |
3345 | double timeSpeed; // Positive : forward, Negative : Backward, 1 = 1sec/sec |
3346 | //double JDay; // Current time in Julian day. IN V0.12 TO V0.14, this was JD in TT, and all places where UT was required had to subtract getDeltaT() explicitly. |
3347 | QPair<double,double> JD; // From 0.14 on: JD.first=JD_UT, JD.second=DeltaT=TT-UT. To gain JD_TT, compute JDE=JD.first+JD.second or better just call getJDE() |
3348 | - // Use is best with calls getJD()/setJD() and getJDE()/setJDE() to explicitly state which flavour of JD you need. |
3349 | + // Use is best with calls getJD()/setJD() and getJDE()/setJDE() to explicitly state which flavour of JD you need. |
3350 | double presetSkyTime; |
3351 | QTime initTodayTime; |
3352 | QString startupTimeMode; |
3353 | double milliSecondsOfLastJDUpdate; // Time in seconds when the time rate or time last changed |
3354 | double jdOfLastJDUpdate; // JD when the time rate or time last changed |
3355 | |
3356 | + QString currentTimeZone; |
3357 | + bool flagUseDST; |
3358 | + |
3359 | // Variables for custom equation of Delta-T |
3360 | Vec3f deltaTCustomEquationCoeff; |
3361 | float deltaTCustomNDot; |
3362 | |
3363 | === modified file 'src/core/StelLocaleMgr.cpp' |
3364 | --- src/core/StelLocaleMgr.cpp 2016-10-22 13:40:38 +0000 |
3365 | +++ src/core/StelLocaleMgr.cpp 2016-10-25 16:10:21 +0000 |
3366 | @@ -27,7 +27,6 @@ |
3367 | #include <QSettings> |
3368 | #include <QString> |
3369 | #include <QTextStream> |
3370 | - |
3371 | #include <QFile> |
3372 | |
3373 | #include <ctime> |
3374 | @@ -37,9 +36,7 @@ |
3375 | StelLocaleMgr::StelLocaleMgr() |
3376 | : skyTranslator(NULL) |
3377 | , timeFormat() |
3378 | - , dateFormat() |
3379 | - , timeZoneMode() |
3380 | - , GMTShift(0) |
3381 | + , dateFormat() |
3382 | { |
3383 | // Load from file |
3384 | QString path = StelFileMgr::findFile("data/countryCodes.dat"); |
3385 | @@ -57,6 +54,8 @@ |
3386 | in >> countryCodeToStringMap; |
3387 | file.close(); |
3388 | } |
3389 | + |
3390 | + core = StelApp::getInstance().getCore(); |
3391 | } |
3392 | |
3393 | |
3394 | @@ -119,33 +118,6 @@ |
3395 | |
3396 | timeFormat = stringToSTimeFormat(conf->value("localization/time_display_format", "system_default").toString()); |
3397 | dateFormat = stringToSDateFormat(conf->value("localization/date_display_format", "system_default").toString()); |
3398 | - // time_zone used to be in init_location section of config, |
3399 | - // so use that as fallback when reading config - Rob |
3400 | - QString tzstr = conf->value("localization/time_zone", conf->value("init_location/time_zone", "system_default").toString()).toString(); |
3401 | - if (tzstr == "system_default") |
3402 | - { |
3403 | - timeZoneMode = STzSystemDefault; |
3404 | - // Set the program global intern timezones variables from the system locale |
3405 | - #ifdef _MSC_BUILD |
3406 | - _tzset(); |
3407 | - #else |
3408 | - tzset(); |
3409 | - #endif |
3410 | - } |
3411 | - else |
3412 | - { |
3413 | - if (tzstr == "gmt+x") // TODO : handle GMT+X timezones form |
3414 | - { |
3415 | - timeZoneMode = STzGMTShift; |
3416 | - // GMTShift = x; |
3417 | - } |
3418 | - else |
3419 | - { |
3420 | - // We have a custom time zone name |
3421 | - timeZoneMode = STzCustom; |
3422 | - setCustomTzName(tzstr); |
3423 | - } |
3424 | - } |
3425 | } |
3426 | |
3427 | /************************************************************************* |
3428 | @@ -214,16 +186,7 @@ |
3429 | // Return the time in ISO 8601 format that is : %Y-%m-%d %H:%M:%S |
3430 | QString StelLocaleMgr::getISO8601TimeLocal(double JD) const |
3431 | { |
3432 | - double shift = 0.0; |
3433 | - if (timeZoneMode == STzGMTShift) |
3434 | - { |
3435 | - shift = GMTShift; |
3436 | - } |
3437 | - else |
3438 | - { |
3439 | - shift = StelUtils::getGMTShiftFromQT(JD)*0.041666666666; |
3440 | - } |
3441 | - return StelUtils::julianDayToISO8601String(JD + shift); |
3442 | + return StelUtils::julianDayToISO8601String(JD + core->getUTCOffset(JD)*0.041666666666); |
3443 | } |
3444 | |
3445 | //! get the six ints from an ISO8601 date time, understood to be local time, make a jdate out |
3446 | @@ -237,11 +200,7 @@ |
3447 | return 0.0; |
3448 | } |
3449 | |
3450 | - // modified by shift |
3451 | - if (timeZoneMode == STzGMTShift) |
3452 | - jd -= GMTShift; |
3453 | - else |
3454 | - jd -= StelUtils::getGMTShiftFromQT(jd)*0.041666666666; |
3455 | + jd -= core->getUTCOffset(jd)*0.041666666666; |
3456 | return jd; |
3457 | } |
3458 | |
3459 | @@ -250,15 +209,7 @@ |
3460 | QString StelLocaleMgr::getPrintableDateLocal(double JD) const |
3461 | { |
3462 | int year, month, day, dayOfWeek; |
3463 | - double shift = 0.0; |
3464 | - if (timeZoneMode == STzGMTShift) |
3465 | - { |
3466 | - shift = GMTShift; |
3467 | - } |
3468 | - else |
3469 | - { |
3470 | - shift = StelUtils::getGMTShiftFromQT(JD)*0.041666666666; |
3471 | - } |
3472 | + double shift = core->getUTCOffset(JD)*0.041666666666; |
3473 | StelUtils::getDateFromJulianDay(JD+shift, &year, &month, &day); |
3474 | dayOfWeek = (int)floor(fmod(JD, 7)); |
3475 | QString str; |
3476 | @@ -288,15 +239,8 @@ |
3477 | QString StelLocaleMgr::getPrintableTimeLocal(double JD) const |
3478 | { |
3479 | int hour, minute, second; |
3480 | - double shift = 0.0; |
3481 | - if (timeZoneMode == STzGMTShift) |
3482 | - { |
3483 | - shift = GMTShift; |
3484 | - } |
3485 | - else |
3486 | - { |
3487 | - shift = StelUtils::getGMTShiftFromQT(JD)*0.041666666666; |
3488 | - } |
3489 | + double shift = core->getUTCOffset(JD)*0.041666666666; |
3490 | + |
3491 | StelUtils::getTimeFromJulianDay(JD+shift, &hour, &minute, &second); |
3492 | |
3493 | QTime t(hour, minute, second); |
3494 | @@ -317,12 +261,32 @@ |
3495 | |
3496 | QString StelLocaleMgr::getPrintableTimeZoneLocal(double JD) const |
3497 | { |
3498 | - double shift = StelUtils::getGMTShiftFromQT(JD); |
3499 | - QTime tz = QTime(0, 0, 0).addSecs(3600*qAbs(shift)); |
3500 | - if(shift<0.0f) |
3501 | - return "UTC-" + tz.toString("hh:mm"); |
3502 | + if (core->getCurrentLocation().planetName=="Earth") |
3503 | + { |
3504 | + QString timeZone = "UTC"; |
3505 | + QString currTZ = core->getCurrentTimeZone(); |
3506 | + QString timeZoneST = ""; |
3507 | + |
3508 | + if (JD<=2409907.5 || currTZ.contains("auto")) |
3509 | + timeZoneST = "LMST"; |
3510 | + |
3511 | + if (currTZ.contains("LMST") || currTZ.contains("LTST")) |
3512 | + timeZoneST = currTZ; |
3513 | + |
3514 | + float shift = core->getUTCOffset(JD); |
3515 | + QTime tz = QTime(0, 0, 0).addSecs(3600*qAbs(shift)); |
3516 | + if(shift<0.0f) |
3517 | + timeZone.append("-" + tz.toString("hh:mm")); |
3518 | + else |
3519 | + timeZone.append("+" + tz.toString("hh:mm")); |
3520 | + |
3521 | + if (!timeZoneST.isEmpty()) |
3522 | + timeZone.append(" (" + timeZoneST + ")"); |
3523 | + |
3524 | + return timeZone; |
3525 | + } |
3526 | else |
3527 | - return "UTC+" + tz.toString("hh:mm"); |
3528 | + return QString(); |
3529 | } |
3530 | |
3531 | // Convert the time format enum to its associated string and reverse |
3532 | @@ -385,30 +349,6 @@ |
3533 | return dfmt; |
3534 | } |
3535 | |
3536 | -void StelLocaleMgr::setCustomTzName(const QString& tzname) |
3537 | -{ |
3538 | - customTzName = tzname; |
3539 | - timeZoneMode = STzCustom; |
3540 | - |
3541 | - if( customTzName != "") |
3542 | - { |
3543 | - // set the TZ environement variable and update c locale stuff |
3544 | - #ifdef _MSC_BUILD |
3545 | - _putenv(_strdup(qPrintable("TZ=" + customTzName))); |
3546 | - _tzset(); |
3547 | - #else |
3548 | - putenv(strdup(qPrintable("TZ=" + customTzName))); |
3549 | - tzset(); |
3550 | - #endif |
3551 | - } |
3552 | -} |
3553 | - |
3554 | -float StelLocaleMgr::getGMTShift(double JD) const |
3555 | -{ |
3556 | - if (timeZoneMode == STzGMTShift) return GMTShift; |
3557 | - else return StelUtils::getGMTShiftFromQT(JD); |
3558 | -} |
3559 | - |
3560 | // Convert a 2 letter country code to string |
3561 | QString StelLocaleMgr::countryCodeToString(const QString& countryCode) |
3562 | { |
3563 | @@ -425,3 +365,4 @@ |
3564 | res.sort(); |
3565 | return res; |
3566 | } |
3567 | + |
3568 | |
3569 | === modified file 'src/core/StelLocaleMgr.hpp' |
3570 | --- src/core/StelLocaleMgr.hpp 2016-10-22 07:48:38 +0000 |
3571 | +++ src/core/StelLocaleMgr.hpp 2016-10-25 16:10:21 +0000 |
3572 | @@ -21,6 +21,7 @@ |
3573 | #define _STELLOCALEMGR_HPP_ |
3574 | |
3575 | #include "StelTranslator.hpp" |
3576 | +#include "StelCore.hpp" |
3577 | |
3578 | //! @class StelLocaleMgr |
3579 | //! Manage i18n operations such as message translation and date/time localization. |
3580 | @@ -101,11 +102,6 @@ |
3581 | //! Get the format string which describes the current date format (Qt style). |
3582 | QString getQtDateFormatStr(void) const; |
3583 | |
3584 | - //! Set the time zone. |
3585 | - //! @param tZ the time zone string as parsed from the TZ environment |
3586 | - //! varibale by the tzset function from libc. |
3587 | - void setCustomTimezone(QString tZ) { setCustomTzName(tZ); } |
3588 | - |
3589 | //! @enum STimeFormat |
3590 | //! The time display format. |
3591 | enum STimeFormat { |
3592 | @@ -131,35 +127,7 @@ |
3593 | |
3594 | //! Get a localized, formatted string representation of the time zone of a Julian date. |
3595 | QString getPrintableTimeZoneLocal(double JD) const; |
3596 | - |
3597 | - //! @enum STzFormat |
3598 | - enum STzFormat |
3599 | - { |
3600 | - STzCustom, //!< User-specified timezone. |
3601 | - STzGMTShift, //!< GMT + offset. |
3602 | - STzSystemDefault //!< System default. |
3603 | - }; |
3604 | - |
3605 | - //! Get the current time shift at observator time zone with respect to GMT time. |
3606 | - void setGMTShift(int t) |
3607 | - { |
3608 | - GMTShift=t; |
3609 | - } |
3610 | - //! Get the current time shift in hours at observator time zone with respect to GMT time. |
3611 | - float getGMTShift(double JD = 0) const; |
3612 | - //! Set the timezone by a TZ-style string (see tzset in the libc manual). |
3613 | - void setCustomTzName(const QString& tzname); |
3614 | - //! Get the timezone name (a TZ-style string - see tzset in the libc manual). |
3615 | - QString getCustomTzName(void) const |
3616 | - { |
3617 | - return customTzName; |
3618 | - } |
3619 | - //! Get the current timezone format mode. |
3620 | - STzFormat getTzFormat(void) const |
3621 | - { |
3622 | - return timeZoneMode; |
3623 | - } |
3624 | - |
3625 | + |
3626 | //! Return the time in ISO 8601 format that is : %Y-%m-%dT%H:%M:%S |
3627 | //! @param JD the time and date expressed as a Julian date value. |
3628 | QString getISO8601TimeLocal(double JD) const; |
3629 | @@ -180,15 +148,12 @@ |
3630 | private: |
3631 | // The translator used for astronomical object naming |
3632 | StelTranslator* skyTranslator; |
3633 | + StelCore* core; |
3634 | |
3635 | // Date and time variables |
3636 | STimeFormat timeFormat; |
3637 | SDateFormat dateFormat; |
3638 | - STzFormat timeZoneMode; // Can be the system default or a user defined value |
3639 | - |
3640 | - QString customTzName; // Something like "Europe/Paris" |
3641 | - float GMTShift; // Time shift between GMT time and local time in hour. (positive for Est of GMT) |
3642 | - |
3643 | + |
3644 | // Convert the time format enum to its associated string and reverse |
3645 | STimeFormat stringToSTimeFormat(const QString&) const; |
3646 | QString sTimeFormatToString(STimeFormat) const; |
3647 | |
3648 | === modified file 'src/core/StelLocationMgr.cpp' |
3649 | --- src/core/StelLocationMgr.cpp 2016-10-22 15:05:57 +0000 |
3650 | +++ src/core/StelLocationMgr.cpp 2016-10-25 16:10:21 +0000 |
3651 | @@ -391,6 +391,7 @@ |
3652 | .arg(longitude<0 ? QString("%1W").arg(-longitude, 0, 'f', 6) : QString("%1E").arg(longitude, 0, 'f', 6)) |
3653 | .arg(ipTimeZone.isEmpty() ? "" : ipTimeZone); |
3654 | location=StelLocation::createFromLine(locLine); // in lack of a regular constructor ;-) |
3655 | + core->setCurrentTimeZone(ipTimeZone.isEmpty() ? "LMST" : ipTimeZone); |
3656 | core->moveObserverTo(location, 0.0f, 0.0f); |
3657 | QSettings* conf = StelApp::getInstance().getSettings(); |
3658 | conf->setValue("init_location/last_location", QString("%1,%2").arg(latitude).arg(longitude)); |
3659 | @@ -436,3 +437,4 @@ |
3660 | } |
3661 | return results; |
3662 | } |
3663 | + |
3664 | |
3665 | === modified file 'src/gui/AstroCalcDialog.cpp' |
3666 | --- src/gui/AstroCalcDialog.cpp 2016-10-15 17:21:05 +0000 |
3667 | +++ src/gui/AstroCalcDialog.cpp 2016-10-25 16:10:21 +0000 |
3668 | @@ -113,7 +113,7 @@ |
3669 | populateMajorPlanetList(); |
3670 | populateGroupCelestialBodyList(); |
3671 | |
3672 | - double JD = core->getJD() + StelUtils::getGMTShiftFromQT(core->getJD())/24; |
3673 | + double JD = core->getJD() + core->getUTCOffset(core->getJD())/24; |
3674 | ui->dateFromDateTimeEdit->setDateTime(StelUtils::jdToQDateTime(JD)); |
3675 | ui->dateToDateTimeEdit->setDateTime(StelUtils::jdToQDateTime(JD + 30.f)); |
3676 | ui->phenomenFromDateEdit->setDateTime(StelUtils::jdToQDateTime(JD)); |
3677 | @@ -181,8 +181,9 @@ |
3678 | |
3679 | initListPlanetaryPositions(); |
3680 | |
3681 | - double JD = StelApp::getInstance().getCore()->getJD(); |
3682 | - ui->positionsTimeLabel->setText(q_("Positions on %1").arg(StelUtils::jdToQDateTime(JD + StelUtils::getGMTShiftFromQT(JD)/24).toString("yyyy-MM-dd hh:mm"))); |
3683 | + StelCore* core = StelApp::getInstance().getCore(); |
3684 | + double JD = core->getJD(); |
3685 | + ui->positionsTimeLabel->setText(q_("Positions on %1").arg(StelUtils::jdToQDateTime(JD + core->getUTCOffset(JD)/24).toString("yyyy-MM-dd hh:mm"))); |
3686 | |
3687 | foreach (const PlanetP& planet, allPlanets) |
3688 | { |
3689 | @@ -338,7 +339,7 @@ |
3690 | { |
3691 | double currentJD = core->getJD(); // save current JD |
3692 | double firstJD = StelUtils::qDateTimeToJd(ui->dateFromDateTimeEdit->dateTime()); |
3693 | - firstJD = firstJD - StelUtils::getGMTShiftFromQT(firstJD)/24; |
3694 | + firstJD = firstJD - core->getUTCOffset(firstJD)/24; |
3695 | int elements = (int)((StelUtils::qDateTimeToJd(ui->dateToDateTimeEdit->dateTime()) - firstJD)/currentStep); |
3696 | EphemerisListJ2000.clear(); |
3697 | EphemerisListJ2000.reserve(elements); |
3698 | @@ -351,11 +352,11 @@ |
3699 | core->update(0); // force update to get new coordinates |
3700 | Vec3d pos = obj->getJ2000EquatorialPos(core); |
3701 | EphemerisListJ2000.append(pos); |
3702 | - EphemerisListDates.append(StelUtils::jdToQDateTime(JD + StelUtils::getGMTShiftFromQT(JD)/24).toString("yyyy-MM-dd")); |
3703 | + EphemerisListDates.append(StelUtils::jdToQDateTime(JD + core->getUTCOffset(JD)/24).toString("yyyy-MM-dd")); |
3704 | StelUtils::rectToSphe(&ra,&dec,pos); |
3705 | ACTreeWidgetItem *treeItem = new ACTreeWidgetItem(ui->ephemerisTreeWidget); |
3706 | // local date and time |
3707 | - treeItem->setText(EphemerisDate, StelUtils::jdToQDateTime(JD + StelUtils::getGMTShiftFromQT(JD)/24).toString("yyyy-MM-dd hh:mm:ss")); |
3708 | + treeItem->setText(EphemerisDate, StelUtils::jdToQDateTime(JD + core->getUTCOffset(JD)/24).toString("yyyy-MM-dd hh:mm:ss")); |
3709 | treeItem->setText(EphemerisJD, QString::number(JD, 'f', 5)); |
3710 | treeItem->setText(EphemerisRA, StelUtils::radToHmsStr(ra)); |
3711 | treeItem->setTextAlignment(EphemerisRA, Qt::AlignRight); |
3712 | @@ -573,7 +574,7 @@ |
3713 | QString date = modelIndex.sibling(modelIndex.row(), PhenomenaDate).data().toString(); |
3714 | bool ok; |
3715 | double JD = StelUtils::getJulianDayFromISO8601String(date.left(10) + "T" + date.right(8), &ok); |
3716 | - JD -= StelUtils::getGMTShiftFromQT(JD)/24.; |
3717 | + JD -= core->getUTCOffset(JD)/24.; |
3718 | |
3719 | if (objectMgr->findAndSelectI18n(name) || objectMgr->findAndSelect(name)) |
3720 | { |
3721 | @@ -712,8 +713,8 @@ |
3722 | double currentJD = core->getJD(); // save current JD |
3723 | double startJD = StelUtils::qDateTimeToJd(ui->phenomenFromDateEdit->dateTime()); |
3724 | double stopJD = StelUtils::qDateTimeToJd(ui->phenomenToDateEdit->dateTime()); |
3725 | - startJD = startJD - StelUtils::getGMTShiftFromQT(startJD)/24; |
3726 | - stopJD = stopJD - StelUtils::getGMTShiftFromQT(stopJD)/24; |
3727 | + startJD = startJD - core->getUTCOffset(startJD)/24; |
3728 | + stopJD = stopJD - core->getUTCOffset(stopJD)/24; |
3729 | |
3730 | if (obj2Type<9) |
3731 | { |
3732 | @@ -805,7 +806,7 @@ |
3733 | ACTreeWidgetItem *treeItem = new ACTreeWidgetItem(ui->phenomenaTreeWidget); |
3734 | treeItem->setText(PhenomenaType, phenomenType); |
3735 | // local date and time |
3736 | - treeItem->setText(PhenomenaDate, StelUtils::jdToQDateTime(it.key() + StelUtils::getGMTShiftFromQT(it.key())/24).toString("yyyy-MM-dd hh:mm:ss")); |
3737 | + treeItem->setText(PhenomenaDate, StelUtils::jdToQDateTime(it.key() + core->getUTCOffset(it.key())/24).toString("yyyy-MM-dd hh:mm:ss")); |
3738 | treeItem->setText(PhenomenaObject1, object1->getNameI18n()); |
3739 | treeItem->setText(PhenomenaObject2, object2->getNameI18n()); |
3740 | treeItem->setText(PhenomenaSeparation, StelUtils::radToDmsStr(separation)); |
3741 | @@ -954,7 +955,7 @@ |
3742 | ACTreeWidgetItem *treeItem = new ACTreeWidgetItem(ui->phenomenaTreeWidget); |
3743 | treeItem->setText(PhenomenaType, phenomenType); |
3744 | // local date and time |
3745 | - treeItem->setText(PhenomenaDate, StelUtils::jdToQDateTime(it.key() + StelUtils::getGMTShiftFromQT(it.key())/24).toString("yyyy-MM-dd hh:mm:ss")); |
3746 | + treeItem->setText(PhenomenaDate, StelUtils::jdToQDateTime(it.key() + core->getUTCOffset(it.key())/24).toString("yyyy-MM-dd hh:mm:ss")); |
3747 | treeItem->setText(PhenomenaObject1, object1->getNameI18n()); |
3748 | if (!object2->getNameI18n().isEmpty()) |
3749 | treeItem->setText(PhenomenaObject2, object2->getNameI18n()); |
3750 | |
3751 | === modified file 'src/gui/BookmarksDialog.cpp' |
3752 | --- src/gui/BookmarksDialog.cpp 2016-08-24 13:32:23 +0000 |
3753 | +++ src/gui/BookmarksDialog.cpp 2016-10-25 16:10:21 +0000 |
3754 | @@ -156,7 +156,7 @@ |
3755 | if (dateTimeFlag) |
3756 | { |
3757 | JD = core->getJD(); |
3758 | - JDs = StelUtils::julianDayToISO8601String(JD + StelUtils::getGMTShiftFromQT(JD)/24.).replace("T", " "); |
3759 | + JDs = StelUtils::julianDayToISO8601String(JD + core->getUTCOffset(JD)/24.).replace("T", " "); |
3760 | } |
3761 | |
3762 | QString Location = ""; |
3763 | @@ -277,7 +277,7 @@ |
3764 | if (!JD.isEmpty()) |
3765 | { |
3766 | bm.jd = JD; |
3767 | - JDs = StelUtils::julianDayToISO8601String(JD.toDouble() + StelUtils::getGMTShiftFromQT(JD.toDouble())/24.).replace("T", " "); |
3768 | + JDs = StelUtils::julianDayToISO8601String(JD.toDouble() + core->getUTCOffset(JD.toDouble())/24.).replace("T", " "); |
3769 | } |
3770 | QString Location = bookmarkData.value("location").toString(); |
3771 | if (!Location.isEmpty()) |
3772 | |
3773 | === modified file 'src/gui/ConfigurationDialog.cpp' |
3774 | --- src/gui/ConfigurationDialog.cpp 2016-10-10 04:45:16 +0000 |
3775 | +++ src/gui/ConfigurationDialog.cpp 2016-10-25 16:10:21 +0000 |
3776 | @@ -988,7 +988,7 @@ |
3777 | { |
3778 | StelCore* core = StelApp::getInstance().getCore(); |
3779 | double JD = core->getJD(); |
3780 | - ui->fixedDateTimeEdit->setDateTime(StelUtils::jdToQDateTime(JD+StelUtils::getGMTShiftFromQT(JD)/24)); |
3781 | + ui->fixedDateTimeEdit->setDateTime(StelUtils::jdToQDateTime(JD+core->getUTCOffset(JD)/24)); |
3782 | ui->fixedTimeRadio->setChecked(true); |
3783 | setStartupTimeMode(); |
3784 | } |
3785 | |
3786 | === modified file 'src/gui/DateTimeDialog.cpp' |
3787 | --- src/gui/DateTimeDialog.cpp 2016-05-16 12:35:53 +0000 |
3788 | +++ src/gui/DateTimeDialog.cpp 2016-10-25 16:10:21 +0000 |
3789 | @@ -54,9 +54,10 @@ |
3790 | void DateTimeDialog::createDialogContent() |
3791 | { |
3792 | ui->setupUi(dialog); |
3793 | - double jd = StelApp::getInstance().getCore()->getJD(); |
3794 | + StelCore *core = StelApp::getInstance().getCore(); |
3795 | + double jd = core->getJD(); |
3796 | // UTC -> local tz |
3797 | - setDateTime(jd + (StelApp::getInstance().getLocaleMgr().getGMTShift(jd)/24.0)); |
3798 | + setDateTime(jd + (core->getUTCOffset(jd)/24.0)); |
3799 | |
3800 | connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); |
3801 | connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); |
3802 | @@ -202,7 +203,7 @@ |
3803 | { |
3804 | double cjd; |
3805 | StelUtils::getJDFromDate(&cjd, year, month, day, hour, minute, second); |
3806 | - cjd -= (StelApp::getInstance().getLocaleMgr().getGMTShift(cjd)/24.0); // local tz -> UTC |
3807 | + cjd -= (StelApp::getInstance().getCore()->getUTCOffset(cjd)/24.0); // local tz -> UTC |
3808 | |
3809 | return cjd; |
3810 | } |
3811 | @@ -232,7 +233,7 @@ |
3812 | { |
3813 | if (this->visible()) { |
3814 | // JD and MJD should be at the UTC scale on the window! |
3815 | - double newJdC = newJd + StelApp::getInstance().getLocaleMgr().getGMTShift(newJd)/24.0; // UTC -> local tz |
3816 | + double newJdC = newJd + StelApp::getInstance().getCore()->getUTCOffset(newJd)/24.0; // UTC -> local tz |
3817 | StelUtils::getDateFromJulianDay(newJdC, &year, &month, &day); |
3818 | StelUtils::getTimeFromJulianDay(newJdC, &hour, &minute, &second); |
3819 | jd = newJd; |
3820 | |
3821 | === modified file 'src/gui/LocationDialog.cpp' |
3822 | --- src/gui/LocationDialog.cpp 2016-06-13 16:32:42 +0000 |
3823 | +++ src/gui/LocationDialog.cpp 2016-10-25 16:10:21 +0000 |
3824 | @@ -40,6 +40,7 @@ |
3825 | #include <QSortFilterProxyModel> |
3826 | #include <QTimer> |
3827 | #include <QStringListModel> |
3828 | +#include <QTimeZone> |
3829 | |
3830 | LocationDialog::LocationDialog(QObject* parent) |
3831 | : StelDialog(parent) |
3832 | @@ -64,6 +65,7 @@ |
3833 | ui->retranslateUi(dialog); |
3834 | populatePlanetList(); |
3835 | populateCountryList(); |
3836 | + populateTimeZonesList(); |
3837 | } |
3838 | } |
3839 | |
3840 | @@ -113,6 +115,7 @@ |
3841 | |
3842 | populatePlanetList(); |
3843 | populateCountryList(); |
3844 | + populateTimeZonesList(); |
3845 | |
3846 | connect(ui->citySearchLineEdit, SIGNAL(textChanged(const QString&)), proxyModel, SLOT(setFilterWildcard(const QString&))); |
3847 | connect(ui->citiesListView, SIGNAL(clicked(const QModelIndex&)), |
3848 | @@ -137,13 +140,24 @@ |
3849 | ui->useIpQueryCheckBox->setChecked(true); |
3850 | b = false; |
3851 | } |
3852 | + updateDefaultLocationControls(b); |
3853 | + |
3854 | + customTimeZone = conf->value("localization/time_zone", "").toString(); |
3855 | + if (!customTimeZone.isEmpty()) |
3856 | + b = true; |
3857 | + else |
3858 | + b = false; |
3859 | + updateTimeZoneControls(b); |
3860 | |
3861 | setFieldsFromLocation(currentLocation); |
3862 | - updateDefaultLocationControls(b); |
3863 | |
3864 | connect(ui->useIpQueryCheckBox, SIGNAL(clicked(bool)), this, SLOT(ipQueryLocation(bool))); |
3865 | connect(ui->useAsDefaultLocationCheckBox, SIGNAL(clicked(bool)), this, SLOT(setDefaultLocation(bool))); |
3866 | connect(ui->pushButtonReturnToDefault, SIGNAL(clicked()), core, SLOT(returnToDefaultLocation())); |
3867 | + connect(ui->useCustomTimeZoneCheckBox, SIGNAL(clicked(bool)), this, SLOT(updateTimeZoneControls(bool))); |
3868 | + |
3869 | + ui->dstCheckBox->setChecked(core->getUseDST()); |
3870 | + connect(ui->dstCheckBox, SIGNAL(clicked(bool)), core, SLOT(setUseDST(bool))); |
3871 | |
3872 | connectEditSignals(); |
3873 | |
3874 | @@ -178,7 +192,7 @@ |
3875 | } |
3876 | |
3877 | const QString& key1 = currentLocation.getID(); |
3878 | - const QString& key2 = locationFromFields().getID(); |
3879 | + const QString& key2 = locationFromFields().getID(); |
3880 | if (key1!=key2) |
3881 | { |
3882 | setFieldsFromLocation(currentLocation); |
3883 | @@ -192,6 +206,7 @@ |
3884 | disconnect(ui->altitudeSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPositionFromCoords(int))); |
3885 | disconnect(ui->planetNameComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(moveToAnotherPlanet(const QString&))); |
3886 | disconnect(ui->countryNameComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(reportEdit())); |
3887 | + disconnect(ui->timeZoneNameComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(saveTimeZone())); |
3888 | disconnect(ui->cityNameLineEdit, SIGNAL(textEdited(const QString&)), this, SLOT(reportEdit())); |
3889 | } |
3890 | |
3891 | @@ -202,6 +217,7 @@ |
3892 | connect(ui->altitudeSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setPositionFromCoords(int))); |
3893 | connect(ui->planetNameComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(moveToAnotherPlanet(const QString&))); |
3894 | connect(ui->countryNameComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(reportEdit())); |
3895 | + connect(ui->timeZoneNameComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(saveTimeZone())); |
3896 | connect(ui->cityNameLineEdit, SIGNAL(textEdited(const QString&)), this, SLOT(reportEdit())); |
3897 | } |
3898 | |
3899 | @@ -230,6 +246,19 @@ |
3900 | idx = ui->planetNameComboBox->findData(QVariant("Earth"), Qt::UserRole, Qt::MatchCaseSensitive); |
3901 | } |
3902 | ui->planetNameComboBox->setCurrentIndex(idx); |
3903 | + |
3904 | + QString tz = loc.timeZone; |
3905 | + if (!customTimeZone.isEmpty()) |
3906 | + tz = customTimeZone; |
3907 | + idx = ui->timeZoneNameComboBox->findData(tz, Qt::UserRole, Qt::MatchCaseSensitive); |
3908 | + if (idx==-1) |
3909 | + { |
3910 | + // Use LMST as default |
3911 | + idx = ui->timeZoneNameComboBox->findData(QVariant("LMST"), Qt::UserRole, Qt::MatchCaseSensitive); |
3912 | + } |
3913 | + ui->timeZoneNameComboBox->setCurrentIndex(idx); |
3914 | + StelApp::getInstance().getCore()->setCurrentTimeZone(tz); |
3915 | + |
3916 | setMapForLocation(loc); |
3917 | |
3918 | // Set pointer position |
3919 | @@ -335,6 +364,7 @@ |
3920 | { |
3921 | countries->addItem(q_(name), name); |
3922 | } |
3923 | + countries->addItem(QChar(0x2014), ""); |
3924 | //Restore the selection |
3925 | index = countries->findData(selectedCountryId, Qt::UserRole, Qt::MatchCaseSensitive); |
3926 | countries->setCurrentIndex(index); |
3927 | @@ -343,6 +373,41 @@ |
3928 | |
3929 | } |
3930 | |
3931 | +void LocationDialog::populateTimeZonesList() |
3932 | +{ |
3933 | + Q_ASSERT(ui->timeZoneNameComboBox); |
3934 | + |
3935 | + QComboBox* timeZones = ui->timeZoneNameComboBox; |
3936 | + // Return a list of all the known time zone names (from Qt) |
3937 | + QStringList tzNames; |
3938 | + QList<QByteArray> tzList = QTimeZone::availableTimeZoneIds(); |
3939 | + QList<QByteArray>::iterator i; |
3940 | + for (i = tzList.begin(); i!= tzList.end(); ++i) |
3941 | + tzNames.append(*i); |
3942 | + |
3943 | + tzNames.sort(); |
3944 | + |
3945 | + //Save the current selection to be restored later |
3946 | + timeZones->blockSignals(true); |
3947 | + int index = timeZones->currentIndex(); |
3948 | + QVariant selectedTzId = timeZones->itemData(index); |
3949 | + timeZones->clear(); |
3950 | + //For each time zone, display the localized name and store the original as user |
3951 | + //data. Unfortunately, there's no other way to do this than with a cycle. |
3952 | + foreach(const QString& name, tzNames) |
3953 | + { |
3954 | + timeZones->addItem(q_(name), name); |
3955 | + } |
3956 | + timeZones->addItem(q_("Local Mean Solar Time"), "LMST"); |
3957 | + timeZones->addItem(q_("Local True Solar Time"), "LTST"); |
3958 | + timeZones->addItem(q_("System default"), "system_default"); |
3959 | + //Restore the selection |
3960 | + index = timeZones->findData(selectedTzId, Qt::UserRole, Qt::MatchCaseSensitive); |
3961 | + timeZones->setCurrentIndex(index); |
3962 | + timeZones->blockSignals(false); |
3963 | + |
3964 | +} |
3965 | + |
3966 | // Create a StelLocation instance from the fields |
3967 | StelLocation LocationDialog::locationFromFields() const |
3968 | { |
3969 | @@ -362,6 +427,12 @@ |
3970 | else |
3971 | loc.country = ui->countryNameComboBox->itemData(index).toString(); |
3972 | |
3973 | + index = ui->timeZoneNameComboBox->currentIndex(); |
3974 | + if (index < 0) |
3975 | + loc.timeZone = QString(); //As returned by QComboBox::currentText() |
3976 | + else |
3977 | + loc.timeZone = ui->timeZoneNameComboBox->itemData(index).toString(); |
3978 | + |
3979 | return loc; |
3980 | } |
3981 | |
3982 | @@ -383,12 +454,14 @@ |
3983 | loc.longitude = longitude; |
3984 | setFieldsFromLocation(loc); |
3985 | StelApp::getInstance().getCore()->moveObserverTo(loc, 0.); |
3986 | + if (customTimeZone.isEmpty()) |
3987 | + ui->timeZoneNameComboBox->setCurrentIndex(ui->timeZoneNameComboBox->findData("LMST", Qt::UserRole, Qt::MatchCaseSensitive)); |
3988 | // GZ: Filter location list for nearby sites. I assume Earth locations are better known. With only few locations on other planets in the list, 30 degrees seem OK. |
3989 | LocationMap results = StelApp::getInstance().getLocationMgr().pickLocationsNearby(loc.planetName, longitude, latitude, loc.planetName=="Earth" ? 3.0f: 30.0f); |
3990 | pickedModel->setStringList(results.keys()); |
3991 | proxyModel->setSourceModel(pickedModel); |
3992 | proxyModel->sort(0, Qt::AscendingOrder); |
3993 | - ui->citySearchLineEdit->clear(); |
3994 | + ui->citySearchLineEdit->clear(); |
3995 | } |
3996 | |
3997 | // Called when the planet name is changed by hand |
3998 | @@ -422,6 +495,10 @@ |
3999 | LocationMap results = locMgr.pickLocationsNearby(loc.planetName, 0.0f, 0.0f, 180.0f); |
4000 | pickedModel->setStringList(results.keys()); |
4001 | proxyModel->setSourceModel(pickedModel); |
4002 | + ui->countryNameComboBox->setCurrentIndex(ui->countryNameComboBox->findData("", Qt::UserRole, Qt::MatchCaseSensitive)); |
4003 | + if (customTimeZone.isEmpty()) |
4004 | + ui->timeZoneNameComboBox->setCurrentIndex(ui->timeZoneNameComboBox->findData("LMST", Qt::UserRole, Qt::MatchCaseSensitive)); |
4005 | + |
4006 | } |
4007 | proxyModel->sort(0, Qt::AscendingOrder); |
4008 | ui->citySearchLineEdit->clear(); |
4009 | @@ -443,6 +520,14 @@ |
4010 | ui->mapLabel->setCursorPos(loc.longitude, loc.latitude); |
4011 | } |
4012 | |
4013 | +void LocationDialog::saveTimeZone() |
4014 | +{ |
4015 | + QString tz = ui->timeZoneNameComboBox->itemData(ui->timeZoneNameComboBox->currentIndex()).toString(); |
4016 | + StelApp::getInstance().getCore()->setCurrentTimeZone(tz); |
4017 | + if (ui->useCustomTimeZoneCheckBox->isChecked()) |
4018 | + StelApp::getInstance().getSettings()->setValue("localization/time_zone", tz); |
4019 | +} |
4020 | + |
4021 | void LocationDialog::reportEdit() |
4022 | { |
4023 | if (isEditingNew==false) |
4024 | @@ -473,6 +558,7 @@ |
4025 | } |
4026 | ui->addLocationToListPushButton->setEnabled(isEditingNew && canSave); |
4027 | ui->deleteLocationFromListPushButton->setEnabled(locationMgr.canDeleteUserLocation(loc.getID())); |
4028 | + ui->timeZoneNameComboBox->setEnabled(isEditingNew && canSave); |
4029 | } |
4030 | |
4031 | // Called when the user clicks on the save button |
4032 | @@ -535,6 +621,29 @@ |
4033 | ui->useAsDefaultLocationCheckBox->setEnabled(!currentIsDefault); |
4034 | } |
4035 | |
4036 | +void LocationDialog::updateTimeZoneControls(bool useCustomTimeZone) |
4037 | +{ |
4038 | + if (useCustomTimeZone) |
4039 | + { |
4040 | + ui->useCustomTimeZoneCheckBox->setChecked(true); |
4041 | + saveTimeZone(); |
4042 | + } |
4043 | + else |
4044 | + { |
4045 | + StelLocation loc = StelApp::getInstance().getCore()->getCurrentLocation(); |
4046 | + int idx = ui->timeZoneNameComboBox->findData(loc.timeZone, Qt::UserRole, Qt::MatchCaseSensitive); |
4047 | + if (idx==-1) |
4048 | + { |
4049 | + // Use LMST as default |
4050 | + idx = ui->timeZoneNameComboBox->findData(QVariant("LMST"), Qt::UserRole, Qt::MatchCaseSensitive); |
4051 | + } |
4052 | + ui->timeZoneNameComboBox->setCurrentIndex(idx); |
4053 | + StelApp::getInstance().getSettings()->remove("localization/time_zone"); |
4054 | + } |
4055 | + |
4056 | + ui->timeZoneNameComboBox->setEnabled(useCustomTimeZone); |
4057 | +} |
4058 | + |
4059 | // called when the user clicks on the IP Query button |
4060 | void LocationDialog::ipQueryLocation(bool state) |
4061 | { |
4062 | @@ -548,6 +657,8 @@ |
4063 | locMgr.locationFromIP(); // This just triggers asynchronous lookup. |
4064 | ui->useAsDefaultLocationCheckBox->setChecked(!state); |
4065 | ui->pushButtonReturnToDefault->setEnabled(!state); |
4066 | + ui->useCustomTimeZoneCheckBox->setChecked(!state); |
4067 | + updateTimeZoneControls(!state); |
4068 | connectEditSignals(); |
4069 | ui->citySearchLineEdit->setFocus(); |
4070 | } |
4071 | |
4072 | === modified file 'src/gui/LocationDialog.hpp' |
4073 | --- src/gui/LocationDialog.hpp 2015-08-31 20:19:42 +0000 |
4074 | +++ src/gui/LocationDialog.hpp 2016-10-25 16:10:21 +0000 |
4075 | @@ -74,6 +74,12 @@ |
4076 | //! The original names are kept in the user data field of each QComboBox |
4077 | //! item. |
4078 | void populateCountryList(); |
4079 | + |
4080 | + //! Populates the drop-down list of time zones. |
4081 | + //! The displayed names are localized in the current interface language. |
4082 | + //! The original names are kept in the user data field of each QComboBox |
4083 | + //! item. |
4084 | + void populateTimeZonesList(); |
4085 | |
4086 | private slots: |
4087 | //! Called whenever the StelLocationMgr is updated |
4088 | @@ -81,6 +87,8 @@ |
4089 | |
4090 | //! To be called when user edits any field |
4091 | void reportEdit(); |
4092 | + |
4093 | + void saveTimeZone(); |
4094 | |
4095 | //! Update the widget to make sure it is synchrone if the location is changed programmatically |
4096 | //! This function should be called repeatidly with e.g. a timer |
4097 | @@ -115,15 +123,20 @@ |
4098 | |
4099 | //! Called when the user wants to use the current location as default |
4100 | void setDefaultLocation(bool state); |
4101 | - |
4102 | + |
4103 | + //! Updates the check state and the enabled/disabled status. |
4104 | + void updateTimeZoneControls(bool useCustomTimeZone); |
4105 | + |
4106 | private: |
4107 | QString lastPlanet; |
4108 | + QString customTimeZone; |
4109 | QStringListModel* allModel; |
4110 | QStringListModel* pickedModel; |
4111 | QSortFilterProxyModel *proxyModel; |
4112 | |
4113 | //! Updates the check state and the enabled/disabled status. |
4114 | void updateDefaultLocationControls(bool currentIsDefault); |
4115 | + |
4116 | }; |
4117 | |
4118 | #endif // _LOCATIONDIALOG_HPP_ |
4119 | |
4120 | === modified file 'src/gui/StelGuiItems.cpp' |
4121 | --- src/gui/StelGuiItems.cpp 2016-09-16 14:19:52 +0000 |
4122 | +++ src/gui/StelGuiItems.cpp 2016-10-25 16:10:21 +0000 |
4123 | @@ -626,6 +626,17 @@ |
4124 | newDateInfo = QString("JD %1").arg(jd, 0, 'f', 6); |
4125 | } |
4126 | |
4127 | + QString currTZ = QString("%1: %2").arg(q_("Time zone")).arg(core->getCurrentTimeZone()); |
4128 | + if (currTZ.contains("system_default")) |
4129 | + currTZ = QString("%1: %2").arg(q_("Time zone")).arg(q_("System default")); |
4130 | + |
4131 | + QString planetName = core->getCurrentLocation().planetName; |
4132 | + if (currTZ.contains("LMST") || currTZ.contains("auto") || (planetName=="Earth" && jd<=2409907.5) || planetName!="Earth") |
4133 | + currTZ = q_("Local Mean Solar Time"); |
4134 | + |
4135 | + if (currTZ.contains("LTST")) |
4136 | + currTZ = q_("Local True Solar Time"); |
4137 | + |
4138 | if (datetime->text()!=newDateInfo) |
4139 | { |
4140 | updatePos = true; |
4141 | @@ -641,10 +652,11 @@ |
4142 | else |
4143 | deltaTInfo = QString("%1s%2").arg(deltaT, 3, 'f', 3).arg(validRangeMarker); |
4144 | |
4145 | - datetime->setToolTip(QString("<p style='white-space:pre'>%1T = %2 [n-dot @ -23.8946\"/cy%3%4]<br>%5</p>").arg(QChar(0x0394)).arg(deltaTInfo).arg(QChar(0x00B2)).arg(sigmaInfo).arg(newDateAppx)); |
4146 | + datetime->setToolTip(QString("<p style='white-space:pre'>%1T = %2 [n-dot @ -23.8946\"/cy%3%4]<br>%5<br>%6</p>").arg(QChar(0x0394)).arg(deltaTInfo).arg(QChar(0x00B2)).arg(sigmaInfo).arg(newDateAppx).arg(currTZ)); |
4147 | } |
4148 | else |
4149 | - datetime->setToolTip(QString("%1").arg(newDateAppx)); |
4150 | + datetime->setToolTip(QString("<p style='white-space:pre'>%1<br>%2</p>").arg(newDateAppx).arg(currTZ)); |
4151 | + |
4152 | if (qApp->property("text_texture")==true) // CLI option -t given? |
4153 | { |
4154 | datetime->setVisible(false); // hide normal thingy. |
4155 | |
4156 | === modified file 'src/gui/configurationDialog.ui' |
4157 | --- src/gui/configurationDialog.ui 2016-08-24 13:32:23 +0000 |
4158 | +++ src/gui/configurationDialog.ui 2016-10-25 16:10:21 +0000 |
4159 | @@ -7,7 +7,7 @@ |
4160 | <x>0</x> |
4161 | <y>0</y> |
4162 | <width>512</width> |
4163 | - <height>548</height> |
4164 | + <height>563</height> |
4165 | </rect> |
4166 | </property> |
4167 | <layout class="QVBoxLayout"> |
4168 | @@ -148,7 +148,7 @@ |
4169 | <item row="1" column="0"> |
4170 | <widget class="QStackedWidget" name="configurationStackedWidget"> |
4171 | <property name="currentIndex"> |
4172 | - <number>0</number> |
4173 | + <number>2</number> |
4174 | </property> |
4175 | <widget class="QWidget" name="page"> |
4176 | <layout class="QVBoxLayout" name="verticalLayout_10"> |
4177 | @@ -495,6 +495,18 @@ |
4178 | <string>Selected object information</string> |
4179 | </property> |
4180 | <layout class="QGridLayout" name="gridLayout_2"> |
4181 | + <property name="leftMargin"> |
4182 | + <number>0</number> |
4183 | + </property> |
4184 | + <property name="topMargin"> |
4185 | + <number>0</number> |
4186 | + </property> |
4187 | + <property name="rightMargin"> |
4188 | + <number>0</number> |
4189 | + </property> |
4190 | + <property name="bottomMargin"> |
4191 | + <number>0</number> |
4192 | + </property> |
4193 | <item row="0" column="0"> |
4194 | <widget class="QRadioButton" name="allSelectedInfoRadio"> |
4195 | <property name="toolTip"> |
4196 | @@ -766,16 +778,6 @@ |
4197 | <property name="bottomMargin"> |
4198 | <number>0</number> |
4199 | </property> |
4200 | - <item row="0" column="0"> |
4201 | - <widget class="QCheckBox" name="enableKeysNavigationCheckBox"> |
4202 | - <property name="toolTip"> |
4203 | - <string>Allow keyboard to pan and zoom</string> |
4204 | - </property> |
4205 | - <property name="text"> |
4206 | - <string>Enable keyboard navigation</string> |
4207 | - </property> |
4208 | - </widget> |
4209 | - </item> |
4210 | <item row="1" column="0"> |
4211 | <widget class="QCheckBox" name="enableMouseNavigationCheckBox"> |
4212 | <property name="toolTip"> |
4213 | @@ -793,6 +795,16 @@ |
4214 | </property> |
4215 | </widget> |
4216 | </item> |
4217 | + <item row="0" column="0"> |
4218 | + <widget class="QCheckBox" name="enableKeysNavigationCheckBox"> |
4219 | + <property name="toolTip"> |
4220 | + <string>Allow keyboard to pan and zoom</string> |
4221 | + </property> |
4222 | + <property name="text"> |
4223 | + <string>Enable keyboard navigation</string> |
4224 | + </property> |
4225 | + </widget> |
4226 | + </item> |
4227 | <item row="1" column="1"> |
4228 | <layout class="QHBoxLayout" name="_8"> |
4229 | <item> |
4230 | @@ -866,63 +878,6 @@ |
4231 | <property name="bottomMargin"> |
4232 | <number>0</number> |
4233 | </property> |
4234 | - <item row="2" column="0"> |
4235 | - <layout class="QHBoxLayout" name="_4"> |
4236 | - <item> |
4237 | - <widget class="QRadioButton" name="fixedTimeRadio"> |
4238 | - <property name="toolTip"> |
4239 | - <string>Use a specific date and time when Stellarium starts up</string> |
4240 | - </property> |
4241 | - <property name="text"> |
4242 | - <string>Other:</string> |
4243 | - </property> |
4244 | - </widget> |
4245 | - </item> |
4246 | - <item> |
4247 | - <widget class="QDateTimeEdit" name="fixedDateTimeEdit"> |
4248 | - <property name="minimumSize"> |
4249 | - <size> |
4250 | - <width>0</width> |
4251 | - <height>24</height> |
4252 | - </size> |
4253 | - </property> |
4254 | - <property name="maximumSize"> |
4255 | - <size> |
4256 | - <width>16777215</width> |
4257 | - <height>24</height> |
4258 | - </size> |
4259 | - </property> |
4260 | - <property name="date"> |
4261 | - <date> |
4262 | - <year>1952</year> |
4263 | - <month>5</month> |
4264 | - <day>11</day> |
4265 | - </date> |
4266 | - </property> |
4267 | - <property name="time"> |
4268 | - <time> |
4269 | - <hour>0</hour> |
4270 | - <minute>42</minute> |
4271 | - <second>0</second> |
4272 | - </time> |
4273 | - </property> |
4274 | - <property name="calendarPopup"> |
4275 | - <bool>true</bool> |
4276 | - </property> |
4277 | - </widget> |
4278 | - </item> |
4279 | - </layout> |
4280 | - </item> |
4281 | - <item row="2" column="1"> |
4282 | - <widget class="QPushButton" name="fixedDateTimeCurrentButton"> |
4283 | - <property name="toolTip"> |
4284 | - <string>Use current local date and time</string> |
4285 | - </property> |
4286 | - <property name="text"> |
4287 | - <string>use current</string> |
4288 | - </property> |
4289 | - </widget> |
4290 | - </item> |
4291 | <item row="0" column="0"> |
4292 | <widget class="QRadioButton" name="systemTimeRadio"> |
4293 | <property name="toolTip"> |
4294 | @@ -991,6 +946,63 @@ |
4295 | </item> |
4296 | </layout> |
4297 | </item> |
4298 | + <item row="2" column="0"> |
4299 | + <layout class="QHBoxLayout" name="_4"> |
4300 | + <item> |
4301 | + <widget class="QRadioButton" name="fixedTimeRadio"> |
4302 | + <property name="toolTip"> |
4303 | + <string>Use a specific date and time when Stellarium starts up</string> |
4304 | + </property> |
4305 | + <property name="text"> |
4306 | + <string>Other:</string> |
4307 | + </property> |
4308 | + </widget> |
4309 | + </item> |
4310 | + <item> |
4311 | + <widget class="QDateTimeEdit" name="fixedDateTimeEdit"> |
4312 | + <property name="minimumSize"> |
4313 | + <size> |
4314 | + <width>0</width> |
4315 | + <height>24</height> |
4316 | + </size> |
4317 | + </property> |
4318 | + <property name="maximumSize"> |
4319 | + <size> |
4320 | + <width>16777215</width> |
4321 | + <height>24</height> |
4322 | + </size> |
4323 | + </property> |
4324 | + <property name="date"> |
4325 | + <date> |
4326 | + <year>1952</year> |
4327 | + <month>5</month> |
4328 | + <day>11</day> |
4329 | + </date> |
4330 | + </property> |
4331 | + <property name="time"> |
4332 | + <time> |
4333 | + <hour>0</hour> |
4334 | + <minute>42</minute> |
4335 | + <second>0</second> |
4336 | + </time> |
4337 | + </property> |
4338 | + <property name="calendarPopup"> |
4339 | + <bool>true</bool> |
4340 | + </property> |
4341 | + </widget> |
4342 | + </item> |
4343 | + </layout> |
4344 | + </item> |
4345 | + <item row="2" column="1"> |
4346 | + <widget class="QPushButton" name="fixedDateTimeCurrentButton"> |
4347 | + <property name="toolTip"> |
4348 | + <string>Use current local date and time</string> |
4349 | + </property> |
4350 | + <property name="text"> |
4351 | + <string>use current</string> |
4352 | + </property> |
4353 | + </widget> |
4354 | + </item> |
4355 | </layout> |
4356 | </widget> |
4357 | </item> |
4358 | @@ -1139,6 +1151,18 @@ |
4359 | <string>Planetarium options</string> |
4360 | </property> |
4361 | <layout class="QGridLayout" name="gridLayoutOptions"> |
4362 | + <property name="leftMargin"> |
4363 | + <number>0</number> |
4364 | + </property> |
4365 | + <property name="topMargin"> |
4366 | + <number>0</number> |
4367 | + </property> |
4368 | + <property name="rightMargin"> |
4369 | + <number>0</number> |
4370 | + </property> |
4371 | + <property name="bottomMargin"> |
4372 | + <number>0</number> |
4373 | + </property> |
4374 | <item row="3" column="0"> |
4375 | <widget class="QCheckBox" name="autoEnableAtmosphereCheckBox"> |
4376 | <property name="toolTip"> |
4377 | @@ -1774,7 +1798,7 @@ |
4378 | <customwidget> |
4379 | <class>BarFrame</class> |
4380 | <extends>QFrame</extends> |
4381 | - <header location="global">Dialog.hpp</header> |
4382 | + <header>Dialog.hpp</header> |
4383 | <container>1</container> |
4384 | </customwidget> |
4385 | </customwidgets> |
4386 | |
4387 | === modified file 'src/gui/locationDialogGui.ui' |
4388 | --- src/gui/locationDialogGui.ui 2014-08-16 16:27:46 +0000 |
4389 | +++ src/gui/locationDialogGui.ui 2016-10-25 16:10:21 +0000 |
4390 | @@ -7,7 +7,7 @@ |
4391 | <x>0</x> |
4392 | <y>0</y> |
4393 | <width>700</width> |
4394 | - <height>460</height> |
4395 | + <height>506</height> |
4396 | </rect> |
4397 | </property> |
4398 | <property name="styleSheet"> |
4399 | @@ -393,18 +393,99 @@ |
4400 | <property name="bottomMargin"> |
4401 | <number>0</number> |
4402 | </property> |
4403 | - <item row="1" column="2" colspan="2"> |
4404 | - <spacer name="verticalSpacer"> |
4405 | - <property name="orientation"> |
4406 | - <enum>Qt::Vertical</enum> |
4407 | - </property> |
4408 | - <property name="sizeHint" stdset="0"> |
4409 | + <item row="2" column="1" colspan="3"> |
4410 | + <widget class="QFrame" name="frame_3"> |
4411 | + <property name="minimumSize"> |
4412 | <size> |
4413 | - <width>20</width> |
4414 | - <height>40</height> |
4415 | + <width>0</width> |
4416 | + <height>0</height> |
4417 | </size> |
4418 | </property> |
4419 | - </spacer> |
4420 | + <property name="frameShape"> |
4421 | + <enum>QFrame::StyledPanel</enum> |
4422 | + </property> |
4423 | + <property name="frameShadow"> |
4424 | + <enum>QFrame::Raised</enum> |
4425 | + </property> |
4426 | + <layout class="QHBoxLayout" name="horizontalLayout"> |
4427 | + <property name="leftMargin"> |
4428 | + <number>0</number> |
4429 | + </property> |
4430 | + <property name="topMargin"> |
4431 | + <number>0</number> |
4432 | + </property> |
4433 | + <property name="rightMargin"> |
4434 | + <number>0</number> |
4435 | + </property> |
4436 | + <property name="bottomMargin"> |
4437 | + <number>0</number> |
4438 | + </property> |
4439 | + <item> |
4440 | + <spacer name="horizontalSpacer"> |
4441 | + <property name="orientation"> |
4442 | + <enum>Qt::Horizontal</enum> |
4443 | + </property> |
4444 | + <property name="sizeHint" stdset="0"> |
4445 | + <size> |
4446 | + <width>40</width> |
4447 | + <height>20</height> |
4448 | + </size> |
4449 | + </property> |
4450 | + </spacer> |
4451 | + </item> |
4452 | + <item> |
4453 | + <widget class="QPushButton" name="addLocationToListPushButton"> |
4454 | + <property name="enabled"> |
4455 | + <bool>false</bool> |
4456 | + </property> |
4457 | + <property name="minimumSize"> |
4458 | + <size> |
4459 | + <width>100</width> |
4460 | + <height>0</height> |
4461 | + </size> |
4462 | + </property> |
4463 | + <property name="focusPolicy"> |
4464 | + <enum>Qt::NoFocus</enum> |
4465 | + </property> |
4466 | + <property name="text"> |
4467 | + <string>Add to list</string> |
4468 | + </property> |
4469 | + </widget> |
4470 | + </item> |
4471 | + <item> |
4472 | + <widget class="QPushButton" name="deleteLocationFromListPushButton"> |
4473 | + <property name="enabled"> |
4474 | + <bool>false</bool> |
4475 | + </property> |
4476 | + <property name="minimumSize"> |
4477 | + <size> |
4478 | + <width>60</width> |
4479 | + <height>0</height> |
4480 | + </size> |
4481 | + </property> |
4482 | + <property name="focusPolicy"> |
4483 | + <enum>Qt::NoFocus</enum> |
4484 | + </property> |
4485 | + <property name="text"> |
4486 | + <string>Delete from list</string> |
4487 | + </property> |
4488 | + </widget> |
4489 | + </item> |
4490 | + <item> |
4491 | + <widget class="QPushButton" name="pushButtonReturnToDefault"> |
4492 | + <property name="enabled"> |
4493 | + <bool>false</bool> |
4494 | + </property> |
4495 | + <property name="focusPolicy"> |
4496 | + <enum>Qt::NoFocus</enum> |
4497 | + </property> |
4498 | + <property name="text"> |
4499 | + <string>Return to default location</string> |
4500 | + </property> |
4501 | + </widget> |
4502 | + </item> |
4503 | + </layout> |
4504 | + </widget> |
4505 | </item> |
4506 | <item row="0" column="1"> |
4507 | <widget class="QFrame" name="frame_4"> |
4508 | @@ -436,6 +517,20 @@ |
4509 | <property name="horizontalSpacing"> |
4510 | <number>6</number> |
4511 | </property> |
4512 | + <item row="5" column="0" colspan="2"> |
4513 | + <widget class="QCheckBox" name="useAsDefaultLocationCheckBox"> |
4514 | + <property name="text"> |
4515 | + <string>Use current location as default</string> |
4516 | + </property> |
4517 | + </widget> |
4518 | + </item> |
4519 | + <item row="1" column="0"> |
4520 | + <widget class="QLabel" name="label"> |
4521 | + <property name="text"> |
4522 | + <string>Longitude:</string> |
4523 | + </property> |
4524 | + </widget> |
4525 | + </item> |
4526 | <item row="0" column="0"> |
4527 | <widget class="QLabel" name="label_5"> |
4528 | <property name="text"> |
4529 | @@ -443,26 +538,10 @@ |
4530 | </property> |
4531 | </widget> |
4532 | </item> |
4533 | - <item row="0" column="1"> |
4534 | - <widget class="AngleSpinBox" name="latitudeSpinBox"> |
4535 | - <property name="minimumSize"> |
4536 | - <size> |
4537 | - <width>180</width> |
4538 | - <height>24</height> |
4539 | - </size> |
4540 | - </property> |
4541 | - <property name="toolTip"> |
4542 | - <string>You can enter values in decimal degrees, or using dms format, for example: +1d 12m 8s</string> |
4543 | - </property> |
4544 | - <property name="alignment"> |
4545 | - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |
4546 | - </property> |
4547 | - </widget> |
4548 | - </item> |
4549 | - <item row="1" column="0"> |
4550 | - <widget class="QLabel" name="label"> |
4551 | + <item row="4" column="0" colspan="2"> |
4552 | + <widget class="QCheckBox" name="useIpQueryCheckBox"> |
4553 | <property name="text"> |
4554 | - <string>Longitude:</string> |
4555 | + <string>Get location from Network</string> |
4556 | </property> |
4557 | </widget> |
4558 | </item> |
4559 | @@ -482,13 +561,6 @@ |
4560 | </property> |
4561 | </widget> |
4562 | </item> |
4563 | - <item row="2" column="0"> |
4564 | - <widget class="QLabel" name="label_7"> |
4565 | - <property name="text"> |
4566 | - <string>Altitude:</string> |
4567 | - </property> |
4568 | - </widget> |
4569 | - </item> |
4570 | <item row="2" column="1"> |
4571 | <widget class="QSpinBox" name="altitudeSpinBox"> |
4572 | <property name="minimumSize"> |
4573 | @@ -517,100 +589,42 @@ |
4574 | </property> |
4575 | </widget> |
4576 | </item> |
4577 | - </layout> |
4578 | - </widget> |
4579 | - </item> |
4580 | - <item row="2" column="1" colspan="3"> |
4581 | - <widget class="QFrame" name="frame_3"> |
4582 | - <property name="minimumSize"> |
4583 | - <size> |
4584 | - <width>0</width> |
4585 | - <height>0</height> |
4586 | - </size> |
4587 | - </property> |
4588 | - <property name="frameShape"> |
4589 | - <enum>QFrame::StyledPanel</enum> |
4590 | - </property> |
4591 | - <property name="frameShadow"> |
4592 | - <enum>QFrame::Raised</enum> |
4593 | - </property> |
4594 | - <layout class="QHBoxLayout" name="horizontalLayout"> |
4595 | - <property name="leftMargin"> |
4596 | - <number>0</number> |
4597 | - </property> |
4598 | - <property name="topMargin"> |
4599 | - <number>0</number> |
4600 | - </property> |
4601 | - <property name="rightMargin"> |
4602 | - <number>0</number> |
4603 | - </property> |
4604 | - <property name="bottomMargin"> |
4605 | - <number>0</number> |
4606 | - </property> |
4607 | - <item> |
4608 | - <widget class="QPushButton" name="pushButtonReturnToDefault"> |
4609 | - <property name="enabled"> |
4610 | - <bool>false</bool> |
4611 | - </property> |
4612 | - <property name="focusPolicy"> |
4613 | - <enum>Qt::NoFocus</enum> |
4614 | - </property> |
4615 | + <item row="0" column="1"> |
4616 | + <widget class="AngleSpinBox" name="latitudeSpinBox"> |
4617 | + <property name="minimumSize"> |
4618 | + <size> |
4619 | + <width>180</width> |
4620 | + <height>24</height> |
4621 | + </size> |
4622 | + </property> |
4623 | + <property name="toolTip"> |
4624 | + <string>You can enter values in decimal degrees, or using dms format, for example: +1d 12m 8s</string> |
4625 | + </property> |
4626 | + <property name="alignment"> |
4627 | + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |
4628 | + </property> |
4629 | + </widget> |
4630 | + </item> |
4631 | + <item row="2" column="0"> |
4632 | + <widget class="QLabel" name="label_7"> |
4633 | <property name="text"> |
4634 | - <string>Return to default location</string> |
4635 | + <string>Altitude:</string> |
4636 | </property> |
4637 | </widget> |
4638 | </item> |
4639 | - <item> |
4640 | - <spacer name="horizontalSpacer"> |
4641 | + <item row="3" column="0"> |
4642 | + <spacer name="verticalSpacer"> |
4643 | <property name="orientation"> |
4644 | - <enum>Qt::Horizontal</enum> |
4645 | + <enum>Qt::Vertical</enum> |
4646 | </property> |
4647 | <property name="sizeHint" stdset="0"> |
4648 | <size> |
4649 | - <width>40</width> |
4650 | - <height>20</height> |
4651 | + <width>20</width> |
4652 | + <height>40</height> |
4653 | </size> |
4654 | </property> |
4655 | </spacer> |
4656 | </item> |
4657 | - <item> |
4658 | - <widget class="QPushButton" name="deleteLocationFromListPushButton"> |
4659 | - <property name="enabled"> |
4660 | - <bool>false</bool> |
4661 | - </property> |
4662 | - <property name="minimumSize"> |
4663 | - <size> |
4664 | - <width>60</width> |
4665 | - <height>0</height> |
4666 | - </size> |
4667 | - </property> |
4668 | - <property name="focusPolicy"> |
4669 | - <enum>Qt::NoFocus</enum> |
4670 | - </property> |
4671 | - <property name="text"> |
4672 | - <string>Delete</string> |
4673 | - </property> |
4674 | - </widget> |
4675 | - </item> |
4676 | - <item> |
4677 | - <widget class="QPushButton" name="addLocationToListPushButton"> |
4678 | - <property name="enabled"> |
4679 | - <bool>false</bool> |
4680 | - </property> |
4681 | - <property name="minimumSize"> |
4682 | - <size> |
4683 | - <width>100</width> |
4684 | - <height>0</height> |
4685 | - </size> |
4686 | - </property> |
4687 | - <property name="focusPolicy"> |
4688 | - <enum>Qt::NoFocus</enum> |
4689 | - </property> |
4690 | - <property name="text"> |
4691 | - <string>Add to list</string> |
4692 | - </property> |
4693 | - </widget> |
4694 | - </item> |
4695 | </layout> |
4696 | </widget> |
4697 | </item> |
4698 | @@ -654,10 +668,31 @@ |
4699 | <property name="bottomMargin"> |
4700 | <number>0</number> |
4701 | </property> |
4702 | - <item row="0" column="0"> |
4703 | - <widget class="QLabel" name="label_3"> |
4704 | - <property name="text"> |
4705 | - <string>Name/City:</string> |
4706 | + <item row="1" column="1"> |
4707 | + <widget class="QComboBox" name="countryNameComboBox"> |
4708 | + <property name="sizePolicy"> |
4709 | + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> |
4710 | + <horstretch>0</horstretch> |
4711 | + <verstretch>0</verstretch> |
4712 | + </sizepolicy> |
4713 | + </property> |
4714 | + <property name="minimumSize"> |
4715 | + <size> |
4716 | + <width>0</width> |
4717 | + <height>24</height> |
4718 | + </size> |
4719 | + </property> |
4720 | + <property name="maximumSize"> |
4721 | + <size> |
4722 | + <width>16777215</width> |
4723 | + <height>24</height> |
4724 | + </size> |
4725 | + </property> |
4726 | + <property name="editable"> |
4727 | + <bool>true</bool> |
4728 | + </property> |
4729 | + <property name="insertPolicy"> |
4730 | + <enum>QComboBox::NoInsert</enum> |
4731 | </property> |
4732 | </widget> |
4733 | </item> |
4734 | @@ -668,41 +703,6 @@ |
4735 | </property> |
4736 | </widget> |
4737 | </item> |
4738 | - <item row="1" column="0"> |
4739 | - <widget class="QLabel" name="label_4"> |
4740 | - <property name="text"> |
4741 | - <string>Country:</string> |
4742 | - </property> |
4743 | - </widget> |
4744 | - </item> |
4745 | - <item row="1" column="1"> |
4746 | - <widget class="QComboBox" name="countryNameComboBox"> |
4747 | - <property name="sizePolicy"> |
4748 | - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> |
4749 | - <horstretch>0</horstretch> |
4750 | - <verstretch>0</verstretch> |
4751 | - </sizepolicy> |
4752 | - </property> |
4753 | - <property name="minimumSize"> |
4754 | - <size> |
4755 | - <width>0</width> |
4756 | - <height>24</height> |
4757 | - </size> |
4758 | - </property> |
4759 | - <property name="maximumSize"> |
4760 | - <size> |
4761 | - <width>16777215</width> |
4762 | - <height>24</height> |
4763 | - </size> |
4764 | - </property> |
4765 | - <property name="editable"> |
4766 | - <bool>true</bool> |
4767 | - </property> |
4768 | - <property name="insertPolicy"> |
4769 | - <enum>QComboBox::NoInsert</enum> |
4770 | - </property> |
4771 | - </widget> |
4772 | - </item> |
4773 | <item row="2" column="0"> |
4774 | <widget class="QLabel" name="label_6"> |
4775 | <property name="text"> |
4776 | @@ -710,6 +710,58 @@ |
4777 | </property> |
4778 | </widget> |
4779 | </item> |
4780 | + <item row="4" column="0" colspan="2"> |
4781 | + <widget class="QCheckBox" name="useCustomTimeZoneCheckBox"> |
4782 | + <property name="text"> |
4783 | + <string>Use custom time zone</string> |
4784 | + </property> |
4785 | + </widget> |
4786 | + </item> |
4787 | + <item row="3" column="0"> |
4788 | + <widget class="QLabel" name="timeZoneLabel"> |
4789 | + <property name="text"> |
4790 | + <string>Time zone:</string> |
4791 | + </property> |
4792 | + </widget> |
4793 | + </item> |
4794 | + <item row="0" column="0"> |
4795 | + <widget class="QLabel" name="label_3"> |
4796 | + <property name="text"> |
4797 | + <string>Name/City:</string> |
4798 | + </property> |
4799 | + </widget> |
4800 | + </item> |
4801 | + <item row="3" column="1"> |
4802 | + <widget class="QComboBox" name="timeZoneNameComboBox"> |
4803 | + <property name="enabled"> |
4804 | + <bool>true</bool> |
4805 | + </property> |
4806 | + <property name="sizePolicy"> |
4807 | + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> |
4808 | + <horstretch>0</horstretch> |
4809 | + <verstretch>0</verstretch> |
4810 | + </sizepolicy> |
4811 | + </property> |
4812 | + <property name="minimumSize"> |
4813 | + <size> |
4814 | + <width>0</width> |
4815 | + <height>24</height> |
4816 | + </size> |
4817 | + </property> |
4818 | + <property name="maximumSize"> |
4819 | + <size> |
4820 | + <width>16777215</width> |
4821 | + <height>24</height> |
4822 | + </size> |
4823 | + </property> |
4824 | + <property name="editable"> |
4825 | + <bool>true</bool> |
4826 | + </property> |
4827 | + <property name="insertPolicy"> |
4828 | + <enum>QComboBox::NoInsert</enum> |
4829 | + </property> |
4830 | + </widget> |
4831 | + </item> |
4832 | <item row="2" column="1"> |
4833 | <widget class="QComboBox" name="planetNameComboBox"> |
4834 | <property name="sizePolicy"> |
4835 | @@ -738,23 +790,26 @@ |
4836 | </property> |
4837 | </widget> |
4838 | </item> |
4839 | + <item row="1" column="0"> |
4840 | + <widget class="QLabel" name="label_4"> |
4841 | + <property name="text"> |
4842 | + <string>Country:</string> |
4843 | + </property> |
4844 | + </widget> |
4845 | + </item> |
4846 | + <item row="5" column="0" colspan="2"> |
4847 | + <widget class="QCheckBox" name="dstCheckBox"> |
4848 | + <property name="toolTip"> |
4849 | + <string/> |
4850 | + </property> |
4851 | + <property name="text"> |
4852 | + <string>Enable daylight saving time</string> |
4853 | + </property> |
4854 | + </widget> |
4855 | + </item> |
4856 | </layout> |
4857 | </widget> |
4858 | </item> |
4859 | - <item row="3" column="1"> |
4860 | - <widget class="QCheckBox" name="useAsDefaultLocationCheckBox"> |
4861 | - <property name="text"> |
4862 | - <string>Use current location as default</string> |
4863 | - </property> |
4864 | - </widget> |
4865 | - </item> |
4866 | - <item row="3" column="3"> |
4867 | - <widget class="QCheckBox" name="useIpQueryCheckBox"> |
4868 | - <property name="text"> |
4869 | - <string>Get location from Network</string> |
4870 | - </property> |
4871 | - </widget> |
4872 | - </item> |
4873 | </layout> |
4874 | </widget> |
4875 | </item> |
4876 | |
4877 | === modified file 'src/scripting/StelMainScriptAPI.cpp' |
4878 | --- src/scripting/StelMainScriptAPI.cpp 2016-10-10 04:45:16 +0000 |
4879 | +++ src/scripting/StelMainScriptAPI.cpp 2016-10-25 16:10:21 +0000 |
4880 | @@ -175,7 +175,7 @@ |
4881 | if (spec=="utc") |
4882 | return StelUtils::julianDayToISO8601String(getJDay()); |
4883 | else |
4884 | - return StelUtils::julianDayToISO8601String(getJDay()+StelUtils::getGMTShiftFromQT(getJDay())/24); |
4885 | + return StelUtils::julianDayToISO8601String(getJDay()+StelApp::getInstance().getCore()->getUTCOffset(getJDay())/24); |
4886 | } |
4887 | |
4888 | QString StelMainScriptAPI::getDeltaT() const |
I've removed Time Zone plugin but maybe I should restore him and use him for management really custom rules for time zone and DST?