Cockatrice 2026-09-01-Development-3.1.0-beta.10
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
UserInfoPopup Class Reference

Floating panel showing an enlarged user card, quick action buttons, and a live scrollable games list. More...

#include <user_info_popup.h>

Inheritance diagram for UserInfoPopup:
[legend]
Collaboration diagram for UserInfoPopup:
[legend]

Signals

void mouseEnteredPopup ()
void mouseLeftPopup ()
void closeRequested ()
void joinGameRequested (int gameId, int roomId, bool asSpectator)
void chatRequested (const QString &userName)
void inviteRequested (const QString &userName)
void detailsRequested (const QString &userName)
void showGamesRequested (const QString &userName)
void addBuddyRequested (const QString &userName)
void removeBuddyRequested (const QString &userName)
void addIgnoreRequested (const QString &userName)
void removeIgnoreRequested (const QString &userName)
void banRequested (const QString &userName)
void warnRequested (const QString &userName)
void banHistoryRequested (const QString &userName)
void warnHistoryRequested (const QString &userName)
void adminNotesRequested (const QString &userName)
void promoteToModRequested (const QString &userName)
void demoteFromModRequested (const QString &userName)
void promoteToJudgeRequested (const QString &userName)
void demoteFromJudgeRequested (const QString &userName)

Public Member Functions

 UserInfoPopup (TabSupervisor *_ts, AbstractClient *_client, const QMap< QString, QPixmap > *_avatarCache, const QMap< QString, QPixmap > *_cardArtCache, const QMap< QString, CardArtParams > *_cardArtParamsMap, QWidget *parent)
void showForUser (const QString &userName, const ServerInfo_User &userInfo, bool online, bool isBuddy, bool isIgnored)
void fetchGames ()
QString getCurrentUser () const
void updateActionButtons (const ServerInfo_User &userInfo, bool online, bool isBuddy, bool isIgnored)
void refreshHeader ()
void setGameInviteAvailable (std::function< bool(const QString &userName)> available)

Protected Member Functions

void enterEvent (QEnterEvent *e) override
void leaveEvent (QEvent *e) override

Private Slots

void refreshGames ()
void onGamesReceived (const Response &r, const QString &forUser)
void onGamesContextMenu (const QPoint &pos)

Private Member Functions

void buildUi ()
void applyTheme ()
void rebuildActionButtons (const ServerInfo_User &userInfo, bool online, bool isBuddy, bool isIgnored)

Private Attributes

TabSupervisorts
AbstractClientclient
const QMap< QString, QPixmap > * avatarCache
const QMap< QString, QPixmap > * cardArtCache
const QMap< QString, CardArtParams > * cardArtParamsMap
PopupTheme theme
QString currentUser
ServerInfo_User currentUserInfo
bool currentOnline = false
std::function< bool(const QString &userName)> gameInviteAvailable
UserInfoHeaderWidgetheader
QWidget * actionArea
 rebuilt per user
QLabel * gamesLabel
QFrame * separator
QListView * gamesView
QStandardItemModel * gamesModel
QLabel * gamesStatus
QPushButton * closeBtn
QPushButton * refreshBtn

Static Private Attributes

static constexpr int PopupWidth = 316

Detailed Description

Floating panel showing an enlarged user card, quick action buttons, and a live scrollable games list.

Lifecycle (mirrors DeckEditorDeckDockWidget):

  • showForUser() — populate, position externally, call show()
  • mouseEnteredPopup / mouseLeftPopup — caller manages hide timer
  • closeRequested() — emitted by the internal close button

The popup is a Qt::Tool frameless child so windowOpacity animations and move() in screen coordinates work identically to CardInfoPictureEnlargedWidget.

Action signals map 1-to-1 to UserContextMenu::exec*() methods so all action logic stays in one place.

Constructor & Destructor Documentation

◆ UserInfoPopup()

UserInfoPopup::UserInfoPopup ( TabSupervisor * _ts,
AbstractClient * _client,
const QMap< QString, QPixmap > * _avatarCache,
const QMap< QString, QPixmap > * _cardArtCache,
const QMap< QString, CardArtParams > * _cardArtParamsMap,
QWidget * parent )
explicit
Here is the call graph for this function:

Member Function Documentation

◆ addBuddyRequested

void UserInfoPopup::addBuddyRequested ( const QString & userName)
signal
Here is the caller graph for this function:

◆ addIgnoreRequested

void UserInfoPopup::addIgnoreRequested ( const QString & userName)
signal
Here is the caller graph for this function:

◆ adminNotesRequested

void UserInfoPopup::adminNotesRequested ( const QString & userName)
signal
Here is the caller graph for this function:

◆ applyTheme()

void UserInfoPopup::applyTheme ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ banHistoryRequested

void UserInfoPopup::banHistoryRequested ( const QString & userName)
signal
Here is the caller graph for this function:

◆ banRequested

void UserInfoPopup::banRequested ( const QString & userName)
signal
Here is the caller graph for this function:

◆ buildUi()

void UserInfoPopup::buildUi ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ chatRequested

void UserInfoPopup::chatRequested ( const QString & userName)
signal
Here is the caller graph for this function:

◆ closeRequested

void UserInfoPopup::closeRequested ( )
signal
Here is the caller graph for this function:

◆ demoteFromJudgeRequested

void UserInfoPopup::demoteFromJudgeRequested ( const QString & userName)
signal
Here is the caller graph for this function:

◆ demoteFromModRequested

void UserInfoPopup::demoteFromModRequested ( const QString & userName)
signal
Here is the caller graph for this function:

