summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir/ui.cpp
diff options
context:
space:
mode:
authorFabian Wickborn <fabian@wickborn.net>2015-05-20 15:02:47 +0200
committerFabian Wickborn <fabian@wickborn.net>2015-05-20 15:05:23 +0200
commit2bb80e1cc1f7755d44a99d19bf9b15f03f7bbbae (patch)
tree45c9b0369545887e2acef53abf45a54ba35842b3 /facetracknoir/ui.cpp
parent2426dcefc8a2f6b0209a0eeafc8499aa4a7551c3 (diff)
Added command line option for automatic starts
Diffstat (limited to 'facetracknoir/ui.cpp')
-rw-r--r--facetracknoir/ui.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/facetracknoir/ui.cpp b/facetracknoir/ui.cpp
index c9a0b7b3..071a4126 100644
--- a/facetracknoir/ui.cpp
+++ b/facetracknoir/ui.cpp
@@ -25,6 +25,7 @@
#include "opentrack/tracker.h"
#include "opentrack/options.hpp"
#include <QFileDialog>
+#include <QFileInfo>
#ifndef _WIN32
# include <unistd.h>
@@ -211,6 +212,18 @@ void MainWindow::bindKeyboardShortcuts()
ensure_tray();
}
+void MainWindow::open_and_run(const QString &fileName) {
+ if (! fileName.isEmpty() && QFileInfo(fileName).exists()) {
+ {
+ QSettings settings(group::org);
+ settings.setValue(group::filename_key, remove_app_path(fileName));
+ }
+ fill_profile_combobox();
+ load_settings();
+ QTimer::singleShot(0, this, SLOT(startTracker()));
+ }
+}
+
void MainWindow::startTracker( ) {
s.b->save();
load_settings();