Cockatrice/cockatrice/src/interface/widgets/dialogs/override_printing_warning.cpp
BruebachL 12f0f59453
[Settings] Split cache_settings monolith into multiple SettingsManager sub-classes (#7050)
* [Settings] Split cache_settings into multiple files

Took 9 minutes

Took 4 minutes

* [Settings] Fwd declare settings classes in cache_settings

Took 15 minutes

* Fix oracle includes.

Took 8 minutes

* Address comments, fix windows CI

Took 8 minutes

* fix copy constructor visibility

Took 3 minutes

* lint

Took 2 minutes

* Fix native format tests.

Took 5 minutes

* Remove test header guard

Took 4 seconds

* Remove tests invalid in CI environ

Took 24 seconds

* Adjust to rebase.

Took 11 minutes

* Change settings file name.

Took 8 minutes

---------

Co-authored-by: Lukas Brübach <lukas.bruebach@bdosecurity.de>
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2026-07-27 11:25:39 +02:00

39 lines
No EOL
1.9 KiB
C++

#include "override_printing_warning.h"
#include "../../card_picture_loader/card_picture_loader.h"
#include "../../client/settings/cache_settings.h"
#include <libcockatrice/settings/cards_display_settings.h>
bool OverridePrintingWarning::execMessageBox(QWidget *parent, bool enable)
{
QString message;
if (enable) {
message =
QObject::tr("Enabling this feature will disable the use of the Printing Selector.\n\n"
"You will not be able to manage printing preferences on a per-deck basis, "
"or see printings other people have selected for their decks.\n\n"
"You will have to use the Set Manager, available through Card Database -> Manage Sets.\n\n"
"Are you sure you would like to enable this feature?");
} else {
message = QObject::tr(
"Disabling this feature will enable the Printing Selector.\n\n"
"You can now choose printings on a per-deck basis in the Deck Editor and configure which printing "
"gets added to a deck by default by pinning it in the Printing Selector.\n\n"
"You can also use the Set Manager to adjust custom sort order for printings in the Printing Selector"
" (other sort orders like alphabetical or release date are available).\n\n"
"Are you sure you would like to disable this feature?");
}
QMessageBox::StandardButton result =
QMessageBox::question(parent, QObject::tr("Confirm Change"), message, QMessageBox::Yes | QMessageBox::No);
if (result == QMessageBox::Yes) {
SettingsCache::instance().cardsDisplay().setOverrideAllCardArtWithPersonalPreference(enable);
// Caches are now invalid.
CardPictureLoader::clearPixmapCache();
CardPictureLoader::clearNetworkCache();
return true;
}
return false;
}