Stellarium 0.13.2
DateTimeDialog.hpp
1 /*
2  * Stellarium
3  * Copyright (C) 2008 Nigel Kerr
4  * Copyright (C) 2012 Timothy Reaves
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, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
19 */
20 
21 #ifndef _DATETIMEDIALOG_HPP_
22 #define _DATETIMEDIALOG_HPP_
23 
24 #include <QObject>
25 #include "StelDialog.hpp"
26 
27 class Ui_dateTimeDialogForm;
28 
29 class DateTimeDialog : public StelDialog
30 {
31  Q_OBJECT
32 public:
33  DateTimeDialog(QObject* parent);
34  ~DateTimeDialog();
35  double newJd();
36  bool valid(int y, int m, int d, int h, int min, int s);
37  bool validJd(double jday);
38  bool validMjd(double mjday);
40  void styleChanged();
41 public slots:
42  void retranslate();
44  void setDateTime(double newJd);
45 
46  void close();
47 
48 
49 protected:
51  virtual void createDialogContent();
52  void connectSpinnerEvents() const;
53  void disconnectSpinnerEvents()const;
54 
55 private slots:
57  void yearChanged(int ny);
59  void monthChanged(int nm);
61  void dayChanged(int nd);
63  void hourChanged(int nh);
65  void minuteChanged(int nm);
67  void secondChanged(int ns);
69  void jdChanged(double njd);
71  void mjdChanged(double nmjd);
72 
73 private:
74  Ui_dateTimeDialogForm* ui;
75  int year;
76  int month;
77  int day;
78  int hour;
79  int minute;
80  int second;
81  double jd;
82  double mjd;
83  void pushToWidgets();
84 };
85 
86 #endif // _DATETIMEDIALOG_HPP_
virtual void createDialogContent()
Initialize the dialog widgets and connect the signals/slots.
void setDateTime(double newJd)
update the editing display with new JD.
Base class for all the GUI windows in Stellarium.
Definition: StelDialog.hpp:45
void styleChanged()
Notify that the application style changed.