diff options
Diffstat (limited to 'facetracknoir/main.cpp')
| -rw-r--r-- | facetracknoir/main.cpp | 35 | 
1 files changed, 32 insertions, 3 deletions
| diff --git a/facetracknoir/main.cpp b/facetracknoir/main.cpp index 45483a68..8425299b 100644 --- a/facetracknoir/main.cpp +++ b/facetracknoir/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 | 
