Qt: show warning if ps move tracking is not supported

This commit is contained in:
Megamouse 2024-11-16 10:30:40 +01:00
parent 05096854bc
commit b89f7515fd
2 changed files with 15 additions and 0 deletions

View file

@ -1,5 +1,11 @@
#pragma once #pragma once
#ifdef HAVE_OPENCV
constexpr bool g_ps_move_tracking_supported = true;
#else
constexpr bool g_ps_move_tracking_supported = false;
#endif
struct ps_move_info struct ps_move_info
{ {
bool valid = false; bool valid = false;

View file

@ -13,6 +13,7 @@
#include <QPainter> #include <QPainter>
#include <QPushButton> #include <QPushButton>
#include <QSlider> #include <QSlider>
#include <QMessageBox>
LOG_CHANNEL(ps_move); LOG_CHANNEL(ps_move);
@ -241,6 +242,14 @@ ps_move_tracker_dialog::ps_move_tracker_dialog(QWidget* parent)
update_saturation_threshold(true); update_saturation_threshold(true);
update_min_radius(true); update_min_radius(true);
update_max_radius(true); update_max_radius(true);
if constexpr (!g_ps_move_tracking_supported)
{
QTimer::singleShot(1000, this, [this]()
{
QMessageBox::warning(this, QObject::tr("Tracking not supported!"), QObject::tr("The PS Move tracking is not yet supported on this operating system."));
});
}
} }
ps_move_tracker_dialog::~ps_move_tracker_dialog() ps_move_tracker_dialog::~ps_move_tracker_dialog()