-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain_window.h
103 lines (77 loc) · 2.54 KB
/
main_window.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
#ifndef MAIN_WINDOW_H
#define MAIN_WINDOW_H
#include <QMainWindow>
#include <QStringListModel>
#include <QGraphicsScene>
#include <QMutex>
#include "src/notification_delegate.h"
#include "src/server_variables_model.h"
#include "src/view_models.h"
#include <functional>
QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
ServerVariablesModel *m_TblServerVariables;
ServerVariables m_ModServerVariables;
ClientInfoModel *m_TblPlayers;
ClientList m_ModPlayers;
// m_TblBlacklist;
QStringListModel m_ListMaps;
QStringListModel m_ListPresets;
QList<QString> m_AvailableMaps;
QList<QString> m_ModPresets;
QMap<QString, std::function<void(QVariant)>> m_ServerVariableSetters;
QString m_CurrentPreviewMap;
QString m_CurrentMapSuffix;
uint64_t m_CurrentMapTag;
QGraphicsScene *m_pMapScene;
QMutex m_Logging;
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
private slots:
void on_TabChanged(int tab);
void on_NotificationReceived(NotificationMessage msg);
void on_btnSaveServerSettings_clicked();
void on_btnLoadServerSettings_clicked();
void on_btnConnect_clicked();
void on_edtAddress_textChanged(const QString &arg1);
void on_edtPassword_textChanged(const QString &arg1);
void on_spnPort_valueChanged(int arg1);
void on_btnApplyServerVariables_clicked();
void on_chkMapSmall_stateChanged(int arg1);
void on_chkMapMedium_stateChanged(int arg1);
void on_chkMapLarge_stateChanged(int arg1);
void on_chkMapVeryLarge_stateChanged(int arg1);
void on_btnChangeMap_clicked();
void on_listMap_doubleClicked(const QModelIndex &index);
void on_listMap_clicked(const QModelIndex &index);
void on_listPreset_clicked(const QModelIndex &index);
void on_listPreset_doubleClicked(const QModelIndex &index);
void on_btnApplyPreset_clicked();
void on_btnUpdatePreset_clicked();
void on_btnWaitPlayer_clicked();
void on_btnReady_clicked();
void on_btnApplyAll_clicked();
void on_btnSetDiffAll_clicked();
void on_btnKick_clicked();
protected:
void resizeEvent(QResizeEvent *event) override;
private:
Ui::MainWindow *ui;
const int m_MapTabIndex = 2;
void PopulateWidgets();
void SaveConfig();
void UpdateMapList();
void UpdateMap(const QString &str);
void PreviewMap(const QString &str);
void ApplyPreset(const QString &str);
void UpdatePreset();
void RconUIState(bool enabled);
};
#endif // MAIN_WINDOW_H