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

#include <window_main.h>

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

Public Slots

void actCheckCardUpdates ()
void actCheckCardUpdatesBackground ()
void actCheckServerUpdates ()
void actCheckClientUpdates ()
void actConnect ()
void actExit ()

Public Member Functions

 MainWindow (QWidget *parent=nullptr)
void setConnectTo (QString url)
 ~MainWindow () override
TabSupervisorgetTabSupervisor () const

Protected Member Functions

void closeEvent (QCloseEvent *event) override
void changeEvent (QEvent *event) override
QString extractInvalidUsernameMessage (QString &in)

Private Slots

void updateTabMenu (const QList< QMenu * > &newMenuList)
void statusChanged (ClientStatus _status)
void processConnectionClosedEvent (const Event_ConnectionClosed &event)
void processServerShutdownEvent (const Event_ServerShutdown &event)
void serverTimeout ()
void loginError (Response::ResponseCode r, QString reasonStr, quint32 endTime, QList< QString > missingFeatures)
void registerError (Response::ResponseCode r, QString reasonStr, quint32 endTime)
void activateError ()
void socketError (const QString &errorStr)
void protocolVersionMismatch (int localVersion, int remoteVersion)
void userInfoReceived (const ServerInfo_User &userInfo)
void registerAccepted ()
void registerAcceptedNeedsActivate ()
void activateAccepted ()
void localGameEnded ()
void pixmapCacheSizeChanged (int newSizeInMBs)
void notifyUserAboutUpdate ()
void actDisconnect ()
void actSinglePlayer ()
void actWatchReplay ()
void actFullScreen (bool checked)
void actRegister ()
void actSettings ()
void actForgotPasswordRequest ()
void actAbout ()
void actTips ()
void actUpdate ()
void actViewLog ()
void actOpenSettingsFolder ()
void forgotPasswordSuccess ()
void forgotPasswordError ()
void promptForgotPasswordReset ()
void actShow ()
void promptForgotPasswordChallenge ()
void showWindowIfHidden ()
void cardUpdateError (QProcess::ProcessError err)
void cardUpdateFinished (int exitCode, QProcess::ExitStatus exitStatus)
void refreshShortcuts ()
void cardDatabaseLoadingFailed ()
void cardDatabaseNewSetsFound (int numUnknownSets, QStringList unknownSetsNames)
void cardDatabaseAllNewSetsEnabled ()
void checkClientUpdatesFinished (bool needToUpdate, bool isCompatible, Release *release)
void actOpenCustomFolder ()
void actOpenCustomsetsFolder ()
void actAddCustomSet ()
void actReloadCardDatabase ()
void actManageSets ()
void actEditTokens ()
void startupConfigCheck ()
void alertForcedOracleRun (const QString &version, bool isUpdate)

Private Member Functions

void setClientStatusTitle ()
void retranslateUi ()
void createActions ()
void createMenus ()
void createTrayIcon ()
int getNextCustomSetPrefix (QDir dataDir)
QString getCardUpdaterBinaryName ()
void createCardUpdateProcess (bool background=false)
void exitCardDatabaseUpdate ()
void startLocalGame (int numberPlayers)

Private Attributes

QList< QMenu * > tabMenus
QMenu * cockatriceMenu
QMenu * dbMenu
QMenu * tabsMenu
QMenu * helpMenu
QMenu * trayIconMenu
QAction * aAbout
QAction * aSettings
QAction * aShow
QAction * aExit
QAction * aConnect
QAction * aDisconnect
QAction * aRegister
QAction * aForgotPassword
QAction * aSinglePlayer
QAction * aWatchReplay
QAction * aFullScreen
QAction * aManageSets
QAction * aEditTokens
QAction * aOpenCustomFolder
QAction * aOpenCustomsetsFolder
QAction * aAddCustomSet
QAction * aReloadCardDatabase
QAction * aTips
QAction * aUpdate
QAction * aCheckCardUpdates
QAction * aCheckCardUpdatesBackground
QAction * aStatusBar
QAction * aViewLog
QAction * aOpenSettingsFolder
TabSupervisortabSupervisor
WndSetswndSets
RemoteClientclient
QThread * clientThread
LocalServerlocalServer
bool bHasActivated
bool askedForDbUpdater
QMessageBox serverShutdownMessageBox
QProcess * cardUpdateProcess
DlgViewLoglogviewDialog
DlgConnectdlgConnect
GameReplay * replay
DlgTipOfTheDaytip
QUrl connectTo

