mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 16:32:16 -07:00
Fix the close button not working on the tab, add an option to launch the visual deck storage tab to Cockatrice menu.
This commit is contained in:
parent
8a95617688
commit
b2674c9767
4 changed files with 22 additions and 4 deletions
|
|
@ -52,12 +52,17 @@ TabDeckStorageVisual::TabDeckStorageVisual(TabSupervisor *_tabSupervisor, Abstra
|
|||
connect(visualDeckStorageWidget, &VisualDeckStorageWidget::imageDoubleClicked, this,
|
||||
&TabDeckStorageVisual::actOpenLocalDeck);
|
||||
|
||||
layout->addWidget(leftToolBar);
|
||||
// layout->addWidget(leftToolBar);
|
||||
layout->addWidget(visualDeckStorageWidget);
|
||||
|
||||
retranslateUi();
|
||||
}
|
||||
|
||||
void TabDeckStorageVisual::closeRequest()
|
||||
{
|
||||
this->close();
|
||||
}
|
||||
|
||||
void TabDeckStorageVisual::retranslateUi()
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ class TabDeckStorageVisual final : public Tab
|
|||
Q_OBJECT
|
||||
public:
|
||||
TabDeckStorageVisual(TabSupervisor *_tabSupervisor, AbstractClient *_client);
|
||||
|
||||
void retranslateUi();
|
||||
QString getTabText() const
|
||||
{
|
||||
|
|
@ -32,6 +33,7 @@ public:
|
|||
}
|
||||
public slots:
|
||||
void cardUpdateFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
||||
void closeRequest() override;
|
||||
signals:
|
||||
void openDeckEditor(const DeckLoader *deckLoader);
|
||||
|
||||
|
|
|
|||
|
|
@ -290,6 +290,11 @@ void MainWindow::actDeckEditor()
|
|||
tabSupervisor->addDeckEditorTab(nullptr);
|
||||
}
|
||||
|
||||
void MainWindow::actVisualDeckStorage()
|
||||
{
|
||||
tabSupervisor->addVisualDeckStorageTab();
|
||||
}
|
||||
|
||||
void MainWindow::actFullScreen(bool checked)
|
||||
{
|
||||
if (checked)
|
||||
|
|
@ -654,6 +659,7 @@ void MainWindow::retranslateUi()
|
|||
aSinglePlayer->setText(tr("Start &local game..."));
|
||||
aWatchReplay->setText(tr("&Watch replay..."));
|
||||
aDeckEditor->setText(tr("&Deck editor"));
|
||||
aVisualDeckStorage->setText(tr("&Visual Deck storage"));
|
||||
aFullScreen->setText(tr("&Full screen"));
|
||||
aRegister->setText(tr("&Register to server..."));
|
||||
aForgotPassword->setText(tr("&Restore password..."));
|
||||
|
|
@ -700,6 +706,8 @@ void MainWindow::createActions()
|
|||
connect(aWatchReplay, SIGNAL(triggered()), this, SLOT(actWatchReplay()));
|
||||
aDeckEditor = new QAction(this);
|
||||
connect(aDeckEditor, SIGNAL(triggered()), this, SLOT(actDeckEditor()));
|
||||
aVisualDeckStorage = new QAction(this);
|
||||
connect(aVisualDeckStorage, SIGNAL(triggered()), this, SLOT(actVisualDeckStorage()));
|
||||
aFullScreen = new QAction(this);
|
||||
aFullScreen->setCheckable(true);
|
||||
connect(aFullScreen, SIGNAL(toggled(bool)), this, SLOT(actFullScreen(bool)));
|
||||
|
|
@ -785,6 +793,7 @@ void MainWindow::createMenus()
|
|||
cockatriceMenu->addAction(aWatchReplay);
|
||||
cockatriceMenu->addSeparator();
|
||||
cockatriceMenu->addAction(aDeckEditor);
|
||||
cockatriceMenu->addAction(aVisualDeckStorage);
|
||||
cockatriceMenu->addSeparator();
|
||||
cockatriceMenu->addAction(aFullScreen);
|
||||
cockatriceMenu->addSeparator();
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ private slots:
|
|||
void actSinglePlayer();
|
||||
void actWatchReplay();
|
||||
void actDeckEditor();
|
||||
void actVisualDeckStorage();
|
||||
void actFullScreen(bool checked);
|
||||
void actRegister();
|
||||
void actSettings();
|
||||
|
|
@ -130,9 +131,10 @@ private:
|
|||
|
||||
QList<QMenu *> tabMenus;
|
||||
QMenu *cockatriceMenu, *dbMenu, *helpMenu, *trayIconMenu;
|
||||
QAction *aConnect, *aDisconnect, *aSinglePlayer, *aWatchReplay, *aDeckEditor, *aFullScreen, *aSettings, *aExit,
|
||||
*aAbout, *aTips, *aCheckCardUpdates, *aRegister, *aForgotPassword, *aUpdate, *aViewLog, *aManageSets,
|
||||
*aEditTokens, *aOpenCustomFolder, *aOpenCustomsetsFolder, *aAddCustomSet, *aReloadCardDatabase, *aShow;
|
||||
QAction *aConnect, *aDisconnect, *aSinglePlayer, *aWatchReplay, *aDeckEditor, *aVisualDeckStorage, *aFullScreen,
|
||||
*aSettings, *aExit, *aAbout, *aTips, *aCheckCardUpdates, *aRegister, *aForgotPassword, *aUpdate, *aViewLog,
|
||||
*aManageSets, *aEditTokens, *aOpenCustomFolder, *aOpenCustomsetsFolder, *aAddCustomSet, *aReloadCardDatabase,
|
||||
*aShow;
|
||||
TabSupervisor *tabSupervisor;
|
||||
WndSets *wndSets;
|
||||
RemoteClient *client;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue