Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
TabSupervisor Class Reference

#include <tab_supervisor.h>

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

Public Types

enum  DeckEditorType { ClassicDeckEditor , VisualDeckEditor }

Public Slots

void openDeckInNewTab (DeckLoader *deckToOpen)
TabDeckEditoraddDeckEditorTab (DeckLoader *deckToOpen)
TabDeckEditorVisualaddVisualDeckEditorTab (DeckLoader *deckToOpen)
TabVisualDatabaseDisplayaddVisualDatabaseDisplayTab ()
TabEdhRecMainaddEdhrecMainTab ()
TabArchidektaddArchidektTab ()
TabEdhRecaddEdhrecTab (const CardInfoPtr &cardToQuery, bool isCommander=false)
void openReplay (GameReplay *replay)
void switchToFirstAvailableNetworkTab ()
void maximizeMainWindow ()
void actTabVisualDeckStorage (bool checked)
void actTabReplays (bool checked)

Signals

void setMenu (const QList< QMenu * > &newMenuList=QList< QMenu * >())
void localGameEnded ()
void adminLockChanged (bool lock)
void showWindowIfHidden ()

Public Member Functions

 TabSupervisor (AbstractClient *_client, QMenu *tabsMenu, QWidget *parent=nullptr)
 ~TabSupervisor () override
void retranslateUi ()
void initStartupTabs ()
void start (const ServerInfo_User &userInfo)
void startLocal (const QList< AbstractClient * > &_clients)
void stop ()
bool getIsLocalGame () const
int getGameCount () const
TabAccountgetTabAccount () const
ServerInfo_User * getUserInfo () const
AbstractClientgetClient () const
const UserListManagergetUserListManager () const
const QMap< int, TabRoom * > & getRoomTabs () const
QList< AbstractTabDeckEditor * > getDeckEditorTabs () const
bool getAdminLocked () const
void closeEvent (QCloseEvent *event) override
bool switchToGameTabIfAlreadyExists (const int gameId)

Static Public Member Functions

static void actShowPopup (const QString &message)

Private Slots

void refreshShortcuts ()
void actTabHome (bool checked)
void actTabServer (bool checked)
void actTabAccount (bool checked)
void actTabDeckStorage (bool checked)
void actTabAdmin (bool checked)
void actTabLog (bool checked)
void openTabVisualDeckStorage ()
void openTabHome ()
void openTabServer ()
void openTabAccount ()
void openTabDeckStorage ()
void openTabReplays ()
void openTabAdmin ()
void openTabLog ()
void updateCurrent (int index)
void updatePingTime (int value, int max)
void gameJoined (const Event_GameJoined &event)
void localGameJoined (const Event_GameJoined &event)
void gameLeft (TabGame *tab)
void addRoomTab (const ServerInfo_Room &info, bool setCurrent)
void roomLeft (TabRoom *tab)
TabMessageaddMessageTab (const QString &userName, bool focus)
void replayLeft (TabGame *tab)
void processUserLeft (const QString &userName)
void processUserJoined (const ServerInfo_User &userInfo)
void talkLeft (TabMessage *tab)
void deckEditorClosed (AbstractTabDeckEditor *tab)
void tabUserEvent (bool globalEvent)
void updateTabText (Tab *tab, const QString &newTabText)
void processRoomEvent (const RoomEvent &event)
void processGameEventContainer (const GameEventContainer &cont)
void processUserMessageEvent (const Event_UserMessage &event)
void processNotifyUserEvent (const Event_NotifyUser &event)

Private Member Functions

int myAddTab (Tab *tab, QAction *manager=nullptr)
void addCloseButtonToTab (Tab *tab, int tabIndex, QAction *manager)
void resetTabsMenu ()

Static Private Member Functions

static QString sanitizeTabName (QString dirty)
static QString sanitizeHtml (QString dirty)

Private Attributes

