summaryrefslogtreecommitdiffhomepage
path: root/tracker-rift-025
diff options
context:
space:
mode:
Diffstat (limited to 'tracker-rift-025')
-rw-r--r--tracker-rift-025/ftnoir_tracker_rift_025.cpp30
-rw-r--r--tracker-rift-025/ftnoir_tracker_rift_025.h6
2 files changed, 15 insertions, 21 deletions
diff --git a/tracker-rift-025/ftnoir_tracker_rift_025.cpp b/tracker-rift-025/ftnoir_tracker_rift_025.cpp
index 92ae36ea..8d4a6e8a 100644
--- a/tracker-rift-025/ftnoir_tracker_rift_025.cpp
+++ b/tracker-rift-025/ftnoir_tracker_rift_025.cpp
@@ -41,8 +41,10 @@ rift_tracker_025::~rift_tracker_025()
System::Destroy();
}
-void rift_tracker_025::start_tracker(QFrame*)
+module_status rift_tracker_025::start_tracker(QFrame*)
{
+ QString err;
+
System::Init(Log::ConfigureDefaultLog(LogMask_All));
pManager = DeviceManager::Create();
if (pManager != NULL)
@@ -59,29 +61,19 @@ void rift_tracker_025::start_tracker(QFrame*)
pSFusion->AttachToSensor(pSensor);
}
else
- {
- QMessageBox::warning(nullptr,
- QCoreApplication::translate("rift_tracker_025", "Error"),
- QCoreApplication::translate("rift_tracker_025", "Unable to create Rift sensor"),
- QMessageBox::Ok,QMessageBox::NoButton);
- }
+ err = tr("Unable to create Rift sensor");
}
else
- {
- QMessageBox::warning(nullptr,
- QCoreApplication::translate("rift_tracker_025", "Error"),
- QCoreApplication::translate("rift_tracker_025", "Unable to enumerate Rift tracker"),
- QMessageBox::Ok,QMessageBox::NoButton);
- }
+ err = tr("Unable to enumerate Rift tracker");
}
else
- {
- QMessageBox::warning(nullptr,
- QCoreApplication::translate("rift_tracker_025", "Error"),
- QCoreApplication::translate("rift_tracker_025", "Unable to start Rift tracker"),
- QMessageBox::Ok,QMessageBox::NoButton);
- }
+ err = tr("Unable to start Rift tracker");
+
+ if (err.isEmpty())
+ return status_ok();
+ else
+ return error(err);
}
diff --git a/tracker-rift-025/ftnoir_tracker_rift_025.h b/tracker-rift-025/ftnoir_tracker_rift_025.h
index b65d3e56..37ffcdaa 100644
--- a/tracker-rift-025/ftnoir_tracker_rift_025.h
+++ b/tracker-rift-025/ftnoir_tracker_rift_025.h
@@ -21,12 +21,14 @@ struct settings : opts {
{}
};
-class rift_tracker_025 : public ITracker
+class rift_tracker_025 : public QObject, public ITracker
{
+ Q_OBJECT
+
public:
rift_tracker_025();
virtual ~rift_tracker_025() override;
- void start_tracker(QFrame *) override;
+ module_status start_tracker(QFrame *) override;
void data(double *data) override;
private:
double old_yaw;