[PrintingSelector] Sync modified and history state on bulk selection (#6379)

* [PrintingSelector] Emit deckModified when using bulk selection

* [PrintingSelector] Hook up history manager.

* [PrintingSelector] Remember card amount.

* Return early.

Took 18 minutes

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2025-12-03 08:23:34 +01:00 committed by GitHub
parent b4e3f2cba9
commit a799cd097a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 31 additions and 1 deletions

View file

@ -40,6 +40,11 @@ public:
return deckModel;
}
[[nodiscard]] AbstractTabDeckEditor *getDeckEditor() const
{
return deckEditor;
}
public slots:
void retranslateUi();
void updateDisplay();

View file

@ -1,6 +1,7 @@
#include "printing_selector_card_selection_widget.h"
#include "../../../interface/widgets/dialogs/dlg_select_set_for_cards.h"
#include "../tabs/abstract_tab_deck_editor.h"
/**
* @brief Constructs a PrintingSelectorCardSelectionWidget for navigating through cards in the deck.
@ -48,6 +49,10 @@ void PrintingSelectorCardSelectionWidget::connectSignals()
void PrintingSelectorCardSelectionWidget::selectSetForCards()
{
auto *setSelectionDialog = new DlgSelectSetForCards(nullptr, parent->getDeckModel());
connect(setSelectionDialog, &DlgSelectSetForCards::deckAboutToBeModified, parent->getDeckEditor(),
&AbstractTabDeckEditor::onDeckHistorySaveRequested);
connect(setSelectionDialog, &DlgSelectSetForCards::deckModified, parent->getDeckEditor(),
&AbstractTabDeckEditor::onDeckModified);
if (!setSelectionDialog->exec()) {
return;
}