ServerInfo_User * userInfo
AbstractClientclient
UserListManageruserListManager
QList< AbstractClient * > localClients
QMenu * tabsMenu
TabHometabHome
TabDeckStorageVisualtabVisualDeckStorage
TabServertabServer
TabAccounttabAccount
TabDeckStoragetabDeckStorage
TabReplaystabReplays
TabAdmintabAdmin
TabLogtabLog
QMap< int, TabRoom * > roomTabs
QMap< int, TabGame * > gameTabs
QList< TabGame * > replayTabs
QMap< QString, TabMessage * > messageTabs
QList< AbstractTabDeckEditor * > deckEditorTabs
bool isLocalGame
QAction * aTabHome
QAction * aTabDeckEditor
QAction * aTabVisualDeckEditor
QAction * aTabEdhRec
QAction * aTabArchidekt
QAction * aTabVisualDeckStorage
QAction * aTabVisualDatabaseDisplay
QAction * aTabServer
QAction * aTabAccount
QAction * aTabDeckStorage
QAction * aTabReplays
QAction * aTabAdmin
QAction * aTabLog

Member Enumeration Documentation

◆ DeckEditorType

Enumerator
ClassicDeckEditor 
VisualDeckEditor 

Constructor & Destructor Documentation

◆ TabSupervisor()

TabSupervisor::TabSupervisor ( AbstractClient * _client,
QMenu * tabsMenu,
QWidget * parent = nullptr )
explicit
Here is the call graph for this function:

◆ ~TabSupervisor()

TabSupervisor::~TabSupervisor ( )
override

Member Function Documentation

◆ actShowPopup()

void TabSupervisor::actShowPopup ( const QString & message)
static
Here is the caller graph for this function:

◆ actTabAccount

void TabSupervisor::actTabAccount ( bool checked)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actTabAdmin

void TabSupervisor::actTabAdmin ( bool checked)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actTabDeckStorage

void TabSupervisor::actTabDeckStorage ( bool checked)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actTabHome

void TabSupervisor::actTabHome ( bool checked)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actTabLog

void TabSupervisor::actTabLog ( bool checked)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actTabReplays

void TabSupervisor::actTabReplays ( bool checked)
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actTabServer

void TabSupervisor::actTabServer ( bool checked)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actTabVisualDeckStorage

void TabSupervisor::actTabVisualDeckStorage ( bool checked)
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addArchidektTab

TabArchidekt * TabSupervisor::addArchidektTab ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addCloseButtonToTab()

void TabSupervisor::addCloseButtonToTab ( Tab * tab,
int tabIndex,
QAction * manager )
private

Adds a usable close button to the tab.

Parameters
tabThe Tab
tabIndexThe tab bar index of the tab
managerThe menu action that corresponds to this tab, if this is a single-instance managed tab. Pass in nullptr if this is not a managed tab.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addDeckEditorTab

TabDeckEditor * TabSupervisor::addDeckEditorTab ( DeckLoader * deckToOpen)
slot

Creates a new deck editor tab

Parameters
deckToOpenThe deck to open in the tab. Creates a copy of the DeckLoader instance.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addEdhrecMainTab

TabEdhRecMain * TabSupervisor::addEdhrecMainTab ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addEdhrecTab

TabEdhRec * TabSupervisor::addEdhrecTab ( const CardInfoPtr & cardToQuery,
bool isCommander = false )
slot
Here is the call graph for this function:

◆ addMessageTab

TabMessage * TabSupervisor::addMessageTab ( const QString & userName,
bool focus )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addRoomTab

void TabSupervisor::addRoomTab ( const ServerInfo_Room & info,
bool setCurrent )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addVisualDatabaseDisplayTab

TabVisualDatabaseDisplay * TabSupervisor::addVisualDatabaseDisplayTab ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addVisualDeckEditorTab

TabDeckEditorVisual * TabSupervisor::addVisualDeckEditorTab ( DeckLoader * deckToOpen)
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ adminLockChanged

void TabSupervisor::adminLockChanged ( bool lock)
signal
Here is the caller graph for this function:

◆ closeEvent()

void TabSupervisor::closeEvent ( QCloseEvent * event)
override
Here is the call graph for this function:

◆ deckEditorClosed

void TabSupervisor::deckEditorClosed ( AbstractTabDeckEditor * tab)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gameJoined

void TabSupervisor::gameJoined ( const Event_GameJoined & event)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gameLeft

void TabSupervisor::gameLeft ( TabGame * tab)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAdminLocked()

bool TabSupervisor::getAdminLocked ( ) const
nodiscard

Determine if a user is a moderator/administrator By seeing if they have the admin tab open & unlocked

