mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-15 11:38:49 -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
|
|
@ -39,6 +39,9 @@ VisualDeckStorageWidget::VisualDeckStorageWidget(QWidget *parent) : QWidget(pare
|
|||
|
||||
cardSizeWidget = new CardSizeWidget(this, flowWidget, SettingsCache::instance().getVisualDeckStorageCardSize());
|
||||
layout->addWidget(cardSizeWidget);
|
||||
|
||||
connect(CardDatabaseManager::getInstance(), &CardDatabase::cardDatabaseLoadingFinished, this,
|
||||
&VisualDeckStorageWidget::refreshBannerCards);
|
||||
}
|
||||
|
||||
void VisualDeckStorageWidget::showEvent(QShowEvent *event)
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -73,7 +73,6 @@ private slots:
|
|||
void actDisconnect();
|
||||
void actSinglePlayer();
|
||||
void actWatchReplay();
|
||||
void actVisualDeckStorage();
|
||||
void actFullScreen(bool checked);
|
||||
void actRegister();
|
||||
void actSettings();
|
||||
|
|
@ -131,10 +130,9 @@ private:
|
|||
|
||||
QList<QMenu *> tabMenus;
|
||||
QMenu *cockatriceMenu, *dbMenu, *tabsMenu, *helpMenu, *trayIconMenu;
|
||||
QAction *aConnect, *aDisconnect, *aSinglePlayer, *aWatchReplay, *aVisualDeckStorage, *aFullScreen, *aSettings,
|
||||
*aExit, *aAbout, *aTips, *aCheckCardUpdates, *aRegister, *aForgotPassword, *aUpdate, *aViewLog, *aManageSets,
|
||||
*aEditTokens, *aOpenCustomFolder, *aOpenCustomsetsFolder, *aAddCustomSet, *aReloadCardDatabase, *aShow,
|
||||
*aOpenSettingsFolder;
|
||||
QAction *aConnect, *aDisconnect, *aSinglePlayer, *aWatchReplay, *aFullScreen, *aSettings, *aExit, *aAbout, *aTips,
|
||||
*aCheckCardUpdates, *aRegister, *aForgotPassword, *aUpdate, *aViewLog, *aManageSets, *aEditTokens,
|
||||
*aOpenCustomFolder, *aOpenCustomsetsFolder, *aAddCustomSet, *aReloadCardDatabase, *aShow, *aOpenSettingsFolder;
|
||||
|
||||
TabSupervisor *tabSupervisor;
|
||||
WndSets *wndSets;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue