Stellarium 0.14.3
SessionsDialog.hpp
1 /*
2  * Copyright (C) 2010 Timothy Reaves
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
17  */
18 
19 #ifndef _SESSIONSDIALOG_HPP_
20 #define _SESSIONSDIALOG_HPP_
21 
22 #include <QObject>
23 #include <QMap>
24 #include "StelDialogLogBook.hpp"
25 #include "StelStyle.hpp"
26 
27 class Ui_SessionsDialog;
28 class FieldConcatModel;
29 class QDateTime;
30 class QModelIndex;
31 class QSqlRecord;
32 class QSqlRelationalTableModel;
33 class QSqlTableModel;
34 
36  Q_OBJECT
37 
38 public:
39  SessionsDialog(QMap<QString, QSqlTableModel *> theTableModels);
40  virtual ~SessionsDialog();
41  void languageChanged();
43  void styleChanged();
44  void updateStyle();
45 
46 protected slots:
47  // session slots
48  void beginDateTimeChanged(const QDateTime &datetime);
49  void commentsTextChanged();
50  void deleteSelectedSession();
51  void endDateTimeChanged(const QDateTime &datetime);
52  void insertNewSession();
53  void observationWindowClosed(StelDialogLogBook* theDialog);
54  void observerChanged(const QString &newValue);
55  void openObservations();
56  void sessionSelected(const QModelIndex &index);
57  void siteChanged(const QString &newValue);
58  void weatherTextChanged();
59 
60 protected:
62  virtual void createDialogContent();
63  QSqlRecord currentSessionRecord();
64  void populateFormWithSessionIndex(const QModelIndex &index);
65  void setupConnections();
66  void setupModels();
67  void teardownConnections();
68 
69 private:
70  QMap<QString, FieldConcatModel *> fieldModels;
71  int lastSessionRowNumberSelected;
72  QSqlRelationalTableModel* sessionsModel;
73  QMap<QString, QSqlTableModel *> tableModels;
74  Ui_SessionsDialog* ui;
75 };
76 
77 #endif // _SESSIONSDIALOG_HPP_
virtual void createDialogContent()
Initialize the dialog widgets and connect the signals/slots.
void styleChanged()
Notify that the application style changed.
Allows for concatinating fields from a model for disply.
void languageChanged()
Retranslate the content of the dialog.