Returns
if the admin tab is open & unlocked

◆ getClient()

AbstractClient * TabSupervisor::getClient ( ) const
nodiscard

◆ getDeckEditorTabs()

QList< AbstractTabDeckEditor * > TabSupervisor::getDeckEditorTabs ( ) const
inlinenodiscard

◆ getGameCount()

int TabSupervisor::getGameCount ( ) const
inlinenodiscard
Here is the caller graph for this function:

◆ getIsLocalGame()

bool TabSupervisor::getIsLocalGame ( ) const
inlinenodiscard

◆ getRoomTabs()

const QMap< int, TabRoom * > & TabSupervisor::getRoomTabs ( ) const
inlinenodiscard

◆ getTabAccount()

TabAccount * TabSupervisor::getTabAccount ( ) const
inlinenodiscard
Here is the caller graph for this function:

◆ getUserInfo()

ServerInfo_User * TabSupervisor::getUserInfo ( ) const
inlinenodiscard

◆ getUserListManager()

const UserListManager * TabSupervisor::getUserListManager ( ) const
inlinenodiscard

◆ initStartupTabs()

void TabSupervisor::initStartupTabs ( )

Opens the always-available tabs, depending on settings.

Here is the call graph for this function:

◆ localGameEnded

void TabSupervisor::localGameEnded ( )
signal
Here is the caller graph for this function:

◆ localGameJoined

void TabSupervisor::localGameJoined ( const Event_GameJoined & event)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ maximizeMainWindow

void TabSupervisor::maximizeMainWindow ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ myAddTab()

int TabSupervisor::myAddTab ( Tab * tab,
QAction * manager = nullptr )
private

Adds the tab to the TabSupervisor's tab bar.

Parameters
tabThe Tab to add
managerThe menu action that corresponds to this tab, if this is a single-instance managed tab. Pass in nullptr if this is not a managed tab.
Returns
The index of the added tab in the tab widget's tab menu
Here is the call graph for this function:
Here is the caller graph for this function:

◆ openDeckInNewTab

void TabSupervisor::openDeckInNewTab ( DeckLoader * deckToOpen)
slot

Creates a new deck editor tab and loads the deck into it. Creates either a classic or visual deck editor tab depending on settings

Parameters
deckToOpenThe deck to open in the tab. Creates a copy of the DeckLoader instance.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ openReplay

void TabSupervisor::openReplay ( GameReplay * replay)
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ openTabAccount

void TabSupervisor::openTabAccount ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ openTabAdmin

void TabSupervisor::openTabAdmin ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ openTabDeckStorage

void TabSupervisor::openTabDeckStorage ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ openTabHome

void TabSupervisor::openTabHome ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ openTabLog

void TabSupervisor::openTabLog ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ openTabReplays

void TabSupervisor::openTabReplays ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ openTabServer

void TabSupervisor::openTabServer ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ openTabVisualDeckStorage

void TabSupervisor::openTabVisualDeckStorage ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processGameEventContainer

void TabSupervisor::processGameEventContainer ( const GameEventContainer & cont)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processNotifyUserEvent

void TabSupervisor::processNotifyUserEvent ( const Event_NotifyUser & event)
privateslot
Here is the caller graph for this function:

◆ processRoomEvent

void TabSupervisor::processRoomEvent ( const RoomEvent & event)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processUserJoined

void TabSupervisor::processUserJoined ( const ServerInfo_User & userInfo)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processUserLeft

void TabSupervisor::processUserLeft ( const QString & userName)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processUserMessageEvent

void TabSupervisor::processUserMessageEvent ( const Event_UserMessage & event)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ refreshShortcuts

void TabSupervisor::refreshShortcuts ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ replayLeft

void TabSupervisor::replayLeft ( TabGame * tab)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resetTabsMenu()

void TabSupervisor::resetTabsMenu ( )
private

Resets the tabs menu to the tabs that are always available

Here is the caller graph for this function:

◆ retranslateUi()

void TabSupervisor::retranslateUi ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ roomLeft

void TabSupervisor::roomLeft ( TabRoom * tab)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sanitizeHtml()

QString TabSupervisor::sanitizeHtml ( QString dirty)
staticprivate
Here is the caller graph for this function:

◆ sanitizeTabName()

