-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathplayerlistwidget.h
More file actions
46 lines (34 loc) · 1.02 KB
/
playerlistwidget.h
File metadata and controls
46 lines (34 loc) · 1.02 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
#pragma once
#include "datatypes.h"
#include <QList>
#include <QListWidget>
#include <QMap>
#include <QPointer>
class AOApplication;
class ModeratorDialog;
class PlayerListWidget : public QListWidget
{
Q_OBJECT
public:
explicit PlayerListWidget(AOApplication *ao_app, QWidget *parent = nullptr);
virtual ~PlayerListWidget();
void registerPlayer(const PlayerRegister &update);
void updatePlayer(const PlayerUpdate &update);
void reloadPlayers();
void setAuthenticated(bool f_state);
private:
AOApplication *ao_app;
QMap<int, PlayerData> m_player_map;
QMap<int, QListWidgetItem *> m_item_map;
QPair<int, QPointer<ModeratorDialog>> active_moderator_menu;
bool m_is_authenticated = false;
void addPlayer(int playerId);
void removePlayer(int playerId);
void updatePlayer(int playerId, bool updateIcon);
QString formatLabel(const PlayerData &data);
void filterPlayerList();
Q_SIGNALS:
void notify(const QString &messasge);
private Q_SLOTS:
void onCustomContextMenuRequested(const QPoint &pos);
};