mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-10 12:23:58 -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()
|
void DlgSelectSetForCards::actOK()
|
||||||
{
|
{
|
||||||
QMap<QString, QStringList> modifiedSetsAndCardsMap = getModifiedCards();
|
QMap<QString, QStringList> modifiedSetsAndCardsMap = getModifiedCards();
|
||||||
|
|
||||||
|
if (!modifiedSetsAndCardsMap.isEmpty()) {
|
||||||
|
emit deckAboutToBeModified(tr("Bulk modified printings."));
|
||||||
|
}
|
||||||
|
|
||||||
for (QString modifiedSet : modifiedSetsAndCardsMap.keys()) {
|
for (QString modifiedSet : modifiedSetsAndCardsMap.keys()) {
|
||||||
for (QString card : modifiedSetsAndCardsMap.value(modifiedSet)) {
|
for (QString card : modifiedSetsAndCardsMap.value(modifiedSet)) {
|
||||||
QModelIndex find_card = model->findCard(card, DECK_ZONE_MAIN);
|
QModelIndex find_card = model->findCard(card, DECK_ZONE_MAIN);
|
||||||
|
|
@ -165,6 +170,7 @@ void DlgSelectSetForCards::actOK()
|
||||||
|
|
||||||
void DlgSelectSetForCards::actClear()
|
void DlgSelectSetForCards::actClear()
|
||||||
{
|
{
|
||||||
|
emit deckAboutToBeModified(tr("Cleared all printing information."));
|
||||||
DeckLoader::clearSetNamesAndNumbers(model->getDeckList());
|
DeckLoader::clearSetNamesAndNumbers(model->getDeckList());
|
||||||
emit deckModified();
|
emit deckModified();
|
||||||
accept();
|
accept();
|
||||||
|
|
@ -172,6 +178,7 @@ void DlgSelectSetForCards::actClear()
|
||||||
|
|
||||||
void DlgSelectSetForCards::actSetAllToPreferred()
|
void DlgSelectSetForCards::actSetAllToPreferred()
|
||||||
{
|
{
|
||||||
|
emit deckAboutToBeModified(tr("Set all printings to preferred."));
|
||||||
DeckLoader::clearSetNamesAndNumbers(model->getDeckList());
|
DeckLoader::clearSetNamesAndNumbers(model->getDeckList());
|
||||||
DeckLoader::setProviderIdToPreferredPrinting(model->getDeckList());
|
DeckLoader::setProviderIdToPreferredPrinting(model->getDeckList());
|
||||||
emit deckModified();
|
emit deckModified();
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ public:
|
||||||
signals:
|
signals:
|
||||||
void widgetOrderChanged();
|
void widgetOrderChanged();
|
||||||
void orderChanged();
|
void orderChanged();
|
||||||
|
void deckAboutToBeModified(const QString &reason);
|
||||||
void deckModified();
|
void deckModified();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,8 @@ void PrintingSelectorCardSelectionWidget::connectSignals()
|
||||||
void PrintingSelectorCardSelectionWidget::selectSetForCards()
|
void PrintingSelectorCardSelectionWidget::selectSetForCards()
|
||||||
{
|
{
|
||||||
auto *setSelectionDialog = new DlgSelectSetForCards(nullptr, parent->getDeckModel());
|
auto *setSelectionDialog = new DlgSelectSetForCards(nullptr, parent->getDeckModel());
|
||||||
|
connect(setSelectionDialog, &DlgSelectSetForCards::deckAboutToBeModified, parent->getDeckEditor(),
|
||||||
|
&AbstractTabDeckEditor::onDeckHistorySaveRequested);
|
||||||
connect(setSelectionDialog, &DlgSelectSetForCards::deckModified, parent->getDeckEditor(),
|
connect(setSelectionDialog, &DlgSelectSetForCards::deckModified, parent->getDeckEditor(),
|
||||||
&AbstractTabDeckEditor::onDeckModified);
|
&AbstractTabDeckEditor::onDeckModified);
|
||||||
if (!setSelectionDialog->exec()) {
|
if (!setSelectionDialog->exec()) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue