mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-07 18:43:26 -08:00
[Client] Transient User Alts investigation tab
New TabAlts tab with user search, depth selector (1-3), and an alt table showing per-row match evidence (Via, Depth, Shared fan-out) alongside the account data. Sends Command_GetUserAlts with the requested depth and degrades gracefully against old servers (missing evidence fields render as dashes). Wired as a transient single-reuse tab via TabSupervisor::openTabAlts with no menu action or persisted setting; closed on disconnect like the other staff tabs.
This commit is contained in:
parent
db751ca14c
commit
1e11f78ac2
5 changed files with 248 additions and 1 deletions
54
cockatrice/src/interface/widgets/tabs/tab_alts.h
Normal file
54
cockatrice/src/interface/widgets/tabs/tab_alts.h
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
#ifndef TAB_ALTS_H
|
||||
#define TAB_ALTS_H
|
||||
|
||||
#include "tab.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
#include <qtmetamacros.h>
|
||||
|
||||
class AbstractClient;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QSpinBox;
|
||||
class QTableWidget;
|
||||
class Response;
|
||||
class TabSupervisor;
|
||||
|
||||
/**
|
||||
* Staff alt-graph investigation tool. Shows accounts related to the
|
||||
* investigated user (shared email, client id, or recent IP address),
|
||||
* including transitive alts-of-alts, with per-row match evidence.
|
||||
*/
|
||||
class TabAlts : public Tab
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit TabAlts(TabSupervisor *_tabSupervisor, AbstractClient *_client, const QString &initialUser = {});
|
||||
void retranslateUi() override;
|
||||
[[nodiscard]] QString getTabText() const override
|
||||
{
|
||||
return tr("User Alts");
|
||||
}
|
||||
void investigate(const QString &userName);
|
||||
|
||||
private slots:
|
||||
void investigateUser();
|
||||
void altsResponse(const Response &response);
|
||||
|
||||
private:
|
||||
void requestAlts(const QString &userName, int depth);
|
||||
[[nodiscard]] QString formatEpoch(quint64 ts) const;
|
||||
|
||||
AbstractClient *client;
|
||||
QString currentUser;
|
||||
|
||||
QLineEdit *searchEdit;
|
||||
QSpinBox *depthSpin;
|
||||
QPushButton *investigateButton;
|
||||
QLabel *statusLabel;
|
||||
QTableWidget *altsTable;
|
||||
};
|
||||
|
||||
#endif // TAB_ALTS_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue