-
Notifications
You must be signed in to change notification settings - Fork 6
/
yatewindow.h
149 lines (110 loc) · 3.04 KB
/
yatewindow.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#ifndef YATEWINDOW_H
#define YATEWINDOW_H
#include <QMainWindow>
#include <QFile>
#include <QDir>
#include <QString>
#include <QAtomicInt>
#include <QSystemTrayIcon>
#include "globals.h"
QT_BEGIN_NAMESPACE
namespace Ui { class YATEWindow; }
class QAction;
QT_END_NAMESPACE
namespace Yate {
class SettingsDialog;
class LiveFeedbackOverlay;
class AnalysisWindow;
class EEParser;
class HuntInfoGenerator;
class DiscordManager;
class MqttManager;
class YATEWindow : public QMainWindow
{
Q_OBJECT
public:
YATEWindow(QString codeURI = "", QWidget *parent = nullptr);
~YATEWindow();
bool isLogManuallySet() const;
void setIsLogManuallySet(bool newIsLogManuallySet);
void showLiveFeedback(bool lock);
void showClientLiveFeedback(bool lock);
protected:
void changeEvent(QEvent* e);
private slots:
void on_btnSettings_clicked();
void on_btnEditLogPath_clicked();
void dragEnterEvent(QDragEnterEvent *e);
void dropEvent(QDropEvent *e);
void on_btnShrineWater_clicked();
void on_btnLiveFeedback_clicked();
void showWindow();
void stopFeedback();
void iconActivated(QSystemTrayIcon::ActivationReason reason);
void exitApp();
void disableUI();
void enableUI();
void onParserStarted();
void onParserFinished();
void onParserError(QString);
void lockFeedbackWindow();
void lockClientFeedbackWindow();
void on_btnLiveFeedbackVS_clicked();
void on_btnCopyLobbyId_clicked();
void on_btnCopyLobbyLink_clicked();
void on_btnReconnect_clicked();
public slots:
void setLogFilePath(QString path);
void onUpdaterBusy(bool busy);
void refreshDiscordSettings();
void onLobbyIdChange(QString id);
void onUserConnected(QString name);
void onMqttConnected();
void onMqttConnecting();
void onMqttDisconnected();
void onVSConnectionSucceeded();
void onVSConnectionFailed();
signals:
void exitFeebackOverlay();
void checkForUpdate();
void feedbackWindowClosed();
void discordStop();
void discordStart();
void discordClearActivity();
void disconnecFromLobby();
private:
void createTrayIcon();
void onDiscordInviteAccepted(QString secret);
void refreshTitle();
Ui::YATEWindow *ui;
QFile eeLogFile_;
SettingsDialog *settingsDialog_;
LiveFeedbackOverlay *feedbackOverlay_;
AnalysisWindow *analysisWindow_;
QSystemTrayIcon *trayIcon_;
QAction *trayShowYate_;
QAction *trayStopFeedback_;
QAction *trayQuit_;
EEParser *parser_;
HuntInfoGenerator *huntInfoGenerator_;
bool isLogManuallySet_;
bool clientVersion_;
MqttManager *mqtt_;
QThread *mqttThread_;
#ifdef DISCORD_ENABLED
DiscordManager *discord_;
QThread *discordThread_;
bool discordConnected_;
bool mqttConnected_;
#endif
QAtomicInt isLiveFeedbackRunning_;
QString codeURI_;
QString discordTitle_;
QString mqttTitle_;
QString prevPeerLobbyId_;
void initDiscord();
void initMqtt();
void establishLobbyConnection(QString lobbyId);
};
}
#endif // YATEWINDOW_H