QString TabSupervisor::sanitizeTabName ( QString dirty)
staticprivate
Here is the caller graph for this function:

◆ setMenu

void TabSupervisor::setMenu ( const QList< QMenu * > & newMenuList = QList< QMenu * >())
signal
Here is the caller graph for this function:

◆ showWindowIfHidden

void TabSupervisor::showWindowIfHidden ( )
signal
Here is the caller graph for this function:

◆ start()

void TabSupervisor::start ( const ServerInfo_User & userInfo)
Here is the call graph for this function:

◆ startLocal()

void TabSupervisor::startLocal ( const QList< AbstractClient * > & _clients)
Here is the call graph for this function:

◆ stop()

void TabSupervisor::stop ( )

Call this when Cockatrice disconnects from the server in order to clean up.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ switchToFirstAvailableNetworkTab

void TabSupervisor::switchToFirstAvailableNetworkTab ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ switchToGameTabIfAlreadyExists()

bool TabSupervisor::switchToGameTabIfAlreadyExists ( const int gameId)

◆ tabUserEvent

void TabSupervisor::tabUserEvent ( bool globalEvent)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ talkLeft

void TabSupervisor::talkLeft ( TabMessage * tab)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateCurrent

void TabSupervisor::updateCurrent ( int index)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updatePingTime

void TabSupervisor::updatePingTime ( int value,
int max )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateTabText

void TabSupervisor::updateTabText ( Tab * tab,
const QString & newTabText )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ aTabAccount

QAction * TabSupervisor::aTabAccount
private

◆ aTabAdmin

QAction * TabSupervisor::aTabAdmin
private

◆ aTabArchidekt

QAction * TabSupervisor::aTabArchidekt
private

◆ aTabDeckEditor

QAction * TabSupervisor::aTabDeckEditor
private

◆ aTabDeckStorage

QAction * TabSupervisor::aTabDeckStorage
private

◆ aTabEdhRec

QAction * TabSupervisor::aTabEdhRec
private

◆ aTabHome

QAction* TabSupervisor::aTabHome
private

◆ aTabLog

QAction * TabSupervisor::aTabLog
private

◆ aTabReplays

QAction * TabSupervisor::aTabReplays
private

◆ aTabServer

QAction * TabSupervisor::aTabServer
private

◆ aTabVisualDatabaseDisplay

QAction * TabSupervisor::aTabVisualDatabaseDisplay
private

◆ aTabVisualDeckEditor

QAction * TabSupervisor::aTabVisualDeckEditor
private

◆ aTabVisualDeckStorage

QAction * TabSupervisor::aTabVisualDeckStorage
private

◆ client

AbstractClient* TabSupervisor::client
private

◆ deckEditorTabs

QList<AbstractTabDeckEditor *> TabSupervisor::deckEditorTabs
private

◆ gameTabs

QMap<int, TabGame *> TabSupervisor::gameTabs
private

◆ isLocalGame

bool TabSupervisor::isLocalGame
private

◆ localClients

QList<AbstractClient *> TabSupervisor::localClients
private

◆ messageTabs

QMap<QString, TabMessage *> TabSupervisor::messageTabs
private

◆ replayTabs

QList<TabGame *> TabSupervisor::replayTabs
private

◆ roomTabs

QMap<int, TabRoom *> TabSupervisor::roomTabs
private

◆ tabAccount

TabAccount* TabSupervisor::tabAccount
private

◆ tabAdmin

TabAdmin* TabSupervisor::tabAdmin
private

◆ tabDeckStorage

TabDeckStorage* TabSupervisor::tabDeckStorage
private

◆ tabHome

TabHome* TabSupervisor::tabHome
private

◆ tabLog

TabLog* TabSupervisor::tabLog
private

◆ tabReplays

TabReplays* TabSupervisor::tabReplays
private

◆ tabServer

TabServer* TabSupervisor::tabServer
private

◆ tabsMenu

QMenu* TabSupervisor::tabsMenu
private

◆ tabVisualDeckStorage

TabDeckStorageVisual* TabSupervisor::tabVisualDeckStorage
private

◆ userInfo

ServerInfo_User* TabSupervisor::userInfo
private

◆ userListManager

UserListManager* TabSupervisor::userListManager
private

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