summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir/main.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-09-30 17:07:35 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-09-30 17:07:35 +0200
commit05865e2e756a42c397bbfe1a2c20ebc4a1a7fa45 (patch)
treee7afd930378d789777309d94d94f91f68fe8a2f2 /facetracknoir/main.cpp
parentfa8278e3c059deb13232ebcc0236c90dbd5054b8 (diff)
ui: don't load if ps3 eye's not plugged in
Diffstat (limited to 'facetracknoir/main.cpp')
-rw-r--r--facetracknoir/main.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/facetracknoir/main.cpp b/facetracknoir/main.cpp
index 85c4c7bd..8425299b 100644
--- a/facetracknoir/main.cpp
+++ b/facetracknoir/main.cpp
@@ -2,9 +2,11 @@
# include <stdlib.h>
#endif
+#include "opentrack/opencv-camera-dialog.hpp"
#include "wizard.h"
#include "ui.h"
#include "opentrack/options.hpp"
+#include "ui_install-driver-dialog.h"
using namespace options;
#include <QApplication>
#include <QCommandLineParser>
@@ -70,10 +72,25 @@ int main(int argc, char** argv)
}
}
- auto w = std::make_shared<MainWindow>();
+ if (get_camera_names().contains("PS3Eye Camera"))
+ {
+ auto w = std::make_shared<MainWindow>();
- w->show();
- app.exec();
+ w->show();
+ app.exec();
+ }
+ else
+ {
+ struct Dialog : QDialog
+ {
+ Ui::DriverDialog dlg;
+ Dialog()
+ {
+ dlg.setupUi(this);
+ }
+ };
+ Dialog().exec();
+ }
// on MSVC crashes in atexit
#ifdef _MSC_VER