mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 16:32:16 -07:00
pass tabsMenu into ctor
This commit is contained in:
parent
51ecb35fde
commit
088ead7522
4 changed files with 11 additions and 6 deletions
|
|
@ -100,9 +100,9 @@ void CloseButton::paintEvent(QPaintEvent * /*event*/)
|
||||||
style()->drawPrimitive(QStyle::PE_IndicatorTabClose, &opt, &p, this);
|
style()->drawPrimitive(QStyle::PE_IndicatorTabClose, &opt, &p, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
TabSupervisor::TabSupervisor(AbstractClient *_client, QWidget *parent)
|
TabSupervisor::TabSupervisor(AbstractClient *_client, QMenu *tabsMenu, QWidget *parent)
|
||||||
: QTabWidget(parent), userInfo(0), client(_client), tabServer(0), tabUserLists(0), tabDeckStorage(0), tabReplays(0),
|
: QTabWidget(parent), userInfo(0), client(_client), tabsMenu(tabsMenu), tabServer(0), tabUserLists(0),
|
||||||
tabAdmin(0), tabLog(0)
|
tabDeckStorage(0), tabReplays(0), tabAdmin(0), tabLog(0)
|
||||||
{
|
{
|
||||||
setElideMode(Qt::ElideRight);
|
setElideMode(Qt::ElideRight);
|
||||||
setMovable(true);
|
setMovable(true);
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ private:
|
||||||
ServerInfo_User *userInfo;
|
ServerInfo_User *userInfo;
|
||||||
AbstractClient *client;
|
AbstractClient *client;
|
||||||
QList<AbstractClient *> localClients;
|
QList<AbstractClient *> localClients;
|
||||||
|
QMenu *tabsMenu;
|
||||||
TabServer *tabServer;
|
TabServer *tabServer;
|
||||||
TabUserLists *tabUserLists;
|
TabUserLists *tabUserLists;
|
||||||
TabDeckStorage *tabDeckStorage;
|
TabDeckStorage *tabDeckStorage;
|
||||||
|
|
@ -87,7 +88,7 @@ private:
|
||||||
bool isLocalGame;
|
bool isLocalGame;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit TabSupervisor(AbstractClient *_client, QWidget *parent = nullptr);
|
explicit TabSupervisor(AbstractClient *_client, QMenu *tabsMenu, QWidget *parent = nullptr);
|
||||||
~TabSupervisor() override;
|
~TabSupervisor() override;
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
void start(const ServerInfo_User &userInfo);
|
void start(const ServerInfo_User &userInfo);
|
||||||
|
|
|
||||||
|
|
@ -692,6 +692,8 @@ void MainWindow::retranslateUi()
|
||||||
aAddCustomSet->setText(tr("Add custom sets/cards"));
|
aAddCustomSet->setText(tr("Add custom sets/cards"));
|
||||||
aReloadCardDatabase->setText(tr("Reload card database"));
|
aReloadCardDatabase->setText(tr("Reload card database"));
|
||||||
|
|
||||||
|
tabsMenu->setTitle(tr("Tabs"));
|
||||||
|
|
||||||
helpMenu->setTitle(tr("&Help"));
|
helpMenu->setTitle(tr("&Help"));
|
||||||
aAbout->setText(tr("&About Cockatrice"));
|
aAbout->setText(tr("&About Cockatrice"));
|
||||||
aTips->setText(tr("&Tip of the Day"));
|
aTips->setText(tr("&Tip of the Day"));
|
||||||
|
|
@ -824,6 +826,8 @@ void MainWindow::createMenus()
|
||||||
dbMenu->addSeparator();
|
dbMenu->addSeparator();
|
||||||
dbMenu->addAction(aReloadCardDatabase);
|
dbMenu->addAction(aReloadCardDatabase);
|
||||||
|
|
||||||
|
tabsMenu = menuBar()->addMenu(QString());
|
||||||
|
|
||||||
helpMenu = menuBar()->addMenu(QString());
|
helpMenu = menuBar()->addMenu(QString());
|
||||||
helpMenu->addAction(aAbout);
|
helpMenu->addAction(aAbout);
|
||||||
helpMenu->addAction(aTips);
|
helpMenu->addAction(aTips);
|
||||||
|
|
@ -871,7 +875,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
createActions();
|
createActions();
|
||||||
createMenus();
|
createMenus();
|
||||||
|
|
||||||
tabSupervisor = new TabSupervisor(client, this);
|
tabSupervisor = new TabSupervisor(client, tabsMenu, this);
|
||||||
connect(tabSupervisor, &TabSupervisor::setMenu, this, &MainWindow::updateTabMenu);
|
connect(tabSupervisor, &TabSupervisor::setMenu, this, &MainWindow::updateTabMenu);
|
||||||
connect(tabSupervisor, &TabSupervisor::localGameEnded, this, &MainWindow::localGameEnded);
|
connect(tabSupervisor, &TabSupervisor::localGameEnded, this, &MainWindow::localGameEnded);
|
||||||
connect(tabSupervisor, &TabSupervisor::showWindowIfHidden, this, &MainWindow::showWindowIfHidden);
|
connect(tabSupervisor, &TabSupervisor::showWindowIfHidden, this, &MainWindow::showWindowIfHidden);
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ private:
|
||||||
void startLocalGame(int numberPlayers);
|
void startLocalGame(int numberPlayers);
|
||||||
|
|
||||||
QList<QMenu *> tabMenus;
|
QList<QMenu *> tabMenus;
|
||||||
QMenu *cockatriceMenu, *dbMenu, *helpMenu, *trayIconMenu;
|
QMenu *cockatriceMenu, *dbMenu, *tabsMenu, *helpMenu, *trayIconMenu;
|
||||||
QAction *aConnect, *aDisconnect, *aSinglePlayer, *aWatchReplay, *aDeckEditor, *aVisualDeckStorage, *aFullScreen,
|
QAction *aConnect, *aDisconnect, *aSinglePlayer, *aWatchReplay, *aDeckEditor, *aVisualDeckStorage, *aFullScreen,
|
||||||
*aSettings, *aExit, *aAbout, *aTips, *aCheckCardUpdates, *aRegister, *aForgotPassword, *aUpdate, *aViewLog,
|
*aSettings, *aExit, *aAbout, *aTips, *aCheckCardUpdates, *aRegister, *aForgotPassword, *aUpdate, *aViewLog,
|
||||||
*aManageSets, *aEditTokens, *aOpenCustomFolder, *aOpenCustomsetsFolder, *aAddCustomSet, *aReloadCardDatabase,
|
*aManageSets, *aEditTokens, *aOpenCustomFolder, *aOpenCustomsetsFolder, *aAddCustomSet, *aReloadCardDatabase,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue