mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
[PrintingSelector] Sync PrintingSelector availability to OverrideAllCardArtWithPersonalPreference setting. (#6218)
* [PrintingSelector] Clearly warn users about disabling the providerId change, hide and disable the printingSelector, clear the networkCache. Took 56 minutes Took 4 seconds Took 9 minutes * Defer rollback so the rollback isn't swallowed logically. Took 7 minutes * Immediately enable select printing action. Took 7 minutes * Remove restart label. Took 8 seconds * Clear PixmapCache as well as NetworkCache. Took 4 minutes * Lint. Took 3 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
3cff55b0bb
commit
ca1b9bf75f
7 changed files with 94 additions and 21 deletions
|
|
@ -478,8 +478,8 @@ AppearanceSettingsPage::AppearanceSettingsPage()
|
|||
&SettingsCache::setAutoRotateSidewaysLayoutCards);
|
||||
|
||||
overrideAllCardArtWithPersonalPreferenceCheckBox.setChecked(settings.getOverrideAllCardArtWithPersonalPreference());
|
||||
connect(&overrideAllCardArtWithPersonalPreferenceCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings,
|
||||
&SettingsCache::setOverrideAllCardArtWithPersonalPreference);
|
||||
connect(&overrideAllCardArtWithPersonalPreferenceCheckBox, &QCheckBox::QT_STATE_CHANGED, this,
|
||||
&AppearanceSettingsPage::overrideAllCardArtWithPersonalPreferenceToggled);
|
||||
|
||||
bumpSetsWithCardsInDeckToTopCheckBox.setChecked(settings.getBumpSetsWithCardsInDeckToTop());
|
||||
connect(&bumpSetsWithCardsInDeckToTopCheckBox, &QCheckBox::QT_STATE_CHANGED, &settings,
|
||||
|
|
@ -652,6 +652,45 @@ void AppearanceSettingsPage::showShortcutsChanged(QT_STATE_CHANGED_T value)
|
|||
qApp->setAttribute(Qt::AA_DontShowShortcutsInContextMenus, value == 0); // 0 = unchecked
|
||||
}
|
||||
|
||||
void AppearanceSettingsPage::overrideAllCardArtWithPersonalPreferenceToggled(QT_STATE_CHANGED_T value)
|
||||
{
|
||||
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?");
|
||||
}
|
||||
|
||||
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.
|
||||
PictureLoader::clearPixmapCache();
|
||||
PictureLoader::clearNetworkCache();
|
||||
} else {
|
||||
// If user cancels, revert the checkbox/state back
|
||||
QTimer::singleShot(0, this, [this, enable]() {
|
||||
overrideAllCardArtWithPersonalPreferenceCheckBox.blockSignals(true);
|
||||
overrideAllCardArtWithPersonalPreferenceCheckBox.setChecked(!enable);
|
||||
overrideAllCardArtWithPersonalPreferenceCheckBox.blockSignals(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the settings for cardViewInitialRowsMax.
|
||||
* Forces expanded rows max to always be >= initial rows max
|
||||
|
|
@ -694,8 +733,7 @@ void AppearanceSettingsPage::retranslateUi()
|
|||
displayCardNamesCheckBox.setText(tr("Display card names on cards having a picture"));
|
||||
autoRotateSidewaysLayoutCardsCheckBox.setText(tr("Auto-Rotate cards with sideways layout"));
|
||||
overrideAllCardArtWithPersonalPreferenceCheckBox.setText(
|
||||
tr("Override all card art with personal set preference (Pre-ProviderID change behavior) [Requires Client "
|
||||
"restart]"));
|
||||
tr("Override all card art with personal set preference (Pre-ProviderID change behavior)"));
|
||||
bumpSetsWithCardsInDeckToTopCheckBox.setText(
|
||||
tr("Bump sets that the deck contains cards from to the top in the printing selector"));
|
||||
cardScalingCheckBox.setText(tr("Scale cards on mouse over"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue