-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
135 lines (121 loc) · 3 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QSqlDatabase>
#include <QSqlTableModel>
#include <QSqlQuery>
#include <QSqlRecord>
#include <QMessageBox>
#include <QFileInfo>
#include <QKeyEvent>
#include <QProcess>
#include <QTimer>
#include <QDesktopServices>
#include <QFontDatabase>
#include "settings.h"
#include "callsigns.h"
#include "udpreceiver.h"
#include "flrig.h"
#include "httpapi.h"
#include "helpers.h"
#include "qrzrucallbook.h"
#include "adif.h"
#include "about.h"
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
struct bandData {
int band_id;
QString band_name;
QString band_value;
QString band_freq;
};
QList<bandData> bandList;
struct modeData {
int mode_id;
QString mode_name;
QString mode_value;
QString mode_report;
};
QList<modeData> modeList;
private:
Ui::MainWindow *ui;
Settings *settings;
Callsigns *callsigns;
UdpReceiver *udpReceiver;
Flrig *flrig;
HttpApi *api;
QString database_file;
QSqlDatabase db;
QSqlTableModel *RecordsModel;
QTimer *EverySecondTimer;
QrzruCallbook *qrz;
QTimer *CallTypeTimer;
Adif *adif;
About *about;
typedef struct baseData {
int callsign_id;
int qsosu_callsign_id;
int qsosu_operator_id;
QString callsign;
QString oper;
QString gridsquare;
QString cnty;
} baseData_t;
baseData_t userData;
void InitDatabase(QString dbFile);
bool CheckDatabase();
bool ConnectDatabase();
void CreateDatabase();
void getCallsigns();
void InitRecordsTable();
void ScrollRecordsToBottom();
void ScrollRecordsToTop();
void FindCallDataQrzru();
void ClearCallbookFields();
void RemoveQSOs(QModelIndexList indexes);
void SetRecordsFilter(int log_id);
void SyncQSOs(QModelIndexList indexes);
void SaveFormData();
void SaveCallsignState();
void darkTheime();
//bool LoadHamDefs();
void readXmlfile();
double BandToDefaultFreq(QString band);
QString getBandValue(int index);
QString getModeValue(QString mode);
QString getRepotValueFromMode(QString mode);
protected:
void keyPressEvent(QKeyEvent *event) override;
private slots:
void onSettingsChanged();
void CallsignToUppercase(const QString &arg);
void RefreshRecords();
void SaveQso();
void ClearQso();
void UpdateFormDateTime();
void onCallsignsUpdated();
void onStationCallsignChanged();
void onOperatorChanged();
void onUdpLogged();
void fillDefaultFreq();
void customMenuRequested(QPoint pos);
void onQsoSynced(int dbid);
void LoadHamDefs();
void setModesList();
void setBandsList();
void HamDefsUploaded();
void HamDefsError();
void on_bandCombo_currentTextChanged(const QString &arg1);
void on_modeCombo_currentTextChanged(const QString &arg1);
void on_freqInput_editingFinished();
void on_rstrInput_editingFinished();
void on_rstsInput_editingFinished();
};
#endif // MAINWINDOW_H