summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--facetracknoir/install-driver-dialog.ui41
-rw-r--r--facetracknoir/main.cpp23
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>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The PS3 Eye driver or camera is missing. Please install the driver or plug in the camera and restart the program. Thanks!&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Driver download: &lt;a href=&quot;https://mega.nz/#!QkAjnBwD!-ULu08uFwGK5hl7ugbFZfuAw2hIdFpwVtn-jewThrN8&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;mega.nz&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</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