mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-16 15:32:15 -07:00
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:
parent
6df97a156f
commit
93d28717e0
34 changed files with 2370 additions and 1810 deletions
|
|
@ -296,7 +296,7 @@ QMenu *CardInfoPictureWidget::createAddToOpenDeckMenu()
|
|||
auto addToOpenDeckMenu = new QMenu(tr("Add card to deck"));
|
||||
|
||||
auto *mainWindow = qobject_cast<MainWindow *>(window());
|
||||
QList<TabDeckEditor *> deckEditorTabs = mainWindow->getTabSupervisor()->getDeckEditorTabs();
|
||||
QList<AbstractTabDeckEditor *> deckEditorTabs = mainWindow->getTabSupervisor()->getDeckEditorTabs();
|
||||
|
||||
if (deckEditorTabs.isEmpty()) {
|
||||
addToOpenDeckMenu->setEnabled(false);
|
||||
|
|
@ -308,14 +308,14 @@ QMenu *CardInfoPictureWidget::createAddToOpenDeckMenu()
|
|||
|
||||
QAction *addCard = addCardMenu->addAction(tr("Mainboard"));
|
||||
connect(addCard, &QAction::triggered, this, [this, deckEditorTab] {
|
||||
deckEditorTab->updateCardInfo(info);
|
||||
deckEditorTab->addCardHelper(info, DECK_ZONE_MAIN);
|
||||
deckEditorTab->updateCard(info);
|
||||
deckEditorTab->actAddCard(info);
|
||||
});
|
||||
|
||||
QAction *addCardSideboard = addCardMenu->addAction(tr("Sideboard"));
|
||||
connect(addCardSideboard, &QAction::triggered, this, [this, deckEditorTab] {
|
||||
deckEditorTab->updateCardInfo(info);
|
||||
deckEditorTab->addCardHelper(info, DECK_ZONE_SIDE);
|
||||
deckEditorTab->updateCard(info);
|
||||
deckEditorTab->actAddCardToSideboard(info);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue