[DeckEditor] Deck List History Manager. (#6340)

* [DeckEditor] Deck List History Manager.

Took 23 minutes

Took 17 minutes

* Add icons.

Took 2 minutes


Took 3 seconds

* Small fixes.

Took 12 minutes

* Style lint.

Took 48 seconds

* tr() things.

Took 5 minutes

* Add tooltips for buttons.

Took 3 minutes

* Add explanation label to history.

Took 3 minutes

* Refactor to .cpp, delegate undo/redo to manager, don't return memento

Took 8 minutes

* Clear history when setting deck.

Took 6 minutes

* Move to value based stacks.

Took 52 seconds

* Default constructor.

Took 31 seconds

Took 3 minutes

Took 4 minutes

Took 2 minutes

* Have it listen to deck editor additions.

Took 18 minutes

* Don't connect buttons *and* actions.

Took 2 minutes

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2025-11-20 14:54:32 +01:00 committed by GitHub
parent c46f6d1178
commit 846f16ddaa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 612 additions and 41 deletions

View file

@ -131,6 +131,8 @@ void AbstractTabDeckEditor::addCardHelper(const ExactCard &card, QString zoneNam
if (card.getInfo().getIsToken())
zoneName = DECK_ZONE_TOKENS;
emit cardAboutToBeAdded(card, zoneName);
QModelIndex newCardIndex = deckDockWidget->deckModel->addCard(card, zoneName);
deckDockWidget->deckView->clearSelection();
deckDockWidget->deckView->setCurrentIndex(newCardIndex);

View file

@ -180,6 +180,7 @@ public slots:
virtual void dockTopLevelChanged(bool topLevel) = 0;
signals:
void cardAboutToBeAdded(const ExactCard &addedCard, const QString &zoneName);
/** @brief Emitted when a deck should be opened in a new editor tab. */
void openDeckEditor(DeckLoader *deckLoader);