-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
74 lines (65 loc) · 1.87 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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "ui_mainwindow.h"
#include "loginwindow.h"
#include "connectwindow.h"
#include "settingswindow.h"
#include "proxysettingswindow.h"
#include "serverlistwindow.h"
#include "getservers.h"
#include "waitwindow.h"
#include <QDebug>
#include <QSystemTrayIcon>
#include <QMenu>
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0, Qt::WindowFlags flags = 0);
~MainWindow();
void setTrayStatusConnected();
void setTrayStatusDisconnected(bool bShowMessage = true);
void setTrayStatusConnecting();
protected:
void closeEvent(QCloseEvent *event);
void changeEvent(QEvent *event);
private slots:
void onSignIn(QString login, QString password);
void onSettings();
void onBack();
void onReturnToSignUp();
void onShow();
void onExit();
void onStatus();
void onConnected();
void onHelp();
void onActHelp();
void onLiveChat();
void onProxy();
void onShowLogs();
void onServerList();
void onChangeServer(const QString &);
void onTrayActivated(QSystemTrayIcon::ActivationReason reason);
void onGetServersFinished(bool bSuccess, QString errorStr, bool bConfigChanged);
void onAuthenticationError();
private:
Ui::MainWindowClass ui;
LoginWindow *loginWindow_;
ConnectWindow *connectWindow_;
SettingsWindow *settingsWindow_;
ProxySettingsWindow *proxySettingsWindow_;
ServerListWindow *serverListWindow_;
WaitWindow *waitWindow_;
GetServers *getServers_;
bool connected_;
QSystemTrayIcon *trayIcon_;
QMenu *trayMenu_;
QAction *actConnect_, *actDisconnect_, *actHelp_, *actLiveChat_, *actExit_;
QTimer *timer_;
int state_;
QMenu *settingsMenu_;
void skipLoginScreen(const QString &username, const QString &password);
void placeWindowToCenter();
};
#endif // MAINWINDOW_H