Skip to content

Commit 5e08608

Browse files
Add controller flags to information tab
1 parent 8fbde80 commit 5e08608

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

qt/OpenRGBDeviceInfoPage/OpenRGBDeviceInfoPage.cpp

+38
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,44 @@ OpenRGBDeviceInfoPage::OpenRGBDeviceInfoPage(RGBController *dev, QWidget *parent
2727
ui->VersionValue->setText(QString::fromStdString(dev->GetVersion()));
2828
ui->LocationValue->setText(QString::fromStdString(dev->GetLocation()));
2929
ui->SerialValue->setText(QString::fromStdString(dev->GetSerial()));
30+
31+
std::string flags_string = "";
32+
bool need_separator = false;
33+
34+
if(dev->flags & CONTROLLER_FLAG_LOCAL)
35+
{
36+
flags_string += "Local";
37+
need_separator = true;
38+
}
39+
if(dev->flags & CONTROLLER_FLAG_REMOTE)
40+
{
41+
if(need_separator)
42+
{
43+
flags_string += ", ";
44+
}
45+
flags_string += "Remote";
46+
need_separator = true;
47+
}
48+
if(dev->flags & CONTROLLER_FLAG_VIRTUAL)
49+
{
50+
if(need_separator)
51+
{
52+
flags_string += ", ";
53+
}
54+
flags_string += "Virtual";
55+
need_separator = true;
56+
}
57+
if(dev->flags & CONTROLLER_FLAG_RESET_BEFORE_UPDATE)
58+
{
59+
if(need_separator)
60+
{
61+
flags_string += ", ";
62+
}
63+
flags_string += "Reset Before Update";
64+
need_separator = true;
65+
}
66+
67+
ui->FlagsValue->setText(QString::fromStdString(flags_string));
3068
}
3169

3270
OpenRGBDeviceInfoPage::~OpenRGBDeviceInfoPage()

qt/OpenRGBDeviceInfoPage/OpenRGBDeviceInfoPage.ui

+17
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,23 @@
154154
</property>
155155
</widget>
156156
</item>
157+
<item row="7" column="0">
158+
<widget class="QLabel" name="FlagsLabel">
159+
<property name="text">
160+
<string>Flags:</string>
161+
</property>
162+
</widget>
163+
</item>
164+
<item row="7" column="1">
165+
<widget class="QLabel" name="FlagsValue">
166+
<property name="text">
167+
<string notr="true">Flags Value</string>
168+
</property>
169+
<property name="wordWrap">
170+
<bool>true</bool>
171+
</property>
172+
</widget>
173+
</item>
157174
</layout>
158175
</widget>
159176
</item>

0 commit comments

Comments
 (0)