-
Notifications
You must be signed in to change notification settings - Fork 2
/
mainwindow.h
97 lines (76 loc) · 2.38 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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QString>
#include <QMap>
#include <QUuid>
#include <QHostAddress>
class ConnectionPane;
class QTreeWidget;
class QTreeWidgetItem;
class ConnectionData;
class GroupData;
class QSettings;
class QNetworkAccessManager;
class QNetworkReply;
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
protected:
ConnectionPane * GetCurrentTab();
void WriteSettings();
private slots:
void on_action_Exit_triggered();
void on_action_Connect_triggered();
void on_action_New_triggered();
void on_actionDelete_group_triggered();
void on_action_Disconnect_triggered();
void on_action_Edit_triggered();
void on_actionDelete_triggered();
void on_action_Restart_triggered();
void on_action_Clear_text_triggered();
void CloseTab(int index);
void ConnContext(const QPoint &);
void ConnectionDoubleClicked(QTreeWidgetItem * item, int column = 0);
void on_actionCopy_triggered();
void on_actionNew_group_triggered();
void on_action_Preferences_triggered();
void on_action_About_triggered();
public:
protected:
QMap<QUuid, ConnectionData *> connections;
QMap<QUuid, GroupData *> groups;
ConnectionData *createConnection();
QTreeWidgetItem *addItem(QTreeWidget *v, ConnectionData *c);
QTreeWidgetItem *addItem(QTreeWidgetItem *i, ConnectionData *c);
void setupItem(QTreeWidgetItem *item, ConnectionData *c);
GroupData *createGroup();
QTreeWidgetItem *insertGroup(GroupData *grp);
QTreeWidgetItem *findItem(QUuid uuid);
QTreeWidgetItem *selectedItem();
QWidget *findTab(QTabWidget *parent, QUuid uuid);
void AddNewTab(GroupData *grp, ConnectionData *conn, QHostAddress addr);
bool blackOnWhite;
bool systemFont;
QNetworkAccessManager *manager;
void loadGroup(QTreeWidgetItem *item);
void showEvent(QShowEvent *event);
void reloadGroup(QTreeWidgetItem *item);
void clearGroup(QTreeWidgetItem *item);
protected slots:
void addRootConnection();
void addChildConnection();
void treeWidgetItemChanged(QTreeWidgetItem *item, int column);
void groupLoaded();
void onRefreshDynamicItem();
private:
QTreeWidgetItem *findOrAddGroup(QString groupName);
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H