Cockatrice 2026-06-27-Development-3.1.0-beta.3
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 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 *tabSupervisor, 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 currentUser () const
void updateActionButtons (const ServerInfo_User &userInfo, bool online, bool isBuddy, bool isIgnored)

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 rebuildActionButtons (const ServerInfo_User &userInfo, bool online, bool isBuddy, bool isIgnored)

Private Attributes

TabSupervisorm_ts
AbstractClientm_client
const QMap< QString, QPixmap > * m_avatarCache
const QMap< QString, QPixmap > * m_cardArtCache
const QMap< QString, CardArtParams > * m_cardArtParamsMap
QString m_currentUser
ServerInfo_User m_currentUserInfo
bool m_currentOnline = false
UserInfoHeaderWidgetm_header
QWidget * m_actionArea
 rebuilt per user
QListView * m_gamesView
QStandardItemModel * m_gamesModel
QLabel * m_gamesStatus
QPushButton * m_closeBtn
QPushButton * m_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 * tabSupervisor,
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:

◆ 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:

◆ currentUser()

QString UserInfoPopup::currentUser ( ) const
inlinenodiscard

◆ 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:

◆ 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:

◆ 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:

◆ 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

◆ m_actionArea

QWidget* UserInfoPopup::m_actionArea
private

rebuilt per user

◆ m_avatarCache

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

◆ m_cardArtCache

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

◆ m_cardArtParamsMap

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

◆ m_client

AbstractClient* UserInfoPopup::m_client
private

◆ m_closeBtn

QPushButton* UserInfoPopup::m_closeBtn
private

◆ m_currentOnline

bool UserInfoPopup::m_currentOnline = false
private

◆ m_currentUser

QString UserInfoPopup::m_currentUser
private

◆ m_currentUserInfo

ServerInfo_User UserInfoPopup::m_currentUserInfo
private

◆ m_gamesModel

QStandardItemModel* UserInfoPopup::m_gamesModel
private

◆ m_gamesStatus

QLabel* UserInfoPopup::m_gamesStatus
private

◆ m_gamesView

QListView* UserInfoPopup::m_gamesView
private

◆ m_header

UserInfoHeaderWidget* UserInfoPopup::m_header
private

◆ m_refreshBtn

QPushButton* UserInfoPopup::m_refreshBtn
private

◆ m_ts

TabSupervisor* UserInfoPopup::m_ts
private

◆ PopupWidth

int UserInfoPopup::PopupWidth = 316
staticconstexprprivate

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