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 | |
parent | fa8278e3c059deb13232ebcc0236c90dbd5054b8 (diff) |
ui: don't load if ps3 eye's not plugged in
Diffstat (limited to 'facetracknoir')
-rw-r--r-- | facetracknoir/install-driver-dialog.ui | 41 | ||||
-rw-r--r-- | facetracknoir/main.cpp | 23 |
2 files changed, 61 insertions, 3 deletions
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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>DriverDialog</class> + <widget class="QDialog" name="DriverDialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>415</width> + <height>94</height> + </rect> + </property> + <property name="windowTitle"> + <string>PS3 Eye driver missing</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="label"> + <property name="text"> + <string><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></string> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string><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></string> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> 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 |