Generify TabDeckEditor.

This commit is contained in:
Lukas Brübach 2025-02-14 13:20:21 +01:00
parent 6df97a156f
commit b49d6930cc
33 changed files with 2283 additions and 1792 deletions

View file

@ -201,7 +201,7 @@ void TabSupervisor::retranslateUi()
QListIterator<TabGame *> replayIterator(replayTabs);
while (replayIterator.hasNext())
tabs.append(replayIterator.next());
QListIterator<TabDeckEditor *> deckEditorIterator(deckEditorTabs);
QListIterator<TabGenericDeckEditor *> deckEditorIterator(deckEditorTabs);
while (deckEditorIterator.hasNext())
tabs.append(deckEditorIterator.next());
QMapIterator<QString, TabMessage *> messageIterator(messageTabs);
@ -242,7 +242,7 @@ bool TabSupervisor::closeRequest()
}
}
for (TabDeckEditor *tab : deckEditorTabs) {
for (TabGenericDeckEditor *tab : deckEditorTabs) {
if (!tab->confirmClose())
return false;
}
@ -706,8 +706,8 @@ TabDeckEditor *TabSupervisor::addDeckEditorTab(const DeckLoader *deckToOpen)
auto *tab = new TabDeckEditor(this);
if (deckToOpen)
tab->setDeck(new DeckLoader(*deckToOpen));
connect(tab, &TabDeckEditor::deckEditorClosing, this, &TabSupervisor::deckEditorClosed);
connect(tab, &TabDeckEditor::openDeckEditor, this, &TabSupervisor::addDeckEditorTab);
connect(tab, &TabGenericDeckEditor::deckEditorClosing, this, &TabSupervisor::deckEditorClosed);
connect(tab, &TabGenericDeckEditor::openDeckEditor, this, &TabSupervisor::addDeckEditorTab);
myAddTab(tab);
deckEditorTabs.append(tab);
setCurrentWidget(tab);
@ -726,7 +726,7 @@ TabEdhRec *TabSupervisor::addEdhrecTab(const CardInfoPtr &cardToQuery, bool isCo
return tab;
}
void TabSupervisor::deckEditorClosed(TabDeckEditor *tab)
void TabSupervisor::deckEditorClosed(TabGenericDeckEditor *tab)
{
if (tab == currentWidget())
emit setMenu();