summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir/main.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-05-20 19:37:25 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-05-20 19:37:25 +0200
commite05f9e949faea2d03d39829c709a410ea0f8813f (patch)
tree45c9b0369545887e2acef53abf45a54ba35842b3 /facetracknoir/main.cpp
parent2426dcefc8a2f6b0209a0eeafc8499aa4a7551c3 (diff)
parent2bb80e1cc1f7755d44a99d19bf9b15f03f7bbbae (diff)
Merge pull request #161 from fawick/unstable
Added command line option for automatic starts
Diffstat (limited to 'facetracknoir/main.cpp')
-rw-r--r--facetracknoir/main.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/facetracknoir/main.cpp b/facetracknoir/main.cpp
index ae237b61..bbdfbc70 100644
--- a/facetracknoir/main.cpp
+++ b/facetracknoir/main.cpp
@@ -1,5 +1,6 @@
#include "ui.h"
#include <QApplication>
+#include <QCommandLineParser>
#include <QStyleFactory>
#include <QStringList>
#include <memory>
@@ -28,8 +29,21 @@ int main(int argc, char** argv)
QApplication::setAttribute(Qt::AA_X11InitThreads, true);
QApplication app(argc, argv);
+ QCommandLineParser p;
+ p.setApplicationDescription("opentrack - Head tracking software for MS Windows, Linux, and Apple OSX");
+ p.addHelpOption();
+ QCommandLineOption autostartOption(QStringList() << "a" << "autostart", "Load <profile> and start tracking", "profile");
+ p.addOption(autostartOption);
+ p.process(app);
+
MainWindow w;
+ QString profile = p.value(autostartOption);
+ if (! profile.isEmpty() )
+ {
+ w.open_and_run(profile);
+ }
+
w.show();
app.exec();