[DeckEditor] Show info in PrintingSelector dock when override printings enabled (#6554)

* don't hide printing selector dock

* extract warning message to separate file

* create printing disabled info widget
This commit is contained in:
RickyRister 2026-01-24 02:20:16 -08:00 committed by GitHub
parent 948ec9e042
commit 3c48d92663
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 176 additions and 67 deletions

View file

@ -13,6 +13,7 @@
#include "../interface/widgets/utility/get_text_with_max.h"
#include "../interface/widgets/utility/sequence_edit.h"
#include "../main.h"
#include "override_printing_warning.h"
#include <../../client/settings/card_counter_settings.h>
#include <QAbstractButton>
@ -680,32 +681,9 @@ void AppearanceSettingsPage::overrideAllCardArtWithPersonalPreferenceToggled(QT_
{
bool enable = static_cast<bool>(value);
QString message;
if (enable) {
message = 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 =
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?");
}
bool accepted = OverridePrintingWarning::execMessageBox(this, enable);
QMessageBox::StandardButton result =
QMessageBox::question(this, tr("Confirm Change"), message, QMessageBox::Yes | QMessageBox::No);
if (result == QMessageBox::Yes) {
SettingsCache::instance().setOverrideAllCardArtWithPersonalPreference(value);
// Caches are now invalid.
CardPictureLoader::clearPixmapCache();
CardPictureLoader::clearNetworkCache();
} else {
if (!accepted) {
// If user cancels, revert the checkbox/state back
QTimer::singleShot(0, this, [this, enable]() {
overrideAllCardArtWithPersonalPreferenceCheckBox.blockSignals(true);