Publish LumaOps source
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBDeviceInfoPage.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB device information page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBDeviceInfoPage.h"
|
||||
#include "ui_OpenRGBDeviceInfoPage.h"
|
||||
|
||||
OpenRGBDeviceInfoPage::OpenRGBDeviceInfoPage(RGBController *dev, QWidget *parent) :
|
||||
QFrame(parent),
|
||||
ui(new Ui::OpenRGBDeviceInfoPage)
|
||||
{
|
||||
controller = dev;
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->TypeValue->setText(device_type_to_str(dev->type).c_str());
|
||||
|
||||
ui->NameValue->setText(QString::fromStdString(dev->GetName()));
|
||||
ui->VendorValue->setText(QString::fromStdString(dev->GetVendor()));
|
||||
ui->DescriptionValue->setText(QString::fromStdString(dev->GetDescription()));
|
||||
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()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBDeviceInfoPage::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
}
|
||||
|
||||
RGBController* OpenRGBDeviceInfoPage::GetController()
|
||||
{
|
||||
return controller;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBDeviceInfoPage.h |
|
||||
| |
|
||||
| User interface for OpenRGB device information page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QFrame>
|
||||
#include "RGBController.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBDeviceInfoPage;
|
||||
}
|
||||
|
||||
class OpenRGBDeviceInfoPage : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBDeviceInfoPage(RGBController *dev, QWidget *parent = nullptr);
|
||||
~OpenRGBDeviceInfoPage();
|
||||
|
||||
RGBController* GetController();
|
||||
|
||||
private:
|
||||
RGBController* controller;
|
||||
Ui::OpenRGBDeviceInfoPage* ui;
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
};
|
||||
@@ -0,0 +1,194 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBDeviceInfoPage</class>
|
||||
<widget class="QFrame" name="OpenRGBDeviceInfoPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>500</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Device Info Page</string>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Shadow::Sunken</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout" columnstretch="0">
|
||||
<item row="0" column="0">
|
||||
<widget class="QFrame" name="DeviceInfoFrame">
|
||||
<property name="autoFillBackground">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Shadow::Sunken</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2" columnstretch="0,1">
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="VersionValue">
|
||||
<property name="text">
|
||||
<string notr="true">Version Value</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="SerialLabel">
|
||||
<property name="text">
|
||||
<string>Serial:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLabel" name="SerialValue">
|
||||
<property name="text">
|
||||
<string notr="true">Serial Value</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="NameLabel">
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="NameValue">
|
||||
<property name="text">
|
||||
<string notr="true">Name Value</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="VendorLabel">
|
||||
<property name="text">
|
||||
<string>Vendor:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="VendorValue">
|
||||
<property name="text">
|
||||
<string notr="true">Vendor Value</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="TypeLabel">
|
||||
<property name="text">
|
||||
<string>Type:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="TypeValue">
|
||||
<property name="text">
|
||||
<string notr="true">Type Value</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="DescriptionValue">
|
||||
<property name="text">
|
||||
<string notr="true">Description Value</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="DescriptionLabel">
|
||||
<property name="text">
|
||||
<string>Description:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="VersionLabel">
|
||||
<property name="text">
|
||||
<string>Version:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="LocationLabel">
|
||||
<property name="text">
|
||||
<string>Location:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLabel" name="LocationValue">
|
||||
<property name="text">
|
||||
<string notr="true">Location Value</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="FlagsLabel">
|
||||
<property name="text">
|
||||
<string>Flags:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QLabel" name="FlagsValue">
|
||||
<property name="text">
|
||||
<string notr="true">Flags Value</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user