ProjectDjangoTagsMenu/TimezoneSelectionDialog.py

branch
eric7
changeset 55
5390ef66c327
parent 52
c264091162a2
child 60
85d3931419d3
equal deleted inserted replaced
54:7e08cb395fca 55:5390ef66c327
5 5
6 """ 6 """
7 Module implementing a dialog to select a time zone. 7 Module implementing a dialog to select a time zone.
8 """ 8 """
9 9
10 from PyQt5.QtCore import pyqtSlot 10 from PyQt6.QtCore import pyqtSlot
11 from PyQt5.QtWidgets import QDialog, QDialogButtonBox 11 from PyQt6.QtWidgets import QDialog, QDialogButtonBox
12 12
13 from .Ui_TimezoneSelectionDialog import Ui_TimezoneSelectionDialog 13 from .Ui_TimezoneSelectionDialog import Ui_TimezoneSelectionDialog
14 14
15 15
16 class TimezoneSelectionDialog(QDialog, Ui_TimezoneSelectionDialog): 16 class TimezoneSelectionDialog(QDialog, Ui_TimezoneSelectionDialog):
17 """ 17 """
18 Class implementing a dialog to select a time zone. 18 Class implementing a dialog to select a time zone.
19 """ 19 """
20 Timezones = { 20 Timezones = {
21 'Africa': [ 21 "Africa": [
22 'Abidjan', 22 "Abidjan",
23 'Accra', 23 "Accra",
24 'Addis_Ababa', 24 "Addis_Ababa",
25 'Algiers', 25 "Algiers",
26 'Asmara', 26 "Asmara",
27 'Asmera', 27 "Asmera",
28 'Bamako', 28 "Bamako",
29 'Bangui', 29 "Bangui",
30 'Banjul', 30 "Banjul",
31 'Bissau', 31 "Bissau",
32 'Blantyre', 32 "Blantyre",
33 'Brazzaville', 33 "Brazzaville",
34 'Bujumbura', 34 "Bujumbura",
35 'Cairo', 35 "Cairo",
36 'Casablanca', 36 "Casablanca",
37 'Ceuta', 37 "Ceuta",
38 'Conakry', 38 "Conakry",
39 'Dakar', 39 "Dakar",
40 'Dar_es_Salaam', 40 "Dar_es_Salaam",
41 'Djibouti', 41 "Djibouti",
42 'Douala', 42 "Douala",
43 'El_Aaiun', 43 "El_Aaiun",
44 'Freetown', 44 "Freetown",
45 'Gaborone', 45 "Gaborone",
46 'Harare', 46 "Harare",
47 'Johannesburg', 47 "Johannesburg",
48 'Juba', 48 "Juba",
49 'Kampala', 49 "Kampala",
50 'Khartoum', 50 "Khartoum",
51 'Kigali', 51 "Kigali",
52 'Kinshasa', 52 "Kinshasa",
53 'Lagos', 53 "Lagos",
54 'Libreville', 54 "Libreville",
55 'Lome', 55 "Lome",
56 'Luanda', 56 "Luanda",
57 'Lubumbashi', 57 "Lubumbashi",
58 'Lusaka', 58 "Lusaka",
59 'Malabo', 59 "Malabo",
60 'Maputo', 60 "Maputo",
61 'Maseru', 61 "Maseru",
62 'Mbabane', 62 "Mbabane",
63 'Mogadishu', 63 "Mogadishu",
64 'Monrovia', 64 "Monrovia",
65 'Nairobi', 65 "Nairobi",
66 'Ndjamena', 66 "Ndjamena",
67 'Niamey', 67 "Niamey",
68 'Nouakchott', 68 "Nouakchott",
69 'Ouagadougou', 69 "Ouagadougou",
70 'Porto-Novo', 70 "Porto-Novo",
71 'Sao_Tome', 71 "Sao_Tome",
72 'Timbuktu', 72 "Timbuktu",
73 'Tripoli', 73 "Tripoli",
74 'Tunis', 74 "Tunis",
75 'Windhoek', 75 "Windhoek",
76 ], 76 ],
77 'America': [ 77 "America": [
78 'Adak', 78 "Adak",
79 'Anchorage', 79 "Anchorage",
80 'Anguilla', 80 "Anguilla",
81 'Antigua', 81 "Antigua",
82 'Araguaina', 82 "Araguaina",
83 'Argentina/Buenos_Aires', 83 "Argentina/Buenos_Aires",
84 'Argentina/Catamarca', 84 "Argentina/Catamarca",
85 'Argentina/ComodRivadavia', 85 "Argentina/ComodRivadavia",
86 'Argentina/Cordoba', 86 "Argentina/Cordoba",
87 'Argentina/Jujuy', 87 "Argentina/Jujuy",
88 'Argentina/La_Rioja', 88 "Argentina/La_Rioja",
89 'Argentina/Mendoza', 89 "Argentina/Mendoza",
90 'Argentina/Rio_Gallegos', 90 "Argentina/Rio_Gallegos",
91 'Argentina/Salta', 91 "Argentina/Salta",
92 'Argentina/San_Juan', 92 "Argentina/San_Juan",
93 'Argentina/San_Luis', 93 "Argentina/San_Luis",
94 'Argentina/Tucuman', 94 "Argentina/Tucuman",
95 'Argentina/Ushuaia', 95 "Argentina/Ushuaia",
96 'Aruba', 96 "Aruba",
97 'Asuncion', 97 "Asuncion",
98 'Atikokan', 98 "Atikokan",
99 'Atka', 99 "Atka",
100 'Bahia', 100 "Bahia",
101 'Bahia_Banderas', 101 "Bahia_Banderas",
102 'Barbados', 102 "Barbados",
103 'Belem', 103 "Belem",
104 'Belize', 104 "Belize",
105 'Blanc-Sablon', 105 "Blanc-Sablon",
106 'Boa_Vista', 106 "Boa_Vista",
107 'Bogota', 107 "Bogota",
108 'Boise', 108 "Boise",
109 'Buenos_Aires', 109 "Buenos_Aires",
110 'Cambridge_Bay', 110 "Cambridge_Bay",
111 'Campo_Grande', 111 "Campo_Grande",
112 'Cancun', 112 "Cancun",
113 'Caracas', 113 "Caracas",
114 'Catamarca', 114 "Catamarca",
115 'Cayenne', 115 "Cayenne",
116 'Cayman', 116 "Cayman",
117 'Chicago', 117 "Chicago",
118 'Chihuahua', 118 "Chihuahua",
119 'Coral_Harbour', 119 "Coral_Harbour",
120 'Cordoba', 120 "Cordoba",
121 'Costa_Rica', 121 "Costa_Rica",
122 'Creston', 122 "Creston",
123 'Cuiaba', 123 "Cuiaba",
124 'Curacao', 124 "Curacao",
125 'Danmarkshavn', 125 "Danmarkshavn",
126 'Dawson', 126 "Dawson",
127 'Dawson_Creek', 127 "Dawson_Creek",
128 'Denver', 128 "Denver",
129 'Detroit', 129 "Detroit",
130 'Dominica', 130 "Dominica",
131 'Edmonton', 131 "Edmonton",
132 'Eirunepe', 132 "Eirunepe",
133 'El_Salvador', 133 "El_Salvador",
134 'Ensenada', 134 "Ensenada",
135 'Fort_Wayne', 135 "Fort_Nelson",
136 'Fortaleza', 136 "Fort_Wayne",
137 'Glace_Bay', 137 "Fortaleza",
138 'Godthab', 138 "Glace_Bay",
139 'Goose_Bay', 139 "Godthab",
140 'Grand_Turk', 140 "Goose_Bay",
141 'Grenada', 141 "Grand_Turk",
142 'Guadeloupe', 142 "Grenada",
143 'Guatemala', 143 "Guadeloupe",
144 'Guayaquil', 144 "Guatemala",
145 'Guyana', 145 "Guayaquil",
146 'Halifax', 146 "Guyana",
147 'Havana', 147 "Halifax",
148 'Hermosillo', 148 "Havana",
149 'Indiana/Indianapolis', 149 "Hermosillo",
150 'Indiana/Knox', 150 "Indiana/Indianapolis",
151 'Indiana/Marengo', 151 "Indiana/Knox",
152 'Indiana/Petersburg', 152 "Indiana/Marengo",
153 'Indiana/Tell_City', 153 "Indiana/Petersburg",
154 'Indiana/Vevay', 154 "Indiana/Tell_City",
155 'Indiana/Vincennes', 155 "Indiana/Vevay",
156 'Indiana/Winamac', 156 "Indiana/Vincennes",
157 'Indianapolis', 157 "Indiana/Winamac",
158 'Inuvik', 158 "Indianapolis",
159 'Iqaluit', 159 "Inuvik",
160 'Jamaica', 160 "Iqaluit",
161 'Jujuy', 161 "Jamaica",
162 'Juneau', 162 "Jujuy",
163 'Kentucky/Louisville', 163 "Juneau",
164 'Kentucky/Monticello', 164 "Kentucky/Louisville",
165 'Knox_IN', 165 "Kentucky/Monticello",
166 'Kralendijk', 166 "Knox_IN",
167 'La_Paz', 167 "Kralendijk",
168 'Lima', 168 "La_Paz",
169 'Los_Angeles', 169 "Lima",
170 'Louisville', 170 "Los_Angeles",
171 'Lower_Princes', 171 "Louisville",
172 'Maceio', 172 "Lower_Princes",
173 'Managua', 173 "Maceio",
174 'Manaus', 174 "Managua",
175 'Marigot', 175 "Manaus",
176 'Martinique', 176 "Marigot",
177 'Matamoros', 177 "Martinique",
178 'Mazatlan', 178 "Matamoros",
179 'Mendoza', 179 "Mazatlan",
180 'Menominee', 180 "Mendoza",
181 'Merida', 181 "Menominee",
182 'Metlakatla', 182 "Merida",
183 'Mexico_City', 183 "Metlakatla",
184 'Miquelon', 184 "Mexico_City",
185 'Moncton', 185 "Miquelon",
186 'Monterrey', 186 "Moncton",
187 'Montevideo', 187 "Monterrey",
188 'Montreal', 188 "Montevideo",
189 'Montserrat', 189 "Montreal",
190 'Nassau', 190 "Montserrat",
191 'New_York', 191 "Nassau",
192 'Nipigon', 192 "New_York",
193 'Nome', 193 "Nipigon",
194 'Noronha', 194 "Nome",
195 'North_Dakota/Beulah', 195 "Noronha",
196 'North_Dakota/Center', 196 "North_Dakota/Beulah",
197 'North_Dakota/New_Salem', 197 "North_Dakota/Center",
198 'Ojinaga', 198 "North_Dakota/New_Salem",
199 'Panama', 199 "Nuuk",
200 'Pangnirtung', 200 "Ojinaga",
201 'Paramaribo', 201 "Panama",
202 'Phoenix', 202 "Pangnirtung",
203 'Port-au-Prince', 203 "Paramaribo",
204 'Port_of_Spain', 204 "Phoenix",
205 'Porto_Acre', 205 "Port-au-Prince",
206 'Porto_Velho', 206 "Port_of_Spain",
207 'Puerto_Rico', 207 "Porto_Acre",
208 'Rainy_River', 208 "Porto_Velho",
209 'Rankin_Inlet', 209 "Puerto_Rico",
210 'Recife', 210 "Punta_Arenas",
211 'Regina', 211 "Rainy_River",
212 'Resolute', 212 "Rankin_Inlet",
213 'Rio_Branco', 213 "Recife",
214 'Rosario', 214 "Regina",
215 'Santa_Isabel', 215 "Resolute",
216 'Santarem', 216 "Rio_Branco",
217 'Santiago', 217 "Rosario",
218 'Santo_Domingo', 218 "Santa_Isabel",
219 'Sao_Paulo', 219 "Santarem",
220 'Scoresbysund', 220 "Santiago",
221 'Shiprock', 221 "Santo_Domingo",
222 'Sitka', 222 "Sao_Paulo",
223 'St_Barthelemy', 223 "Scoresbysund",
224 'St_Johns', 224 "Shiprock",
225 'St_Kitts', 225 "Sitka",
226 'St_Lucia', 226 "St_Barthelemy",
227 'St_Thomas', 227 "St_Johns",
228 'St_Vincent', 228 "St_Kitts",
229 'Swift_Current', 229 "St_Lucia",
230 'Tegucigalpa', 230 "St_Thomas",
231 'Thule', 231 "St_Vincent",
232 'Thunder_Bay', 232 "Swift_Current",
233 'Tijuana', 233 "Tegucigalpa",
234 'Toronto', 234 "Thule",
235 'Tortola', 235 "Thunder_Bay",
236 'Vancouver', 236 "Tijuana",
237 'Virgin', 237 "Toronto",
238 'Whitehorse', 238 "Tortola",
239 'Winnipeg', 239 "Vancouver",
240 'Yakutat', 240 "Virgin",
241 'Yellowknife', 241 "Whitehorse",
242 ], 242 "Winnipeg",
243 'Antarctica': [ 243 "Yakutat",
244 'Casey', 244 "Yellowknife",
245 'Davis', 245 ],
246 'DumontDUrville', 246 "Antarctica": [
247 'Macquarie', 247 "Casey",
248 'Mawson', 248 "Davis",
249 'McMurdo', 249 "DumontDUrville",
250 'Palmer', 250 "Macquarie",
251 'Rothera', 251 "Mawson",
252 'South_Pole', 252 "McMurdo",
253 'Syowa', 253 "Palmer",
254 'Vostok', 254 "Rothera",
255 ], 255 "South_Pole",
256 'Arctic': [ 256 "Syowa",
257 'Longyearbyen', 257 "Troll",
258 ], 258 "Vostok",
259 'Asia': [ 259 ],
260 'Aden', 260 "Arctic": [
261 'Almaty', 261 "Longyearbyen",
262 'Amman', 262 ],
263 'Anadyr', 263 "Asia": [
264 'Aqtau', 264 "Aden",
265 'Aqtobe', 265 "Almaty",
266 'Ashgabat', 266 "Amman",
267 'Ashkhabad', 267 "Anadyr",
268 'Baghdad', 268 "Aqtau",
269 'Bahrain', 269 "Aqtobe",
270 'Baku', 270 "Ashgabat",
271 'Bangkok', 271 "Ashkhabad",
272 'Beirut', 272 "Atyrau",
273 'Bishkek', 273 "Baghdad",
274 'Brunei', 274 "Bahrain",
275 'Calcutta', 275 "Baku",
276 'Choibalsan', 276 "Bangkok",
277 'Chongqing', 277 "Barnaul",
278 'Chungking', 278 "Beirut",
279 'Colombo', 279 "Bishkek",
280 'Dacca', 280 "Brunei",
281 'Damascus', 281 "Calcutta",
282 'Dhaka', 282 "Chita",
283 'Dili', 283 "Choibalsan",
284 'Dubai', 284 "Chongqing",
285 'Dushanbe', 285 "Chungking",
286 'Gaza', 286 "Colombo",
287 'Harbin', 287 "Dacca",
288 'Hebron', 288 "Damascus",
289 'Ho_Chi_Minh', 289 "Dhaka",
290 'Hong_Kong', 290 "Dili",
291 'Hovd', 291 "Dubai",
292 'Irkutsk', 292 "Dushanbe",
293 'Istanbul', 293 "Famagusta",
294 'Jakarta', 294 "Gaza",
295 'Jayapura', 295 "Harbin",
296 'Jerusalem', 296 "Hebron",
297 'Kabul', 297 "Ho_Chi_Minh",
298 'Kamchatka', 298 "Hong_Kong",
299 'Karachi', 299 "Hovd",
300 'Kashgar', 300 "Irkutsk",
301 'Kathmandu', 301 "Istanbul",
302 'Katmandu', 302 "Jakarta",
303 'Khandyga', 303 "Jayapura",
304 'Kolkata', 304 "Jerusalem",
305 'Krasnoyarsk', 305 "Kabul",
306 'Kuala_Lumpur', 306 "Kamchatka",
307 'Kuching', 307 "Karachi",
308 'Kuwait', 308 "Kashgar",
309 'Macao', 309 "Kathmandu",
310 'Macau', 310 "Katmandu",
311 'Magadan', 311 "Khandyga",
312 'Makassar', 312 "Kolkata",
313 'Manila', 313 "Krasnoyarsk",
314 'Muscat', 314 "Kuala_Lumpur",
315 'Nicosia', 315 "Kuching",
316 'Novokuznetsk', 316 "Kuwait",
317 'Novosibirsk', 317 "Macao",
318 'Omsk', 318 "Macau",
319 'Oral', 319 "Magadan",
320 'Phnom_Penh', 320 "Makassar",
321 'Pontianak', 321 "Manila",
322 'Pyongyang', 322 "Muscat",
323 'Qatar', 323 "Nicosia",
324 'Qyzylorda', 324 "Novokuznetsk",
325 'Rangoon', 325 "Novosibirsk",
326 'Riyadh', 326 "Omsk",
327 'Saigon', 327 "Oral",
328 'Sakhalin', 328 "Phnom_Penh",
329 'Samarkand', 329 "Pontianak",
330 'Seoul', 330 "Pyongyang",
331 'Shanghai', 331 "Qatar",
332 'Singapore', 332 "Qostanay",
333 'Taipei', 333 "Qyzylorda",
334 'Tashkent', 334 "Rangoon",
335 'Tbilisi', 335 "Riyadh",
336 'Tehran', 336 "Saigon",
337 'Tel_Aviv', 337 "Sakhalin",
338 'Thimbu', 338 "Samarkand",
339 'Thimphu', 339 "Seoul",
340 'Tokyo', 340 "Shanghai",
341 'Ujung_Pandang', 341 "Singapore",
342 'Ulaanbaatar', 342 "Srednekolymsk",
343 'Ulan_Bator', 343 "Taipei",
344 'Urumqi', 344 "Tashkent",
345 'Ust-Nera', 345 "Tbilisi",
346 'Vientiane', 346 "Tehran",
347 'Vladivostok', 347 "Tel_Aviv",
348 'Yakutsk', 348 "Thimbu",
349 'Yekaterinburg', 349 "Thimphu",
350 'Yerevan', 350 "Tokyo",
351 ], 351 "Tomsk",
352 'Atlantic': [ 352 "Ujung_Pandang",
353 'Azores', 353 "Ulaanbaatar",
354 'Bermuda', 354 "Ulan_Bator",
355 'Canary', 355 "Urumqi",
356 'Cape_Verde', 356 "Ust-Nera",
357 'Faeroe', 357 "Vientiane",
358 'Faroe', 358 "Vladivostok",
359 'Jan_Mayen', 359 "Yakutsk",
360 'Madeira', 360 "Yangon",
361 'Reykjavik', 361 "Yekaterinburg",
362 'South_Georgia', 362 "Yerevan",
363 'St_Helena', 363 ],
364 'Stanley', 364 "Atlantic": [
365 ], 365 "Azores",
366 'Australia': [ 366 "Bermuda",
367 'ACT', 367 "Canary",
368 'Adelaide', 368 "Cape_Verde",
369 'Brisbane', 369 "Faeroe",
370 'Broken_Hill', 370 "Faroe",
371 'Canberra', 371 "Jan_Mayen",
372 'Currie', 372 "Madeira",
373 'Darwin', 373 "Reykjavik",
374 'Eucla', 374 "South_Georgia",
375 'Hobart', 375 "St_Helena",
376 'LHI', 376 "Stanley",
377 'Lindeman', 377 ],
378 'Lord_Howe', 378 "Australia": [
379 'Melbourne', 379 "ACT",
380 'NSW', 380 "Adelaide",
381 'North', 381 "Brisbane",
382 'Perth', 382 "Broken_Hill",
383 'Queensland', 383 "Canberra",
384 'South', 384 "Currie",
385 'Sydney', 385 "Darwin",
386 'Tasmania', 386 "Eucla",
387 'Victoria', 387 "Hobart",
388 'West', 388 "LHI",
389 'Yancowinna', 389 "Lindeman",
390 ], 390 "Lord_Howe",
391 'Europe': [ 391 "Melbourne",
392 'Amsterdam', 392 "NSW",
393 'Andorra', 393 "North",
394 'Athens', 394 "Perth",
395 'Belfast', 395 "Queensland",
396 'Belgrade', 396 "South",
397 'Berlin', 397 "Sydney",
398 'Bratislava', 398 "Tasmania",
399 'Brussels', 399 "Victoria",
400 'Bucharest', 400 "West",
401 'Budapest', 401 "Yancowinna",
402 'Busingen', 402 ],
403 'Chisinau', 403 "Brazil": [
404 'Copenhagen', 404 "Acre",
405 'Dublin', 405 "DeNoronha",
406 'Gibraltar', 406 "East",
407 'Guernsey', 407 "West",
408 'Helsinki', 408 ],
409 'Isle_of_Man', 409 "Canada": [
410 'Istanbul', 410 "Atlantic",
411 'Jersey', 411 "Central",
412 'Kaliningrad', 412 "Eastern",
413 'Kiev', 413 "Mountain",
414 'Lisbon', 414 "Newfoundland",
415 'Ljubljana', 415 "Pacific",
416 'London', 416 "Saskatchewan",
417 'Luxembourg', 417 "Yukon",
418 'Madrid', 418 ],
419 'Malta', 419 "Chile": [
420 'Mariehamn', 420 "Continental",
421 'Minsk', 421 "EasterIsland",
422 'Monaco', 422 ],
423 'Moscow', 423 "Etc": [
424 'Nicosia', 424 "GMT",
425 'Oslo', 425 "GMT+0",
426 'Paris', 426 "GMT+1",
427 'Podgorica', 427 "GMT+10",
428 'Prague', 428 "GMT+11",
429 'Riga', 429 "GMT+12",
430 'Rome', 430 "GMT+2",
431 'Samara', 431 "GMT+3",
432 'San_Marino', 432 "GMT+4",
433 'Sarajevo', 433 "GMT+5",
434 'Simferopol', 434 "GMT+6",
435 'Skopje', 435 "GMT+7",
436 'Sofia', 436 "GMT+8",
437 'Stockholm', 437 "GMT+9",
438 'Tallinn', 438 "GMT-0",
439 'Tirane', 439 "GMT-1",
440 'Tiraspol', 440 "GMT-10",
441 'Uzhgorod', 441 "GMT-11",
442 'Vaduz', 442 "GMT-12",
443 'Vatican', 443 "GMT-13",
444 'Vienna', 444 "GMT-14",
445 'Vilnius', 445 "GMT-2",
446 'Volgograd', 446 "GMT-3",
447 'Warsaw', 447 "GMT-4",
448 'Zagreb', 448 "GMT-5",
449 'Zaporozhye', 449 "GMT-6",
450 'Zurich', 450 "GMT-7",
451 ], 451 "GMT-8",
452 'Indian': [ 452 "GMT-9",
453 'Antananarivo', 453 "GMT0",
454 'Chagos', 454 "Greenwich",
455 'Christmas', 455 "UCT",
456 'Cocos', 456 "UTC",
457 'Comoro', 457 "Universal",
458 'Kerguelen', 458 "Zulu",
459 'Mahe', 459 ],
460 'Maldives', 460 "Europe": [
461 'Mauritius', 461 "Amsterdam",
462 'Mayotte', 462 "Andorra",
463 'Reunion', 463 "Astrakhan",
464 ], 464 "Athens",
465 'Pacific': [ 465 "Belfast",
466 'Apia', 466 "Belgrade",
467 'Auckland', 467 "Berlin",
468 'Chatham', 468 "Bratislava",
469 'Chuuk', 469 "Brussels",
470 'Easter', 470 "Bucharest",
471 'Efate', 471 "Budapest",
472 'Enderbury', 472 "Busingen",
473 'Fakaofo', 473 "Chisinau",
474 'Fiji', 474 "Copenhagen",
475 'Funafuti', 475 "Dublin",
476 'Galapagos', 476 "Gibraltar",
477 'Gambier', 477 "Guernsey",
478 'Guadalcanal', 478 "Helsinki",
479 'Guam', 479 "Isle_of_Man",
480 'Honolulu', 480 "Istanbul",
481 'Johnston', 481 "Jersey",
482 'Kiritimati', 482 "Kaliningrad",
483 'Kosrae', 483 "Kiev",
484 'Kwajalein', 484 "Kirov",
485 'Majuro', 485 "Lisbon",
486 'Marquesas', 486 "Ljubljana",
487 'Midway', 487 "London",
488 'Nauru', 488 "Luxembourg",
489 'Niue', 489 "Madrid",
490 'Norfolk', 490 "Malta",
491 'Noumea', 491 "Mariehamn",
492 'Pago_Pago', 492 "Minsk",
493 'Palau', 493 "Monaco",
494 'Pitcairn', 494 "Moscow",
495 'Pohnpei', 495 "Nicosia",
496 'Ponape', 496 "Oslo",
497 'Port_Moresby', 497 "Paris",
498 'Rarotonga', 498 "Podgorica",
499 'Saipan', 499 "Prague",
500 'Samoa', 500 "Riga",
501 'Tahiti', 501 "Rome",
502 'Tarawa', 502 "Samara",
503 'Tongatapu', 503 "San_Marino",
504 'Truk', 504 "Sarajevo",
505 'Wake', 505 "Saratov",
506 'Wallis', 506 "Simferopol",
507 'Yap', 507 "Skopje",
508 "Sofia",
509 "Stockholm",
510 "Tallinn",
511 "Tirane",
512 "Tiraspol",
513 "Ulyanovsk",
514 "Uzhgorod",
515 "Vaduz",
516 "Vatican",
517 "Vienna",
518 "Vilnius",
519 "Volgograd",
520 "Warsaw",
521 "Zagreb",
522 "Zaporozhye",
523 "Zurich",
524 ],
525 "Indian": [
526 "Antananarivo",
527 "Chagos",
528 "Christmas",
529 "Cocos",
530 "Comoro",
531 "Kerguelen",
532 "Mahe",
533 "Maldives",
534 "Mauritius",
535 "Mayotte",
536 "Reunion",
537 ],
538 "Mexico": [
539 "BajaNorte",
540 "BajaSur",
541 "General",
542 ],
543 "Pacific": [
544 "Apia",
545 "Auckland",
546 "Bougainville",
547 "Chatham",
548 "Chuuk",
549 "Easter",
550 "Efate",
551 "Enderbury",
552 "Fakaofo",
553 "Fiji",
554 "Funafuti",
555 "Galapagos",
556 "Gambier",
557 "Guadalcanal",
558 "Guam",
559 "Honolulu",
560 "Johnston",
561 "Kiritimati",
562 "Kosrae",
563 "Kwajalein",
564 "Majuro",
565 "Marquesas",
566 "Midway",
567 "Nauru",
568 "Niue",
569 "Norfolk",
570 "Noumea",
571 "Pago_Pago",
572 "Palau",
573 "Pitcairn",
574 "Pohnpei",
575 "Ponape",
576 "Port_Moresby",
577 "Rarotonga",
578 "Saipan",
579 "Samoa",
580 "Tahiti",
581 "Tarawa",
582 "Tongatapu",
583 "Truk",
584 "Wake",
585 "Wallis",
586 "Yap",
587 ],
588 "US": [
589 "Alaska",
590 "Aleutian",
591 "Arizona",
592 "Central",
593 "East-Indiana",
594 "Eastern",
595 "Hawaii",
596 "Indiana-Starke",
597 "Michigan",
598 "Mountain",
599 "Pacific",
600 "Samoa",
508 ], 601 ],
509 } 602 }
510 603
511 def __init__(self, parent=None): 604 def __init__(self, parent=None):
512 """ 605 """
513 Constructor 606 Constructor
514 607
515 @param parent reference to the parent widget (QWidget) 608 @param parent reference to the parent widget
609 @type QWidget
516 """ 610 """
517 super().__init__(parent) 611 super().__init__(parent)
518 self.setupUi(self) 612 self.setupUi(self)
519 613
520 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) 614 self.buttonBox.button(
615 QDialogButtonBox.StandardButton.Ok).setEnabled(False)
521 616
522 self.regionCombo.addItems([" "] + sorted(self.Timezones.keys())) 617 self.regionCombo.addItems([" "] + sorted(self.Timezones.keys()))
523 618
524 def __updateOK(self): 619 def __updateOK(self):
525 """ 620 """
526 Private method to update the OK button. 621 Private method to update the OK button.
527 """ 622 """
528 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled( 623 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(
529 bool(self.regionCombo.currentText()) and 624 bool(self.regionCombo.currentText()) and
530 len(self.cityList.selectedItems()) == 1 625 len(self.cityList.selectedItems()) == 1
531 ) 626 )
532 627
533 @pyqtSlot(str) 628 @pyqtSlot(str)
534 def on_regionCombo_currentIndexChanged(self, region): 629 def on_regionCombo_currentTextChanged(self, region):
535 """ 630 """
536 Private slot handling the selection of a time zone region. 631 Private slot handling the selection of a time zone region.
537 632
538 @param region selected region (string) 633 @param region selected region
634 @type str
539 """ 635 """
540 self.cityList.clear() 636 self.cityList.clear()
541 if region in self.Timezones: 637 if region in self.Timezones:
542 self.cityList.addItems(sorted(self.Timezones[region])) 638 self.cityList.addItems(sorted(self.Timezones[region]))
543 639
552 648
553 def getData(self): 649 def getData(self):
554 """ 650 """
555 Public method to retrieve the data. 651 Public method to retrieve the data.
556 652
557 @return selected time zone (string) 653 @return selected time zone
654 @rtype str
558 """ 655 """
559 if (self.regionCombo.currentText() and 656 if (self.regionCombo.currentText() and
560 len(self.cityList.selectedItems()) == 1): 657 len(self.cityList.selectedItems()) == 1):
561 return "{0}/{1}".format( 658 return "{0}/{1}".format(
562 self.regionCombo.currentText(), 659 self.regionCombo.currentText(),
568 @staticmethod 665 @staticmethod
569 def getTimezone(parent=None): 666 def getTimezone(parent=None):
570 """ 667 """
571 Public static method to select a time zone. 668 Public static method to select a time zone.
572 669
573 @param parent reference to the parent widget (QWidget) 670 @param parent reference to the parent widget
574 @return tuple of selected time zone (string) and flag indicating 671 @type QWidget
575 the acceptance state (boolean) 672 @return tuple of selected time zone and flag indicating the acceptance
673 state
674 @rtype tuple of (str, bool)
576 """ 675 """
577 dlg = TimezoneSelectionDialog(parent) 676 dlg = TimezoneSelectionDialog(parent)
578 tz = "" 677 tz = ""
579 if dlg.exec() == QDialog.Accepted: 678 if dlg.exec() == QDialog.DialogCode.Accepted:
580 tz = dlg.getData() 679 tz = dlg.getData()
581 return tz, bool(tz) 680 return tz, bool(tz)

eric ide

mercurial