◆ detailsRequested

void UserInfoPopup::detailsRequested ( const QString & userName)
signal
Here is the caller graph for this function:

◆ enterEvent()

void UserInfoPopup::enterEvent ( QEnterEvent * e)
overrideprotected
Here is the call graph for this function:

◆ fetchGames()

void UserInfoPopup::fetchGames ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCurrentUser()

QString UserInfoPopup::getCurrentUser ( ) const
inlinenodiscard

◆ inviteRequested

void UserInfoPopup::inviteRequested ( const QString & userName)
signal
Here is the caller graph for this function:

◆ joinGameRequested

void UserInfoPopup::joinGameRequested ( int gameId,
int roomId,
bool asSpectator )
signal

Emitted when the user requests joining or spectating a game in the list.

Here is the caller graph for this function:

◆ leaveEvent()

void UserInfoPopup::leaveEvent ( QEvent * e)
overrideprotected
Here is the call graph for this function:

◆ mouseEnteredPopup

void UserInfoPopup::mouseEnteredPopup ( )
signal
Here is the caller graph for this function:

◆ mouseLeftPopup

void UserInfoPopup::mouseLeftPopup ( )
signal
Here is the caller graph for this function:

◆ onGamesContextMenu

void UserInfoPopup::onGamesContextMenu ( const QPoint & pos)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onGamesReceived

void UserInfoPopup::onGamesReceived ( const Response & r,
const QString & forUser )
privateslot
Here is the caller graph for this function:

◆ promoteToJudgeRequested

void UserInfoPopup::promoteToJudgeRequested ( const QString & userName)
signal
Here is the caller graph for this function:

◆ promoteToModRequested

void UserInfoPopup::promoteToModRequested ( const QString & userName)
signal
Here is the caller graph for this function:

◆ rebuildActionButtons()

void UserInfoPopup::rebuildActionButtons ( const ServerInfo_User & userInfo,
bool online,
bool isBuddy,
bool isIgnored )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ refreshGames

void UserInfoPopup::refreshGames ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ refreshHeader()

void UserInfoPopup::refreshHeader ( )

Re-pulls the avatar/card art for the currently shown user (e.g. after it loads).

Here is the caller graph for this function:

◆ removeBuddyRequested

void UserInfoPopup::removeBuddyRequested ( const QString & userName)
signal
Here is the caller graph for this function:

◆ removeIgnoreRequested

void UserInfoPopup::removeIgnoreRequested ( const QString & userName)
signal
Here is the caller graph for this function:

◆ setGameInviteAvailable()

void UserInfoPopup::setGameInviteAvailable ( std::function< bool(const QString &userName)> available)
inline

Sets a predicate evaluated on every action-button rebuild. It receives the name of the user the popup currently shows; when it returns true an "Invite" button is shown. The popup itself never resolves the invite link, it just forwards the request.

◆ showForUser()

void UserInfoPopup::showForUser ( const QString & userName,
const ServerInfo_User & userInfo,
bool online,
bool isBuddy,
bool isIgnored )

Populate the popup for userName and kick off a game list fetch. Call show() / move() externally after this.

Here is the call graph for this function:

◆ showGamesRequested

void UserInfoPopup::showGamesRequested ( const QString & userName)
signal
Here is the caller graph for this function:

◆ updateActionButtons()

void UserInfoPopup::updateActionButtons ( const ServerInfo_User & userInfo,
bool online,
bool isBuddy,
bool isIgnored )

Called when buddy/ignore status changes externally while popup is open.

Here is the call graph for this function:

◆ warnHistoryRequested

void UserInfoPopup::warnHistoryRequested ( const QString & userName)
signal
Here is the caller graph for this function:

◆ warnRequested

void UserInfoPopup::warnRequested ( const QString & userName)
signal
Here is the caller graph for this function:

Member Data Documentation

◆ actionArea

QWidget* UserInfoPopup::actionArea
private

rebuilt per user

◆ avatarCache

const QMap<QString, QPixmap>* UserInfoPopup::avatarCache
private

◆ cardArtCache

const QMap<QString, QPixmap>* UserInfoPopup::cardArtCache
private

◆ cardArtParamsMap

const QMap<QString, CardArtParams>* UserInfoPopup::cardArtParamsMap
private

◆ client

AbstractClient* UserInfoPopup::client
private

◆ closeBtn

QPushButton* UserInfoPopup::closeBtn
private

◆ currentOnline

bool UserInfoPopup::currentOnline = false
private

◆ currentUser

QString UserInfoPopup::currentUser
private

◆ currentUserInfo

ServerInfo_User UserInfoPopup::currentUserInfo
private

◆ gameInviteAvailable

std::function<bool(const QString &userName)> UserInfoPopup::gameInviteAvailable
private

◆ gamesLabel

QLabel* UserInfoPopup::gamesLabel
private

◆ gamesModel

QStandardItemModel* UserInfoPopup::gamesModel
private

◆ gamesStatus

QLabel* UserInfoPopup::gamesStatus
private

◆ gamesView

QListView* UserInfoPopup::gamesView
private

◆ header

UserInfoHeaderWidget* UserInfoPopup::header
private

◆ PopupWidth

int UserInfoPopup::PopupWidth = 316
staticconstexprprivate

◆ refreshBtn

QPushButton* UserInfoPopup::refreshBtn
private

◆ separator

QFrame* UserInfoPopup::separator
private

◆ theme

PopupTheme UserInfoPopup::theme
private

◆ ts

TabSupervisor* UserInfoPopup::ts
private

The documentation for this class was generated from the following files: