mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Make Visual Deck Storage tab be managed by TabSupervisor (#5453)
* remove closeRequest override * remove visualDeckStorage from WindowMain * manage visual deck storage in TabSupervisor * open on startup * refresh vds on db load finish * open deck editor tab first on startup
This commit is contained in:
parent
883f1a5c11
commit
a417b049da
7 changed files with 39 additions and 38 deletions
|
|
@ -290,11 +290,6 @@ void MainWindow::localGameEnded()
|
|||
aSinglePlayer->setEnabled(true);
|
||||
}
|
||||
|
||||
void MainWindow::actVisualDeckStorage()
|
||||
{
|
||||
tabSupervisor->addVisualDeckStorageTab();
|
||||
}
|
||||
|
||||
void MainWindow::actFullScreen(bool checked)
|
||||
{
|
||||
if (checked)
|
||||
|
|
@ -664,7 +659,6 @@ void MainWindow::retranslateUi()
|
|||
aDisconnect->setText(tr("&Disconnect"));
|
||||
aSinglePlayer->setText(tr("Start &local game..."));
|
||||
aWatchReplay->setText(tr("&Watch replay..."));
|
||||
aVisualDeckStorage->setText(tr("&Visual Deck storage"));
|
||||
aFullScreen->setText(tr("&Full screen"));
|
||||
aRegister->setText(tr("&Register to server..."));
|
||||
aForgotPassword->setText(tr("&Restore password..."));
|
||||
|
|
@ -712,8 +706,6 @@ void MainWindow::createActions()
|
|||
connect(aSinglePlayer, &QAction::triggered, this, &MainWindow::actSinglePlayer);
|
||||
aWatchReplay = new QAction(this);
|
||||
connect(aWatchReplay, &QAction::triggered, this, &MainWindow::actWatchReplay);
|
||||
aVisualDeckStorage = new QAction(this);
|
||||
connect(aVisualDeckStorage, &QAction::triggered, this, &MainWindow::actVisualDeckStorage);
|
||||
aFullScreen = new QAction(this);
|
||||
aFullScreen->setCheckable(true);
|
||||
connect(aFullScreen, &QAction::toggled, this, &MainWindow::actFullScreen);
|
||||
|
|
@ -800,8 +792,6 @@ void MainWindow::createMenus()
|
|||
cockatriceMenu->addAction(aSinglePlayer);
|
||||
cockatriceMenu->addAction(aWatchReplay);
|
||||
cockatriceMenu->addSeparator();
|
||||
cockatriceMenu->addAction(aVisualDeckStorage);
|
||||
cockatriceMenu->addSeparator();
|
||||
cockatriceMenu->addAction(aFullScreen);
|
||||
cockatriceMenu->addSeparator();
|
||||
cockatriceMenu->addAction(aSettings);
|
||||
|
|
@ -870,7 +860,6 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
connect(tabSupervisor, &TabSupervisor::setMenu, this, &MainWindow::updateTabMenu);
|
||||
connect(tabSupervisor, &TabSupervisor::localGameEnded, this, &MainWindow::localGameEnded);
|
||||
connect(tabSupervisor, &TabSupervisor::showWindowIfHidden, this, &MainWindow::showWindowIfHidden);
|
||||
tabSupervisor->addDeckEditorTab(nullptr);
|
||||
|
||||
setCentralWidget(tabSupervisor);
|
||||
|
||||
|
|
@ -889,10 +878,6 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
&MainWindow::refreshShortcuts);
|
||||
refreshShortcuts();
|
||||
|
||||
if (SettingsCache::instance().getVisualDeckStorageShowOnLoad()) {
|
||||
connect(CardDatabaseManager::getInstance(), &CardDatabase::cardDatabaseLoadingFinished, tabSupervisor,
|
||||
&TabSupervisor::addVisualDeckStorageTab);
|
||||
}
|
||||
connect(CardDatabaseManager::getInstance(), &CardDatabase::cardDatabaseLoadingFailed, this,
|
||||
&MainWindow::cardDatabaseLoadingFailed);
|
||||
connect(CardDatabaseManager::getInstance(), &CardDatabase::cardDatabaseNewSetsFound, this,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue