Compare commits

...

3 commits

Author SHA1 Message Date
BruebachL
26a74c96c5
[Oracle] Stop linking the full client network stack into the oracle binary (#7354)
Some checks failed
CodeQL / Analyze (cpp) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
Build Desktop / Configure (push) Has been cancelled
Build Docker / Servatrice (arm) (push) Has been cancelled
Build Docker / Servatrice (x86) (push) Has been cancelled
Build Desktop / Debian 13 (push) Has been cancelled
Build Desktop / Debian 12 (push) Has been cancelled
Build Desktop / Fedora 44 (push) Has been cancelled
Build Desktop / Fedora 43 (push) Has been cancelled
Build Desktop / Servatrice_Debian 12 (push) Has been cancelled
Build Desktop / Ubuntu 26.04 (push) Has been cancelled
Build Desktop / Ubuntu 24.04 (push) Has been cancelled
Build Desktop / Arch (push) Has been cancelled
Build Desktop / macOS 13 Intel (push) Has been cancelled
Build Desktop / macOS 14 (push) Has been cancelled
Build Desktop / macOS 15 (push) Has been cancelled
Build Desktop / macOS 26 Debug (push) Has been cancelled
Build Desktop / Windows 10 (push) Has been cancelled
Build Docker / Publish multi-platform Servatrice image (push) Has been cancelled
Co-authored-by: user.email <Bruebach.Lukas@bdosecurity.de>
2026-09-25 08:32:54 +02:00
BruebachL
e9cd9453ea
[Startup] Run the onboarding wizard before the first-run set dialog (#7349)
On a clean install, checkUnknownSets() fired before the onboarding wizard,
so the legacy 'all the sets have been enabled' welcome and the Manage Sets
dialog appeared first - with no card data there are no sets to manage yet.
Defer the set check until after the wizard closes, suppress its dialogs
while onboarding runs, and enable newly downloaded sets silently instead.

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2026-09-25 08:32:03 +02:00
BruebachL
bc26e19564
[DeckEditor] Highlight card name in VDE quick search after adding (#7350)
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2026-09-25 08:31:38 +02:00
5 changed files with 56 additions and 22 deletions

View file

@ -20,6 +20,7 @@
#include <QLineEdit>
#include <QPushButton>
#include <QResizeEvent>
#include <QTimer>
#include <libcockatrice/card/card_info_comparator.h>
#include <libcockatrice/card/database/card_database.h>
#include <libcockatrice/card/database/card_database_manager.h>
@ -82,13 +83,8 @@ void VisualDeckEditorWidget::initializeSearchBarAndCompleter()
searchBar = new QLineEdit(searchContainer);
searchContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
connect(searchBar, &QLineEdit::returnPressed, this, [=, this]() {
if (!searchBar->hasFocus()) {
return;
}
ExactCard card = CardDatabaseManager::query()->getCard({searchBar->text()});
if (card) {
emit cardAdditionRequested(card);
if (searchBar->hasFocus()) {
addCardFromSearch();
}
});
@ -133,16 +129,24 @@ void VisualDeckEditorWidget::initializeSearchBarAndCompleter()
// Search button functionality
searchPushButton = new CompactPushButton(searchContainer);
searchPushButton->setButtonIcon(themePixmap(QStringLiteral("icons/search")));
connect(searchPushButton, &QPushButton::clicked, this, [=, this]() {
ExactCard card = CardDatabaseManager::query()->getCard({searchBar->text()});
if (card) {
emit cardAdditionRequested(card);
}
});
connect(searchPushButton, &QPushButton::clicked, this, [this] { addCardFromSearch(); });
searchLayout->addWidget(searchPushButton);
}
void VisualDeckEditorWidget::addCardFromSearch()
{
ExactCard card = CardDatabaseManager::query()->getCard({searchBar->text()});
if (!card) {
return;
}
emit cardAdditionRequested(card);
searchBar->setFocus();
QTimer::singleShot(0, searchBar, [this] { searchBar->setSelection(0, searchBar->text().length()); });
}
void VisualDeckEditorWidget::initializeDisplayOptionsWidget()
{
displayOptionsWidget = new VisualDeckDisplayOptionsWidget(this);

View file

@ -78,6 +78,7 @@ signals:
protected:
void initializeSearchBarAndCompleter();
void addCardFromSearch();
void initializeDisplayOptionsWidget();
void initializeDisplayOptionsAndSearchWidget();
void initializeScrollAreaAndZoneContainer();

View file

@ -575,11 +575,18 @@ MainWindow::MainWindow(QWidget *parent)
void MainWindow::startupConfigCheck()
{
const bool isCleanInstall = SettingsCache::instance().network().getClientVersion() == CLIENT_INFO_NOT_SET;
// checkUnknownSets() is intentionally deferred from the card database load
// (which runs in main() before MainWindow exists) so that
// cardDatabaseNewSetsFound / cardDatabaseAllNewSetsEnabled have live
// receivers when emitted.
CardDatabaseManager::getInstance()->checkUnknownSets();
// On a clean install the onboarding wizard owns the first-run experience;
// wait until it closes so the legacy "all sets enabled" welcome and the
// Manage Sets dialog don't appear first.
if (!isCleanInstall) {
CardDatabaseManager::getInstance()->checkUnknownSets();
}
if (SettingsCache::instance().debug().getLocalGameOnStartup()) {
LocalGameOptions options;
@ -593,14 +600,14 @@ void MainWindow::startupConfigCheck()
actCheckCommanderBracketDefinitionUpdates();
if (SettingsCache::instance().network().getClientVersion() == CLIENT_INFO_NOT_SET) {
if (isCleanInstall) {
// no config found, 99% new clean install
qCInfo(WindowMainStartupVersionLog)
<< "Startup: old client version empty, assuming first start after clean install";
SettingsCache::instance().downloads().resetToDefaultURLs(); // populate the download urls
SettingsCache::instance().network().setClientVersion(VERSION_STRING);
actCheckServerUpdates();
runFirstRunWizard();
runFirstRunWizard(true);
if (QString(VERSION_STRING).contains("custom", Qt::CaseInsensitive)) {
SettingsCache::instance().updates().setCheckUpdatesOnStartup(false);
@ -680,7 +687,7 @@ void MainWindow::startupConfigCheck()
}
}
void MainWindow::runFirstRunWizard()
void MainWindow::runFirstRunWizard(bool firstRun)
{
auto *wizard = new FirstRunWizard(this);
wizard->setAttribute(Qt::WA_DeleteOnClose);
@ -692,6 +699,19 @@ void MainWindow::runFirstRunWizard()
connect(wizard, &FirstRunWizard::registerRequested, connectionController, &ConnectionController::registerToServer);
connect(wizard, &FirstRunWizard::connectRequested, connectionController, &ConnectionController::connectToServer);
if (firstRun) {
// The onboarding wizard owns set handling for a clean install. Suppress
// the legacy set dialogs while it's open and run checkUnknownSets() once
// it closes so the sets end up enabled in the right order.
firstRunWizardActive = true;
connect(wizard, &QDialog::finished, this, [this] {
QTimer::singleShot(0, this, [this] {
CardDatabaseManager::getInstance()->checkUnknownSets();
firstRunWizardActive = false;
});
});
}
wizard->setModal(true);
wizard->show();
}
@ -995,7 +1015,7 @@ void MainWindow::cardDatabaseLoadingFailed()
void MainWindow::cardDatabaseNewSetsFound(int numUnknownSets, QStringList unknownSetsNames)
{
if (SettingsCache::instance().updates().getAlwaysEnableNewSets()) {
if (firstRunWizardActive || SettingsCache::instance().updates().getAlwaysEnableNewSets()) {
CardDatabaseManager::getInstance()->enableAllUnknownSets();
const auto reloadOk1 =
QtConcurrent::run([] { CardDatabaseManager::getInstance()->reloadCardDatabasesAndNotify(); });
@ -1038,6 +1058,12 @@ void MainWindow::cardDatabaseNewSetsFound(int numUnknownSets, QStringList unknow
void MainWindow::cardDatabaseAllNewSetsEnabled()
{
if (firstRunWizardActive || CardDatabaseManager::getInstance()->getCardList().isEmpty()) {
// The onboarding wizard owns the first-run messaging on a clean install,
// and with no card data there are no sets to have enabled.
return;
}
QMessageBox::information(
this, tr("Welcome"),
tr("Hi! It seems like you're running this version of Cockatrice for the first time.\nAll the sets in the card "

View file

@ -139,7 +139,7 @@ private:
void createTrayIcon();
int getNextCustomSetPrefix(QDir dataDir);
void runFirstRunWizard();
void runFirstRunWizard(bool firstRun = false);
inline QString getCardUpdaterBinaryName()
{
@ -169,6 +169,7 @@ private:
bool bHasActivated, askedForDbUpdater;
bool skipStartupAutoConnect = false;
bool startupAutoConnectAttempted = false;
bool firstRunWizardActive = false;
QProcess *cardUpdateProcess;
QByteArray cardUpdateOutputBuffer;
DlgViewLog *logviewDialog;

View file

@ -31,8 +31,6 @@ set(oracle_SOURCES
../cockatrice/src/interface/pixel_map_generator.cpp
../cockatrice/src/interface/theme_config.cpp
../cockatrice/src/interface/theme_manager.cpp
../cockatrice/src/interface/widgets/quick_settings/settings_button_widget.cpp
../cockatrice/src/interface/widgets/quick_settings/settings_popup_widget.cpp
${VERSION_STRING_CPP}
)
@ -123,10 +121,14 @@ target_link_libraries(
oracle
PUBLIC libcockatrice_card
PUBLIC libcockatrice_settings
PUBLIC libcockatrice_network
PUBLIC libcockatrice_protocol
PUBLIC ${ORACLE_QT_MODULES}
)
# Only user_level.h is needed from the network headers (pulled in transitively
# by pixel_map_generator.h); nothing from the network libraries is linked.
target_include_directories(oracle PRIVATE ${CMAKE_SOURCE_DIR}/libcockatrice_network)
if(ZLIB_FOUND)
target_link_libraries(oracle PUBLIC ${ZLIB_LIBRARIES})
endif()