Cockatrice 2026-09-01-Development-3.1.0-beta.10
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 <libcockatrice/protocol/pb/response.pb.h>
8#include <libcockatrice/protocol/pb/serverinfo_report.pb.h>
9
10class AbstractClient;
11class QCheckBox;
12class QComboBox;
13class QGroupBox;
14class QLabel;
15class QLineEdit;
16class QPushButton;
17class QSplitter;
18class QTableWidget;
19class QTextEdit;
20class QTimer;
21class GameReplay;
22
23class TabReport : public Tab
24{
25 Q_OBJECT
26public:
27 TabReport(TabSupervisor *_tabSupervisor, AbstractClient *_client);
28 void retranslateUi() override;
29 [[nodiscard]] QString getTabText() const override
30 {
31 return tr("Report Queue");
32 }
33
34signals:
35 void openReplay(GameReplay *replay);
36 void requestJoinGame(int gameId, int roomId);
37
38private slots:
39 void refreshList();
40 void reportListResponse(const Response &response);
41 void assignReport();
42 void assignResponse(const Response &response);
43 void resolveReport(bool dismissed, bool promptNote);
44 void resolveResponse(const Response &response);
45 void onSelectionChanged();
46 void viewReplay();
47 void viewReplayResponse(const Response &response);
48 void joinGame();
49 void addComment();
50 void addCommentResponse(const Response &response);
51 void requestUserInfo(const QString &userName);
52 void userInfoResponse(const Response &response);
53 void reportDetailsResponse(const Response &response);
54 void requestStats();
55 void statsResponse(const Response &response);
56
57private:
58 int selectedReportId() const;
59 bool selectedReportInfo(ServerInfo_Report &info) const;
60 void setActionsEnabled(bool enabled);
61 void updateActionStates();
62 void applyFilters();
63 void updateStats();
64 void loadReportDetails(int reportId);
65
67
68 QLineEdit *searchEdit;
69 QComboBox *statusFilter;
71 QPushButton *refreshButton;
72 QLabel *statsLabel;
73 QTableWidget *table;
74 QSplitter *detailSplitter;
75 QGroupBox *descGroup;
76 QGroupBox *chatGroup;
77 QGroupBox *commentsGroup;
78 QTextEdit *descriptionEdit;
79 QTextEdit *chatLogEdit;
80 QTextEdit *commentsEdit;
81 QLineEdit *commentInput;
82 QPushButton *commentButton;
83 QPushButton *assignButton;
84 QPushButton *resolveButton;
86 QPushButton *dismissButton;
87 QPushButton *viewReplayButton;
88 QPushButton *joinGameButton;
89 QLabel *statusLabel;
90 QTimer *refreshTimer;
91
92 QGroupBox *userContextGroup;
98 QTextEdit *userContextNotes;
108 QGroupBox *statsGroup;
112 QTextEdit *statsDetailText;
113
114 QList<ServerInfo_Report> allReports;
115 QList<ServerInfo_Report> filteredReports;
122};
123
124#endif // TAB_REPORT_H
Definition abstract_client.h:57
void statsResponse(const Response &response)
Definition tab_report.cpp:864
QString commentDraftBeforeRefresh
Definition tab_report.h:119
QPushButton * dismissButton
Definition tab_report.h:86
void resolveReport(bool dismissed, bool promptNote)
Definition tab_report.cpp:646
QTextEdit * descriptionEdit
Definition tab_report.h:78
int detailsRequestedReportId
Definition tab_report.h:116
QTableWidget * table
Definition tab_report.h:73
QLabel * userContextBans
Definition tab_report.h:96
QGroupBox * statsGroup
Definition tab_report.h:108
bool selectedReportInfo(ServerInfo_Report &info) const
Definition tab_report.cpp:600
QComboBox * statusFilter
Definition tab_report.h:69
AbstractClient * client
Definition tab_report.h:66
void addCommentResponse(const Response &response)
Definition tab_report.cpp:769
QList< ServerInfo_Report > allReports
Definition tab_report.h:114
void assignReport()
Definition tab_report.cpp:617
void reportDetailsResponse(const Response &response)
Definition tab_report.cpp:532
void updateActionStates()
Definition tab_report.cpp:553
QLabel * userContextRecentReportsLabel
Definition tab_report.h:106
int selectedReportIdBeforeRefresh
Definition tab_report.h:118
void resolveResponse(const Response &response)
Definition tab_report.cpp:679
void addComment()
Definition tab_report.cpp:746
QList< ServerInfo_Report > filteredReports
Definition tab_report.h:115
QString lastRequestedUser
Definition tab_report.h:107
void applyFilters()
Definition tab_report.cpp:399
QLabel * userContextBansLabel
Definition tab_report.h:103
void requestStats()
Definition tab_report.cpp:850
QPushButton * assignButton
Definition tab_report.h:83
QTextEdit * commentsEdit
Definition tab_report.h:80
QPushButton * resolveWithNoteButton
Definition tab_report.h:85
QLabel * userContextAccountAge
Definition tab_report.h:94
void retranslateUi() override
Definition tab_report.cpp:263
QLabel * userContextAgeLabel
Definition tab_report.h:101
QPushButton * viewReplayButton
Definition tab_report.h:87
void onSelectionChanged()
Definition tab_report.cpp:468
void updateStats()
Definition tab_report.cpp:445
QTimer * refreshTimer
Definition tab_report.h:90
QTextEdit * chatLogEdit
Definition tab_report.h:79
QCheckBox * unresolvedOnlyBox
Definition tab_report.h:70
QLabel * userContextReports
Definition tab_report.h:95
QLabel * userContextReportsLabel
Definition tab_report.h:102
ServerInfo_Report previousSelectedReport
Definition tab_report.h:120
QSplitter * detailSplitter
Definition tab_report.h:74
void loadReportDetails(int reportId)
Definition tab_report.cpp:487
QGroupBox * userContextGroup
Definition tab_report.h:92
QLineEdit * searchEdit
Definition tab_report.h:68
QTextEdit * userContextNotes
Definition tab_report.h:98
int detailsRequestSeq
Definition tab_report.h:117
void viewReplayResponse(const Response &response)
Definition tab_report.cpp:708
void requestUserInfo(const QString &userName)
Definition tab_report.cpp:780
void viewReplay()
Definition tab_report.cpp:690
QLabel * userContextNotesLabel
Definition tab_report.h:105
QLabel * statsLabel
Definition tab_report.h:72
void refreshList()
Definition tab_report.cpp:312
void openReplay(GameReplay *replay)
QLabel * userContextWarnsLabel
Definition tab_report.h:104
int selectedReportId() const
Definition tab_report.cpp:591
void requestJoinGame(int gameId, int roomId)
QLabel * statsCategoriesLabel
Definition tab_report.h:111
QPushButton * joinGameButton
Definition tab_report.h:88
QGroupBox * descGroup
Definition tab_report.h:75
void assignResponse(const Response &response)
Definition tab_report.cpp:635
QTextEdit * statsDetailText
Definition tab_report.h:112
QTextEdit * userContextRecentReports
Definition tab_report.h:99
void setActionsEnabled(bool enabled)
Definition tab_report.cpp:579
QString getTabText() const override
Definition tab_report.h:29
QLineEdit * commentInput
Definition tab_report.h:81
QGroupBox * commentsGroup
Definition tab_report.h:77
QLabel * statsTrendLabel
Definition tab_report.h:110
void userInfoResponse(const Response &response)
Definition tab_report.cpp:805
TabReport(TabSupervisor *_tabSupervisor, AbstractClient *_client)
Definition tab_report.cpp:61
void reportListResponse(const Response &response)
Definition tab_report.cpp:334
QLabel * userContextWarns
Definition tab_report.h:97
bool previousSelectedReportValid
Definition tab_report.h:121
QPushButton * resolveButton
Definition tab_report.h:84
QLabel * userContextName
Definition tab_report.h:93
QPushButton * commentButton
Definition tab_report.h:82
QGroupBox * chatGroup
Definition tab_report.h:76
QPushButton * refreshButton
Definition tab_report.h:71
QLabel * statusLabel
Definition tab_report.h:89
QLabel * userContextUserLabel
Definition tab_report.h:100
QLabel * statsTotalLabel
Definition tab_report.h:109
void joinGame()
Definition tab_report.cpp:729
Definition tab_supervisor.h:84
Tab(TabSupervisor *_tabSupervisor)
Definition tab.cpp:11
Definition game_replay.proto:4
Definition response.proto:11
Definition serverinfo_report.proto:8