Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
tab_report.h
Go to the documentation of this file.
1#ifndef TAB_REPORT_H
2#define TAB_REPORT_H
3
4#include "tab.h"
5
6#include <QList>
7#include <QPoint>
8#include <QString>
9#include <libcockatrice/protocol/pb/serverinfo_report.pb.h>
10#include <qtmetamacros.h>
11
12class AbstractClient;
13class QCheckBox;
14class QComboBox;
15class QGroupBox;
16class QLabel;
17class QLineEdit;
18class QPushButton;
19class QSplitter;
20class QTableWidget;
21class QTextEdit;
22class QTimer;
23class GameReplay;
24class Response;
25class TabSupervisor;
26class UserContextMenu;
27
28class TabReport : public Tab
29{
30 Q_OBJECT
31public:
32 TabReport(TabSupervisor *_tabSupervisor, AbstractClient *_client);
33 void retranslateUi() override;
34 [[nodiscard]] QString getTabText() const override
35 {
36 return tr("Report Queue");
37 }
38
39signals:
40 void openReplay(GameReplay *replay);
41 void requestJoinGame(int gameId, int roomId);
42 void openMessageDialog(const QString &userName, bool focus);
43
44private slots:
45 void refreshList();
46 void reportListResponse(const Response &response);
47 void assignReport();
48 void assignResponse(const Response &response);
49 void resolveReport(bool dismissed);
50 void resolveResponse(const Response &response);
51 void onSelectionChanged();
52 void showTableContextMenu(const QPoint &pos);
53 void viewReplay();
54 void viewReplayResponse(const Response &response);
55 void joinGame();
56 void addComment();
57 void addCommentResponse(const Response &response);
58 void requestUserInfo(const QString &userName);
59 void userInfoResponse(const Response &response);
60 void reportDetailsResponse(const Response &response);
61 void requestStats();
62 void statsResponse(const Response &response);
63 void reopenReport();
64 void reopenResponse(const Response &response);
65
66private:
67 int selectedReportId() const;
68 bool selectedReportInfo(ServerInfo_Report &info) const;
69 void setActionsEnabled(bool enabled);
70 void updateActionStates();
71 void applyFilters();
72 void updateStats();
73 void loadReportDetails(int reportId);
74
76
77 QLineEdit *searchEdit;
78 QComboBox *statusFilter;
80 QPushButton *refreshButton;
81 QLabel *statsLabel;
82 QTableWidget *table;
83 QSplitter *detailSplitter;
84 QGroupBox *descGroup;
85 QGroupBox *chatGroup;
86 QGroupBox *commentsGroup;
87 QTextEdit *descriptionEdit;
88 QTextEdit *chatLogEdit;
89 QTextEdit *commentsEdit;
90 QLineEdit *commentInput;
91 QPushButton *commentButton;
92 QPushButton *assignButton;
93 QPushButton *resolveButton;
94 QPushButton *dismissButton;
95 QPushButton *reopenButton;
96 QPushButton *viewReplayButton;
97 QPushButton *joinGameButton;
98 QLabel *statusLabel;
99 QTimer *refreshTimer;
101
119 QGroupBox *statsGroup;
123 QTextEdit *statsDetailText;
124
133};
134
135#endif // TAB_REPORT_H
Definition abstract_client.h:73
Definition remote_connection_controller.h:20
void statsResponse(const Response &response)
Definition tab_report.cpp:955
QString commentDraftBeforeRefresh
Definition tab_report.h:130
QPushButton * dismissButton
Definition tab_report.h:94
UserContextMenu * userContextMenu
Definition tab_report.h:100
QTextEdit * descriptionEdit
Definition tab_report.h:87
int detailsRequestedReportId
Definition tab_report.h:127
QTableWidget * table
Definition tab_report.h:82
QLabel * userContextBans
Definition tab_report.h:106
QGroupBox * statsGroup
Definition tab_report.h:119
bool selectedReportInfo(ServerInfo_Report &info) const
Definition tab_report.cpp:655
QComboBox * statusFilter
Definition tab_report.h:78
AbstractClient * client
Definition tab_report.h:75
void addCommentResponse(const Response &response)
Definition tab_report.cpp:860
QList< ServerInfo_Report > allReports
Definition tab_report.h:125
void assignReport()
Definition tab_report.cpp:672
void reportDetailsResponse(const Response &response)
Definition tab_report.cpp:587
void updateActionStates()
Definition tab_report.cpp:608
QLabel * userContextRecentReportsLabel
Definition tab_report.h:116
int selectedReportIdBeforeRefresh
Definition tab_report.h:129
void resolveResponse(const Response &response)
Definition tab_report.cpp:731
void addComment()
Definition tab_report.cpp:837
QList< ServerInfo_Report > filteredReports
Definition tab_report.h:126
QString lastRequestedUser
Definition tab_report.h:117
void applyFilters()
Definition tab_report.cpp:424
QLabel * userContextBansLabel
Definition tab_report.h:113
void requestStats()
Definition tab_report.cpp:941
QPushButton * assignButton
Definition tab_report.h:92
void showTableContextMenu(const QPoint &pos)
Definition tab_report.cpp:512
QTextEdit * commentsEdit
Definition tab_report.h:89
QLabel * userContextAccountAge
Definition tab_report.h:104
void retranslateUi() override
Definition tab_report.cpp:280
QLabel * userContextAgeLabel
Definition tab_report.h:111
QPushButton * viewReplayButton
Definition tab_report.h:96
void onSelectionChanged()
Definition tab_report.cpp:493
void updateStats()
Definition tab_report.cpp:470
QTimer * refreshTimer
Definition tab_report.h:99
void reopenResponse(const Response &response)
Definition tab_report.cpp:770
QTextEdit * chatLogEdit
Definition tab_report.h:88
QCheckBox * unresolvedOnlyBox
Definition tab_report.h:79
QLabel * userContextReports
Definition tab_report.h:105
QLabel * userContextReportsLabel
Definition tab_report.h:112
ServerInfo_Report previousSelectedReport
Definition tab_report.h:131
QSplitter * detailSplitter
Definition tab_report.h:83
void loadReportDetails(int reportId)
Definition tab_report.cpp:542
void openMessageDialog(const QString &userName, bool focus)
QGroupBox * userContextGroup
Definition tab_report.h:102
QLineEdit * searchEdit
Definition tab_report.h:77
QString pendingStatusMessage
Definition tab_report.h:118
QTextEdit * userContextNotes
Definition tab_report.h:108
int detailsRequestSeq
Definition tab_report.h:128
void viewReplayResponse(const Response &response)
Definition tab_report.cpp:799
void requestUserInfo(const QString &userName)
Definition tab_report.cpp:871
void viewReplay()
Definition tab_report.cpp:781
QLabel * userContextNotesLabel
Definition tab_report.h:115
QLabel * statsLabel
Definition tab_report.h:81
void refreshList()
Definition tab_report.cpp:331
void openReplay(GameReplay *replay)
QLabel * userContextWarnsLabel
Definition tab_report.h:114
int selectedReportId() const
Definition tab_report.cpp:646
void requestJoinGame(int gameId, int roomId)
QLabel * statsCategoriesLabel
Definition tab_report.h:122
QPushButton * joinGameButton
Definition tab_report.h:97
QGroupBox * descGroup
Definition tab_report.h:84
void assignResponse(const Response &response)
Definition tab_report.cpp:690
QTextEdit * statsDetailText
Definition tab_report.h:123
QTextEdit * userContextRecentReports
Definition tab_report.h:109
void setActionsEnabled(bool enabled)
Definition tab_report.cpp:634
QString getTabText() const override
Definition tab_report.h:34
QLineEdit * commentInput
Definition tab_report.h:90
QGroupBox * commentsGroup
Definition tab_report.h:86
QPushButton * reopenButton
Definition tab_report.h:95
QLabel * statsTrendLabel
Definition tab_report.h:121
void userInfoResponse(const Response &response)
Definition tab_report.cpp:896
TabReport(TabSupervisor *_tabSupervisor, AbstractClient *_client)
Definition tab_report.cpp:74
void reportListResponse(const Response &response)
Definition tab_report.cpp:353
QLabel * userContextWarns
Definition tab_report.h:107
bool previousSelectedReportValid
Definition tab_report.h:132
QPushButton * resolveButton
Definition tab_report.h:93
QLabel * userContextName
Definition tab_report.h:103
void reopenReport()
Definition tab_report.cpp:742
QPushButton * commentButton
Definition tab_report.h:91
QGroupBox * chatGroup
Definition tab_report.h:85
QPushButton * refreshButton
Definition tab_report.h:80
QLabel * statusLabel
Definition tab_report.h:98
void resolveReport(bool dismissed)
Definition tab_report.cpp:701
QLabel * userContextUserLabel
Definition tab_report.h:110
QLabel * statsTotalLabel
Definition tab_report.h:120
void joinGame()
Definition tab_report.cpp:820
Definition tab_supervisor.h:92
Tab(TabSupervisor *_tabSupervisor)
Definition tab.cpp:16
Definition user_context_menu.h:32
Definition game_replay.proto:4
Definition response.proto:11
Definition serverinfo_report.proto:8