Stellarium 0.14.3
DefineTimeZoneWindow.hpp
1 /*
2  * Time zone configuration plug-in for Stellarium
3  *
4  * Copyright (C) 2010 Bogdan Marinov
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef _DEFINE_TIME_ZONE_HPP_
21 #define _DEFINE_TIME_ZONE_HPP_
22 
23 #include "StelDialog.hpp"
24 
25 class Ui_defineTimeZoneForm;
26 class QRegExpValidator;
27 class QSpinBox;
28 
30 {
31  Q_OBJECT
32 
33 public:
36 
39  void setTimeZone(QString timeZoneString);
40 
41 public slots:
42  void retranslate();
43 
44 signals:
45  void timeZoneDefined(QString timeZoneString);
46 
47 protected:
48  void createDialogContent();
49 
50 private:
51  Ui_defineTimeZoneForm * ui;
52 
53  QRegExpValidator * timeZoneNameValidator;
54 
55  void resetWindowState();
56  void populateDateLists();
57 
58  void updateDayNumberMaximum(int monthIndex, QSpinBox * spinBoxDay);
59 
60  enum DstEndpoint {DstStart, DstEnd};
62  bool readDstEndpoint(const QString& string, DstEndpoint endpoint);
63  void setEndPointDate(int ordinalDate, bool leapYear, DstEndpoint endpoint);
64 
65 private slots:
66  void useDefinition();
67  void updateDstOffset(double normalOffset);
68  void updateDayNumberMaximumDstStart(int monthIndex);
69  void updateDayNumberMaximumDstEnd(int monthIndex);
70 };
71 
72 
73 #endif //_DEFINE_TIME_ZONE_HPP_
void setTimeZone(QString timeZoneString)
Fills the fields of the form with the time zone described in the string.
A local copy of StelDialog, the base class for all the GUI windows in Stellarium, included to allow t...