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
16 changed files with 360 additions and 17 deletions

View File

@@ -8,6 +8,7 @@
#include <QCommandLineParser>
#include <QIcon>
#include <QLibraryInfo>
#include <QTimer>
#include <QTranslator>
QTranslator *translator, *qtTranslator;
@@ -16,6 +17,7 @@ ThemeManager *themeManager;
const QString translationPrefix = "oracle";
QString translationPath;
bool isSpoilersOnly;
bool isBackgrounded;
void installNewTranslator()
{
@@ -57,10 +59,13 @@ int main(int argc, char *argv[])
// If the program is opened with the -s flag, it will only do spoilers. Otherwise it will do MTGJSON/Tokens
QCommandLineParser parser;
QCommandLineOption showProgressOption("s", QCoreApplication::translate("main", "Only run in spoiler mode"));
parser.addOption(showProgressOption);
QCommandLineOption spoilersOnlyOption("s", QCoreApplication::translate("main", "Only run in spoiler mode"));
QCommandLineOption backgroundOption("b", QCoreApplication::translate("main", "Run in no-confirm background mode"));
parser.addOption(spoilersOnlyOption);
parser.addOption(backgroundOption);
parser.process(app);
isSpoilersOnly = parser.isSet(showProgressOption);
isSpoilersOnly = parser.isSet(spoilersOnlyOption);
isBackgrounded = parser.isSet(backgroundOption);
#ifdef Q_OS_MAC
translationPath = qApp->applicationDirPath() + "/../Resources/translations";
@@ -85,5 +90,9 @@ int main(int argc, char *argv[])
wizard.show();
if (isBackgrounded) {
QTimer::singleShot(0, &wizard, [&wizard]() { wizard.runInBackground(); });
}
return app.exec();
}