Abstract deck editor (#5646)

* Generify TabDeckEditor.

* Connect dockTopLevelChanged signals.

* Connect eventFilters.

* Remove comments.

* Fix ze build (accidentally deleted a line)

* Fix some pointer chaining.

* Be a lot saner about some signals/slots, as in, individual Deck Editor widgets now internally determine their CardInfo and then simply communicate this to the DeckEditor

* Lint.

* DeckDock can handle its own menu.

* DeckDock can handle its own decrement.

* DeckDock now notifies the deck editor on deck change, instead of individually modifying menu items and modification status.

* Rename.

* Include pixelmap generator for icon.

* Directly use an AbstractTabDeckEditor as parent.

* Move clearing database filter into signal/slot relation.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2025-02-27 16:57:58 +01:00 committed by GitHub
parent 6df97a156f
commit 93d28717e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 2370 additions and 1810 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<AbstractTabDeckEditor *> 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 (AbstractTabDeckEditor *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, &AbstractTabDeckEditor::deckEditorClosing, this, &TabSupervisor::deckEditorClosed);
connect(tab, &AbstractTabDeckEditor::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(AbstractTabDeckEditor *tab)
{
if (tab == currentWidget())
emit setMenu();