Automatic Card Database Updates (#6004)

* Add the option to background the oracle wizard, add an option to automatically launch oracle wizard in background every X days since last launch.

* Mocks and a typo.

* Lint.

* Lint?

* qOverload the spinBox.

* Change to a prompt instead.

* An Label.

* Update window_main.cpp

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: Zach H <zahalpern+github@gmail.com>
This commit is contained in:
BruebachL 2025-06-30 04:21:52 +02:00 committed by GitHub
parent 76fdbfaa2f
commit f3913949b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 360 additions and 17 deletions

View file

@ -13,6 +13,7 @@
#include "servers_settings.h"
#include "shortcuts_settings.h"
#include <QDate>
#include <QLoggingCategory>
#include <QObject>
#include <QSize>
@ -198,6 +199,11 @@ private:
bool tabVisualDeckStorageOpen, tabServerOpen, tabAccountOpen, tabDeckStorageOpen, tabReplaysOpen, tabAdminOpen,
tabLogOpen;
bool checkUpdatesOnStartup;
bool startupCardUpdateCheckPromptForUpdate;
bool startupCardUpdateCheckAlwaysUpdate;
bool checkCardUpdatesOnStartup;
int cardUpdateCheckInterval;
QDate lastCardUpdateCheck;
bool notifyAboutUpdates;
bool notifyAboutNewVersion;
bool showTipsOnStartup;
@ -438,6 +444,27 @@ public:
{
return checkUpdatesOnStartup;
}
bool getStartupCardUpdateCheckPromptForUpdate()
{
return startupCardUpdateCheckPromptForUpdate;
}
bool getStartupCardUpdateCheckAlwaysUpdate()
{
return startupCardUpdateCheckAlwaysUpdate;
}
int getCardUpdateCheckInterval() const
{
return cardUpdateCheckInterval;
}
QDate getLastCardUpdateCheck() const
{
return lastCardUpdateCheck;
}
bool getCardUpdateCheckRequired() const
{
return getLastCardUpdateCheck().daysTo(QDateTime::currentDateTime().date()) >= getCardUpdateCheckInterval() &&
getLastCardUpdateCheck() != QDateTime::currentDateTime().date();
}
bool getNotifyAboutUpdates() const
{
return notifyAboutUpdates;
@ -1007,6 +1034,10 @@ public slots:
void setDefaultStartingLifeTotal(const int _defaultStartingLifeTotal);
void setRememberGameSettings(const bool _rememberGameSettings);
void setCheckUpdatesOnStartup(QT_STATE_CHANGED_T value);
void setStartupCardUpdateCheckPromptForUpdate(bool value);
void setStartupCardUpdateCheckAlwaysUpdate(bool value);
void setCardUpdateCheckInterval(int value);
void setLastCardUpdateCheck(QDate value);
void setNotifyAboutUpdate(QT_STATE_CHANGED_T _notifyaboutupdate);
void setNotifyAboutNewVersion(QT_STATE_CHANGED_T _notifyaboutnewversion);
void setUpdateReleaseChannelIndex(int value);