disable add to deck menu if no deck editor tabs are open

This commit is contained in:
RickyRister 2025-01-26 02:03:21 -08:00
parent fe5f75a291
commit 8290494535

View file

@ -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());