diff options
Diffstat (limited to 'gui/main.cpp')
-rw-r--r-- | gui/main.cpp | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/gui/main.cpp b/gui/main.cpp index a63fe54a..4e56b3df 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -2,8 +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> @@ -58,10 +61,36 @@ int main(int argc, char** argv) QApplication::setAttribute(Qt::AA_X11InitThreads, true); QApplication app(argc, argv); - auto w = std::make_shared<MainWindow>(); + { + QSettings s(OPENTRACK_ORG); + if (!s.contains("wizard-run-once")) + { + s.setValue("wizard-run-once", true); + auto w = std::make_shared<Wizard>(); + w->show(); + app.exec(); + } + } + + 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 |