mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-07 18:43:26 -08:00
Some checks are pending
CodeQL / Analyze (cpp) (push) Waiting to run
CodeQL / Analyze (actions) (push) Waiting to run
Build Desktop / Configure (push) Waiting to run
Build Desktop / Debian 13 (push) Blocked by required conditions
Build Desktop / Debian 12 (push) Blocked by required conditions
Build Desktop / Fedora 44 (push) Blocked by required conditions
Build Desktop / Fedora 43 (push) Blocked by required conditions
Build Desktop / Servatrice_Debian 12 (push) Blocked by required conditions
Build Desktop / Ubuntu 24.04 (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 (push) Blocked by required conditions
Build Desktop / Arch (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 cover (push) Blocked by required conditions
Build Desktop / macOS 13 Intel (push) Blocked by required conditions
Build Desktop / macOS 14 (push) Blocked by required conditions
Build Desktop / macOS 15 (push) Blocked by required conditions
Build Desktop / macOS 26 Debug (push) Blocked by required conditions
Build Desktop / Windows 10 (push) Blocked by required conditions
Build Desktop / Prune caches (push) Waiting to run
Build Docker / Servatrice (arm) (push) Waiting to run
Build Docker / Servatrice (x86) (push) Waiting to run
Build Docker / Publish multi-platform Servatrice image (push) Blocked by required conditions
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
43 lines
No EOL
1.9 KiB
C++
43 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 <QMessageBox>
|
|
#include <QObject>
|
|
#include <QString>
|
|
#include <libcockatrice/settings/cards_display_settings.h>
|
|
#include <libcockatrice/utility/qt_utils.h>
|
|
|
|
class QWidget;
|
|
|
|
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?");
|
|
}
|
|
|
|
if (QtUtils::confirm(parent, QObject::tr("Confirm Change"), message)) {
|
|
SettingsCache::instance().cardsDisplay().setOverrideAllCardArtWithPersonalPreference(enable);
|
|
// Caches are now invalid.
|
|
CardPictureLoader::clearPixmapCache();
|
|
CardPictureLoader::clearNetworkCache();
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
} |