summaryrefslogtreecommitdiffhomepage
path: root/proto-iokit-foohid
diff options
context:
space:
mode:
Diffstat (limited to 'proto-iokit-foohid')
-rw-r--r--proto-iokit-foohid/iokitprotocol.cpp17
-rw-r--r--proto-iokit-foohid/iokitprotocol.h2
2 files changed, 16 insertions, 3 deletions
diff --git a/proto-iokit-foohid/iokitprotocol.cpp b/proto-iokit-foohid/iokitprotocol.cpp
index 4af6ad5b..693ce31e 100644
--- a/proto-iokit-foohid/iokitprotocol.cpp
+++ b/proto-iokit-foohid/iokitprotocol.cpp
@@ -20,9 +20,22 @@ IOKitProtocol::IOKitProtocol()
qWarning("%s\n", qPrintable(joystick->errorMessage()));
}
-bool IOKitProtocol::correct()
+module_status IOKitProtocol::check_status()
{
- return joystick && !joystick->hasError();
+ if (!joystick)
+ return QCoreApplication::translate("foohid", "Load failure");
+
+ if (joystick->hasError())
+ {
+ QString msg = joystick->errorMessage();
+
+ if (msg.isEmpty())
+ msg = QCoreApplication::translate("foohid", "Unknown error");
+
+ return error(msg);
+ }
+
+ return status_ok();
}
static uint8_t valueToStick(FooHIDJoystick *stick, double min, double value, double max)
diff --git a/proto-iokit-foohid/iokitprotocol.h b/proto-iokit-foohid/iokitprotocol.h
index f3f4089f..4c5b13a4 100644
--- a/proto-iokit-foohid/iokitprotocol.h
+++ b/proto-iokit-foohid/iokitprotocol.h
@@ -18,7 +18,7 @@ class IOKitProtocol : public IProtocol
public:
IOKitProtocol();
- bool correct() final;
+ module_status check_status() override;
void pose(const double *headpose) final;
QString game_name() final;