Stellarium 0.14.3
ObservationsDialog.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 _OBSERVATIONSDIALOG_HPP_
20 #define _OBSERVATIONSDIALOG_HPP_
21 
22 #include <QObject>
23 #include <QMap>
24 #include "StelDialogLogBook.hpp"
25 #include "StelStyle.hpp"
26 
27 class Ui_ObservationsDialog;
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  ObservationsDialog(QMap<QString, QSqlTableModel *> theTableModels, int sessionID);
40  virtual ~ObservationsDialog();
41  void languageChanged();
43  void styleChanged();
44  void updateStyle();
45 
46 protected slots:
47  void accessoriesTextChanged();
48  void barlowChanged(const QString &newValue);
49  void beginDateTimeChanged(const QDateTime &datetime);
50  void deleteSelectedObservation();
51  void endDateTimeChanged(const QDateTime &datetime);
52  void filterChanged(const QString &newValue);
53  void imagerChanged(const QString &newValue);
54  void insertNewObservation();
55  void limitingMagnitudeChanged(const QString &newValue);
56  void notesTextChanged();
57  void observerChanged(const QString &newValue);
58  void observationSelected(const QModelIndex &index);
59  void ocularChanged(const QString &newValue);
60  void opticChanged(const QString &newValue);
61  void seeingChanged(const QString &newValue);
62  void targetChanged(const QString &newValue);
63 
64 protected:
66  virtual void createDialogContent();
67  QSqlRecord currentObservationRecord();
68  void populateFormWithObservationIndex(const QModelIndex &index);
69  void setupConnections();
70  void setupModels();
71  void teardownConnections();
72 
73 private:
74  QMap<QString, FieldConcatModel *> fieldModels;
75  int lastObservationRowNumberSelected;
76  QSqlRelationalTableModel* observationsModel;
77  int sessionKey;
78  QMap<QString, QSqlTableModel *> tableModels;
79  Ui_ObservationsDialog* ui;
80 };
81 
82 #endif // _OBSERVATIONSDIALOG_HPP_
virtual void createDialogContent()
Initialize the dialog widgets and connect the signals/slots.
void styleChanged()
Notify that the application style changed.
void languageChanged()
Retranslate the content of the dialog.
Allows for concatinating fields from a model for disply.