summaryrefslogtreecommitdiff
path: root/ui/qt5/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ui/qt5/main.cc')
-rw-r--r--ui/qt5/main.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/ui/qt5/main.cc b/ui/qt5/main.cc
index 330311f..22ef39e 100644
--- a/ui/qt5/main.cc
+++ b/ui/qt5/main.cc
@@ -11,6 +11,7 @@
*/
#include <QApplication>
+#include <QCommandLineParser>
#include <QDialog>
#include <QIcon>
#include <QLabel>
@@ -44,6 +45,9 @@ void WaitDialog::reject() { return; }
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
+ app.setOrganizationName("Adélie Linux");
+ app.setApplicationName("Horizon Qt UI");
+ app.setApplicationVersion(VERSTR);
QString translatorFileName = QLatin1String("qt_");
translatorFileName += QLocale::system().name();
@@ -62,6 +66,26 @@ int main(int argc, char *argv[]) {
app.setWindowIcon(QIcon(":/horizon-256.png"));
+ QCommandLineParser parser;
+ parser.setApplicationDescription(app.tr("Guides the user through creation of a HorizonScript."));
+ QCommandLineOption help = parser.addHelpOption();
+ QCommandLineOption version = parser.addVersionOption();
+
+ 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;
+ }
+
HorizonWizard wizard;
d.hide();
app.restoreOverrideCursor();