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