mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 08:22:15 -07:00
disable add to deck menu if no deck editor tabs are open
This commit is contained in:
parent
fe5f75a291
commit
8290494535
1 changed files with 5 additions and 0 deletions
|
|
@ -298,6 +298,11 @@ QMenu *CardInfoPictureWidget::createAddToOpenDeckMenu()
|
|||
auto *mainWindow = qobject_cast<MainWindow *>(window());
|
||||
QList<TabDeckEditor *> deckEditorTabs = mainWindow->getTabSupervisor()->getDeckEditorTabs();
|
||||
|
||||
if (deckEditorTabs.isEmpty()) {
|
||||
addToOpenDeckMenu->setEnabled(false);
|
||||
return addToOpenDeckMenu;
|
||||
}
|
||||
|
||||
for (auto &deckEditorTab : deckEditorTabs) {
|
||||
auto *addCardMenu = addToOpenDeckMenu->addMenu(deckEditorTab->getTabText());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue