From 5e08608c5695583ebdb1da043a4133986dbb0036 Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Tue, 12 Nov 2024 11:20:43 -0600 Subject: [PATCH] Add controller flags to information tab --- .../OpenRGBDeviceInfoPage.cpp | 38 +++++++++++++++++++ .../OpenRGBDeviceInfoPage.ui | 17 +++++++++ 2 files changed, 55 insertions(+) diff --git a/qt/OpenRGBDeviceInfoPage/OpenRGBDeviceInfoPage.cpp b/qt/OpenRGBDeviceInfoPage/OpenRGBDeviceInfoPage.cpp index 2c73fd0d..a6ae0c8b 100644 --- a/qt/OpenRGBDeviceInfoPage/OpenRGBDeviceInfoPage.cpp +++ b/qt/OpenRGBDeviceInfoPage/OpenRGBDeviceInfoPage.cpp @@ -27,6 +27,44 @@ OpenRGBDeviceInfoPage::OpenRGBDeviceInfoPage(RGBController *dev, QWidget *parent ui->VersionValue->setText(QString::fromStdString(dev->GetVersion())); ui->LocationValue->setText(QString::fromStdString(dev->GetLocation())); ui->SerialValue->setText(QString::fromStdString(dev->GetSerial())); + + std::string flags_string = ""; + bool need_separator = false; + + if(dev->flags & CONTROLLER_FLAG_LOCAL) + { + flags_string += "Local"; + need_separator = true; + } + if(dev->flags & CONTROLLER_FLAG_REMOTE) + { + if(need_separator) + { + flags_string += ", "; + } + flags_string += "Remote"; + need_separator = true; + } + if(dev->flags & CONTROLLER_FLAG_VIRTUAL) + { + if(need_separator) + { + flags_string += ", "; + } + flags_string += "Virtual"; + need_separator = true; + } + if(dev->flags & CONTROLLER_FLAG_RESET_BEFORE_UPDATE) + { + if(need_separator) + { + flags_string += ", "; + } + flags_string += "Reset Before Update"; + need_separator = true; + } + + ui->FlagsValue->setText(QString::fromStdString(flags_string)); } OpenRGBDeviceInfoPage::~OpenRGBDeviceInfoPage() diff --git a/qt/OpenRGBDeviceInfoPage/OpenRGBDeviceInfoPage.ui b/qt/OpenRGBDeviceInfoPage/OpenRGBDeviceInfoPage.ui index 9ae1a1bd..5f988297 100644 --- a/qt/OpenRGBDeviceInfoPage/OpenRGBDeviceInfoPage.ui +++ b/qt/OpenRGBDeviceInfoPage/OpenRGBDeviceInfoPage.ui @@ -154,6 +154,23 @@ + + + + Flags: + + + + + + + Flags Value + + + true + + +