summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2020-02-10 11:06:40 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-02-10 11:06:40 -0600
commitd8565f987dab41cf98b689058826d522d49bc265 (patch)
tree154b2da66f8d4d2b388ec197beba389975bf3278 /ui
parentee5471ca10a671f97ef440a0f0fcc10b2161829f (diff)
downloadhorizon-d8565f987dab41cf98b689058826d522d49bc265.tar.gz
horizon-d8565f987dab41cf98b689058826d522d49bc265.tar.bz2
horizon-d8565f987dab41cf98b689058826d522d49bc265.tar.xz
horizon-d8565f987dab41cf98b689058826d522d49bc265.zip
Qt Runner: Handle command line arguments, including --automatic
Diffstat (limited to 'ui')
-rw-r--r--ui/qt5/runner/main.cc28
1 files changed, 27 insertions, 1 deletions
diff --git a/ui/qt5/runner/main.cc b/ui/qt5/runner/main.cc
index bac429d..a545982 100644
--- a/ui/qt5/runner/main.cc
+++ b/ui/qt5/runner/main.cc
@@ -11,6 +11,7 @@
*/
#include <QApplication>
+#include <QCommandLineParser>
#include <QIcon>
#include <QLibraryInfo>
#include <QTranslator>
@@ -19,6 +20,9 @@
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
+ app.setOrganizationName("Adélie Linux");
+ app.setApplicationName("Horizon Runner GUI");
+ app.setApplicationVersion(VERSTR);
QString translatorFileName = QLatin1String("qt_");
translatorFileName += QLocale::system().name();
@@ -32,7 +36,29 @@ int main(int argc, char *argv[]) {
app.setWindowIcon(QIcon(":/horizon-256.png"));
- ExecutorWizard wizard;
+ QCommandLineParser parser;
+ parser.setApplicationDescription(app.tr("Executes a HorizonScript with graphical progress indication."));
+ QCommandLineOption help = parser.addHelpOption();
+ QCommandLineOption version = parser.addVersionOption();
+ QCommandLineOption automatic("automatic", app.tr("Runs the Executor in Automatic mode. After installation, the system will be restarted automatically."));
+ parser.addOption(automatic);
+
+ if(!parser.parse(app.arguments())) {
+ parser.showHelp(1);
+ return 1;
+ }
+
+ if(parser.isSet(help)) {
+ parser.showHelp();
+ return 0;
+ }
+
+ if(parser.isSet(version)) {
+ parser.showVersion();
+ return 0;
+ }
+
+ ExecutorWizard wizard(nullptr, parser.isSet(automatic));
wizard.show();
return app.exec();