-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpixelpuppetmain.h
More file actions
54 lines (46 loc) · 1.52 KB
/
pixelpuppetmain.h
File metadata and controls
54 lines (46 loc) · 1.52 KB
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
#ifndef PIXELPUPPETMAIN_H
#define PIXELPUPPETMAIN_H
#include <QMainWindow>
#include <QLabel>
#include <QMenu>
#include <QAction>
#include <QToolBar>
#include <QStatusBar>
#include <QMessageBox>
#include "canvas.h"
#include "NetworkManager.h"
#include "PaintTogetherDialog.h"
#include "sessioncreateddialog.h" // Include the new session created dialog
#include <QTcpServer>
#include <QTcpSocket>
#include <QHostAddress>
#include <QNetworkInterface>
#include <QCryptographicHash>
#include <QByteArray>
class PixelPuppetMain : public QMainWindow
{
Q_OBJECT
public:
explicit PixelPuppetMain(QWidget *parent = nullptr);
~PixelPuppetMain();
private:
Canvas *canvas;
NetworkManager *networkManager;
QLabel *userCountLabel; // QLabel for user count
void setupMenu();
void setupToolbar();
void resizeCanvas(int width, int height);
void showAboutDialog();
void updateUserCount(int guestCount); // Method to update the user count
QString generateSessionCode(); // Method to generate the session code
QString base64Encode(const QByteArray& data); // Base64 encoding function
QByteArray base64Decode(const QString& encodedString); // Base64 decoding function
QString getLocalIPv6Address(); // New method to get the local IPv6 address
private slots:
void onPaintTogetherClicked();
void onSessionCreated(QString sessionCode);
void onSessionJoined(QString sessionCode);
signals:
void userCountUpdated(int guestCount); // Signal to update user count in main
};
#endif // PIXELPUPPETMAIN_H