mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-27 09:03:54 -07:00
Some checks are pending
Build Desktop / Configure (push) Waiting to run
Build Desktop / Debian 13 (push) Blocked by required conditions
Build Desktop / Debian 12 (push) Blocked by required conditions
Build Desktop / Fedora 44 (push) Blocked by required conditions
Build Desktop / Fedora 43 (push) Blocked by required conditions
Build Desktop / Servatrice_Debian 12 (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 (push) Blocked by required conditions
Build Desktop / Ubuntu 24.04 (push) Blocked by required conditions
Build Desktop / Arch (push) Blocked by required conditions
Build Desktop / macOS 14 (push) Blocked by required conditions
Build Desktop / macOS 15 (push) Blocked by required conditions
Build Desktop / macOS 13 Intel (push) Blocked by required conditions
Build Desktop / macOS 15 Debug (push) Blocked by required conditions
Build Desktop / Windows 10 (push) Blocked by required conditions
Build Docker Image / amd64 & arm64 (push) Waiting to run
* [Room] Additionally show a tab for friends and ignored users instead of just all online users.
Took 21 minutes
Took 12 minutes
* [Room][UserList] Introduce style delegate for user list
- Allow users to set a card name and parameters as their background banner
- Allow mods to white/blacklist cards
- Allow toggling back to the old display style
Took 7 minutes
Took 28 seconds
Took 2 minutes
Took 2 minutes
* Right checkstate.
Took 14 minutes
Took 2 minutes
* Utility for test.
Took 9 minutes
Took 8 seconds
Took 2 seconds
* Lint.
Took 10 minutes
* Algorithm for sql schema migration
Took 13 minutes
* Use {prefix}, bound card name, return errors.
Took 27 seconds
* Convert queue to while loop.
Took 19 seconds
* Hover popup.
Took 36 minutes
Took 1 minute
* More granular signals, popup for user info.
Took 25 minutes
Took 8 seconds
Took 16 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
100 lines
3.5 KiB
C++
100 lines
3.5 KiB
C++
/**
|
|
* @file user_context_menu.h
|
|
* @ingroup Lobby
|
|
*/
|
|
//! \todo Document this file.
|
|
|
|
#ifndef USER_CONTEXT_MENU_H
|
|
#define USER_CONTEXT_MENU_H
|
|
|
|
#include <QObject>
|
|
#include <libcockatrice/network/server/remote/user_level.h>
|
|
|
|
class AbstractGame;
|
|
class UserListProxy;
|
|
class AbstractClient;
|
|
class ChatView;
|
|
class CommandContainer;
|
|
class QAction;
|
|
class QMenu;
|
|
class QPoint;
|
|
class Response;
|
|
class ServerInfo_User;
|
|
class TabSupervisor;
|
|
|
|
class UserContextMenu : public QObject
|
|
{
|
|
Q_OBJECT
|
|
private:
|
|
AbstractClient *client;
|
|
TabSupervisor *tabSupervisor;
|
|
const UserListProxy *userListProxy;
|
|
AbstractGame *game;
|
|
|
|
QAction *aUserName;
|
|
QAction *aDetails;
|
|
QAction *aShowGames;
|
|
QAction *aChat;
|
|
QAction *aAddToBuddyList, *aRemoveFromBuddyList;
|
|
QAction *aAddToIgnoreList, *aRemoveFromIgnoreList;
|
|
QAction *aKick;
|
|
QAction *aBan, *aBanHistory;
|
|
QAction *aPromoteToMod, *aDemoteFromMod;
|
|
QAction *aPromoteToJudge, *aDemoteFromJudge;
|
|
QAction *aWarnUser, *aWarnHistory;
|
|
QAction *aGetAdminNotes;
|
|
signals:
|
|
void openMessageDialog(const QString &userName, bool focus);
|
|
private slots:
|
|
void banUser_processUserInfoResponse(const Response &resp);
|
|
void warnUser_processGetWarningsListResponse(const Response &r);
|
|
void warnUser_processUserInfoResponse(const Response &resp);
|
|
void banUserHistory_processResponse(const Response &resp);
|
|
void warnUserHistory_processResponse(const Response &resp);
|
|
void getAdminNotes_processResponse(const Response &resp);
|
|
void adjustMod_processUserResponse(const Response &resp, const CommandContainer &commandContainer);
|
|
void banUser_dialogFinished();
|
|
void warnUser_dialogFinished();
|
|
void updateAdminNotes_dialogFinished();
|
|
void gamesOfUserReceived(const Response &resp, const CommandContainer &commandContainer);
|
|
|
|
public:
|
|
UserContextMenu(TabSupervisor *_tabSupervisor, QWidget *_parent, AbstractGame *_game = 0);
|
|
void retranslateUi();
|
|
void showContextMenu(const QPoint &pos,
|
|
const QString &userName,
|
|
UserLevelFlags userLevel,
|
|
bool online = true,
|
|
int playerId = -1);
|
|
void showContextMenu(const QPoint &pos, const QString &userName, UserLevelFlags userLevel, ChatView *chatView);
|
|
void showContextMenu(const QPoint &pos,
|
|
const QString &userName,
|
|
UserLevelFlags userLevel,
|
|
bool online,
|
|
int playerId,
|
|
const QString &deckHash,
|
|
ChatView *chatView = nullptr);
|
|
|
|
const UserListProxy *getUserListProxy() const
|
|
{
|
|
return userListProxy;
|
|
}
|
|
|
|
// Individual action entry points — used by UserInfoPopup to trigger
|
|
// actions without re-running the full context menu flow.
|
|
void execChat(const QString &userName);
|
|
void execDetails(const QString &userName);
|
|
void execShowGames(const QString &userName);
|
|
void execAddToBuddy(const QString &userName);
|
|
void execRemoveFromBuddy(const QString &userName);
|
|
void execAddToIgnore(const QString &userName);
|
|
void execRemoveFromIgnore(const QString &userName);
|
|
void execBan(const QString &userName);
|
|
void execWarn(const QString &userName);
|
|
void execBanHistory(const QString &userName);
|
|
void execWarnHistory(const QString &userName);
|
|
void execAdminNotes(const QString &userName);
|
|
void execAdjustMod(const QString &userName, bool shouldBeMod, bool shouldBeJudge);
|
|
};
|
|
|
|
#endif
|