diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-09-30 17:07:35 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-09-30 17:07:35 +0200 |
commit | 05865e2e756a42c397bbfe1a2c20ebc4a1a7fa45 (patch) | |
tree | e7afd930378d789777309d94d94f91f68fe8a2f2 /facetracknoir/main.cpp | |
parent | fa8278e3c059deb13232ebcc0236c90dbd5054b8 (diff) |
ui: don't load if ps3 eye's not plugged in
Diffstat (limited to 'facetracknoir/main.cpp')
-rw-r--r-- | facetracknoir/main.cpp | 23 |
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 |