1 #ifndef SETUPPAGESATSNEW_H
2 #define SETUPPAGESATSNEW_H
3 /***************************************************************************
4                           setuppagesatsnew.h  -  description
5                              -------------------
6     begin                : dec 2018
7     copyright            : (C) 2018 by Jaime Robles
8     email                : jaime@robles.es
9  ***************************************************************************/
10 
11 /*****************************************************************************
12  * This file is part of KLog.                                                *
13  *                                                                           *
14  *    KLog is free software: you can redistribute it and/or modify           *
15  *    it under the terms of the GNU General Public License as published by   *
16  *    the Free Software Foundation, either version 3 of the License, or      *
17  *    (at your option) any later version.                                    *
18  *                                                                           *
19  *    KLog is distributed in the hope that it will be useful,                *
20  *    but WITHOUT ANY WARRANTY; without even the implied warranty of         *
21  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
22  *    GNU General Public License for more details.                           *
23  *                                                                           *
24  *    You should have received a copy of the GNU General Public License      *
25  *    along with KLog.  If not, see <https://www.gnu.org/licenses/>.         *
26  *                                                                           *
27  *****************************************************************************/
28 //
29 // This class implements the Dialog to add a new satellite
30 //
31 #include "dataproxy_sqlite.h"
32 #include "utilities.h"
33 #include <QDialog>
34 #include <QtWidgets>
35 #include <QSqlQuery>
36 
37 //TODO: Read the data when the user clicks the OK button
38 //TODO: Fill the data from the list of sats when the user wants to edit a sat
39 
40 class SetupPageSatsNew : public QDialog
41 {
42     Q_OBJECT
43 
44 public:
45     SetupPageSatsNew(DataProxy_SQLite *dp, QWidget *parent = nullptr);
46 
47     void setEditing(const bool b);
48 
49     void setShortName(const QString st);
50     void setName(const QString st);
51     void setUpLink(const QString st);
52     void setDownLink(const QString st);
53     void setModes(const QString st);
54 
55     void clear();
56 
57 
58 private slots:
59     void slotOKButtonClicked();
60     void slotCancelButtonClicked();
61 
62     void slotShortNameTextChanged();
63     void slotNameTextChanged();
64     void slotUpLinkTextChanged();
65     void slotDownLinkTextChanged();
66     void slotModesTextChanged();
67 
68 signals:
69     void newSatData(const QStringList _qs); //
70     void cancelled(const bool _c); // Cancel button is clicked
71 
72 private:
73 
74     //bool isThereAnyNotManagedSat();
75     void createUI();
76     void gatherAndSend();
77     bool isItAFreq(const QString &_st);
78 
79     //void fillWithType(const int _n);
80     //void updateAllCats();
81     //void showOK();
82     //void showNOK();
83     //void clear();
84 
85 
86     DataProxy_SQLite *dataProxy;
87     Utilities *util;
88 
89     QLineEdit *shortNameLineEdit, *nameLineEdit;
90     QLineEdit *uplinkLineEdit, *downlinkLineEdit;
91     QLineEdit *modesLineEdit;
92 
93     QLabel *shortNameLabel, *nameLabel;
94     QLabel *uplinkLabel, *downlinkLabel;
95     QLabel *modesLabel;
96 
97 
98     QString shortName, name, uplink, downlink, modes;
99     bool hasShortName, hasName, hasUplink, hasDownlink, hasModes;
100 
101     QPushButton *okButton, *cancelButton;
102 
103     QStringList satData;
104     bool editing;
105 
106 };
107 
108 #endif // SETUPPAGESATSNEW_H
109