Static Private Attributes

static const QString appName = "Cockatrice"
static const QStringList fileNameFilters

Constructor & Destructor Documentation

◆ MainWindow()

MainWindow::MainWindow ( QWidget * parent = nullptr)
explicit

◆ ~MainWindow()

MainWindow::~MainWindow ( )
override

Member Function Documentation

◆ actAbout

void MainWindow::actAbout ( )
privateslot
Here is the caller graph for this function:

◆ actAddCustomSet

void MainWindow::actAddCustomSet ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actCheckCardUpdates

void MainWindow::actCheckCardUpdates ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actCheckCardUpdatesBackground

void MainWindow::actCheckCardUpdatesBackground ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actCheckClientUpdates

void MainWindow::actCheckClientUpdates ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actCheckServerUpdates

void MainWindow::actCheckServerUpdates ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actConnect

void MainWindow::actConnect ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actDisconnect

void MainWindow::actDisconnect ( )
privateslot
Here is the caller graph for this function:

◆ actEditTokens

void MainWindow::actEditTokens ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actExit

void MainWindow::actExit ( )
slot
Here is the caller graph for this function:

◆ actForgotPasswordRequest

void MainWindow::actForgotPasswordRequest ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actFullScreen

void MainWindow::actFullScreen ( bool checked)
privateslot
Here is the caller graph for this function:

◆ activateAccepted

void MainWindow::activateAccepted ( )
privateslot
Here is the caller graph for this function:

◆ activateError

void MainWindow::activateError ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actManageSets

void MainWindow::actManageSets ( )
privateslot
Here is the caller graph for this function:

◆ actOpenCustomFolder

void MainWindow::actOpenCustomFolder ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actOpenCustomsetsFolder

void MainWindow::actOpenCustomsetsFolder ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actOpenSettingsFolder

void MainWindow::actOpenSettingsFolder ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actRegister

void MainWindow::actRegister ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actReloadCardDatabase

void MainWindow::actReloadCardDatabase ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actSettings

void MainWindow::actSettings ( )
privateslot
Here is the caller graph for this function:

◆ actShow

void MainWindow::actShow ( )
privateslot
Here is the caller graph for this function:

◆ actSinglePlayer

void MainWindow::actSinglePlayer ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actTips

void MainWindow::actTips ( )
privateslot
Here is the caller graph for this function:

◆ actUpdate

void MainWindow::actUpdate ( )
privateslot
Here is the caller graph for this function:

◆ actViewLog

void MainWindow::actViewLog ( )
privateslot
Here is the caller graph for this function:

◆ actWatchReplay

void MainWindow::actWatchReplay ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ alertForcedOracleRun

void MainWindow::alertForcedOracleRun ( const QString & version,
bool isUpdate )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cardDatabaseAllNewSetsEnabled

void MainWindow::cardDatabaseAllNewSetsEnabled ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cardDatabaseLoadingFailed

void MainWindow::cardDatabaseLoadingFailed ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cardDatabaseNewSetsFound

void MainWindow::cardDatabaseNewSetsFound ( int numUnknownSets,
QStringList unknownSetsNames )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cardUpdateError

void MainWindow::cardUpdateError ( QProcess::ProcessError err)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cardUpdateFinished

void MainWindow::cardUpdateFinished ( int exitCode,
QProcess::ExitStatus exitStatus )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ changeEvent()

void MainWindow::changeEvent ( QEvent * event)
overrideprotected
Here is the call graph for this function:

◆ checkClientUpdatesFinished

void MainWindow::checkClientUpdatesFinished ( bool needToUpdate,
bool isCompatible,
Release * release )
privateslot
Here is the caller graph for this function:

◆ closeEvent()

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

◆ createActions()

void MainWindow::createActions ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createCardUpdateProcess()

void MainWindow::createCardUpdateProcess ( bool background = false)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createMenus()

void MainWindow::createMenus ( )
private
Here is the caller graph for this function:

◆ createTrayIcon()

void MainWindow::createTrayIcon ( )
private
Here is the caller graph for this function:

◆ exitCardDatabaseUpdate()

void MainWindow::exitCardDatabaseUpdate ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ extractInvalidUsernameMessage()

QString MainWindow::extractInvalidUsernameMessage ( QString & in)
protected
Here is the caller graph for this function:

◆ forgotPasswordError

void MainWindow::forgotPasswordError ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ forgotPasswordSuccess

void MainWindow::forgotPasswordSuccess ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCardUpdaterBinaryName()

QString MainWindow::getCardUpdaterBinaryName ( )
inlineprivate
Here is the caller graph for this function:

◆ getNextCustomSetPrefix()

int MainWindow::getNextCustomSetPrefix ( QDir dataDir)
private
Here is the caller graph for this function:

◆ getTabSupervisor()

TabSupervisor * MainWindow::getTabSupervisor ( ) const
inline

◆ localGameEnded

void MainWindow::localGameEnded ( )
privateslot
Here is the caller graph for this function:

◆ loginError

void MainWindow::loginError ( Response::ResponseCode r,
QString reasonStr,
quint32 endTime,
QList< QString > missingFeatures )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ notifyUserAboutUpdate

void MainWindow::notifyUserAboutUpdate ( )
privateslot
Here is the caller graph for this function:

◆ pixmapCacheSizeChanged

void MainWindow::pixmapCacheSizeChanged ( int newSizeInMBs)
privateslot
Here is the caller graph for this function:

◆ processConnectionClosedEvent

void MainWindow::processConnectionClosedEvent ( const Event_ConnectionClosed & event)
privateslot
Here is the caller graph for this function:

◆ processServerShutdownEvent

void MainWindow::processServerShutdownEvent ( const Event_ServerShutdown & event)
privateslot
Here is the caller graph for this function:

◆ promptForgotPasswordChallenge

void MainWindow::promptForgotPasswordChallenge ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ promptForgotPasswordReset

void MainWindow::promptForgotPasswordReset ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ protocolVersionMismatch

void MainWindow::protocolVersionMismatch ( int localVersion,
int remoteVersion )
privateslot
Here is the caller graph for this function:

◆ refreshShortcuts

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

◆ registerAccepted

void MainWindow::registerAccepted ( )
privateslot
Here is the caller graph for this function:

◆ registerAcceptedNeedsActivate

void MainWindow::registerAcceptedNeedsActivate ( )
privateslot
Here is the caller graph for this function:

◆ registerError

void MainWindow::registerError ( Response::ResponseCode r,
QString reasonStr,
quint32 endTime )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ retranslateUi()

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

◆ serverTimeout

void MainWindow::serverTimeout ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setClientStatusTitle()

void MainWindow::setClientStatusTitle ( )
private
Here is the caller graph for this function:

◆ setConnectTo()

void MainWindow::setConnectTo ( QString url)
inline
Here is the caller graph for this function:

◆ showWindowIfHidden

void MainWindow::showWindowIfHidden ( )
privateslot
Here is the caller graph for this function:

◆ socketError

void MainWindow::socketError ( const QString & errorStr)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ startLocalGame()

void MainWindow::startLocalGame ( int numberPlayers)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ startupConfigCheck

void MainWindow::startupConfigCheck ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ statusChanged

void MainWindow::statusChanged ( ClientStatus _status)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateTabMenu

void MainWindow::updateTabMenu ( const QList< QMenu * > & newMenuList)
privateslot

Replaces the tab-specific menus that are shown in the menuBar.

Parameters
newMenuListThe tab-specific menus to show in the menuBar
Here is the caller graph for this function:

◆ userInfoReceived

void MainWindow::userInfoReceived ( const ServerInfo_User & userInfo)
privateslot
Here is the caller graph for this function:

Member Data Documentation

◆ aAbout

QAction* MainWindow::aAbout
private

◆ aAddCustomSet

QAction * MainWindow::aAddCustomSet
private

◆ aCheckCardUpdates

QAction * MainWindow::aCheckCardUpdates
private

◆ aCheckCardUpdatesBackground

QAction * MainWindow::aCheckCardUpdatesBackground
private

◆ aConnect

QAction* MainWindow::aConnect
private

◆ aDisconnect

QAction * MainWindow::aDisconnect
private

◆ aEditTokens

QAction * MainWindow::aEditTokens
private

◆ aExit

QAction * MainWindow::aExit
private

◆ aForgotPassword

QAction * MainWindow::aForgotPassword
private

◆ aFullScreen

QAction * MainWindow::aFullScreen
private

◆ aManageSets

QAction* MainWindow::aManageSets
private

◆ aOpenCustomFolder

QAction * MainWindow::aOpenCustomFolder
private

◆ aOpenCustomsetsFolder

QAction * MainWindow::aOpenCustomsetsFolder
private

◆ aOpenSettingsFolder

QAction * MainWindow::aOpenSettingsFolder
private

◆ appName

const QString MainWindow::appName = "Cockatrice"
staticprivate

◆ aRegister

QAction * MainWindow::aRegister
private

◆ aReloadCardDatabase

QAction * MainWindow::aReloadCardDatabase
private

◆ aSettings

QAction * MainWindow::aSettings
private

◆ aShow

QAction * MainWindow::aShow
private

◆ aSinglePlayer

QAction * MainWindow::aSinglePlayer
private

◆ askedForDbUpdater

bool MainWindow::askedForDbUpdater
private

◆ aStatusBar

QAction * MainWindow::aStatusBar
private

◆ aTips

QAction* MainWindow::aTips
private

◆ aUpdate

QAction * MainWindow::aUpdate
private

◆ aViewLog

QAction * MainWindow::aViewLog
private

◆ aWatchReplay

QAction * MainWindow::aWatchReplay
private

◆ bHasActivated

bool MainWindow::bHasActivated
private

◆ cardUpdateProcess

QProcess* MainWindow::cardUpdateProcess
private

◆ client

RemoteClient* MainWindow::client
private

◆ clientThread

QThread* MainWindow::clientThread
private

◆ cockatriceMenu

QMenu* MainWindow::cockatriceMenu
private

◆ connectTo

QUrl MainWindow::connectTo
private

◆ dbMenu

QMenu * MainWindow::dbMenu
private

◆ dlgConnect

DlgConnect* MainWindow::dlgConnect
private

◆ fileNameFilters

const QStringList MainWindow::fileNameFilters
staticprivate
Initial value:
= QStringList() << QObject::tr("Cockatrice card database (*.xml)")
<< QObject::tr("All files (*.*)")

◆ helpMenu

QMenu * MainWindow::helpMenu
private

◆ localServer

LocalServer* MainWindow::localServer
private

◆ logviewDialog

DlgViewLog* MainWindow::logviewDialog
private

◆ replay

GameReplay* MainWindow::replay
private

◆ serverShutdownMessageBox

QMessageBox MainWindow::serverShutdownMessageBox
private

◆ tabMenus

QList<QMenu *> MainWindow::tabMenus
private

◆ tabsMenu

QMenu * MainWindow::tabsMenu
private

◆ tabSupervisor

TabSupervisor* MainWindow::tabSupervisor
private

◆ tip

DlgTipOfTheDay* MainWindow::tip
private

◆ trayIconMenu

QMenu * MainWindow::trayIconMenu
private

◆ wndSets

WndSets* MainWindow::wndSets
private

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