From 23d1222a8c94647c13db827213eabc139a6bb187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Sat, 22 Aug 2026 00:47:03 +0200 Subject: [PATCH] [Client] Restore stored banner printing when the art dialog opens Two gaps made opening and confirming the banner dialog silently switch the banner to the default art of the first local printing. The caller dropped the card provider id when constructing the initial params, and the constructor left the printing combo wherever onCardNameChanged put it, which is always the first printing Pass the provider id through, restore it in the combo when it resolves locally, and keep it verbatim when it does not Took 2 minutes --- .../server/user/user_card_settings_dialog.cpp | 13 +++++++++++++ .../interface/widgets/server/user/user_info_box.cpp | 1 + 2 files changed, 14 insertions(+) diff --git a/cockatrice/src/interface/widgets/server/user/user_card_settings_dialog.cpp b/cockatrice/src/interface/widgets/server/user/user_card_settings_dialog.cpp index ca32edaf1..1d76b2c67 100644 --- a/cockatrice/src/interface/widgets/server/user/user_card_settings_dialog.cpp +++ b/cockatrice/src/interface/widgets/server/user/user_card_settings_dialog.cpp @@ -112,6 +112,19 @@ UserCardArtSettingsDialog::UserCardArtSettingsDialog(const CardArtParams &initia if (!initial.cardName.isEmpty()) { searchBar->setText(initial.cardName); onCardNameChanged(initial.cardName); + + // onCardNameChanged leaves the printing combo on the first printing in + // the database, which would silently change the stored banner card on + // accept. Restore the stored printing when it resolves locally. + const int storedPrintingIndex = providerComboBox->findData(initial.cardProviderId); + if (storedPrintingIndex != -1) { + providerComboBox->setCurrentIndex(storedPrintingIndex); + } else { + // Stored printing not in the local database: keep it rather than + // silently substituting the first printing. + currentParams.cardProviderId = initial.cardProviderId; + reloadPreview(); + } } marginLSpin->setValue(initial.marginPctL); marginRSpin->setValue(initial.marginPctR); diff --git a/cockatrice/src/interface/widgets/server/user/user_info_box.cpp b/cockatrice/src/interface/widgets/server/user/user_info_box.cpp index 416cd42e3..875bdfb05 100644 --- a/cockatrice/src/interface/widgets/server/user/user_info_box.cpp +++ b/cockatrice/src/interface/widgets/server/user/user_info_box.cpp @@ -319,6 +319,7 @@ void UserInfoBox::actBannerCard() if (hasUserInfo && currentUserInfo.has_card_art_params()) { const auto &cap = currentUserInfo.card_art_params(); initial.cardName = QString::fromStdString(cap.card_name()); + initial.cardProviderId = QString::fromStdString(cap.card_provider_id()); initial.marginPctL = cap.margin_pct_l(); initial.marginPctR = cap.margin_pct_r(); initial.verticalOffset = cap.vertical_offset();