mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-09 17:44:01 -07:00
[PrintingSelector] Hook up history manager.
This commit is contained in:
parent
6d0b511e3f
commit
b52be14904
3 changed files with 10 additions and 0 deletions
|
|
@ -145,6 +145,11 @@ void DlgSelectSetForCards::retranslateUi()
|
|||
void DlgSelectSetForCards::actOK()
|
||||
{
|
||||
QMap<QString, QStringList> modifiedSetsAndCardsMap = getModifiedCards();
|
||||
|
||||
if (!modifiedSetsAndCardsMap.isEmpty()) {
|
||||
emit deckAboutToBeModified(tr("Bulk modified printings."));
|
||||
}
|
||||
|
||||
for (QString modifiedSet : modifiedSetsAndCardsMap.keys()) {
|
||||
for (QString card : modifiedSetsAndCardsMap.value(modifiedSet)) {
|
||||
QModelIndex find_card = model->findCard(card, DECK_ZONE_MAIN);
|
||||
|
|
@ -165,6 +170,7 @@ void DlgSelectSetForCards::actOK()
|
|||
|
||||
void DlgSelectSetForCards::actClear()
|
||||
{
|
||||
emit deckAboutToBeModified(tr("Cleared all printing information."));
|
||||
DeckLoader::clearSetNamesAndNumbers(model->getDeckList());
|
||||
emit deckModified();
|
||||
accept();
|
||||
|
|
@ -172,6 +178,7 @@ void DlgSelectSetForCards::actClear()
|
|||
|
||||
void DlgSelectSetForCards::actSetAllToPreferred()
|
||||
{
|
||||
emit deckAboutToBeModified(tr("Set all printings to preferred."));
|
||||
DeckLoader::clearSetNamesAndNumbers(model->getDeckList());
|
||||
DeckLoader::setProviderIdToPreferredPrinting(model->getDeckList());
|
||||
emit deckModified();
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ public:
|
|||
signals:
|
||||
void widgetOrderChanged();
|
||||
void orderChanged();
|
||||
void deckAboutToBeModified(const QString &reason);
|
||||
void deckModified();
|
||||
|
||||
public slots:
|
||||
|
|
|
|||
|
|
@ -49,6 +49,8 @@ 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()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue