From 05865e2e756a42c397bbfe1a2c20ebc4a1a7fa45 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 30 Sep 2015 17:07:35 +0200 Subject: ui: don't load if ps3 eye's not plugged in --- facetracknoir/install-driver-dialog.ui | 41 ++++++++++++++++++++++++++++++++++ facetracknoir/main.cpp | 23 ++++++++++++++++--- 2 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 facetracknoir/install-driver-dialog.ui diff --git a/facetracknoir/install-driver-dialog.ui b/facetracknoir/install-driver-dialog.ui new file mode 100644 index 00000000..3ef3bb2f --- /dev/null +++ b/facetracknoir/install-driver-dialog.ui @@ -0,0 +1,41 @@ + + + DriverDialog + + + + 0 + 0 + 415 + 94 + + + + PS3 Eye driver missing + + + + + + <html><head/><body><p>The PS3 Eye driver or camera is missing. Please install the driver or plug in the camera and restart the program. Thanks!</p></body></html> + + + true + + + + + + + <html><head/><body><p>Driver download: <a href="https://mega.nz/#!QkAjnBwD!-ULu08uFwGK5hl7ugbFZfuAw2hIdFpwVtn-jewThrN8"><span style=" text-decoration: underline; color:#0000ff;">mega.nz</span></a></p></body></html> + + + true + + + + + + + + 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 #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 #include @@ -70,10 +72,25 @@ int main(int argc, char** argv) } } - auto w = std::make_shared(); + if (get_camera_names().contains("PS3Eye Camera")) + { + auto w = std::make_shared(); - 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 -- cgit v1.2.3