mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-03-24 08:51:07 -04:00
Unified page for Manually Added Devices
This commit is contained in:
15
main.cpp
15
main.cpp
@@ -7,18 +7,15 @@
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <vector>
|
||||
#include "ResourceManager.h"
|
||||
#include "NetworkServer.h"
|
||||
#include "LogManager.h"
|
||||
#include "cli.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <thread>
|
||||
#include "cli.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "NetworkClient.h"
|
||||
#include "NetworkServer.h"
|
||||
#include "ProfileManager.h"
|
||||
#include "RGBController.h"
|
||||
#include "i2c_smbus.h"
|
||||
#include "LogManager.h"
|
||||
|
||||
#ifdef _MACOSX_X86_X64
|
||||
#include "macUSPCIOAccess.h"
|
||||
|
||||
27
qt/ManualDevicesSettingsPage/BaseManualDeviceEntry.cpp
Normal file
27
qt/ManualDevicesSettingsPage/BaseManualDeviceEntry.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
/*-----------------------------------------------------------------*\
|
||||
| BaseManualDeviceEntry.cpp |
|
||||
| |
|
||||
| Base class to all user-defined device settings entries |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*-----------------------------------------------------------------*/
|
||||
|
||||
#include "BaseManualDeviceEntry.h"
|
||||
|
||||
#include "ManualDevicesTypeManager.h"
|
||||
|
||||
void BaseManualDeviceEntry::setSettingsSection(const std::string& section)
|
||||
{
|
||||
settingsSection = section;
|
||||
}
|
||||
|
||||
std::string BaseManualDeviceEntry::getSettingsSection()
|
||||
{
|
||||
return settingsSection;
|
||||
}
|
||||
|
||||
ManualDeviceTypeRegistrator::ManualDeviceTypeRegistrator(const std::string& name, const std::string& settingsEntry, ManualDeviceEntrySpawnFunction entrySpawnFunction)
|
||||
{
|
||||
ManualDevicesTypeManager::get()->registerType(name, settingsEntry, entrySpawnFunction);
|
||||
};
|
||||
@@ -20,7 +20,22 @@ class BaseManualDeviceEntry: public QWidget
|
||||
|
||||
public:
|
||||
explicit BaseManualDeviceEntry(QWidget *parent = nullptr): QWidget(parent) {}
|
||||
virtual void loadFromSettings(const json& data) = 0;
|
||||
virtual json saveSettings() = 0;
|
||||
virtual const char* settingsSection() = 0;
|
||||
virtual bool isDataValid() = 0;
|
||||
|
||||
void setSettingsSection(const std::string& section);
|
||||
std::string getSettingsSection();
|
||||
|
||||
private:
|
||||
std::string settingsSection;
|
||||
};
|
||||
|
||||
typedef std::function<BaseManualDeviceEntry*(const json& data)> ManualDeviceEntrySpawnFunction;
|
||||
|
||||
class ManualDeviceTypeRegistrator
|
||||
{
|
||||
public:
|
||||
ManualDeviceTypeRegistrator(const std::string& name, const std::string& settingsEntry, ManualDeviceEntrySpawnFunction entrySpawnFunction);
|
||||
};
|
||||
|
||||
#define REGISTER_MANUAL_DEVICE_TYPE(name, settingsEntry, func) static ManualDeviceTypeRegistrator device_detector_obj_##func(name, settingsEntry, func)
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBDMXSettingsEntry.cpp |
|
||||
| DMXSettingsEntry.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB DMX settings entry |
|
||||
| |
|
||||
@@ -7,22 +7,22 @@
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBDMXSettingsEntry.h"
|
||||
#include "ui_OpenRGBDMXSettingsEntry.h"
|
||||
#include "DMXSettingsEntry.h"
|
||||
#include "ui_DMXSettingsEntry.h"
|
||||
|
||||
OpenRGBDMXSettingsEntry::OpenRGBDMXSettingsEntry(QWidget *parent) :
|
||||
DMXSettingsEntry::DMXSettingsEntry(QWidget *parent) :
|
||||
BaseManualDeviceEntry(parent),
|
||||
ui(new Ui::OpenRGBDMXSettingsEntry)
|
||||
ui(new Ui::DMXSettingsEntry)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
OpenRGBDMXSettingsEntry::~OpenRGBDMXSettingsEntry()
|
||||
DMXSettingsEntry::~DMXSettingsEntry()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBDMXSettingsEntry::changeEvent(QEvent *event)
|
||||
void DMXSettingsEntry::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
@@ -30,7 +30,7 @@ void OpenRGBDMXSettingsEntry::changeEvent(QEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBDMXSettingsEntry::loadFromSettings(const json& data)
|
||||
void DMXSettingsEntry::loadFromSettings(const json& data)
|
||||
{
|
||||
if(data.contains("name"))
|
||||
{
|
||||
@@ -68,7 +68,7 @@ void OpenRGBDMXSettingsEntry::loadFromSettings(const json& data)
|
||||
}
|
||||
}
|
||||
|
||||
json OpenRGBDMXSettingsEntry::saveSettings()
|
||||
json DMXSettingsEntry::saveSettings()
|
||||
{
|
||||
json result;
|
||||
/*-------------------------------------------------*\
|
||||
@@ -96,7 +96,17 @@ json OpenRGBDMXSettingsEntry::saveSettings()
|
||||
return result;
|
||||
}
|
||||
|
||||
const char* OpenRGBDMXSettingsEntry::settingsSection()
|
||||
bool DMXSettingsEntry::isDataValid()
|
||||
{
|
||||
return "DMXDevices";
|
||||
// stub
|
||||
return true;
|
||||
}
|
||||
|
||||
static BaseManualDeviceEntry* SpawnDMXEntry(const json& data)
|
||||
{
|
||||
DMXSettingsEntry* entry = new DMXSettingsEntry;
|
||||
entry->loadFromSettings(data);
|
||||
return entry;
|
||||
}
|
||||
|
||||
REGISTER_MANUAL_DEVICE_TYPE("DMX", "DMXDevices", SpawnDMXEntry);
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBDMXSettingsEntry.h |
|
||||
| DMXSettingsEntry.h |
|
||||
| |
|
||||
| User interface for OpenRGB DMX settings entry |
|
||||
| |
|
||||
@@ -13,23 +13,23 @@
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBDMXSettingsEntry;
|
||||
class DMXSettingsEntry;
|
||||
}
|
||||
|
||||
class OpenRGBDMXSettingsEntry : public BaseManualDeviceEntry
|
||||
class DMXSettingsEntry : public BaseManualDeviceEntry
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBDMXSettingsEntry(QWidget *parent = nullptr);
|
||||
~OpenRGBDMXSettingsEntry();
|
||||
explicit DMXSettingsEntry(QWidget *parent = nullptr);
|
||||
~DMXSettingsEntry();
|
||||
void loadFromSettings(const json& data);
|
||||
json saveSettings();
|
||||
const char* settingsSection();
|
||||
json saveSettings() override;
|
||||
bool isDataValid() override;
|
||||
|
||||
private:
|
||||
Ui::OpenRGBDMXSettingsEntry *ui;
|
||||
Ui::DMXSettingsEntry *ui;
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void changeEvent(QEvent *event) override;
|
||||
};
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBDMXSettingsEntry</class>
|
||||
<widget class="QWidget" name="OpenRGBDMXSettingsEntry">
|
||||
<class>DMXSettingsEntry</class>
|
||||
<widget class="QWidget" name="DMXSettingsEntry">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@@ -23,7 +23,7 @@
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string/>
|
||||
<string>DMX Device</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="4" column="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBE131SettingsEntry.cpp |
|
||||
| E131SettingsEntry.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB E1.31 settings entry |
|
||||
| |
|
||||
@@ -7,12 +7,12 @@
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBE131SettingsEntry.h"
|
||||
#include "ui_OpenRGBE131SettingsEntry.h"
|
||||
#include "E131SettingsEntry.h"
|
||||
#include "ui_E131SettingsEntry.h"
|
||||
|
||||
OpenRGBE131SettingsEntry::OpenRGBE131SettingsEntry(QWidget *parent) :
|
||||
E131SettingsEntry::E131SettingsEntry(QWidget *parent) :
|
||||
BaseManualDeviceEntry(parent),
|
||||
ui(new Ui::OpenRGBE131SettingsEntry)
|
||||
ui(new Ui::E131SettingsEntry)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
@@ -39,12 +39,12 @@ OpenRGBE131SettingsEntry::OpenRGBE131SettingsEntry(QWidget *parent) :
|
||||
HideMatrixSettings();
|
||||
}
|
||||
|
||||
OpenRGBE131SettingsEntry::~OpenRGBE131SettingsEntry()
|
||||
E131SettingsEntry::~E131SettingsEntry()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBE131SettingsEntry::changeEvent(QEvent *event)
|
||||
void E131SettingsEntry::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
@@ -52,7 +52,7 @@ void OpenRGBE131SettingsEntry::changeEvent(QEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBE131SettingsEntry::HideMatrixSettings()
|
||||
void E131SettingsEntry::HideMatrixSettings()
|
||||
{
|
||||
ui->MatrixWidthLabel->setDisabled(true);
|
||||
ui->MatrixWidthEdit->setDisabled(true);
|
||||
@@ -64,7 +64,7 @@ void OpenRGBE131SettingsEntry::HideMatrixSettings()
|
||||
ui->MatrixOrderComboBox->setDisabled(true);
|
||||
}
|
||||
|
||||
void OpenRGBE131SettingsEntry::ShowMatrixSettings()
|
||||
void E131SettingsEntry::ShowMatrixSettings()
|
||||
{
|
||||
ui->MatrixWidthLabel->setDisabled(false);
|
||||
ui->MatrixWidthEdit->setDisabled(false);
|
||||
@@ -76,7 +76,7 @@ void OpenRGBE131SettingsEntry::ShowMatrixSettings()
|
||||
ui->MatrixOrderComboBox->setDisabled(false);
|
||||
}
|
||||
|
||||
void OpenRGBE131SettingsEntry::on_TypeComboBox_currentIndexChanged(int index)
|
||||
void E131SettingsEntry::on_TypeComboBox_currentIndexChanged(int index)
|
||||
{
|
||||
if(index == 2)
|
||||
{
|
||||
@@ -88,7 +88,7 @@ void OpenRGBE131SettingsEntry::on_TypeComboBox_currentIndexChanged(int index)
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBE131SettingsEntry::loadFromSettings(const json& data)
|
||||
void E131SettingsEntry::loadFromSettings(const json& data)
|
||||
{
|
||||
if(data.contains("name"))
|
||||
{
|
||||
@@ -243,7 +243,7 @@ void OpenRGBE131SettingsEntry::loadFromSettings(const json& data)
|
||||
}
|
||||
}
|
||||
|
||||
json OpenRGBE131SettingsEntry::saveSettings()
|
||||
json E131SettingsEntry::saveSettings()
|
||||
{
|
||||
json result;
|
||||
/*-------------------------------------------------*\
|
||||
@@ -284,7 +284,19 @@ json OpenRGBE131SettingsEntry::saveSettings()
|
||||
return result;
|
||||
}
|
||||
|
||||
const char* OpenRGBE131SettingsEntry::settingsSection()
|
||||
bool E131SettingsEntry::isDataValid()
|
||||
{
|
||||
return "E131Devices";
|
||||
// stub
|
||||
return true;
|
||||
}
|
||||
|
||||
static BaseManualDeviceEntry* SpawnE131Entry(const json& data)
|
||||
{
|
||||
E131SettingsEntry* entry = new E131SettingsEntry;
|
||||
entry->loadFromSettings(data);
|
||||
return entry;
|
||||
}
|
||||
|
||||
static const char* E131DeviceName = QT_TRANSLATE_NOOP("ManualDevice", "E1.31 (including WLED)");
|
||||
|
||||
REGISTER_MANUAL_DEVICE_TYPE(E131DeviceName, "E131Devices", SpawnE131Entry);
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBE131SettingsEntry.h |
|
||||
| E131SettingsEntry.h |
|
||||
| |
|
||||
| User interface for OpenRGB E1.31 settings entry |
|
||||
| |
|
||||
@@ -13,28 +13,28 @@
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBE131SettingsEntry;
|
||||
class E131SettingsEntry;
|
||||
}
|
||||
|
||||
class OpenRGBE131SettingsEntry : public BaseManualDeviceEntry
|
||||
class E131SettingsEntry : public BaseManualDeviceEntry
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBE131SettingsEntry(QWidget *parent = nullptr);
|
||||
~OpenRGBE131SettingsEntry();
|
||||
explicit E131SettingsEntry(QWidget *parent = nullptr);
|
||||
~E131SettingsEntry();
|
||||
void loadFromSettings(const json& data);
|
||||
json saveSettings();
|
||||
const char* settingsSection();
|
||||
json saveSettings() override;
|
||||
bool isDataValid() override;
|
||||
|
||||
private:
|
||||
Ui::OpenRGBE131SettingsEntry *ui;
|
||||
Ui::E131SettingsEntry *ui;
|
||||
|
||||
private:
|
||||
void HideMatrixSettings();
|
||||
void ShowMatrixSettings();
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void changeEvent(QEvent *event) override;
|
||||
void on_TypeComboBox_currentIndexChanged(int index);
|
||||
};
|
||||
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBE131SettingsEntry</class>
|
||||
<widget class="QWidget" name="OpenRGBE131SettingsEntry">
|
||||
<class>E131SettingsEntry</class>
|
||||
<widget class="QWidget" name="E131SettingsEntry">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>531</width>
|
||||
<height>237</height>
|
||||
<height>256</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -23,7 +23,7 @@
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string/>
|
||||
<string>E1.31 Device</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="2" column="5">
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBElgatoKeyLightSettingsEntry.cpp |
|
||||
| ElgatoKeyLightSettingsEntry.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB Elgato Key Light entry |
|
||||
| |
|
||||
@@ -7,23 +7,23 @@
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBElgatoKeyLightSettingsEntry.h"
|
||||
#include "ui_OpenRGBElgatoKeyLightSettingsEntry.h"
|
||||
#include "ElgatoKeyLightSettingsEntry.h"
|
||||
#include "ui_ElgatoKeyLightSettingsEntry.h"
|
||||
|
||||
OpenRGBElgatoKeyLightSettingsEntry::OpenRGBElgatoKeyLightSettingsEntry(QWidget *parent) :
|
||||
ElgatoKeyLightSettingsEntry::ElgatoKeyLightSettingsEntry(QWidget *parent) :
|
||||
BaseManualDeviceEntry(parent),
|
||||
ui(new Ui::OpenRGBElgatoKeyLightSettingsEntry)
|
||||
ui(new Ui::ElgatoKeyLightSettingsEntry)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
}
|
||||
|
||||
OpenRGBElgatoKeyLightSettingsEntry::~OpenRGBElgatoKeyLightSettingsEntry()
|
||||
ElgatoKeyLightSettingsEntry::~ElgatoKeyLightSettingsEntry()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBElgatoKeyLightSettingsEntry::changeEvent(QEvent *event)
|
||||
void ElgatoKeyLightSettingsEntry::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
@@ -31,7 +31,7 @@ void OpenRGBElgatoKeyLightSettingsEntry::changeEvent(QEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBElgatoKeyLightSettingsEntry::loadFromSettings(const json& data)
|
||||
void ElgatoKeyLightSettingsEntry::loadFromSettings(const json& data)
|
||||
{
|
||||
if(data.contains("ip"))
|
||||
{
|
||||
@@ -39,14 +39,24 @@ void OpenRGBElgatoKeyLightSettingsEntry::loadFromSettings(const json& data)
|
||||
}
|
||||
}
|
||||
|
||||
json OpenRGBElgatoKeyLightSettingsEntry::saveSettings()
|
||||
json ElgatoKeyLightSettingsEntry::saveSettings()
|
||||
{
|
||||
json result;
|
||||
result["ip"] = ui->IPEdit->text().toStdString();
|
||||
return result;
|
||||
}
|
||||
|
||||
const char* OpenRGBElgatoKeyLightSettingsEntry::settingsSection()
|
||||
bool ElgatoKeyLightSettingsEntry::isDataValid()
|
||||
{
|
||||
return "ElgatoKeyLightDevices";
|
||||
// stub
|
||||
return true;
|
||||
}
|
||||
|
||||
static BaseManualDeviceEntry* SpawnElgatoKeyLightEntry(const json& data)
|
||||
{
|
||||
ElgatoKeyLightSettingsEntry* entry = new ElgatoKeyLightSettingsEntry;
|
||||
entry->loadFromSettings(data);
|
||||
return entry;
|
||||
}
|
||||
|
||||
REGISTER_MANUAL_DEVICE_TYPE("Elgato Key Light", "ElgatoKeyLightDevices", SpawnElgatoKeyLightEntry);
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBElgatoKeyLightSettingsEntry.h |
|
||||
| ElgatoKeyLightSettingsEntry.h |
|
||||
| |
|
||||
| User interface for OpenRGB Elgato Key Light entry |
|
||||
| |
|
||||
@@ -13,23 +13,23 @@
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBElgatoKeyLightSettingsEntry;
|
||||
class ElgatoKeyLightSettingsEntry;
|
||||
}
|
||||
|
||||
class OpenRGBElgatoKeyLightSettingsEntry : public BaseManualDeviceEntry
|
||||
class ElgatoKeyLightSettingsEntry : public BaseManualDeviceEntry
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBElgatoKeyLightSettingsEntry(QWidget *parent = nullptr);
|
||||
~OpenRGBElgatoKeyLightSettingsEntry();
|
||||
explicit ElgatoKeyLightSettingsEntry(QWidget *parent = nullptr);
|
||||
~ElgatoKeyLightSettingsEntry();
|
||||
void loadFromSettings(const json& data);
|
||||
json saveSettings();
|
||||
const char* settingsSection();
|
||||
json saveSettings() override;
|
||||
bool isDataValid() override;
|
||||
|
||||
private:
|
||||
Ui::OpenRGBElgatoKeyLightSettingsEntry *ui;
|
||||
Ui::ElgatoKeyLightSettingsEntry *ui;
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void changeEvent(QEvent *event) override;
|
||||
};
|
||||
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBElgatoKeyLightSettingsEntry</class>
|
||||
<widget class="QWidget" name="OpenRGBElgatoKeyLightSettingsEntry">
|
||||
<class>ElgatoKeyLightSettingsEntry</class>
|
||||
<widget class="QWidget" name="ElgatoKeyLightSettingsEntry">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>225</width>
|
||||
<height>85</height>
|
||||
<height>108</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -17,7 +17,7 @@
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string/>
|
||||
<string>Elgato Key Light</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="1" column="0" rowspan="2" colspan="2">
|
||||
@@ -0,0 +1,63 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| ElgatoLightStripSettingsEntry.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB Elgato Light Strips entry |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "ElgatoLightStripSettingsEntry.h"
|
||||
#include "ui_ElgatoLightStripSettingsEntry.h"
|
||||
|
||||
ElgatoLightStripSettingsEntry::ElgatoLightStripSettingsEntry(QWidget *parent) :
|
||||
BaseManualDeviceEntry(parent),
|
||||
ui(new Ui::ElgatoLightStripSettingsEntry)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
}
|
||||
|
||||
ElgatoLightStripSettingsEntry::~ElgatoLightStripSettingsEntry()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ElgatoLightStripSettingsEntry::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
}
|
||||
|
||||
void ElgatoLightStripSettingsEntry::loadFromSettings(const json& data)
|
||||
{
|
||||
if(data.contains("ip"))
|
||||
{
|
||||
ui->IPEdit->setText(QString::fromStdString(data["ip"]));
|
||||
}
|
||||
}
|
||||
|
||||
json ElgatoLightStripSettingsEntry::saveSettings()
|
||||
{
|
||||
json result;
|
||||
result["ip"] = ui->IPEdit->text().toStdString();
|
||||
return result;
|
||||
}
|
||||
|
||||
bool ElgatoLightStripSettingsEntry::isDataValid()
|
||||
{
|
||||
// stub
|
||||
return true;
|
||||
}
|
||||
|
||||
static BaseManualDeviceEntry* SpawnElgatoLightStripEntry(const json& data)
|
||||
{
|
||||
ElgatoLightStripSettingsEntry* entry = new ElgatoLightStripSettingsEntry;
|
||||
entry->loadFromSettings(data);
|
||||
return entry;
|
||||
}
|
||||
|
||||
REGISTER_MANUAL_DEVICE_TYPE("Elgato Light Strip", "ElgatoLightStripDevices", SpawnElgatoLightStripEntry);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBElgatoLightStripSettingsEntry.h |
|
||||
| ElgatoLightStripSettingsEntry.h |
|
||||
| |
|
||||
| User interface for OpenRGB Elgato Light Strips entry |
|
||||
| |
|
||||
@@ -13,23 +13,23 @@
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBElgatoLightStripSettingsEntry;
|
||||
class ElgatoLightStripSettingsEntry;
|
||||
}
|
||||
|
||||
class OpenRGBElgatoLightStripSettingsEntry : public BaseManualDeviceEntry
|
||||
class ElgatoLightStripSettingsEntry : public BaseManualDeviceEntry
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBElgatoLightStripSettingsEntry(QWidget *parent = nullptr);
|
||||
~OpenRGBElgatoLightStripSettingsEntry();
|
||||
explicit ElgatoLightStripSettingsEntry(QWidget *parent = nullptr);
|
||||
~ElgatoLightStripSettingsEntry();
|
||||
void loadFromSettings(const json& data);
|
||||
json saveSettings();
|
||||
const char* settingsSection();
|
||||
json saveSettings() override;
|
||||
bool isDataValid() override;
|
||||
|
||||
private:
|
||||
Ui::OpenRGBElgatoLightStripSettingsEntry *ui;
|
||||
Ui::ElgatoLightStripSettingsEntry *ui;
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void changeEvent(QEvent *event) override;
|
||||
};
|
||||
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBElgatoLightStripSettingsEntry</class>
|
||||
<widget class="QWidget" name="OpenRGBElgatoLightStripSettingsEntry">
|
||||
<class>ElgatoLightStripSettingsEntry</class>
|
||||
<widget class="QWidget" name="ElgatoLightStripSettingsEntry">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>225</width>
|
||||
<height>85</height>
|
||||
<height>108</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -17,7 +17,7 @@
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string/>
|
||||
<string>Elgato Light Strip</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="1" column="0" rowspan="2" colspan="2">
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBGoveeSettingsEntry.cpp |
|
||||
| GoveeSettingsEntry.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB Govee settings entry |
|
||||
| |
|
||||
@@ -9,22 +9,22 @@
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBGoveeSettingsEntry.h"
|
||||
#include "ui_OpenRGBGoveeSettingsEntry.h"
|
||||
#include "GoveeSettingsEntry.h"
|
||||
#include "ui_GoveeSettingsEntry.h"
|
||||
|
||||
OpenRGBGoveeSettingsEntry::OpenRGBGoveeSettingsEntry(QWidget *parent) :
|
||||
GoveeSettingsEntry::GoveeSettingsEntry(QWidget *parent) :
|
||||
BaseManualDeviceEntry(parent),
|
||||
ui(new Ui::OpenRGBGoveeSettingsEntry)
|
||||
ui(new Ui::GoveeSettingsEntry)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
OpenRGBGoveeSettingsEntry::~OpenRGBGoveeSettingsEntry()
|
||||
GoveeSettingsEntry::~GoveeSettingsEntry()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBGoveeSettingsEntry::changeEvent(QEvent *event)
|
||||
void GoveeSettingsEntry::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
@@ -32,7 +32,7 @@ void OpenRGBGoveeSettingsEntry::changeEvent(QEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBGoveeSettingsEntry::loadFromSettings(const json& data)
|
||||
void GoveeSettingsEntry::loadFromSettings(const json& data)
|
||||
{
|
||||
if(data.contains("ip"))
|
||||
{
|
||||
@@ -40,14 +40,24 @@ void OpenRGBGoveeSettingsEntry::loadFromSettings(const json& data)
|
||||
}
|
||||
}
|
||||
|
||||
json OpenRGBGoveeSettingsEntry::saveSettings()
|
||||
json GoveeSettingsEntry::saveSettings()
|
||||
{
|
||||
json result;
|
||||
result["ip"] = ui->IPEdit->text().toStdString();
|
||||
return result;
|
||||
}
|
||||
|
||||
const char* OpenRGBGoveeSettingsEntry::settingsSection()
|
||||
bool GoveeSettingsEntry::isDataValid()
|
||||
{
|
||||
return "GoveeDevices";
|
||||
// stub
|
||||
return true;
|
||||
}
|
||||
|
||||
static BaseManualDeviceEntry* SpawnGoveeSettingsEntry(const json& data)
|
||||
{
|
||||
GoveeSettingsEntry* entry = new GoveeSettingsEntry;
|
||||
entry->loadFromSettings(data);
|
||||
return entry;
|
||||
}
|
||||
|
||||
REGISTER_MANUAL_DEVICE_TYPE("Govee", "GoveeDevices", SpawnGoveeSettingsEntry);
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBGoveeSettingsEntry.h |
|
||||
| GoveeSettingsEntry.h |
|
||||
| |
|
||||
| User interface for OpenRGB Govee settings entry |
|
||||
| |
|
||||
@@ -15,23 +15,23 @@
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBGoveeSettingsEntry;
|
||||
class GoveeSettingsEntry;
|
||||
}
|
||||
|
||||
class OpenRGBGoveeSettingsEntry : public BaseManualDeviceEntry
|
||||
class GoveeSettingsEntry : public BaseManualDeviceEntry
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBGoveeSettingsEntry(QWidget *parent = nullptr);
|
||||
~OpenRGBGoveeSettingsEntry();
|
||||
explicit GoveeSettingsEntry(QWidget *parent = nullptr);
|
||||
~GoveeSettingsEntry();
|
||||
void loadFromSettings(const json& data);
|
||||
json saveSettings();
|
||||
const char* settingsSection();
|
||||
json saveSettings() override;
|
||||
bool isDataValid() override;
|
||||
|
||||
private:
|
||||
Ui::OpenRGBGoveeSettingsEntry *ui;
|
||||
Ui::GoveeSettingsEntry *ui;
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void changeEvent(QEvent *event) override;
|
||||
};
|
||||
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBGoveeSettingsEntry</class>
|
||||
<widget class="QWidget" name="OpenRGBGoveeSettingsEntry">
|
||||
<class>GoveeSettingsEntry</class>
|
||||
<widget class="QWidget" name="GoveeSettingsEntry">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>328</width>
|
||||
<height>72</height>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -23,7 +23,7 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string/>
|
||||
<string>Govee Device</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBKasaSmartSettingsEntry.cpp |
|
||||
| KasaSmartSettingsEntry.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB Kasa Smart settings entry |
|
||||
| |
|
||||
@@ -7,22 +7,22 @@
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBKasaSmartSettingsEntry.h"
|
||||
#include "ui_OpenRGBKasaSmartSettingsEntry.h"
|
||||
#include "KasaSmartSettingsEntry.h"
|
||||
#include "ui_KasaSmartSettingsEntry.h"
|
||||
|
||||
OpenRGBKasaSmartSettingsEntry::OpenRGBKasaSmartSettingsEntry(QWidget *parent) :
|
||||
KasaSmartSettingsEntry::KasaSmartSettingsEntry(QWidget *parent) :
|
||||
BaseManualDeviceEntry(parent),
|
||||
ui(new Ui::OpenRGBKasaSmartSettingsEntry)
|
||||
ui(new Ui::KasaSmartSettingsEntry)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
OpenRGBKasaSmartSettingsEntry::~OpenRGBKasaSmartSettingsEntry()
|
||||
KasaSmartSettingsEntry::~KasaSmartSettingsEntry()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBKasaSmartSettingsEntry::changeEvent(QEvent *event)
|
||||
void KasaSmartSettingsEntry::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
@@ -30,7 +30,7 @@ void OpenRGBKasaSmartSettingsEntry::changeEvent(QEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBKasaSmartSettingsEntry::loadFromSettings(const json& data)
|
||||
void KasaSmartSettingsEntry::loadFromSettings(const json& data)
|
||||
{
|
||||
if(data.contains("ip"))
|
||||
{
|
||||
@@ -42,7 +42,7 @@ void OpenRGBKasaSmartSettingsEntry::loadFromSettings(const json& data)
|
||||
}
|
||||
}
|
||||
|
||||
json OpenRGBKasaSmartSettingsEntry::saveSettings()
|
||||
json KasaSmartSettingsEntry::saveSettings()
|
||||
{
|
||||
json result;
|
||||
result["ip"] = ui->IPEdit->text().toStdString();
|
||||
@@ -50,12 +50,22 @@ json OpenRGBKasaSmartSettingsEntry::saveSettings()
|
||||
return result;
|
||||
}
|
||||
|
||||
const char* OpenRGBKasaSmartSettingsEntry::settingsSection()
|
||||
{
|
||||
return "KasaSmartDevices";
|
||||
}
|
||||
|
||||
void OpenRGBKasaSmartSettingsEntry::setName(QString name)
|
||||
void KasaSmartSettingsEntry::setName(QString name)
|
||||
{
|
||||
ui->NameEdit->setText(name);
|
||||
}
|
||||
|
||||
bool KasaSmartSettingsEntry::isDataValid()
|
||||
{
|
||||
// stub
|
||||
return true;
|
||||
}
|
||||
|
||||
static BaseManualDeviceEntry* SpawnKasaSmartSettingsEntry(const json& data)
|
||||
{
|
||||
KasaSmartSettingsEntry* entry = new KasaSmartSettingsEntry;
|
||||
entry->loadFromSettings(data);
|
||||
return entry;
|
||||
}
|
||||
|
||||
REGISTER_MANUAL_DEVICE_TYPE("Kasa Smart", "KasaSmartDevices", SpawnKasaSmartSettingsEntry);
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBKasaSmartSettingsEntry.h |
|
||||
| KasaSmartSettingsEntry.h |
|
||||
| |
|
||||
| User interface for OpenRGB Kasa Smart settings entry |
|
||||
| |
|
||||
@@ -13,24 +13,25 @@
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBKasaSmartSettingsEntry;
|
||||
class KasaSmartSettingsEntry;
|
||||
}
|
||||
|
||||
class OpenRGBKasaSmartSettingsEntry : public BaseManualDeviceEntry
|
||||
class KasaSmartSettingsEntry : public BaseManualDeviceEntry
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBKasaSmartSettingsEntry(QWidget *parent = nullptr);
|
||||
~OpenRGBKasaSmartSettingsEntry();
|
||||
explicit KasaSmartSettingsEntry(QWidget *parent = nullptr);
|
||||
~KasaSmartSettingsEntry();
|
||||
void loadFromSettings(const json& data);
|
||||
json saveSettings();
|
||||
const char* settingsSection();
|
||||
void setName(QString name);
|
||||
|
||||
json saveSettings() override;
|
||||
bool isDataValid() override;
|
||||
|
||||
private:
|
||||
Ui::OpenRGBKasaSmartSettingsEntry *ui;
|
||||
Ui::KasaSmartSettingsEntry *ui;
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void changeEvent(QEvent *event) override;
|
||||
};
|
||||
@@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBKasaSmartSettingsEntry</class>
|
||||
<widget class="QWidget" name="OpenRGBKasaSmartSettingsEntry">
|
||||
<class>KasaSmartSettingsEntry</class>
|
||||
<widget class="QWidget" name="KasaSmartSettingsEntry">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>190</width>
|
||||
<width>216</width>
|
||||
<height>89</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -23,7 +23,7 @@
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string/>
|
||||
<string>Kasa Smart Device</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="1" column="5">
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBLIFXSettingsEntry.cpp |
|
||||
| LIFXSettingsEntry.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB LIFX settings entry |
|
||||
| |
|
||||
@@ -7,22 +7,22 @@
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBLIFXSettingsEntry.h"
|
||||
#include "ui_OpenRGBLIFXSettingsEntry.h"
|
||||
#include "LIFXSettingsEntry.h"
|
||||
#include "ui_LIFXSettingsEntry.h"
|
||||
|
||||
OpenRGBLIFXSettingsEntry::OpenRGBLIFXSettingsEntry(QWidget *parent) :
|
||||
LIFXSettingsEntry::LIFXSettingsEntry(QWidget *parent) :
|
||||
BaseManualDeviceEntry(parent),
|
||||
ui(new Ui::OpenRGBLIFXSettingsEntry)
|
||||
ui(new Ui::LIFXSettingsEntry)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
OpenRGBLIFXSettingsEntry::~OpenRGBLIFXSettingsEntry()
|
||||
LIFXSettingsEntry::~LIFXSettingsEntry()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBLIFXSettingsEntry::changeEvent(QEvent *event)
|
||||
void LIFXSettingsEntry::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
@@ -30,7 +30,7 @@ void OpenRGBLIFXSettingsEntry::changeEvent(QEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBLIFXSettingsEntry::loadFromSettings(const json& data)
|
||||
void LIFXSettingsEntry::loadFromSettings(const json& data)
|
||||
{
|
||||
if(data.contains("ip"))
|
||||
{
|
||||
@@ -42,7 +42,7 @@ void OpenRGBLIFXSettingsEntry::loadFromSettings(const json& data)
|
||||
}
|
||||
}
|
||||
|
||||
json OpenRGBLIFXSettingsEntry::saveSettings()
|
||||
json LIFXSettingsEntry::saveSettings()
|
||||
{
|
||||
json result;
|
||||
result["ip"] = ui->IPEdit->text().toStdString();
|
||||
@@ -50,12 +50,22 @@ json OpenRGBLIFXSettingsEntry::saveSettings()
|
||||
return result;
|
||||
}
|
||||
|
||||
const char* OpenRGBLIFXSettingsEntry::settingsSection()
|
||||
{
|
||||
return "LIFXDevices";
|
||||
}
|
||||
|
||||
void OpenRGBLIFXSettingsEntry::setName(QString name)
|
||||
void LIFXSettingsEntry::setName(QString name)
|
||||
{
|
||||
ui->NameEdit->setText(name);
|
||||
}
|
||||
|
||||
bool LIFXSettingsEntry::isDataValid()
|
||||
{
|
||||
// stub
|
||||
return true;
|
||||
}
|
||||
|
||||
static BaseManualDeviceEntry* SpawnLIFXSettingsEntry(const json& data)
|
||||
{
|
||||
LIFXSettingsEntry* entry = new LIFXSettingsEntry;
|
||||
entry->loadFromSettings(data);
|
||||
return entry;
|
||||
}
|
||||
|
||||
REGISTER_MANUAL_DEVICE_TYPE("LIFX", "LIFXDevices", SpawnLIFXSettingsEntry);
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBLIFXSettingsEntry.h |
|
||||
| LIFXSettingsEntry.h |
|
||||
| |
|
||||
| User interface for OpenRGB LIFX settings entry |
|
||||
| |
|
||||
@@ -11,24 +11,25 @@
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBLIFXSettingsEntry;
|
||||
class LIFXSettingsEntry;
|
||||
}
|
||||
|
||||
class OpenRGBLIFXSettingsEntry : public BaseManualDeviceEntry
|
||||
class LIFXSettingsEntry : public BaseManualDeviceEntry
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBLIFXSettingsEntry(QWidget *parent = nullptr);
|
||||
~OpenRGBLIFXSettingsEntry();
|
||||
explicit LIFXSettingsEntry(QWidget *parent = nullptr);
|
||||
~LIFXSettingsEntry();
|
||||
void loadFromSettings(const json& data);
|
||||
json saveSettings();
|
||||
const char* settingsSection();
|
||||
void setName(QString name);
|
||||
|
||||
json saveSettings() override;
|
||||
bool isDataValid() override;
|
||||
|
||||
private:
|
||||
Ui::OpenRGBLIFXSettingsEntry *ui;
|
||||
Ui::LIFXSettingsEntry *ui;
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void changeEvent(QEvent *event) override;
|
||||
};
|
||||
@@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBLIFXSettingsEntry</class>
|
||||
<widget class="QWidget" name="OpenRGBLIFXSettingsEntry">
|
||||
<class>LIFXSettingsEntry</class>
|
||||
<widget class="QWidget" name="LIFXSettingsEntry">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>190</width>
|
||||
<width>216</width>
|
||||
<height>89</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -23,7 +23,7 @@
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string/>
|
||||
<string>LIFX Device</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="1" column="5">
|
||||
330
qt/ManualDevicesSettingsPage/ManualDevicesSettingsPage.cpp
Normal file
330
qt/ManualDevicesSettingsPage/ManualDevicesSettingsPage.cpp
Normal file
@@ -0,0 +1,330 @@
|
||||
/*-----------------------------------------------------------------*\
|
||||
| ManualDevicesSettingsPage.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB Manually Added Devices settings page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*-----------------------------------------------------------------*/
|
||||
|
||||
#include "ManualDevicesSettingsPage.h"
|
||||
#include "ui_ManualDevicesSettingsPage.h"
|
||||
|
||||
#include "NanoleafSettingsEntry.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "SettingsManager.h"
|
||||
|
||||
#include <QLineEdit>
|
||||
|
||||
static void ManualDevicesPageReloadCallback(void* this_ptr)
|
||||
{
|
||||
ManualDevicesSettingsPage * this_obj = (ManualDevicesSettingsPage *)this_ptr;
|
||||
|
||||
QMetaObject::invokeMethod(this_obj, "reloadList", Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
ManualDevicesSettingsPage::ManualDevicesSettingsPage(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::ManualDevicesSettingsPage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ResourceManager::get()->RegisterDetectionEndCallback(&ManualDevicesPageReloadCallback, this);
|
||||
|
||||
addDeviceMenu = new QMenu(this);
|
||||
ui->addDeviceButton->setMenu(addDeviceMenu);
|
||||
connect(addDeviceMenu, &QMenu::triggered, this, &ManualDevicesSettingsPage::onAddDeviceItemSelected);
|
||||
|
||||
QMenu* saveButtonMenu = new QMenu(this);
|
||||
saveButtonMenu->addAction(ui->ActionSaveAndRescan);
|
||||
saveButtonMenu->addAction(ui->ActionSaveNoRescan);
|
||||
ui->saveConfigurationButton->setMenu(saveButtonMenu);
|
||||
ui->saveConfigurationButton->setDefaultAction(ui->ActionSaveAndRescan);
|
||||
|
||||
reloadList();
|
||||
}
|
||||
|
||||
ManualDevicesSettingsPage::~ManualDevicesSettingsPage()
|
||||
{
|
||||
ResourceManager::get()->UnregisterDetectionEndCallback(&ManualDevicesPageReloadCallback, this);
|
||||
clearList();
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ManualDevicesSettingsPage::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
reloadMenu();
|
||||
}
|
||||
}
|
||||
|
||||
void ManualDevicesSettingsPage::on_removeDeviceButton_clicked()
|
||||
{
|
||||
int cur_row = ui->deviceList->currentRow();
|
||||
|
||||
if(cur_row < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QListWidgetItem* item = ui->deviceList->takeItem(cur_row);
|
||||
|
||||
ui->deviceList->removeItemWidget(item);
|
||||
delete item;
|
||||
|
||||
BaseManualDeviceEntry* entry = entries[cur_row];
|
||||
entries.erase(entries.begin() + cur_row);
|
||||
delete entry;
|
||||
|
||||
setUnsavedChanges(true);
|
||||
}
|
||||
|
||||
void ManualDevicesSettingsPage::saveSettings()
|
||||
{
|
||||
SettingsManager* sm = ResourceManager::get()->GetSettingsManager();
|
||||
|
||||
json result;
|
||||
|
||||
/*-----------------------------------------------------------------------------*\
|
||||
| First, cache the data that will be stored as JSON |
|
||||
| We wrap data into arrays by type (except Nanoleaf) |
|
||||
| Nanoleaf stores it's data as an object with "location" as key for some reason |
|
||||
\*-----------------------------------------------------------------------------*/
|
||||
for(size_t idx = 0; idx < entries.size(); ++idx)
|
||||
{
|
||||
std::string section = entries[idx]->getSettingsSection();
|
||||
if(section == "NanoleafDevices")
|
||||
{
|
||||
NanoleafSettingsEntry* entry = dynamic_cast<NanoleafSettingsEntry*>(entries[idx]);
|
||||
result[section]["devices"][entry->getLocation()] = entries[idx]->saveSettings();
|
||||
}
|
||||
else if(section == "PhilipsHueDevices")
|
||||
{
|
||||
result[section]["bridges"].push_back(entries[idx]->saveSettings());
|
||||
}
|
||||
else
|
||||
{
|
||||
result[section]["devices"].push_back(entries[idx]->saveSettings());
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Transfer data from the cached object into config sections |
|
||||
| Use ALL possible settings entry names, so that those with |
|
||||
| all entries deleted are cleared properly |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
std::vector<ManualDeviceTypeBlock> blocks = ManualDevicesTypeManager::get()->getRegisteredTypes();
|
||||
for(int i = 0; i < blocks.size(); ++i)
|
||||
{
|
||||
sm->SetSettings(blocks[i].settingsSection, result[blocks[i].settingsSection]);
|
||||
}
|
||||
sm->SaveSettings();
|
||||
|
||||
setUnsavedChanges(false);
|
||||
}
|
||||
|
||||
void ManualDevicesSettingsPage::reloadMenu()
|
||||
{
|
||||
std::vector<std::string> names = ManualDevicesTypeManager::get()->getRegisteredTypeNames();
|
||||
|
||||
addDeviceMenu->clear();
|
||||
for(int i = 0; i < names.size(); ++i)
|
||||
{
|
||||
QAction* action = addDeviceMenu->addAction(qApp->translate("ManualDevice", names[i].c_str()));
|
||||
action->setData(QString::fromStdString(names[i]));
|
||||
}
|
||||
}
|
||||
|
||||
void ManualDevicesSettingsPage::reloadList()
|
||||
{
|
||||
clearList();
|
||||
addDeviceMenu->clear();
|
||||
|
||||
std::vector<ManualDeviceTypeBlock> blocks = ManualDevicesTypeManager::get()->getRegisteredTypes();
|
||||
for(int i = 0; i < blocks.size(); ++i)
|
||||
{
|
||||
addEntries(blocks[i]);
|
||||
|
||||
/*------------------------------------------------------------*\
|
||||
| While we have all the data at hand, load in the menu as well |
|
||||
\*------------------------------------------------------------*/
|
||||
QAction* action = addDeviceMenu->addAction(qApp->translate("ManualDevice", blocks[i].name.c_str()));
|
||||
action->setData(QString::fromStdString(blocks[i].name));
|
||||
}
|
||||
|
||||
/*--------------------*\
|
||||
| Refresh button state |
|
||||
\*--------------------*/
|
||||
setUnsavedChanges(false);
|
||||
on_deviceList_itemSelectionChanged();
|
||||
}
|
||||
|
||||
void ManualDevicesSettingsPage::onTextEditChanged()
|
||||
{
|
||||
setUnsavedChanges(true);
|
||||
}
|
||||
|
||||
void ManualDevicesSettingsPage::clearList()
|
||||
{
|
||||
std::vector<BaseManualDeviceEntry*> entries_copy;
|
||||
entries_copy.swap(entries);
|
||||
ui->deviceList->clear();
|
||||
|
||||
for(int i = 0; i < entries_copy.size(); ++i)
|
||||
{
|
||||
delete entries_copy[i];
|
||||
}
|
||||
entries_copy.clear();
|
||||
setUnsavedChanges(true);
|
||||
}
|
||||
|
||||
void ManualDevicesSettingsPage::setUnsavedChanges(bool v)
|
||||
{
|
||||
unsavedChanges = v;
|
||||
ui->saveConfigurationButton->setEnabled(v && checkValidToSave());
|
||||
if(v)
|
||||
{
|
||||
ui->saveConfigurationButton->setStyleSheet("font: bold");
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->saveConfigurationButton->setStyleSheet("");
|
||||
}
|
||||
}
|
||||
|
||||
bool ManualDevicesSettingsPage::checkValidToSave()
|
||||
{
|
||||
for(int i = 0; i < entries.size(); ++i)
|
||||
{
|
||||
if(!entries[i]->isDataValid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
QListWidgetItem* ManualDevicesSettingsPage::addEntry(BaseManualDeviceEntry* entry)
|
||||
{
|
||||
if(!entry)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Find EVERY QLineEdit in the entry and get notified if ANY |
|
||||
| text in them changes - for validation |
|
||||
| Validation mostly affects the "Save" button state |
|
||||
\*---------------------------------------------------------*/
|
||||
QList<QLineEdit*> textEditList = entry->findChildren<QLineEdit*>(QString(), Qt::FindChildrenRecursively);
|
||||
for(int i = 0; i < textEditList.size(); ++i)
|
||||
{
|
||||
connect(textEditList[i], &QLineEdit::textChanged, this, &ManualDevicesSettingsPage::onTextEditChanged);
|
||||
}
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->deviceList->addItem(item);
|
||||
ui->deviceList->setItemWidget(item, entry);
|
||||
ui->deviceList->show();
|
||||
|
||||
entries.push_back(entry);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| New entries generally indicate unsaved changes |
|
||||
\*---------------------------------------------------------*/
|
||||
setUnsavedChanges(true);
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
void ManualDevicesSettingsPage::addEntries(const ManualDeviceTypeBlock& block)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Spawn list entries for all config entries of one type |
|
||||
\*---------------------------------------------------------*/
|
||||
json settings = ResourceManager::get()->GetSettingsManager()->GetSettings(block.settingsSection);
|
||||
const char* array_name = "devices";
|
||||
if(block.settingsSection == "PhilipsHueDevices")
|
||||
{
|
||||
array_name = "bridges";
|
||||
}
|
||||
|
||||
if(settings.contains(array_name))
|
||||
{
|
||||
json& array_ref = settings[array_name];
|
||||
|
||||
if(!array_ref.is_array() && !array_ref.is_object())
|
||||
{
|
||||
return;
|
||||
}
|
||||
/*-----------------------------------------------------------------*\
|
||||
| Nanoleaf stores it's data as objects with location field as "key" |
|
||||
| everything else is arrays |
|
||||
| For uniformity, use iterators, as if it's always an object |
|
||||
\*-----------------------------------------------------------------*/
|
||||
for(json::const_iterator iter = array_ref.begin(); iter != array_ref.end(); ++iter)
|
||||
{
|
||||
if(!iter.value().empty())
|
||||
{
|
||||
BaseManualDeviceEntry* entry = block.spawn(iter.value());
|
||||
|
||||
/*---------------------------------------------------*\
|
||||
| Note: spawn functions are allowed to return nullptr |
|
||||
\*---------------------------------------------------*/
|
||||
if(entry)
|
||||
{
|
||||
addEntry(entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ManualDevicesSettingsPage::onAddDeviceItemSelected(QAction* action)
|
||||
{
|
||||
std::string entryName = action->data().toString().toStdString();
|
||||
BaseManualDeviceEntry* entry = ManualDevicesTypeManager::get()->spawnByTypeName(entryName, json());
|
||||
/*---------------------------------------------------*\
|
||||
| Note: spawn functions are allowed to return nullptr |
|
||||
\*---------------------------------------------------*/
|
||||
if(entry)
|
||||
{
|
||||
QListWidgetItem* item = addEntry(entry);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Scroll to the newly added entry (last one in the list |
|
||||
\*-----------------------------------------------------*/
|
||||
if(item)
|
||||
{
|
||||
ui->deviceList->scrollToItem(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ManualDevicesSettingsPage::on_deviceList_itemSelectionChanged()
|
||||
{
|
||||
int cur_row = ui->deviceList->currentRow();
|
||||
|
||||
bool anySelected = (cur_row >= 0);
|
||||
ui->removeDeviceButton->setEnabled(anySelected);
|
||||
}
|
||||
|
||||
void ManualDevicesSettingsPage::on_ActionSaveNoRescan_triggered()
|
||||
{
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
void ManualDevicesSettingsPage::on_ActionSaveAndRescan_triggered()
|
||||
{
|
||||
saveSettings();
|
||||
/*---------------*\
|
||||
| Trigger rescan |
|
||||
\*--------------*/
|
||||
ResourceManager::get()->DetectDevices();
|
||||
}
|
||||
|
||||
61
qt/ManualDevicesSettingsPage/ManualDevicesSettingsPage.h
Normal file
61
qt/ManualDevicesSettingsPage/ManualDevicesSettingsPage.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/*-----------------------------------------------------------------*\
|
||||
| ManualDevicesSettingsPage.h |
|
||||
| |
|
||||
| User interface for OpenRGB Manually Added Devices settings page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*-----------------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BaseManualDeviceEntry.h"
|
||||
#include "ManualDevicesTypeManager.h"
|
||||
#include "nlohmann/json.hpp"
|
||||
#include <QWidget>
|
||||
#include <QMenu>
|
||||
#include <QListWidgetItem>
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class ManualDevicesSettingsPage;
|
||||
}
|
||||
|
||||
class ManualDevicesSettingsPage : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ManualDevicesSettingsPage(QWidget *parent = nullptr);
|
||||
~ManualDevicesSettingsPage();
|
||||
|
||||
public slots:
|
||||
void reloadList();
|
||||
void reloadMenu();
|
||||
|
||||
private slots:
|
||||
void onTextEditChanged(); // Slot connected to all text edits in all entries; for validation & marking dirty changes
|
||||
void onAddDeviceItemSelected(QAction* action);
|
||||
|
||||
void changeEvent(QEvent *event);
|
||||
|
||||
void on_removeDeviceButton_clicked();
|
||||
void on_deviceList_itemSelectionChanged();
|
||||
void on_ActionSaveNoRescan_triggered();
|
||||
void on_ActionSaveAndRescan_triggered();
|
||||
|
||||
private:
|
||||
Ui::ManualDevicesSettingsPage* ui;
|
||||
std::vector<BaseManualDeviceEntry*> entries;
|
||||
QMenu* addDeviceMenu;
|
||||
bool unsavedChanges;
|
||||
|
||||
QListWidgetItem* addEntry(BaseManualDeviceEntry* entry);
|
||||
void addEntries(const ManualDeviceTypeBlock&);
|
||||
void clearList();
|
||||
void saveSettings();
|
||||
void setUnsavedChanges(bool v);
|
||||
bool checkValidToSave();
|
||||
};
|
||||
72
qt/ManualDevicesSettingsPage/ManualDevicesSettingsPage.ui
Normal file
72
qt/ManualDevicesSettingsPage/ManualDevicesSettingsPage.ui
Normal file
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ManualDevicesSettingsPage</class>
|
||||
<widget class="QWidget" name="ManualDevicesSettingsPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Manually Added Devices Settings Page</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QListWidget" name="deviceList">
|
||||
<property name="verticalScrollMode">
|
||||
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="addDeviceButton">
|
||||
<property name="text">
|
||||
<string>Add Device...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="removeDeviceButton">
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="saveConfigurationButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save and Rescan</string>
|
||||
</property>
|
||||
<property name="popupMode">
|
||||
<enum>QToolButton::MenuButtonPopup</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
<action name="ActionSaveAndRescan">
|
||||
<property name="text">
|
||||
<string>Save and Rescan</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="ActionSaveNoRescan">
|
||||
<property name="text">
|
||||
<string>Save without Rescan</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
80
qt/ManualDevicesSettingsPage/ManualDevicesTypeManager.cpp
Normal file
80
qt/ManualDevicesSettingsPage/ManualDevicesTypeManager.cpp
Normal file
@@ -0,0 +1,80 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| ManualDevicesTypeManager.cpp |
|
||||
| |
|
||||
| OpenRGB Manual Devices Type Manager registers available |
|
||||
| types of Manually Added devices and generates UI |
|
||||
| elements for their settings |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "ManualDevicesTypeManager.h"
|
||||
|
||||
ManualDeviceTypeBlock::ManualDeviceTypeBlock(const std::string& _name, const std::string& _settingsSection, ManualDeviceEntrySpawnFunction _entrySpawnFunction)
|
||||
{
|
||||
name = _name;
|
||||
settingsSection = _settingsSection;
|
||||
entrySpawnFunction = _entrySpawnFunction;
|
||||
}
|
||||
|
||||
BaseManualDeviceEntry* ManualDeviceTypeBlock::spawn(const json& data) const
|
||||
{
|
||||
BaseManualDeviceEntry* result = entrySpawnFunction(data);
|
||||
if(result)
|
||||
{
|
||||
result->setSettingsSection(settingsSection);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
ManualDevicesTypeManager* ManualDevicesTypeManager::instance;
|
||||
|
||||
ManualDevicesTypeManager *ManualDevicesTypeManager::get()
|
||||
{
|
||||
if(!instance)
|
||||
{
|
||||
instance = new ManualDevicesTypeManager();
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
ManualDevicesTypeManager::ManualDevicesTypeManager()
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
void ManualDevicesTypeManager::registerType(const std::string& name, const std::string& settingsSection, ManualDeviceEntrySpawnFunction entrySpawnFunction)
|
||||
{
|
||||
types.push_back(ManualDeviceTypeBlock(name, settingsSection, entrySpawnFunction));
|
||||
}
|
||||
|
||||
std::vector<ManualDeviceTypeBlock> ManualDevicesTypeManager::getRegisteredTypes()
|
||||
{
|
||||
return types;
|
||||
}
|
||||
|
||||
std::vector<std::string> ManualDevicesTypeManager::getRegisteredTypeNames()
|
||||
{
|
||||
std::vector<std::string> result;
|
||||
result.resize(types.size());
|
||||
|
||||
for(int i = 0; i < types.size(); ++i)
|
||||
{
|
||||
result[i] = types[i].name;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
BaseManualDeviceEntry* ManualDevicesTypeManager::spawnByTypeName(const std::string& typeName, const json& data)
|
||||
{
|
||||
for(int i = 0; i < types.size(); ++i)
|
||||
{
|
||||
if(types[i].name == typeName)
|
||||
{
|
||||
return types[i].spawn(data);
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
50
qt/ManualDevicesSettingsPage/ManualDevicesTypeManager.h
Normal file
50
qt/ManualDevicesSettingsPage/ManualDevicesTypeManager.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| ManualDevicesTypeManager.h |
|
||||
| |
|
||||
| OpenRGB Manual Devices Type Manager registers UI |
|
||||
| classes for managing Manually Added devices |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BaseManualDeviceEntry.h"
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include "nlohmann/json.hpp"
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
|
||||
class ManualDeviceTypeBlock
|
||||
{
|
||||
public:
|
||||
ManualDeviceTypeBlock(const std::string& name, const std::string& settingsSection, ManualDeviceEntrySpawnFunction entrySpawnFunction);
|
||||
std::string name; // Name as listed in the drop-down list
|
||||
std::string settingsSection; // Settings Section name, as listed in Config file
|
||||
BaseManualDeviceEntry* spawn(const json &data) const;
|
||||
|
||||
private:
|
||||
ManualDeviceEntrySpawnFunction entrySpawnFunction;
|
||||
};
|
||||
|
||||
class ManualDevicesTypeManager
|
||||
{
|
||||
public:
|
||||
static ManualDevicesTypeManager* get();
|
||||
void registerType(const std::string& name, const std::string& settingsSection, ManualDeviceEntrySpawnFunction entrySpawnFunction);
|
||||
|
||||
std::vector<ManualDeviceTypeBlock> getRegisteredTypes();
|
||||
std::vector<std::string> getRegisteredTypeNames();
|
||||
BaseManualDeviceEntry* spawnByTypeName(const std::string& typeName, const json& data);
|
||||
|
||||
private:
|
||||
static ManualDevicesTypeManager* instance;
|
||||
std::vector<ManualDeviceTypeBlock> types;
|
||||
|
||||
ManualDevicesTypeManager();
|
||||
};
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBNanoleafNewDeviceDialog.cpp |
|
||||
| NanoleafNewDeviceDialog.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB Nanoleaf dialog |
|
||||
| |
|
||||
@@ -9,27 +9,27 @@
|
||||
|
||||
#include <QCloseEvent>
|
||||
#include "ResourceManager.h"
|
||||
#include "OpenRGBNanoleafNewDeviceDialog.h"
|
||||
#include "ui_OpenRGBNanoleafNewDeviceDialog.h"
|
||||
#include "NanoleafNewDeviceDialog.h"
|
||||
#include "ui_NanoleafNewDeviceDialog.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <QSettings>
|
||||
#endif
|
||||
|
||||
OpenRGBNanoleafNewDeviceDialog::OpenRGBNanoleafNewDeviceDialog(QWidget *parent) :
|
||||
QDialog(parent), ui(new Ui::OpenRGBNanoleafNewDeviceDialog)
|
||||
NanoleafNewDeviceDialog::NanoleafNewDeviceDialog(QWidget *parent) :
|
||||
QDialog(parent), ui(new Ui::NanoleafNewDeviceDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
ui->devicePortEdit->setText("16021");
|
||||
}
|
||||
|
||||
OpenRGBNanoleafNewDeviceDialog::~OpenRGBNanoleafNewDeviceDialog()
|
||||
NanoleafNewDeviceDialog::~NanoleafNewDeviceDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBNanoleafNewDeviceDialog::changeEvent(QEvent *event)
|
||||
void NanoleafNewDeviceDialog::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
@@ -37,7 +37,7 @@ void OpenRGBNanoleafNewDeviceDialog::changeEvent(QEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
NanoleafDevice OpenRGBNanoleafNewDeviceDialog::show()
|
||||
NanoleafDevice NanoleafNewDeviceDialog::show()
|
||||
{
|
||||
NanoleafDevice return_device;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBNanoleafNewDeviceDialog.h |
|
||||
| NanoleafNewDeviceDialog.h |
|
||||
| |
|
||||
| User interface for OpenRGB Nanoleaf dialog |
|
||||
| |
|
||||
@@ -8,7 +8,6 @@
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <QDialog>
|
||||
#include "OpenRGBDialog.h"
|
||||
|
||||
struct NanoleafDevice
|
||||
{
|
||||
@@ -18,21 +17,21 @@ struct NanoleafDevice
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBNanoleafNewDeviceDialog;
|
||||
class NanoleafNewDeviceDialog;
|
||||
}
|
||||
|
||||
class OpenRGBNanoleafNewDeviceDialog : public QDialog
|
||||
class NanoleafNewDeviceDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBNanoleafNewDeviceDialog(QWidget *parent = nullptr);
|
||||
~OpenRGBNanoleafNewDeviceDialog();
|
||||
explicit NanoleafNewDeviceDialog(QWidget *parent = nullptr);
|
||||
~NanoleafNewDeviceDialog();
|
||||
|
||||
NanoleafDevice show();
|
||||
|
||||
private:
|
||||
Ui::OpenRGBNanoleafNewDeviceDialog *ui;
|
||||
Ui::NanoleafNewDeviceDialog *ui;
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBNanoleafNewDeviceDialog</class>
|
||||
<widget class="QDialog" name="OpenRGBNanoleafNewDeviceDialog">
|
||||
<class>NanoleafNewDeviceDialog</class>
|
||||
<widget class="QDialog" name="NanoleafNewDeviceDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@@ -57,7 +57,7 @@
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>OpenRGBNanoleafNewDeviceDialog</receiver>
|
||||
<receiver>NanoleafNewDeviceDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
@@ -73,7 +73,7 @@
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>OpenRGBNanoleafNewDeviceDialog</receiver>
|
||||
<receiver>NanoleafNewDeviceDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
@@ -1,60 +1,36 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBNanoleafSettingsPage.cpp |
|
||||
| NanoleafScanDialog.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB Nanoleaf settings page |
|
||||
| User interface for Nanoleaf scan & pairing page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBNanoleafSettingsPage.h"
|
||||
#include "ui_OpenRGBNanoleafSettingsPage.h"
|
||||
#include "OpenRGBNanoleafNewDeviceDialog.h"
|
||||
#include "NanoleafScanDialog.h"
|
||||
#include "ui_NanoleafScanDialog.h"
|
||||
|
||||
#include "NanoleafNewDeviceDialog.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "SettingsManager.h"
|
||||
#include "LogManager.h"
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
OpenRGBNanoleafSettingsPage::OpenRGBNanoleafSettingsPage(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::OpenRGBNanoleafSettingsPage)
|
||||
NanoleafScanDialog::NanoleafScanDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::NanoleafScanDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
json nanoleaf_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("NanoleafDevices");
|
||||
|
||||
if(nanoleaf_settings.contains("devices"))
|
||||
{
|
||||
for(json::const_iterator it = nanoleaf_settings["devices"].begin(); it != nanoleaf_settings["devices"].end(); ++it)
|
||||
{
|
||||
const json& device = it.value();
|
||||
const std::string& location = it.key();
|
||||
|
||||
if(device.contains("ip") && device.contains("port"))
|
||||
{
|
||||
OpenRGBNanoleafSettingsEntry* entry = new OpenRGBNanoleafSettingsEntry(QString::fromStdString(device["ip"]), device["port"]);
|
||||
|
||||
entries[location] = entry;
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->NanoleafDeviceList->addItem(item);
|
||||
ui->NanoleafDeviceList->setItemWidget(item, entry);
|
||||
ui->NanoleafDeviceList->show();
|
||||
}
|
||||
}
|
||||
}
|
||||
on_NanoleafDeviceList_itemSelectionChanged(); // Refresh button state
|
||||
}
|
||||
|
||||
OpenRGBNanoleafSettingsPage::~OpenRGBNanoleafSettingsPage()
|
||||
NanoleafScanDialog::~NanoleafScanDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBNanoleafSettingsPage::changeEvent(QEvent *event)
|
||||
void NanoleafScanDialog::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
@@ -62,13 +38,13 @@ void OpenRGBNanoleafSettingsPage::changeEvent(QEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBNanoleafSettingsPage::on_AddNanoleafDeviceButton_clicked()
|
||||
void NanoleafScanDialog::on_AddNanoleafDeviceButton_clicked()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Open a popup to manually add a device by setting ip |
|
||||
| and port |
|
||||
\*-----------------------------------------------------*/
|
||||
OpenRGBNanoleafNewDeviceDialog dialog;
|
||||
NanoleafNewDeviceDialog dialog;
|
||||
NanoleafDevice device = dialog.show();
|
||||
if(!device.ip.empty())
|
||||
{
|
||||
@@ -77,7 +53,7 @@ void OpenRGBNanoleafSettingsPage::on_AddNanoleafDeviceButton_clicked()
|
||||
|
||||
if(entries.find(location) == entries.end())
|
||||
{
|
||||
OpenRGBNanoleafSettingsEntry* entry = new OpenRGBNanoleafSettingsEntry(QString::fromUtf8(device.ip.c_str()), device.port);
|
||||
NanoleafSettingsEntry* entry = new NanoleafSettingsEntry(QString::fromUtf8(device.ip.c_str()), device.port);
|
||||
|
||||
entries[location] = entry;
|
||||
|
||||
@@ -98,7 +74,7 @@ void OpenRGBNanoleafSettingsPage::on_AddNanoleafDeviceButton_clicked()
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBNanoleafSettingsPage::on_RemoveNanoleafDeviceButton_clicked()
|
||||
void NanoleafScanDialog::on_RemoveNanoleafDeviceButton_clicked()
|
||||
{
|
||||
/*-------------------------------------------------*\
|
||||
| Remove the selected device |
|
||||
@@ -111,13 +87,12 @@ void OpenRGBNanoleafSettingsPage::on_RemoveNanoleafDeviceButton_clicked()
|
||||
}
|
||||
|
||||
QListWidgetItem* item = ui->NanoleafDeviceList->item(cur_row);
|
||||
OpenRGBNanoleafSettingsEntry* entry = (OpenRGBNanoleafSettingsEntry*) ui->NanoleafDeviceList->itemWidget(item);
|
||||
LOG_TRACE("[%s] Remove %s:%d", "Nanoleaf", entry->address.toStdString().c_str(), entry->port);
|
||||
NanoleafSettingsEntry* entry = (NanoleafSettingsEntry*) ui->NanoleafDeviceList->itemWidget(item);
|
||||
|
||||
ui->NanoleafDeviceList->removeItemWidget(item);
|
||||
delete item;
|
||||
|
||||
std::string location = entry->address.toStdString()+":"+std::to_string(entry->port);
|
||||
std::string location = entry->getLocation();
|
||||
delete entries[location];
|
||||
entries.erase(location);
|
||||
|
||||
@@ -127,13 +102,13 @@ void OpenRGBNanoleafSettingsPage::on_RemoveNanoleafDeviceButton_clicked()
|
||||
ResourceManager::get()->GetSettingsManager()->SaveSettings();
|
||||
}
|
||||
|
||||
void OpenRGBNanoleafSettingsPage::on_ScanForNanoleafDevicesButton_clicked()
|
||||
void NanoleafScanDialog::on_ScanForNanoleafDevicesButton_clicked()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Create a worker thread for the mDNS query and hookup |
|
||||
| callbacks for when it finds devices |
|
||||
\*-----------------------------------------------------*/
|
||||
OpenRGBNanoleafScanningThread *scanThread = new OpenRGBNanoleafScanningThread;
|
||||
NanoleafScanningThread *scanThread = new NanoleafScanningThread;
|
||||
|
||||
connect(scanThread, SIGNAL(DeviceFound(QString, int)),
|
||||
SLOT(on_DeviceFound(QString, int)));
|
||||
@@ -144,13 +119,13 @@ void OpenRGBNanoleafSettingsPage::on_ScanForNanoleafDevicesButton_clicked()
|
||||
scanThread->start();
|
||||
}
|
||||
|
||||
void OpenRGBNanoleafSettingsPage::on_DeviceFound(QString address, int port)
|
||||
void NanoleafScanDialog::on_DeviceFound(QString address, int port)
|
||||
{
|
||||
std::string location = address.toStdString()+":"+std::to_string(port);
|
||||
|
||||
if(entries.find(location) == entries.end())
|
||||
{
|
||||
OpenRGBNanoleafSettingsEntry* entry = new OpenRGBNanoleafSettingsEntry(address, port);
|
||||
NanoleafSettingsEntry* entry = new NanoleafSettingsEntry(address, port);
|
||||
|
||||
entries[location] = entry;
|
||||
|
||||
@@ -163,3 +138,12 @@ void OpenRGBNanoleafSettingsPage::on_DeviceFound(QString address, int port)
|
||||
ui->NanoleafDeviceList->show();
|
||||
}
|
||||
}
|
||||
|
||||
void NanoleafScanDialog::on_NanoleafDeviceList_itemSelectionChanged()
|
||||
{
|
||||
int cur_row = ui->NanoleafDeviceList->currentRow();
|
||||
|
||||
bool anySelected = (cur_row >= 0);
|
||||
ui->RemoveNanoleafDeviceButton->setEnabled(anySelected);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBNanoleafSettingsPage.h |
|
||||
| NanoleafScanDialog.h |
|
||||
| |
|
||||
| User interface for OpenRGB Nanoleaf settings page |
|
||||
| User interface for OpenRGB Nanoleaf scan & pairing page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
@@ -9,21 +9,21 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "OpenRGBNanoleafSettingsEntry.h"
|
||||
#include <QDialog>
|
||||
#include "NanoleafSettingsEntry.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBNanoleafSettingsPage;
|
||||
class NanoleafScanDialog;
|
||||
}
|
||||
|
||||
class OpenRGBNanoleafSettingsPage : public QWidget
|
||||
class NanoleafScanDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBNanoleafSettingsPage(QWidget *parent = nullptr);
|
||||
~OpenRGBNanoleafSettingsPage();
|
||||
explicit NanoleafScanDialog(QWidget *parent = nullptr);
|
||||
~NanoleafScanDialog();
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
@@ -32,7 +32,9 @@ private slots:
|
||||
void on_ScanForNanoleafDevicesButton_clicked();
|
||||
void on_DeviceFound(QString address, int port);
|
||||
|
||||
void on_NanoleafDeviceList_itemSelectionChanged();
|
||||
|
||||
private:
|
||||
Ui::OpenRGBNanoleafSettingsPage *ui;
|
||||
std::map<std::string, OpenRGBNanoleafSettingsEntry*> entries;
|
||||
Ui::NanoleafScanDialog *ui;
|
||||
std::map<std::string, NanoleafSettingsEntry*> entries;
|
||||
};
|
||||
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>NanoleafScanDialog</class>
|
||||
<widget class="QDialog" name="NanoleafScanDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Nanoleaf Scan Page</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="SyncLabel">
|
||||
<property name="text">
|
||||
<string>To pair, hold the on-off button down for 5-7 seconds until the LED starts flashing in a pattern, a new entry should appear in the list below, then click the "Pair" button on the entry within 30 seconds.</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="NanoleafDeviceList">
|
||||
<property name="verticalScrollMode">
|
||||
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="ScanForNanoleafDevicesButton">
|
||||
<property name="text">
|
||||
<string>Scan</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="AddNanoleafDeviceButton">
|
||||
<property name="text">
|
||||
<string>Add manually</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="RemoveNanoleafDeviceButton">
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBNanoleafScanningThread.cpp |
|
||||
| NanoleafScanningThread.cpp |
|
||||
| |
|
||||
| OpenRGB Nanoleaf scanning thread |
|
||||
| |
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "mdns.h"
|
||||
|
||||
#include "OpenRGBNanoleafScanningThread.h"
|
||||
#include "NanoleafScanningThread.h"
|
||||
|
||||
static char namebuffer[256];
|
||||
|
||||
@@ -366,13 +366,13 @@ static int query_callback(
|
||||
|
||||
mdns_string_t addrstr = ipv4_address_to_string(namebuffer, sizeof(namebuffer), &address, sizeof(address));
|
||||
|
||||
(static_cast<OpenRGBNanoleafScanningThread*>(user_data))->EmitDeviceFound(addrstr.str, address.sin_port);
|
||||
(static_cast<NanoleafScanningThread*>(user_data))->EmitDeviceFound(addrstr.str, address.sin_port);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void OpenRGBNanoleafScanningThread::EmitDeviceFound(QString address, int port)
|
||||
void NanoleafScanningThread::EmitDeviceFound(QString address, int port)
|
||||
{
|
||||
emit DeviceFound(address, port);
|
||||
}
|
||||
@@ -380,7 +380,7 @@ void OpenRGBNanoleafScanningThread::EmitDeviceFound(QString address, int port)
|
||||
/*-----------------------------------------------------*\
|
||||
| Send a mDNS query |
|
||||
\*-----------------------------------------------------*/
|
||||
int OpenRGBNanoleafScanningThread::SendMDNSQuery()
|
||||
int NanoleafScanningThread::SendMDNSQuery()
|
||||
{
|
||||
const char* service = "_nanoleafapi._tcp.local.";
|
||||
mdns_record_type record = MDNS_RECORDTYPE_PTR;
|
||||
@@ -471,7 +471,7 @@ int OpenRGBNanoleafScanningThread::SendMDNSQuery()
|
||||
return 0;
|
||||
}
|
||||
|
||||
void OpenRGBNanoleafScanningThread::run()
|
||||
void NanoleafScanningThread::run()
|
||||
{
|
||||
SendMDNSQuery();
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBNanoleafScanningThread.h |
|
||||
| NanoleafScanningThread.h |
|
||||
| |
|
||||
| OpenRGB Nanoleaf scanning thread |
|
||||
| |
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include <QThread>
|
||||
|
||||
class OpenRGBNanoleafScanningThread : public QThread
|
||||
class NanoleafScanningThread : public QThread
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBNanoleafSettingsEntry.cpp |
|
||||
| NanoleafSettingsEntry.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB Nanoleaf settings entry |
|
||||
| |
|
||||
@@ -8,26 +7,28 @@
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBNanoleafSettingsEntry.h"
|
||||
#include "ui_OpenRGBNanoleafSettingsEntry.h"
|
||||
#include "NanoleafSettingsEntry.h"
|
||||
#include "ui_NanoleafSettingsEntry.h"
|
||||
|
||||
#include "NanoleafScanDialog.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "SettingsManager.h"
|
||||
#include "NanoleafController.h"
|
||||
|
||||
OpenRGBNanoleafSettingsEntry::OpenRGBNanoleafSettingsEntry(QWidget *parent) :
|
||||
NanoleafSettingsEntry::NanoleafSettingsEntry(QWidget *parent) :
|
||||
BaseManualDeviceEntry(parent),
|
||||
ui(new Ui::OpenRGBNanoleafSettingsEntry),
|
||||
ui(new Ui::NanoleafSettingsEntry),
|
||||
paired(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
OpenRGBNanoleafSettingsEntry::OpenRGBNanoleafSettingsEntry(QString a_address, int a_port) :
|
||||
OpenRGBNanoleafSettingsEntry(nullptr)
|
||||
NanoleafSettingsEntry::NanoleafSettingsEntry(QString a_address, int a_port) :
|
||||
NanoleafSettingsEntry(nullptr)
|
||||
{
|
||||
address = a_address;
|
||||
port = a_port;
|
||||
const std::string location = address.toStdString()+":"+std::to_string(port);
|
||||
const std::string location = getLocation();
|
||||
|
||||
ui->IPValue->setText(address);
|
||||
ui->PortValue->setText(QString::fromStdString(std::to_string(a_port)));
|
||||
@@ -49,12 +50,12 @@ OpenRGBNanoleafSettingsEntry::OpenRGBNanoleafSettingsEntry(QString a_address, in
|
||||
}
|
||||
}
|
||||
|
||||
OpenRGBNanoleafSettingsEntry::~OpenRGBNanoleafSettingsEntry()
|
||||
NanoleafSettingsEntry::~NanoleafSettingsEntry()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBNanoleafSettingsEntry::changeEvent(QEvent *event)
|
||||
void NanoleafSettingsEntry::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
@@ -62,14 +63,14 @@ void OpenRGBNanoleafSettingsEntry::changeEvent(QEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBNanoleafSettingsEntry::on_PairButton_clicked()
|
||||
void NanoleafSettingsEntry::on_PairButton_clicked()
|
||||
{
|
||||
try
|
||||
{
|
||||
auth_token = NanoleafController::Pair(address.toStdString(), port);
|
||||
|
||||
// Save auth token.
|
||||
const std::string location = address.toStdString()+":"+std::to_string(port);
|
||||
std::string location = getLocation();
|
||||
json nanoleaf_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("NanoleafDevices");
|
||||
nanoleaf_settings["devices"][location]["ip"] = address.toStdString();
|
||||
nanoleaf_settings["devices"][location]["port"] = port;
|
||||
@@ -90,11 +91,11 @@ void OpenRGBNanoleafSettingsEntry::on_PairButton_clicked()
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBNanoleafSettingsEntry::on_UnpairButton_clicked()
|
||||
void NanoleafSettingsEntry::on_UnpairButton_clicked()
|
||||
{
|
||||
NanoleafController::Unpair(address.toStdString(), port, auth_token);
|
||||
|
||||
const std::string location = address.toStdString()+":"+std::to_string(port);
|
||||
std::string location = getLocation();
|
||||
json nanoleaf_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("NanoleafDevices");
|
||||
nanoleaf_settings["devices"].erase(location);
|
||||
ResourceManager::get()->GetSettingsManager()->SetSettings("NanoleafDevices", nanoleaf_settings);
|
||||
@@ -106,7 +107,7 @@ void OpenRGBNanoleafSettingsEntry::on_UnpairButton_clicked()
|
||||
ui->UnpairButton->hide();
|
||||
}
|
||||
|
||||
void OpenRGBNanoleafSettingsEntry::loadFromSettings(const json& data)
|
||||
void NanoleafSettingsEntry::loadFromSettings(const json& data)
|
||||
{
|
||||
address = QString::fromStdString(data["ip"]);
|
||||
port = data["port"];
|
||||
@@ -127,7 +128,7 @@ void OpenRGBNanoleafSettingsEntry::loadFromSettings(const json& data)
|
||||
}
|
||||
}
|
||||
|
||||
json OpenRGBNanoleafSettingsEntry::saveSettings()
|
||||
json NanoleafSettingsEntry::saveSettings()
|
||||
{
|
||||
json result;
|
||||
|
||||
@@ -144,7 +145,33 @@ json OpenRGBNanoleafSettingsEntry::saveSettings()
|
||||
return result;
|
||||
}
|
||||
|
||||
const char* OpenRGBNanoleafSettingsEntry::settingsSection()
|
||||
std::string NanoleafSettingsEntry::getLocation()
|
||||
{
|
||||
return "NanoleafDevices";
|
||||
return (address.toStdString() + ":" + std::to_string(port));
|
||||
}
|
||||
|
||||
bool NanoleafSettingsEntry::isDataValid()
|
||||
{
|
||||
// stub
|
||||
return true;
|
||||
}
|
||||
|
||||
static BaseManualDeviceEntry* SpawnNanoleafSettingsEntry(const json& data)
|
||||
{
|
||||
if(data.empty())
|
||||
{
|
||||
// A special case: we open a new scanning dialog instead of returning a new entry
|
||||
// The caller should be able to handle this
|
||||
NanoleafScanDialog scanPage;
|
||||
scanPage.exec();
|
||||
return nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
NanoleafSettingsEntry* entry = new NanoleafSettingsEntry;
|
||||
entry->loadFromSettings(data);
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
|
||||
REGISTER_MANUAL_DEVICE_TYPE("Nanoleaf", "NanoleafDevices", SpawnNanoleafSettingsEntry);
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBNanoleafSettingsEntry.h |
|
||||
| NanoleafSettingsEntry.h |
|
||||
| |
|
||||
| User interface for OpenRGB Nanoleaf settings entry |
|
||||
| |
|
||||
@@ -10,37 +10,36 @@
|
||||
#pragma once
|
||||
|
||||
#include "BaseManualDeviceEntry.h"
|
||||
#include "OpenRGBNanoleafScanningThread.h"
|
||||
#include "NanoleafScanningThread.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBNanoleafSettingsEntry;
|
||||
class NanoleafSettingsEntry;
|
||||
}
|
||||
|
||||
class OpenRGBNanoleafSettingsEntry : public BaseManualDeviceEntry
|
||||
class NanoleafSettingsEntry : public BaseManualDeviceEntry
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBNanoleafSettingsEntry(QWidget *parent = nullptr);
|
||||
OpenRGBNanoleafSettingsEntry(QString a_address, int a_port);
|
||||
~OpenRGBNanoleafSettingsEntry();
|
||||
explicit NanoleafSettingsEntry(QWidget *parent = nullptr);
|
||||
NanoleafSettingsEntry(QString a_address, int a_port);
|
||||
~NanoleafSettingsEntry();
|
||||
void loadFromSettings(const json& data);
|
||||
json saveSettings();
|
||||
const char* settingsSection();
|
||||
std::string getLocation();
|
||||
|
||||
QString address;
|
||||
int port;
|
||||
|
||||
private:
|
||||
Ui::OpenRGBNanoleafSettingsEntry *ui;
|
||||
json saveSettings() override;
|
||||
bool isDataValid() override;
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void changeEvent(QEvent *event) override;
|
||||
void on_UnpairButton_clicked();
|
||||
void on_PairButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::NanoleafSettingsEntry *ui;
|
||||
QString address;
|
||||
int port;
|
||||
std::string auth_token;
|
||||
bool paired;
|
||||
};
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBNanoleafSettingsEntry</class>
|
||||
<widget class="QWidget" name="OpenRGBNanoleafSettingsEntry">
|
||||
<class>NanoleafSettingsEntry</class>
|
||||
<widget class="QWidget" name="NanoleafSettingsEntry">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@@ -23,7 +23,7 @@
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string/>
|
||||
<string>Nanoleaf Device</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="1" column="0">
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBPhilipsHueSettingsEntry.cpp |
|
||||
| PhilipsHueSettingsEntry.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB Philips Hue settings entry |
|
||||
| |
|
||||
@@ -7,22 +7,22 @@
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBPhilipsHueSettingsEntry.h"
|
||||
#include "ui_OpenRGBPhilipsHueSettingsEntry.h"
|
||||
#include "PhilipsHueSettingsEntry.h"
|
||||
#include "ui_PhilipsHueSettingsEntry.h"
|
||||
|
||||
OpenRGBPhilipsHueSettingsEntry::OpenRGBPhilipsHueSettingsEntry(QWidget *parent) :
|
||||
PhilipsHueSettingsEntry::PhilipsHueSettingsEntry(QWidget *parent) :
|
||||
BaseManualDeviceEntry(parent),
|
||||
ui(new Ui::OpenRGBPhilipsHueSettingsEntry)
|
||||
ui(new Ui::PhilipsHueSettingsEntry)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
OpenRGBPhilipsHueSettingsEntry::~OpenRGBPhilipsHueSettingsEntry()
|
||||
PhilipsHueSettingsEntry::~PhilipsHueSettingsEntry()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBPhilipsHueSettingsEntry::changeEvent(QEvent *event)
|
||||
void PhilipsHueSettingsEntry::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
@@ -30,13 +30,13 @@ void OpenRGBPhilipsHueSettingsEntry::changeEvent(QEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBPhilipsHueSettingsEntry::on_UnpairButton_clicked()
|
||||
void PhilipsHueSettingsEntry::on_UnpairButton_clicked()
|
||||
{
|
||||
ui->UsernameValue->setText("");
|
||||
ui->ClientKeyValue->setText("");
|
||||
}
|
||||
|
||||
void OpenRGBPhilipsHueSettingsEntry::loadFromSettings(const json& data)
|
||||
void PhilipsHueSettingsEntry::loadFromSettings(const json& data)
|
||||
{
|
||||
if(data.contains("ip"))
|
||||
{
|
||||
@@ -69,7 +69,7 @@ void OpenRGBPhilipsHueSettingsEntry::loadFromSettings(const json& data)
|
||||
}
|
||||
}
|
||||
|
||||
json OpenRGBPhilipsHueSettingsEntry::saveSettings()
|
||||
json PhilipsHueSettingsEntry::saveSettings()
|
||||
{
|
||||
json result;
|
||||
/*-------------------------------------------------*\
|
||||
@@ -93,7 +93,17 @@ json OpenRGBPhilipsHueSettingsEntry::saveSettings()
|
||||
return result;
|
||||
}
|
||||
|
||||
const char* OpenRGBPhilipsHueSettingsEntry::settingsSection()
|
||||
bool PhilipsHueSettingsEntry::isDataValid()
|
||||
{
|
||||
return "PhilipsHueDevices";
|
||||
// stub
|
||||
return true;
|
||||
}
|
||||
|
||||
static BaseManualDeviceEntry* SpawnPhilipsHueSettingsEntry(const json& data)
|
||||
{
|
||||
PhilipsHueSettingsEntry* entry = new PhilipsHueSettingsEntry;
|
||||
entry->loadFromSettings(data);
|
||||
return entry;
|
||||
}
|
||||
|
||||
REGISTER_MANUAL_DEVICE_TYPE("Philips Hue", "PhilipsHueDevices", SpawnPhilipsHueSettingsEntry);
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBPhilipsHueSettingsEntry.h |
|
||||
| PhilipsHueSettingsEntry.h |
|
||||
| |
|
||||
| User interface for OpenRGB Philips Hue settings entry |
|
||||
| |
|
||||
@@ -13,24 +13,24 @@
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBPhilipsHueSettingsEntry;
|
||||
class PhilipsHueSettingsEntry;
|
||||
}
|
||||
|
||||
class OpenRGBPhilipsHueSettingsEntry : public BaseManualDeviceEntry
|
||||
class PhilipsHueSettingsEntry : public BaseManualDeviceEntry
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBPhilipsHueSettingsEntry(QWidget *parent = nullptr);
|
||||
~OpenRGBPhilipsHueSettingsEntry();
|
||||
explicit PhilipsHueSettingsEntry(QWidget *parent = nullptr);
|
||||
~PhilipsHueSettingsEntry();
|
||||
void loadFromSettings(const json& data);
|
||||
json saveSettings();
|
||||
const char* settingsSection();
|
||||
json saveSettings() override;
|
||||
bool isDataValid() override;
|
||||
|
||||
private:
|
||||
Ui::OpenRGBPhilipsHueSettingsEntry *ui;
|
||||
Ui::PhilipsHueSettingsEntry *ui;
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void changeEvent(QEvent *event) override;
|
||||
void on_UnpairButton_clicked();
|
||||
};
|
||||
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBPhilipsHueSettingsEntry</class>
|
||||
<widget class="QWidget" name="OpenRGBPhilipsHueSettingsEntry">
|
||||
<class>PhilipsHueSettingsEntry</class>
|
||||
<widget class="QWidget" name="PhilipsHueSettingsEntry">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>297</width>
|
||||
<height>228</height>
|
||||
<height>260</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -23,7 +23,7 @@
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string/>
|
||||
<string>Philips Hue Bridge</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="3" column="0">
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBPhilipsWizSettingsEntry.cpp |
|
||||
| PhilipsWizSettingsEntry.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB Philips Wiz settings entry |
|
||||
| |
|
||||
@@ -7,12 +7,12 @@
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBPhilipsWizSettingsEntry.h"
|
||||
#include "ui_OpenRGBPhilipsWizSettingsEntry.h"
|
||||
#include "PhilipsWizSettingsEntry.h"
|
||||
#include "ui_PhilipsWizSettingsEntry.h"
|
||||
|
||||
OpenRGBPhilipsWizSettingsEntry::OpenRGBPhilipsWizSettingsEntry(QWidget *parent) :
|
||||
PhilipsWizSettingsEntry::PhilipsWizSettingsEntry(QWidget *parent) :
|
||||
BaseManualDeviceEntry(parent),
|
||||
ui(new Ui::OpenRGBPhilipsWizSettingsEntry)
|
||||
ui(new Ui::PhilipsWizSettingsEntry)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
@@ -20,12 +20,12 @@ OpenRGBPhilipsWizSettingsEntry::OpenRGBPhilipsWizSettingsEntry(QWidget *parent)
|
||||
ui->WhiteStrategyComboBox->addItem(tr("Minimum"));
|
||||
}
|
||||
|
||||
OpenRGBPhilipsWizSettingsEntry::~OpenRGBPhilipsWizSettingsEntry()
|
||||
PhilipsWizSettingsEntry::~PhilipsWizSettingsEntry()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBPhilipsWizSettingsEntry::changeEvent(QEvent *event)
|
||||
void PhilipsWizSettingsEntry::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
@@ -33,7 +33,7 @@ void OpenRGBPhilipsWizSettingsEntry::changeEvent(QEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBPhilipsWizSettingsEntry::loadFromSettings(const json& data)
|
||||
void PhilipsWizSettingsEntry::loadFromSettings(const json& data)
|
||||
{
|
||||
if(data.contains("ip"))
|
||||
{
|
||||
@@ -56,7 +56,7 @@ void OpenRGBPhilipsWizSettingsEntry::loadFromSettings(const json& data)
|
||||
}
|
||||
}
|
||||
|
||||
json OpenRGBPhilipsWizSettingsEntry::saveSettings()
|
||||
json PhilipsWizSettingsEntry::saveSettings()
|
||||
{
|
||||
json result;
|
||||
/*-------------------------------------------------*\
|
||||
@@ -70,7 +70,17 @@ json OpenRGBPhilipsWizSettingsEntry::saveSettings()
|
||||
return result;
|
||||
}
|
||||
|
||||
const char* OpenRGBPhilipsWizSettingsEntry::settingsSection()
|
||||
bool PhilipsWizSettingsEntry::isDataValid()
|
||||
{
|
||||
return "PhilipsWizDevices";
|
||||
// stub
|
||||
return true;
|
||||
}
|
||||
|
||||
static BaseManualDeviceEntry* SpawnPhilipsWizSettingsEntry(const json& data)
|
||||
{
|
||||
PhilipsWizSettingsEntry* entry = new PhilipsWizSettingsEntry;
|
||||
entry->loadFromSettings(data);
|
||||
return entry;
|
||||
}
|
||||
|
||||
REGISTER_MANUAL_DEVICE_TYPE("Philips Wiz", "PhilipsWizDevices", SpawnPhilipsWizSettingsEntry);
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBPhilipsWizSettingsEntry.h |
|
||||
| PhilipsWizSettingsEntry.h |
|
||||
| |
|
||||
| User interface for OpenRGB Philips Wiz settings entry |
|
||||
| |
|
||||
@@ -13,23 +13,23 @@
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBPhilipsWizSettingsEntry;
|
||||
class PhilipsWizSettingsEntry;
|
||||
}
|
||||
|
||||
class OpenRGBPhilipsWizSettingsEntry : public BaseManualDeviceEntry
|
||||
class PhilipsWizSettingsEntry : public BaseManualDeviceEntry
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBPhilipsWizSettingsEntry(QWidget *parent = nullptr);
|
||||
~OpenRGBPhilipsWizSettingsEntry();
|
||||
explicit PhilipsWizSettingsEntry(QWidget *parent = nullptr);
|
||||
~PhilipsWizSettingsEntry();
|
||||
void loadFromSettings(const json& data);
|
||||
json saveSettings();
|
||||
const char* settingsSection();
|
||||
json saveSettings() override;
|
||||
bool isDataValid() override;
|
||||
|
||||
private:
|
||||
Ui::OpenRGBPhilipsWizSettingsEntry *ui;
|
||||
Ui::PhilipsWizSettingsEntry *ui;
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void changeEvent(QEvent *event) override;
|
||||
};
|
||||
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBPhilipsWizSettingsEntry</class>
|
||||
<widget class="QWidget" name="OpenRGBPhilipsWizSettingsEntry">
|
||||
<class>PhilipsWizSettingsEntry</class>
|
||||
<widget class="QWidget" name="PhilipsWizSettingsEntry">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>246</width>
|
||||
<height>82</height>
|
||||
<width>327</width>
|
||||
<height>149</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -23,7 +23,7 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string/>
|
||||
<string>Philips Wiz Device</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="2" column="0">
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBQMKORGBSettingsEntry.cpp |
|
||||
| QMKORGBSettingsEntry.cpp |
|
||||
| |
|
||||
| User interface entry for OpenRGB QMK configuration |
|
||||
| |
|
||||
@@ -7,22 +7,22 @@
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBQMKORGBSettingsEntry.h"
|
||||
#include "ui_OpenRGBQMKORGBSettingsEntry.h"
|
||||
#include "QMKORGBSettingsEntry.h"
|
||||
#include "ui_QMKORGBSettingsEntry.h"
|
||||
|
||||
OpenRGBQMKORGBSettingsEntry::OpenRGBQMKORGBSettingsEntry(QWidget *parent) :
|
||||
QMKORGBSettingsEntry::QMKORGBSettingsEntry(QWidget *parent) :
|
||||
BaseManualDeviceEntry(parent),
|
||||
ui(new Ui::OpenRGBQMKORGBSettingsEntry)
|
||||
ui(new Ui::QMKORGBSettingsEntry)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
OpenRGBQMKORGBSettingsEntry::~OpenRGBQMKORGBSettingsEntry()
|
||||
QMKORGBSettingsEntry::~QMKORGBSettingsEntry()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBQMKORGBSettingsEntry::changeEvent(QEvent *event)
|
||||
void QMKORGBSettingsEntry::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
@@ -30,7 +30,7 @@ void OpenRGBQMKORGBSettingsEntry::changeEvent(QEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBQMKORGBSettingsEntry::loadFromSettings(const json& data)
|
||||
void QMKORGBSettingsEntry::loadFromSettings(const json& data)
|
||||
{
|
||||
if(data.contains("name"))
|
||||
{
|
||||
@@ -48,7 +48,7 @@ void OpenRGBQMKORGBSettingsEntry::loadFromSettings(const json& data)
|
||||
}
|
||||
}
|
||||
|
||||
json OpenRGBQMKORGBSettingsEntry::saveSettings()
|
||||
json QMKORGBSettingsEntry::saveSettings()
|
||||
{
|
||||
json result;
|
||||
/*-------------------------------------------------*\
|
||||
@@ -61,7 +61,19 @@ json OpenRGBQMKORGBSettingsEntry::saveSettings()
|
||||
return result;
|
||||
}
|
||||
|
||||
const char* OpenRGBQMKORGBSettingsEntry::settingsSection()
|
||||
bool QMKORGBSettingsEntry::isDataValid()
|
||||
{
|
||||
return "QMKOpenRGBDevices";
|
||||
// stub
|
||||
return true;
|
||||
}
|
||||
|
||||
static BaseManualDeviceEntry* SpawnQMKORGBSettingsEntry(const json& data)
|
||||
{
|
||||
QMKORGBSettingsEntry* entry = new QMKORGBSettingsEntry;
|
||||
entry->loadFromSettings(data);
|
||||
return entry;
|
||||
}
|
||||
|
||||
static const char* QMKDeviceName = QT_TRANSLATE_NOOP("ManualDevice", "QMK (built with ORGB support)");
|
||||
|
||||
REGISTER_MANUAL_DEVICE_TYPE(QMKDeviceName, "QMKOpenRGBDevices", SpawnQMKORGBSettingsEntry);
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBQMKORGBSettingsEntry.h |
|
||||
| QMKORGBSettingsEntry.h |
|
||||
| |
|
||||
| User interface entry for OpenRGB QMK configuration |
|
||||
| |
|
||||
@@ -13,10 +13,10 @@
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBQMKORGBSettingsEntry;
|
||||
class QMKORGBSettingsEntry;
|
||||
}
|
||||
|
||||
class OpenRGBQMKORGBSettingsEntry : public BaseManualDeviceEntry
|
||||
class QMKORGBSettingsEntry : public BaseManualDeviceEntry
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -24,12 +24,12 @@ private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
|
||||
public:
|
||||
explicit OpenRGBQMKORGBSettingsEntry(QWidget *parent = nullptr);
|
||||
~OpenRGBQMKORGBSettingsEntry();
|
||||
explicit QMKORGBSettingsEntry(QWidget *parent = nullptr);
|
||||
~QMKORGBSettingsEntry();
|
||||
void loadFromSettings(const json& data);
|
||||
json saveSettings();
|
||||
const char* settingsSection();
|
||||
json saveSettings() override;
|
||||
bool isDataValid() override;
|
||||
|
||||
private:
|
||||
Ui::OpenRGBQMKORGBSettingsEntry *ui;
|
||||
Ui::QMKORGBSettingsEntry *ui;
|
||||
};
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBQMKORGBSettingsEntry</class>
|
||||
<widget class="QWidget" name="OpenRGBQMKORGBSettingsEntry">
|
||||
<class>QMKORGBSettingsEntry</class>
|
||||
<widget class="QWidget" name="QMKORGBSettingsEntry">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@@ -17,13 +17,13 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">OpenRGB QMK Settings Entry</string>
|
||||
<string notr="true"> QMK Settings Entry</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string/>
|
||||
<string>QMK Device</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="2" column="5">
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBSerialSettingsEntry.cpp |
|
||||
| SerialSettingsEntry.cpp |
|
||||
| |
|
||||
| User interface entry for serial device configuration |
|
||||
| |
|
||||
@@ -7,12 +7,12 @@
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBSerialSettingsEntry.h"
|
||||
#include "ui_OpenRGBSerialSettingsEntry.h"
|
||||
#include "SerialSettingsEntry.h"
|
||||
#include "ui_SerialSettingsEntry.h"
|
||||
|
||||
OpenRGBSerialSettingsEntry::OpenRGBSerialSettingsEntry(QWidget *parent) :
|
||||
SerialSettingsEntry::SerialSettingsEntry(QWidget *parent) :
|
||||
BaseManualDeviceEntry(parent),
|
||||
ui(new Ui::OpenRGBSerialSettingsEntry)
|
||||
ui(new Ui::SerialSettingsEntry)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
@@ -22,12 +22,12 @@ OpenRGBSerialSettingsEntry::OpenRGBSerialSettingsEntry(QWidget *parent) :
|
||||
ui->ProtocolComboBox->addItem("Basic I2C");
|
||||
}
|
||||
|
||||
OpenRGBSerialSettingsEntry::~OpenRGBSerialSettingsEntry()
|
||||
SerialSettingsEntry::~SerialSettingsEntry()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBSerialSettingsEntry::changeEvent(QEvent *event)
|
||||
void SerialSettingsEntry::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
@@ -35,7 +35,7 @@ void OpenRGBSerialSettingsEntry::changeEvent(QEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBSerialSettingsEntry::on_ProtocolComboBox_currentIndexChanged(int index)
|
||||
void SerialSettingsEntry::on_ProtocolComboBox_currentIndexChanged(int index)
|
||||
{
|
||||
if(index == 3)
|
||||
{
|
||||
@@ -47,7 +47,7 @@ void OpenRGBSerialSettingsEntry::on_ProtocolComboBox_currentIndexChanged(int ind
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBSerialSettingsEntry::loadFromSettings(const json& data)
|
||||
void SerialSettingsEntry::loadFromSettings(const json& data)
|
||||
{
|
||||
if(data.contains("name"))
|
||||
{
|
||||
@@ -92,7 +92,7 @@ void OpenRGBSerialSettingsEntry::loadFromSettings(const json& data)
|
||||
}
|
||||
}
|
||||
|
||||
json OpenRGBSerialSettingsEntry::saveSettings()
|
||||
json SerialSettingsEntry::saveSettings()
|
||||
{
|
||||
json result;
|
||||
/*-------------------------------------------------*\
|
||||
@@ -122,7 +122,19 @@ json OpenRGBSerialSettingsEntry::saveSettings()
|
||||
return result;
|
||||
}
|
||||
|
||||
const char* OpenRGBSerialSettingsEntry::settingsSection()
|
||||
bool SerialSettingsEntry::isDataValid()
|
||||
{
|
||||
return "LEDStripDevices";
|
||||
// stub
|
||||
return true;
|
||||
}
|
||||
|
||||
static BaseManualDeviceEntry* SpawnSerialSettingsEntry(const json& data)
|
||||
{
|
||||
SerialSettingsEntry* entry = new SerialSettingsEntry;
|
||||
entry->loadFromSettings(data);
|
||||
return entry;
|
||||
}
|
||||
|
||||
static const char* SerialDeviceName = QT_TRANSLATE_NOOP("ManualDevice", "Serial Device");
|
||||
|
||||
REGISTER_MANUAL_DEVICE_TYPE(SerialDeviceName, "LEDStripDevices", SpawnSerialSettingsEntry);
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBSerialSettingsEntry.h |
|
||||
| SerialSettingsEntry.h |
|
||||
| |
|
||||
| User interface entry for serial device configuration |
|
||||
| |
|
||||
@@ -13,25 +13,25 @@
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBSerialSettingsEntry;
|
||||
class SerialSettingsEntry;
|
||||
}
|
||||
|
||||
class OpenRGBSerialSettingsEntry : public BaseManualDeviceEntry
|
||||
class SerialSettingsEntry : public BaseManualDeviceEntry
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void changeEvent(QEvent *event) override;
|
||||
|
||||
void on_ProtocolComboBox_currentIndexChanged(int index);
|
||||
|
||||
public:
|
||||
explicit OpenRGBSerialSettingsEntry(QWidget *parent = nullptr);
|
||||
~OpenRGBSerialSettingsEntry();
|
||||
explicit SerialSettingsEntry(QWidget *parent = nullptr);
|
||||
~SerialSettingsEntry();
|
||||
void loadFromSettings(const json& data);
|
||||
json saveSettings();
|
||||
const char* settingsSection();
|
||||
json saveSettings() override;
|
||||
bool isDataValid() override;
|
||||
|
||||
private:
|
||||
Ui::OpenRGBSerialSettingsEntry *ui;
|
||||
Ui::SerialSettingsEntry *ui;
|
||||
};
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBSerialSettingsEntry</class>
|
||||
<widget class="QWidget" name="OpenRGBSerialSettingsEntry">
|
||||
<class>SerialSettingsEntry</class>
|
||||
<widget class="QWidget" name="SerialSettingsEntry">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@@ -23,7 +23,7 @@
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string/>
|
||||
<string>Serial Device</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="1" column="5">
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBYeelightSettingsEntry.cpp |
|
||||
| YeelightSettingsEntry.cpp |
|
||||
| |
|
||||
| User interface for Yeelight settings entry |
|
||||
| |
|
||||
@@ -8,23 +8,23 @@
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <QInputDialog>
|
||||
#include "OpenRGBYeelightSettingsEntry.h"
|
||||
#include "ui_OpenRGBYeelightSettingsEntry.h"
|
||||
#include "YeelightSettingsEntry.h"
|
||||
#include "ui_YeelightSettingsEntry.h"
|
||||
#include "net_port.h"
|
||||
|
||||
OpenRGBYeelightSettingsEntry::OpenRGBYeelightSettingsEntry(QWidget *parent) :
|
||||
YeelightSettingsEntry::YeelightSettingsEntry(QWidget *parent) :
|
||||
BaseManualDeviceEntry(parent),
|
||||
ui(new Ui::OpenRGBYeelightSettingsEntry)
|
||||
ui(new Ui::YeelightSettingsEntry)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
OpenRGBYeelightSettingsEntry::~OpenRGBYeelightSettingsEntry()
|
||||
YeelightSettingsEntry::~YeelightSettingsEntry()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBYeelightSettingsEntry::changeEvent(QEvent *event)
|
||||
void YeelightSettingsEntry::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
@@ -32,7 +32,7 @@ void OpenRGBYeelightSettingsEntry::changeEvent(QEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBYeelightSettingsEntry::on_HostIPChooserButton_clicked()
|
||||
void YeelightSettingsEntry::on_HostIPChooserButton_clicked()
|
||||
{
|
||||
char hostname[256];
|
||||
gethostname(hostname, 256);
|
||||
@@ -62,7 +62,7 @@ void OpenRGBYeelightSettingsEntry::on_HostIPChooserButton_clicked()
|
||||
ui->HostIPEdit->setText(inp.textValue());
|
||||
}
|
||||
|
||||
void OpenRGBYeelightSettingsEntry::loadFromSettings(const json& data)
|
||||
void YeelightSettingsEntry::loadFromSettings(const json& data)
|
||||
{
|
||||
if(data.contains("ip"))
|
||||
{
|
||||
@@ -80,7 +80,7 @@ void OpenRGBYeelightSettingsEntry::loadFromSettings(const json& data)
|
||||
}
|
||||
}
|
||||
|
||||
json OpenRGBYeelightSettingsEntry::saveSettings()
|
||||
json YeelightSettingsEntry::saveSettings()
|
||||
{
|
||||
json result;
|
||||
/*-------------------------------------------------*\
|
||||
@@ -93,7 +93,17 @@ json OpenRGBYeelightSettingsEntry::saveSettings()
|
||||
return result;
|
||||
}
|
||||
|
||||
const char* OpenRGBYeelightSettingsEntry::settingsSection()
|
||||
bool YeelightSettingsEntry::isDataValid()
|
||||
{
|
||||
return "YeelightDevices";
|
||||
// stub
|
||||
return true;
|
||||
}
|
||||
|
||||
static BaseManualDeviceEntry* SpawnYeelightSettingsEntry(const json& data)
|
||||
{
|
||||
YeelightSettingsEntry* entry = new YeelightSettingsEntry;
|
||||
entry->loadFromSettings(data);
|
||||
return entry;
|
||||
}
|
||||
|
||||
REGISTER_MANUAL_DEVICE_TYPE("Yeelight", "YeelightDevices", SpawnYeelightSettingsEntry);
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBYeelightSettingsEntry.h |
|
||||
| YeelightSettingsEntry.h |
|
||||
| |
|
||||
| User interface for Yeelight settings entry |
|
||||
| |
|
||||
@@ -13,24 +13,24 @@
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBYeelightSettingsEntry;
|
||||
class YeelightSettingsEntry;
|
||||
}
|
||||
|
||||
class OpenRGBYeelightSettingsEntry : public BaseManualDeviceEntry
|
||||
class YeelightSettingsEntry : public BaseManualDeviceEntry
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBYeelightSettingsEntry(QWidget *parent = nullptr);
|
||||
~OpenRGBYeelightSettingsEntry();
|
||||
explicit YeelightSettingsEntry(QWidget *parent = nullptr);
|
||||
~YeelightSettingsEntry();
|
||||
void loadFromSettings(const json& data);
|
||||
json saveSettings();
|
||||
const char* settingsSection();
|
||||
json saveSettings() override;
|
||||
bool isDataValid() override;
|
||||
|
||||
private:
|
||||
Ui::OpenRGBYeelightSettingsEntry *ui;
|
||||
Ui::YeelightSettingsEntry *ui;
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void changeEvent(QEvent *event) override;
|
||||
void on_HostIPChooserButton_clicked();
|
||||
};
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBYeelightSettingsEntry</class>
|
||||
<widget class="QWidget" name="OpenRGBYeelightSettingsEntry">
|
||||
<class>YeelightSettingsEntry</class>
|
||||
<widget class="QWidget" name="YeelightSettingsEntry">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@@ -23,7 +23,7 @@
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string/>
|
||||
<string>Yeelight Device</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="2" column="1">
|
||||
@@ -1,115 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBDMXSettingsPage.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB DMX settings page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBDMXSettingsPage.h"
|
||||
#include "ui_OpenRGBDMXSettingsPage.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "SettingsManager.h"
|
||||
|
||||
OpenRGBDMXSettingsPage::OpenRGBDMXSettingsPage(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::OpenRGBDMXSettingsPage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
json dmx_settings;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Get DMX settings from settings manager |
|
||||
\*-------------------------------------------------*/
|
||||
dmx_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("DMXDevices");
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| If the DMX settings contains devices, process |
|
||||
\*-------------------------------------------------*/
|
||||
if(dmx_settings.contains("devices"))
|
||||
{
|
||||
for(unsigned int device_idx = 0; device_idx < dmx_settings["devices"].size(); device_idx++)
|
||||
{
|
||||
OpenRGBDMXSettingsEntry* entry = new OpenRGBDMXSettingsEntry;
|
||||
|
||||
entry->loadFromSettings(dmx_settings["devices"][device_idx]);
|
||||
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->DMXDeviceList->addItem(item);
|
||||
ui->DMXDeviceList->setItemWidget(item, entry);
|
||||
ui->DMXDeviceList->show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OpenRGBDMXSettingsPage::~OpenRGBDMXSettingsPage()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBDMXSettingsPage::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBDMXSettingsPage::on_AddDMXDeviceButton_clicked()
|
||||
{
|
||||
OpenRGBDMXSettingsEntry* entry = new OpenRGBDMXSettingsEntry;
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->DMXDeviceList->addItem(item);
|
||||
ui->DMXDeviceList->setItemWidget(item, entry);
|
||||
ui->DMXDeviceList->show();
|
||||
}
|
||||
|
||||
void OpenRGBDMXSettingsPage::on_RemoveDMXDeviceButton_clicked()
|
||||
{
|
||||
int cur_row = ui->DMXDeviceList->currentRow();
|
||||
|
||||
if(cur_row < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QListWidgetItem* item = ui->DMXDeviceList->takeItem(cur_row);
|
||||
|
||||
ui->DMXDeviceList->removeItemWidget(item);
|
||||
delete item;
|
||||
|
||||
delete entries[cur_row];
|
||||
entries.erase(entries.begin() + cur_row);
|
||||
}
|
||||
|
||||
void OpenRGBDMXSettingsPage::on_SaveDMXConfigurationButton_clicked()
|
||||
{
|
||||
json dmx_settings;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Get DMX settings from settings manager |
|
||||
\*-------------------------------------------------*/
|
||||
dmx_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("DMXDevices");
|
||||
|
||||
dmx_settings["devices"].clear();
|
||||
|
||||
for(unsigned int device_idx = 0; device_idx < entries.size(); device_idx++)
|
||||
{
|
||||
dmx_settings["devices"][device_idx] = entries[device_idx]->saveSettings();
|
||||
}
|
||||
|
||||
ResourceManager::get()->GetSettingsManager()->SetSettings("DMXDevices", dmx_settings);
|
||||
ResourceManager::get()->GetSettingsManager()->SaveSettings();
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBDMXSettingsPage.h |
|
||||
| |
|
||||
| User interface for OpenRGB DMX settings page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "OpenRGBDMXSettingsEntry.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBDMXSettingsPage;
|
||||
}
|
||||
|
||||
class OpenRGBDMXSettingsPage : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBDMXSettingsPage(QWidget *parent = nullptr);
|
||||
~OpenRGBDMXSettingsPage();
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void on_AddDMXDeviceButton_clicked();
|
||||
|
||||
void on_RemoveDMXDeviceButton_clicked();
|
||||
|
||||
void on_SaveDMXConfigurationButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::OpenRGBDMXSettingsPage* ui;
|
||||
std::vector<OpenRGBDMXSettingsEntry*> entries;
|
||||
|
||||
};
|
||||
@@ -1,49 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBDMXSettingsPage</class>
|
||||
<widget class="QWidget" name="OpenRGBDMXSettingsPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">DMX Settings Page</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="AddDMXDeviceButton">
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="RemoveDMXDeviceButton">
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="SaveDMXConfigurationButton">
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QListWidget" name="DMXDeviceList">
|
||||
<property name="verticalScrollMode">
|
||||
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -7,12 +7,10 @@
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBDialog.h"
|
||||
#include "OpenRGBDevicePage.h"
|
||||
#include "OpenRGBZoneResizeDialog.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "SettingsManager.h"
|
||||
#include "hsv.h"
|
||||
#include "ui_OpenRGBDevicePage.h"
|
||||
|
||||
static void UpdateCallback(void * this_ptr)
|
||||
|
||||
@@ -489,69 +489,9 @@ OpenRGBDialog::OpenRGBDialog(QWidget *parent) : QMainWindow(parent), ui(new Ui::
|
||||
AddPluginsPage();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Add the DMX settings page |
|
||||
| Add the Manually Added Devices settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
AddDMXSettingsPage();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Add the E1.31 settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
AddE131SettingsPage();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Add the Govee settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
AddGoveeSettingsPage();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Add the Kasa Smart settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
AddKasaSmartSettingsPage();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Add the LIFX settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
AddLIFXSettingsPage();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Add the Serial settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
AddSerialSettingsPage();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Add the QMK OpenRGB Protocol settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
AddQMKORGBSettingsPage();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Add the Philips Hue settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
AddPhilipsHueSettingsPage();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Add the Philips Wiz settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
AddPhilipsWizSettingsPage();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Add the Yeelight settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
AddYeelightSettingsPage();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Add the Nanoleaf settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
AddNanoleafSettingsPage();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Add the ElgatoKeyLight settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
AddElgatoKeyLightSettingsPage();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Add the ElgatoLightStrip settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
AddElgatoLightStripSettingsPage();
|
||||
AddManualDevicesSettingsPage();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Add the SMBus Tools page if enabled |
|
||||
@@ -809,223 +749,19 @@ void OpenRGBDialog::AddSettingsPage()
|
||||
connect(this, SIGNAL(ProfileListChanged()), SettingsPage, SLOT(UpdateProfiles()));
|
||||
}
|
||||
|
||||
void OpenRGBDialog::AddDMXSettingsPage()
|
||||
void OpenRGBDialog::AddManualDevicesSettingsPage()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the Settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
DMXSettingsPage = new OpenRGBDMXSettingsPage();
|
||||
manualDevicesPage = new ManualDevicesSettingsPage();
|
||||
|
||||
ui->SettingsTabBar->addTab(DMXSettingsPage, "");
|
||||
ui->SettingsTabBar->addTab(manualDevicesPage, "");
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::serial, tr("DMX Devices"), (char *)"DMX Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
|
||||
void OpenRGBDialog::AddE131SettingsPage()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the Settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
E131SettingsPage = new OpenRGBE131SettingsPage();
|
||||
|
||||
ui->SettingsTabBar->addTab(E131SettingsPage, "");
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::data, tr("E1.31 Devices"), (char *)"E1.31 Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
|
||||
void OpenRGBDialog::AddGoveeSettingsPage()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the Settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
GoveeSettingsPage = new OpenRGBGoveeSettingsPage();
|
||||
|
||||
ui->SettingsTabBar->addTab(GoveeSettingsPage, "");
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::bulb, tr("Govee Devices"), (char *)"Govee Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
|
||||
void OpenRGBDialog::AddKasaSmartSettingsPage()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the Settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
KasaSmartSettingsPage = new OpenRGBKasaSmartSettingsPage();
|
||||
|
||||
ui->SettingsTabBar->addTab(KasaSmartSettingsPage, "");
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::bulb, tr("Kasa Smart Devices"), (char *)"Kasa Smart Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
|
||||
void OpenRGBDialog::AddLIFXSettingsPage()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the Settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
LIFXSettingsPage = new OpenRGBLIFXSettingsPage();
|
||||
|
||||
ui->SettingsTabBar->addTab(LIFXSettingsPage, "");
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::bulb, tr("LIFX Devices"), (char *)"LIFX Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
|
||||
void OpenRGBDialog::AddPhilipsHueSettingsPage()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the Settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
PhilipsHueSettingsPage = new OpenRGBPhilipsHueSettingsPage();
|
||||
|
||||
ui->SettingsTabBar->addTab(PhilipsHueSettingsPage, "");
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::bulb, tr("Philips Hue Devices"), (char *)"Philips Hue Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
|
||||
void OpenRGBDialog::AddPhilipsWizSettingsPage()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the Settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
PhilipsWizSettingsPage = new OpenRGBPhilipsWizSettingsPage();
|
||||
|
||||
ui->SettingsTabBar->addTab(PhilipsWizSettingsPage, "");
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::bulb, tr("Philips Wiz Devices"), (char *)"Philips Wiz Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
|
||||
void OpenRGBDialog::AddQMKORGBSettingsPage()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the Settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
QMKORGBSettingsPage = new OpenRGBQMKORGBSettingsPage();
|
||||
|
||||
ui->SettingsTabBar->addTab(QMKORGBSettingsPage, "");
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::keyboard, tr("OpenRGB QMK Protocol"), (char *)"OpenRGB QMK Protocol", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
|
||||
void OpenRGBDialog::AddSerialSettingsPage()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the Settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
SerialSettingsPage = new OpenRGBSerialSettingsPage();
|
||||
|
||||
ui->SettingsTabBar->addTab(SerialSettingsPage, "");
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SerialSettingsTabLabel = new TabLabel(OpenRGBFont::serial, tr("Serial Devices"), (char *)"Serial Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SerialSettingsTabLabel);
|
||||
}
|
||||
|
||||
void OpenRGBDialog::AddYeelightSettingsPage()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the Settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
YeelightSettingsPage = new OpenRGBYeelightSettingsPage();
|
||||
|
||||
ui->SettingsTabBar->addTab(YeelightSettingsPage, "");
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::bulb, tr("Yeelight Devices"), (char *)"Yeelight Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
|
||||
void OpenRGBDialog::AddNanoleafSettingsPage()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the Settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
NanoleafSettingsPage = new OpenRGBNanoleafSettingsPage();
|
||||
|
||||
ui->SettingsTabBar->addTab(NanoleafSettingsPage, "");
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::bulb, tr("Nanoleaf Devices"), (char *)"Nanoleaf Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
|
||||
void OpenRGBDialog::AddElgatoKeyLightSettingsPage()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the Settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
ElgatoKeyLightSettingsPage = new OpenRGBElgatoKeyLightSettingsPage();
|
||||
|
||||
ui->SettingsTabBar->addTab(ElgatoKeyLightSettingsPage, "");
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::bulb, tr("Elgato KeyLight Devices"), (char *)"Elgato KeyLight Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
|
||||
void OpenRGBDialog::AddElgatoLightStripSettingsPage()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the Settings page |
|
||||
\*-----------------------------------------------------*/
|
||||
ElgatoLightStripSettingsPage = new OpenRGBElgatoLightStripSettingsPage();
|
||||
|
||||
ui->SettingsTabBar->addTab(ElgatoLightStripSettingsPage, "");
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------------------*/
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::bulb, tr("Elgato LightStrip Devices"), (char *)"Elgato LightStrip Devices", (char *)context);
|
||||
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::bulb, tr("Manually Added Devices"), (char *)"Manually Added Devices", (char *)context);
|
||||
|
||||
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <QMainWindow>
|
||||
#include <QTimer>
|
||||
#include <QSystemTrayIcon>
|
||||
@@ -23,19 +22,8 @@
|
||||
#include "OpenRGBSystemInfoPage.h"
|
||||
#include "OpenRGBSupportedDevicesPage.h"
|
||||
#include "OpenRGBSettingsPage.h"
|
||||
#include "OpenRGBDMXSettingsPage/OpenRGBDMXSettingsPage.h"
|
||||
#include "OpenRGBE131SettingsPage/OpenRGBE131SettingsPage.h"
|
||||
#include "OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsPage.h"
|
||||
#include "OpenRGBElgatoLightStripSettingsPage/OpenRGBElgatoLightStripSettingsPage.h"
|
||||
#include "OpenRGBGoveeSettingsPage/OpenRGBGoveeSettingsPage.h"
|
||||
#include "OpenRGBKasaSmartSettingsPage/OpenRGBKasaSmartSettingsPage.h"
|
||||
#include "OpenRGBLIFXSettingsPage/OpenRGBLIFXSettingsPage.h"
|
||||
#include "OpenRGBPhilipsHueSettingsPage/OpenRGBPhilipsHueSettingsPage.h"
|
||||
#include "OpenRGBPhilipsWizSettingsPage/OpenRGBPhilipsWizSettingsPage.h"
|
||||
#include "OpenRGBQMKORGBSettingsPage/OpenRGBQMKORGBSettingsPage.h"
|
||||
#include "OpenRGBSerialSettingsPage/OpenRGBSerialSettingsPage.h"
|
||||
#include "OpenRGBYeelightSettingsPage/OpenRGBYeelightSettingsPage.h"
|
||||
#include "OpenRGBNanoleafSettingsPage/OpenRGBNanoleafSettingsPage.h"
|
||||
#include "ManualDevicesSettingsPage/ManualDevicesSettingsPage.h"
|
||||
|
||||
#include "PluginManager.h"
|
||||
#include "SuspendResume.h"
|
||||
|
||||
@@ -98,19 +86,8 @@ private:
|
||||
OpenRGBSoftwareInfoPage *SoftInfoPage;
|
||||
OpenRGBSupportedDevicesPage *SupportedPage;
|
||||
OpenRGBSettingsPage *SettingsPage;
|
||||
OpenRGBDMXSettingsPage *DMXSettingsPage;
|
||||
OpenRGBE131SettingsPage *E131SettingsPage;
|
||||
OpenRGBElgatoKeyLightSettingsPage *ElgatoKeyLightSettingsPage;
|
||||
OpenRGBElgatoLightStripSettingsPage *ElgatoLightStripSettingsPage;
|
||||
OpenRGBGoveeSettingsPage *GoveeSettingsPage;
|
||||
OpenRGBKasaSmartSettingsPage *KasaSmartSettingsPage;
|
||||
OpenRGBLIFXSettingsPage *LIFXSettingsPage;
|
||||
OpenRGBPhilipsHueSettingsPage *PhilipsHueSettingsPage;
|
||||
OpenRGBPhilipsWizSettingsPage *PhilipsWizSettingsPage;
|
||||
OpenRGBQMKORGBSettingsPage *QMKORGBSettingsPage;
|
||||
OpenRGBSerialSettingsPage *SerialSettingsPage;
|
||||
OpenRGBYeelightSettingsPage *YeelightSettingsPage;
|
||||
OpenRGBNanoleafSettingsPage *NanoleafSettingsPage;
|
||||
|
||||
ManualDevicesSettingsPage *manualDevicesPage;
|
||||
|
||||
bool ShowI2CTools = false;
|
||||
bool plugins_loaded = false;
|
||||
@@ -130,21 +107,9 @@ private:
|
||||
void AddSoftwareInfoPage();
|
||||
void AddSupportedDevicesPage();
|
||||
void AddSettingsPage();
|
||||
void AddDMXSettingsPage();
|
||||
void AddE131SettingsPage();
|
||||
void AddElgatoKeyLightSettingsPage();
|
||||
void AddElgatoLightStripSettingsPage();
|
||||
void AddGoveeSettingsPage();
|
||||
void AddKasaSmartSettingsPage();
|
||||
void AddLIFXSettingsPage();
|
||||
void AddPhilipsHueSettingsPage();
|
||||
void AddPhilipsWizSettingsPage();
|
||||
void AddQMKORGBSettingsPage();
|
||||
void AddSerialSettingsPage();
|
||||
void AddYeelightSettingsPage();
|
||||
void AddNanoleafSettingsPage();
|
||||
void AddPluginsPage();
|
||||
void AddConsolePage();
|
||||
void AddManualDevicesSettingsPage();
|
||||
|
||||
void ClearDevicesList();
|
||||
void UpdateDevicesList();
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBE131SettingsPage.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB E1.31 settings page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBE131SettingsPage.h"
|
||||
#include "ui_OpenRGBE131SettingsPage.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "SettingsManager.h"
|
||||
|
||||
OpenRGBE131SettingsPage::OpenRGBE131SettingsPage(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::OpenRGBE131SettingsPage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
json e131_settings;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Get E1.31 settings from settings manager |
|
||||
\*-------------------------------------------------*/
|
||||
e131_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("E131Devices");
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| If the E1.31 settings contains devices, process |
|
||||
\*-------------------------------------------------*/
|
||||
if(e131_settings.contains("devices"))
|
||||
{
|
||||
for(unsigned int device_idx = 0; device_idx < e131_settings["devices"].size(); device_idx++)
|
||||
{
|
||||
OpenRGBE131SettingsEntry* entry = new OpenRGBE131SettingsEntry;
|
||||
|
||||
entry->loadFromSettings(e131_settings["devices"][device_idx]);
|
||||
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->E131DeviceList->addItem(item);
|
||||
ui->E131DeviceList->setItemWidget(item, entry);
|
||||
ui->E131DeviceList->show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OpenRGBE131SettingsPage::~OpenRGBE131SettingsPage()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBE131SettingsPage::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBE131SettingsPage::on_AddE131DeviceButton_clicked()
|
||||
{
|
||||
OpenRGBE131SettingsEntry* entry = new OpenRGBE131SettingsEntry;
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->E131DeviceList->addItem(item);
|
||||
ui->E131DeviceList->setItemWidget(item, entry);
|
||||
ui->E131DeviceList->show();
|
||||
}
|
||||
|
||||
void OpenRGBE131SettingsPage::on_RemoveE131DeviceButton_clicked()
|
||||
{
|
||||
int cur_row = ui->E131DeviceList->currentRow();
|
||||
|
||||
if(cur_row < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QListWidgetItem* item = ui->E131DeviceList->takeItem(cur_row);
|
||||
|
||||
ui->E131DeviceList->removeItemWidget(item);
|
||||
delete item;
|
||||
|
||||
delete entries[cur_row];
|
||||
entries.erase(entries.begin() + cur_row);
|
||||
}
|
||||
|
||||
void OpenRGBE131SettingsPage::on_SaveE131ConfigurationButton_clicked()
|
||||
{
|
||||
json e131_settings;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Get E1.31 settings from settings manager |
|
||||
\*-------------------------------------------------*/
|
||||
e131_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("E131Devices");
|
||||
|
||||
e131_settings["devices"].clear();
|
||||
|
||||
for(unsigned int device_idx = 0; device_idx < entries.size(); device_idx++)
|
||||
{
|
||||
e131_settings["devices"][device_idx] = entries[device_idx]->saveSettings();
|
||||
}
|
||||
|
||||
ResourceManager::get()->GetSettingsManager()->SetSettings("E131Devices", e131_settings);
|
||||
ResourceManager::get()->GetSettingsManager()->SaveSettings();
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBE131SettingsPage.h |
|
||||
| |
|
||||
| User interface for OpenRGB E1.31 settings page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "ui_OpenRGBE131SettingsPage.h"
|
||||
#include "OpenRGBE131SettingsEntry.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBE131SettingsPage;
|
||||
}
|
||||
|
||||
class OpenRGBE131SettingsPage : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBE131SettingsPage(QWidget *parent = nullptr);
|
||||
~OpenRGBE131SettingsPage();
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void on_AddE131DeviceButton_clicked();
|
||||
|
||||
void on_RemoveE131DeviceButton_clicked();
|
||||
|
||||
void on_SaveE131ConfigurationButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::OpenRGBE131SettingsPage *ui;
|
||||
std::vector<OpenRGBE131SettingsEntry*> entries;
|
||||
};
|
||||
@@ -1,49 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBE131SettingsPage</class>
|
||||
<widget class="QWidget" name="OpenRGBE131SettingsPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">E.131 Settings Page</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="AddE131DeviceButton">
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="RemoveE131DeviceButton">
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="SaveE131ConfigurationButton">
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QListWidget" name="E131DeviceList">
|
||||
<property name="verticalScrollMode">
|
||||
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,109 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBElgatoKeyLightSettingsPage.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB Elgato Key Light page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBElgatoKeyLightSettingsPage.h"
|
||||
#include "ui_OpenRGBElgatoKeyLightSettingsPage.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "SettingsManager.h"
|
||||
|
||||
OpenRGBElgatoKeyLightSettingsPage::OpenRGBElgatoKeyLightSettingsPage(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::OpenRGBElgatoKeyLightSettingsPage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
json elgato_keylight_settings;
|
||||
|
||||
elgato_keylight_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("ElgatoKeyLightDevices");
|
||||
|
||||
/*---------------------------------------------------------------*\
|
||||
| If the Elgato Key Light settings contains devices, process |
|
||||
\*---------------------------------------------------------------*/
|
||||
if(elgato_keylight_settings.contains("devices"))
|
||||
{
|
||||
for(unsigned int device_idx = 0; device_idx < elgato_keylight_settings["devices"].size(); device_idx++)
|
||||
{
|
||||
OpenRGBElgatoKeyLightSettingsEntry* entry = new OpenRGBElgatoKeyLightSettingsEntry;
|
||||
|
||||
entry->loadFromSettings(elgato_keylight_settings["devices"][device_idx]);
|
||||
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->ElgatoKeyLightDeviceList->addItem(item);
|
||||
ui->ElgatoKeyLightDeviceList->setItemWidget(item, entry);
|
||||
ui->ElgatoKeyLightDeviceList->show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OpenRGBElgatoKeyLightSettingsPage::~OpenRGBElgatoKeyLightSettingsPage()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBElgatoKeyLightSettingsPage::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBElgatoKeyLightSettingsPage::on_AddElgatoKeyLightDeviceButton_clicked()
|
||||
{
|
||||
OpenRGBElgatoKeyLightSettingsEntry* entry = new OpenRGBElgatoKeyLightSettingsEntry;
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->ElgatoKeyLightDeviceList->addItem(item);
|
||||
ui->ElgatoKeyLightDeviceList->setItemWidget(item, entry);
|
||||
ui->ElgatoKeyLightDeviceList->show();
|
||||
}
|
||||
|
||||
void OpenRGBElgatoKeyLightSettingsPage::on_RemoveElgatoKeyLightDeviceButton_clicked()
|
||||
{
|
||||
int cur_row = ui->ElgatoKeyLightDeviceList->currentRow();
|
||||
|
||||
if(cur_row < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QListWidgetItem* item = ui->ElgatoKeyLightDeviceList->takeItem(cur_row);
|
||||
|
||||
ui->ElgatoKeyLightDeviceList->removeItemWidget(item);
|
||||
delete item;
|
||||
|
||||
delete entries[cur_row];
|
||||
entries.erase(entries.begin() + cur_row);
|
||||
}
|
||||
|
||||
void OpenRGBElgatoKeyLightSettingsPage::on_SaveElgatoKeyLightConfigurationButton_clicked()
|
||||
{
|
||||
json elgato_keylight_settings;
|
||||
|
||||
elgato_keylight_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("ElgatoKeyLightDevices");
|
||||
|
||||
elgato_keylight_settings["devices"].clear();
|
||||
|
||||
for(unsigned int device_idx = 0; device_idx < entries.size(); device_idx++)
|
||||
{
|
||||
elgato_keylight_settings["devices"][device_idx] = entries[device_idx]->saveSettings();
|
||||
}
|
||||
|
||||
ResourceManager::get()->GetSettingsManager()->SetSettings("ElgatoKeyLightDevices", elgato_keylight_settings);
|
||||
ResourceManager::get()->GetSettingsManager()->SaveSettings();
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBElgatoKeyLightSettingsPage.h |
|
||||
| |
|
||||
| User interface for OpenRGB Elgato Key Light page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "OpenRGBElgatoKeyLightSettingsEntry.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBElgatoKeyLightSettingsPage;
|
||||
}
|
||||
|
||||
class OpenRGBElgatoKeyLightSettingsPage : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBElgatoKeyLightSettingsPage(QWidget *parent = nullptr);
|
||||
~OpenRGBElgatoKeyLightSettingsPage();
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void on_AddElgatoKeyLightDeviceButton_clicked();
|
||||
|
||||
void on_RemoveElgatoKeyLightDeviceButton_clicked();
|
||||
|
||||
void on_SaveElgatoKeyLightConfigurationButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::OpenRGBElgatoKeyLightSettingsPage *ui;
|
||||
std::vector<OpenRGBElgatoKeyLightSettingsEntry*> entries;
|
||||
};
|
||||
@@ -1,45 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBElgatoKeyLightSettingsPage</class>
|
||||
<widget class="QWidget" name="OpenRGBElgatoKeyLightSettingsPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Elgato Key Light Settings Page</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QListWidget" name="ElgatoKeyLightDeviceList"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="AddElgatoKeyLightDeviceButton">
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="RemoveElgatoKeyLightDeviceButton">
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="SaveElgatoKeyLightConfigurationButton">
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,52 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBElgatoLightStripSettingsEntry.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB Elgato Light Strips entry |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBElgatoLightStripSettingsEntry.h"
|
||||
#include "ui_OpenRGBElgatoLightStripSettingsEntry.h"
|
||||
|
||||
OpenRGBElgatoLightStripSettingsEntry::OpenRGBElgatoLightStripSettingsEntry(QWidget *parent) :
|
||||
BaseManualDeviceEntry(parent),
|
||||
ui(new Ui::OpenRGBElgatoLightStripSettingsEntry)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
}
|
||||
|
||||
OpenRGBElgatoLightStripSettingsEntry::~OpenRGBElgatoLightStripSettingsEntry()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBElgatoLightStripSettingsEntry::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBElgatoLightStripSettingsEntry::loadFromSettings(const json& data)
|
||||
{
|
||||
if(data.contains("ip"))
|
||||
{
|
||||
ui->IPEdit->setText(QString::fromStdString(data["ip"]));
|
||||
}
|
||||
}
|
||||
|
||||
json OpenRGBElgatoLightStripSettingsEntry::saveSettings()
|
||||
{
|
||||
json result;
|
||||
result["ip"] = ui->IPEdit->text().toStdString();
|
||||
return result;
|
||||
}
|
||||
|
||||
const char* OpenRGBElgatoLightStripSettingsEntry::settingsSection()
|
||||
{
|
||||
return "ElgatoLightStripDevices";
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBElgatoLightStripSettingsPage.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB Elgato Light Strips page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBElgatoLightStripSettingsPage.h"
|
||||
#include "ui_OpenRGBElgatoLightStripSettingsPage.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "SettingsManager.h"
|
||||
|
||||
OpenRGBElgatoLightStripSettingsPage::OpenRGBElgatoLightStripSettingsPage(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::OpenRGBElgatoLightStripSettingsPage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
json elgato_lightstrip_settings;
|
||||
|
||||
elgato_lightstrip_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("ElgatoLightStripDevices");
|
||||
|
||||
/*---------------------------------------------------------------*\
|
||||
| If the Elgato Light Strip settings contains devices, process |
|
||||
\*---------------------------------------------------------------*/
|
||||
if(elgato_lightstrip_settings.contains("devices"))
|
||||
{
|
||||
for(unsigned int device_idx = 0; device_idx < elgato_lightstrip_settings["devices"].size(); device_idx++)
|
||||
{
|
||||
OpenRGBElgatoLightStripSettingsEntry* entry = new OpenRGBElgatoLightStripSettingsEntry;
|
||||
|
||||
entry->loadFromSettings(elgato_lightstrip_settings["devices"][device_idx]);
|
||||
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->ElgatoLightStripDeviceList->addItem(item);
|
||||
ui->ElgatoLightStripDeviceList->setItemWidget(item, entry);
|
||||
ui->ElgatoLightStripDeviceList->show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OpenRGBElgatoLightStripSettingsPage::~OpenRGBElgatoLightStripSettingsPage()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBElgatoLightStripSettingsPage::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBElgatoLightStripSettingsPage::on_AddElgatoLightStripDeviceButton_clicked()
|
||||
{
|
||||
OpenRGBElgatoLightStripSettingsEntry* entry = new OpenRGBElgatoLightStripSettingsEntry;
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->ElgatoLightStripDeviceList->addItem(item);
|
||||
ui->ElgatoLightStripDeviceList->setItemWidget(item, entry);
|
||||
ui->ElgatoLightStripDeviceList->show();
|
||||
}
|
||||
|
||||
void OpenRGBElgatoLightStripSettingsPage::on_RemoveElgatoLightStripDeviceButton_clicked()
|
||||
{
|
||||
int cur_row = ui->ElgatoLightStripDeviceList->currentRow();
|
||||
|
||||
if(cur_row < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QListWidgetItem* item = ui->ElgatoLightStripDeviceList->takeItem(cur_row);
|
||||
|
||||
ui->ElgatoLightStripDeviceList->removeItemWidget(item);
|
||||
delete item;
|
||||
|
||||
delete entries[cur_row];
|
||||
entries.erase(entries.begin() + cur_row);
|
||||
}
|
||||
|
||||
void OpenRGBElgatoLightStripSettingsPage::on_SaveElgatoLightStripConfigurationButton_clicked()
|
||||
{
|
||||
json elgato_lightstrip_settings;
|
||||
|
||||
elgato_lightstrip_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("ElgatoLightStripDevices");
|
||||
|
||||
elgato_lightstrip_settings["devices"].clear();
|
||||
|
||||
for(unsigned int device_idx = 0; device_idx < entries.size(); device_idx++)
|
||||
{
|
||||
elgato_lightstrip_settings["devices"][device_idx] = entries[device_idx]->saveSettings();
|
||||
}
|
||||
|
||||
ResourceManager::get()->GetSettingsManager()->SetSettings("ElgatoLightStripDevices", elgato_lightstrip_settings);
|
||||
ResourceManager::get()->GetSettingsManager()->SaveSettings();
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBElgatoLightStripSettingsPage.h |
|
||||
| |
|
||||
| User interface for OpenRGB Elgato Light Strips page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "OpenRGBElgatoLightStripSettingsEntry.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBElgatoLightStripSettingsPage;
|
||||
}
|
||||
|
||||
class OpenRGBElgatoLightStripSettingsPage : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBElgatoLightStripSettingsPage(QWidget *parent = nullptr);
|
||||
~OpenRGBElgatoLightStripSettingsPage();
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void on_AddElgatoLightStripDeviceButton_clicked();
|
||||
|
||||
void on_RemoveElgatoLightStripDeviceButton_clicked();
|
||||
|
||||
void on_SaveElgatoLightStripConfigurationButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::OpenRGBElgatoLightStripSettingsPage *ui;
|
||||
std::vector<OpenRGBElgatoLightStripSettingsEntry*> entries;
|
||||
};
|
||||
@@ -1,45 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBElgatoLightStripSettingsPage</class>
|
||||
<widget class="QWidget" name="OpenRGBElgatoLightStripSettingsPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Elgato Light Strip Settings Page</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QListWidget" name="ElgatoLightStripDeviceList"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="AddElgatoLightStripDeviceButton">
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="RemoveElgatoLightStripDeviceButton">
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="SaveElgatoLightStripConfigurationButton">
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,117 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBGoveeSettingsPage.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB Govee settings page |
|
||||
| |
|
||||
| Adam Honse (calcprogrammer1@gmail.com) 15 May 2025 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBGoveeSettingsPage.h"
|
||||
#include "ui_OpenRGBGoveeSettingsPage.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "SettingsManager.h"
|
||||
|
||||
OpenRGBGoveeSettingsPage::OpenRGBGoveeSettingsPage(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::OpenRGBGoveeSettingsPage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
json govee_settings;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Get Govee settings |
|
||||
\*-------------------------------------------------*/
|
||||
govee_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("GoveeDevices");
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| If the Govee settings contains devices, process |
|
||||
\*-------------------------------------------------*/
|
||||
if(govee_settings.contains("devices"))
|
||||
{
|
||||
for(unsigned int device_idx = 0; device_idx < govee_settings["devices"].size(); device_idx++)
|
||||
{
|
||||
OpenRGBGoveeSettingsEntry* entry = new OpenRGBGoveeSettingsEntry;
|
||||
|
||||
entry->loadFromSettings(govee_settings["devices"][device_idx]);
|
||||
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->GoveeDeviceList->addItem(item);
|
||||
ui->GoveeDeviceList->setItemWidget(item, entry);
|
||||
ui->GoveeDeviceList->show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OpenRGBGoveeSettingsPage::~OpenRGBGoveeSettingsPage()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBGoveeSettingsPage::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBGoveeSettingsPage::on_AddGoveeDeviceButton_clicked()
|
||||
{
|
||||
OpenRGBGoveeSettingsEntry* entry = new OpenRGBGoveeSettingsEntry;
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->GoveeDeviceList->addItem(item);
|
||||
ui->GoveeDeviceList->setItemWidget(item, entry);
|
||||
ui->GoveeDeviceList->show();
|
||||
}
|
||||
|
||||
void OpenRGBGoveeSettingsPage::on_RemoveGoveeDeviceButton_clicked()
|
||||
{
|
||||
int cur_row = ui->GoveeDeviceList->currentRow();
|
||||
|
||||
if(cur_row < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QListWidgetItem* item = ui->GoveeDeviceList->takeItem(cur_row);
|
||||
|
||||
ui->GoveeDeviceList->removeItemWidget(item);
|
||||
delete item;
|
||||
|
||||
delete entries[cur_row];
|
||||
entries.erase(entries.begin() + cur_row);
|
||||
}
|
||||
|
||||
void OpenRGBGoveeSettingsPage::on_SaveGoveeConfigurationButton_clicked()
|
||||
{
|
||||
json govee_settings;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Get Govee settings |
|
||||
\*-------------------------------------------------*/
|
||||
govee_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("GoveeDevices");
|
||||
|
||||
govee_settings["devices"].clear();
|
||||
|
||||
for(unsigned int device_idx = 0; device_idx < entries.size(); device_idx++)
|
||||
{
|
||||
govee_settings["devices"][device_idx] = entries[device_idx]->saveSettings();
|
||||
}
|
||||
|
||||
ResourceManager::get()->GetSettingsManager()->SetSettings("GoveeDevices", govee_settings);
|
||||
ResourceManager::get()->GetSettingsManager()->SaveSettings();
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBGoveeSettingsPage.h |
|
||||
| |
|
||||
| User interface for OpenRGB Govee settings page |
|
||||
| |
|
||||
| Adam Honse (calcprogrammer1@gmail.com) 15 May 2025 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "OpenRGBGoveeSettingsEntry.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBGoveeSettingsPage;
|
||||
}
|
||||
|
||||
class OpenRGBGoveeSettingsPage : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBGoveeSettingsPage(QWidget *parent = nullptr);
|
||||
~OpenRGBGoveeSettingsPage();
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void on_AddGoveeDeviceButton_clicked();
|
||||
|
||||
void on_RemoveGoveeDeviceButton_clicked();
|
||||
|
||||
void on_SaveGoveeConfigurationButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::OpenRGBGoveeSettingsPage *ui;
|
||||
std::vector<OpenRGBGoveeSettingsEntry*> entries;
|
||||
|
||||
};
|
||||
@@ -1,49 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBGoveeSettingsPage</class>
|
||||
<widget class="QWidget" name="OpenRGBGoveeSettingsPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Philips Wiz Settings Page</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="AddGoveeDeviceButton">
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="RemoveGoveeDeviceButton">
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="SaveGoveeConfigurationButton">
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QListWidget" name="GoveeDeviceList">
|
||||
<property name="verticalScrollMode">
|
||||
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,121 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBKasaSmartSettingsPage.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB Kasa Smart settings page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBKasaSmartSettingsPage.h"
|
||||
#include "ui_OpenRGBKasaSmartSettingsPage.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "SettingsManager.h"
|
||||
|
||||
OpenRGBKasaSmartSettingsPage::OpenRGBKasaSmartSettingsPage(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::OpenRGBKasaSmartSettingsPage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
json KasaSmart_settings;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Get KasaSmart settings |
|
||||
\*-------------------------------------------------*/
|
||||
KasaSmart_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("KasaSmartDevices");
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| If the Wiz settings contains devices, process |
|
||||
\*-------------------------------------------------*/
|
||||
if(KasaSmart_settings.contains("devices"))
|
||||
{
|
||||
for(unsigned int device_idx = 0; device_idx < KasaSmart_settings["devices"].size(); device_idx++)
|
||||
{
|
||||
OpenRGBKasaSmartSettingsEntry* entry = new OpenRGBKasaSmartSettingsEntry;
|
||||
|
||||
entry->loadFromSettings(KasaSmart_settings["devices"][device_idx]);
|
||||
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->KasaSmartDeviceList->addItem(item);
|
||||
ui->KasaSmartDeviceList->setItemWidget(item, entry);
|
||||
ui->KasaSmartDeviceList->show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OpenRGBKasaSmartSettingsPage::~OpenRGBKasaSmartSettingsPage()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBKasaSmartSettingsPage::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBKasaSmartSettingsPage::on_AddKasaSmartDeviceButton_clicked()
|
||||
{
|
||||
OpenRGBKasaSmartSettingsEntry* entry = new OpenRGBKasaSmartSettingsEntry;
|
||||
|
||||
entry->setName(QString("KasaSmart%1").arg(entries.size()));
|
||||
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->KasaSmartDeviceList->addItem(item);
|
||||
ui->KasaSmartDeviceList->setItemWidget(item, entry);
|
||||
ui->KasaSmartDeviceList->show();
|
||||
}
|
||||
|
||||
void OpenRGBKasaSmartSettingsPage::on_RemoveKasaSmartDeviceButton_clicked()
|
||||
{
|
||||
int cur_row = ui->KasaSmartDeviceList->currentRow();
|
||||
|
||||
if(cur_row < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QListWidgetItem* item = ui->KasaSmartDeviceList->takeItem(cur_row);
|
||||
|
||||
ui->KasaSmartDeviceList->removeItemWidget(item);
|
||||
delete item;
|
||||
|
||||
delete entries[cur_row];
|
||||
entries.erase(entries.begin() + cur_row);
|
||||
}
|
||||
|
||||
void OpenRGBKasaSmartSettingsPage::on_SaveKasaSmartConfigurationButton_clicked()
|
||||
{
|
||||
json KasaSmart_settings;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Get KasaSmart settings |
|
||||
\*-------------------------------------------------*/
|
||||
KasaSmart_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("KasaSmartDevices");
|
||||
|
||||
KasaSmart_settings["devices"].clear();
|
||||
|
||||
for(unsigned int device_idx = 0; device_idx < entries.size(); device_idx++)
|
||||
{
|
||||
/*-------------------------------------------------*\
|
||||
| Required parameters |
|
||||
\*-------------------------------------------------*/
|
||||
KasaSmart_settings["devices"][device_idx] = entries[device_idx]->saveSettings();
|
||||
}
|
||||
|
||||
ResourceManager::get()->GetSettingsManager()->SetSettings("KasaSmartDevices", KasaSmart_settings);
|
||||
ResourceManager::get()->GetSettingsManager()->SaveSettings();
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBKasaSmartSettingsPage.h |
|
||||
| |
|
||||
| User interface for OpenRGB Kasa Smart settings page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <QWidget>
|
||||
#include "OpenRGBKasaSmartSettingsEntry.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBKasaSmartSettingsPage;
|
||||
}
|
||||
|
||||
class OpenRGBKasaSmartSettingsPage : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBKasaSmartSettingsPage(QWidget *parent = nullptr);
|
||||
~OpenRGBKasaSmartSettingsPage();
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void on_AddKasaSmartDeviceButton_clicked();
|
||||
|
||||
void on_RemoveKasaSmartDeviceButton_clicked();
|
||||
|
||||
void on_SaveKasaSmartConfigurationButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::OpenRGBKasaSmartSettingsPage *ui;
|
||||
std::vector<OpenRGBKasaSmartSettingsEntry*> entries;
|
||||
|
||||
};
|
||||
@@ -1,49 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBKasaSmartSettingsPage</class>
|
||||
<widget class="QWidget" name="OpenRGBKasaSmartSettingsPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Kasa Smart Settings Page</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="AddKasaSmartDeviceButton">
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="RemoveKasaSmartDeviceButton">
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="SaveKasaSmartConfigurationButton">
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QListWidget" name="KasaSmartDeviceList">
|
||||
<property name="verticalScrollMode">
|
||||
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,118 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBLIFXSettingsPage.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB LIFX settings page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBLIFXSettingsPage.h"
|
||||
#include "ui_OpenRGBLIFXSettingsPage.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "SettingsManager.h"
|
||||
|
||||
OpenRGBLIFXSettingsPage::OpenRGBLIFXSettingsPage(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::OpenRGBLIFXSettingsPage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
json lifx_settings;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Get LIFX settings |
|
||||
\*-------------------------------------------------*/
|
||||
lifx_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("LIFXDevices");
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| If the Wiz settings contains devices, process |
|
||||
\*-------------------------------------------------*/
|
||||
if(lifx_settings.contains("devices"))
|
||||
{
|
||||
for(unsigned int device_idx = 0; device_idx < lifx_settings["devices"].size(); device_idx++)
|
||||
{
|
||||
OpenRGBLIFXSettingsEntry* entry = new OpenRGBLIFXSettingsEntry;
|
||||
|
||||
entry->loadFromSettings(lifx_settings["devices"][device_idx]);
|
||||
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->LIFXDeviceList->addItem(item);
|
||||
ui->LIFXDeviceList->setItemWidget(item, entry);
|
||||
ui->LIFXDeviceList->show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OpenRGBLIFXSettingsPage::~OpenRGBLIFXSettingsPage()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBLIFXSettingsPage::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBLIFXSettingsPage::on_AddLIFXDeviceButton_clicked()
|
||||
{
|
||||
OpenRGBLIFXSettingsEntry* entry = new OpenRGBLIFXSettingsEntry;
|
||||
|
||||
entry->setName(QString("LIFX%1").arg(entries.size()));
|
||||
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->LIFXDeviceList->addItem(item);
|
||||
ui->LIFXDeviceList->setItemWidget(item, entry);
|
||||
ui->LIFXDeviceList->show();
|
||||
}
|
||||
|
||||
void OpenRGBLIFXSettingsPage::on_RemoveLIFXDeviceButton_clicked()
|
||||
{
|
||||
int cur_row = ui->LIFXDeviceList->currentRow();
|
||||
|
||||
if(cur_row < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QListWidgetItem* item = ui->LIFXDeviceList->takeItem(cur_row);
|
||||
|
||||
ui->LIFXDeviceList->removeItemWidget(item);
|
||||
delete item;
|
||||
|
||||
delete entries[cur_row];
|
||||
entries.erase(entries.begin() + cur_row);
|
||||
}
|
||||
|
||||
void OpenRGBLIFXSettingsPage::on_SaveLIFXConfigurationButton_clicked()
|
||||
{
|
||||
json lifx_settings;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Get LIFX settings |
|
||||
\*-------------------------------------------------*/
|
||||
lifx_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("LIFXDevices");
|
||||
|
||||
lifx_settings["devices"].clear();
|
||||
|
||||
for(unsigned int device_idx = 0; device_idx < entries.size(); device_idx++)
|
||||
{
|
||||
lifx_settings["devices"][device_idx] = entries[device_idx]->saveSettings();
|
||||
}
|
||||
|
||||
ResourceManager::get()->GetSettingsManager()->SetSettings("LIFXDevices", lifx_settings);
|
||||
ResourceManager::get()->GetSettingsManager()->SaveSettings();
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBLIFXSettingsPage.h |
|
||||
| |
|
||||
| User interface for OpenRGB LIFX settings page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "OpenRGBLIFXSettingsEntry.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBLIFXSettingsPage;
|
||||
}
|
||||
|
||||
class OpenRGBLIFXSettingsPage : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBLIFXSettingsPage(QWidget *parent = nullptr);
|
||||
~OpenRGBLIFXSettingsPage();
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void on_AddLIFXDeviceButton_clicked();
|
||||
|
||||
void on_RemoveLIFXDeviceButton_clicked();
|
||||
|
||||
void on_SaveLIFXConfigurationButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::OpenRGBLIFXSettingsPage *ui;
|
||||
std::vector<OpenRGBLIFXSettingsEntry*> entries;
|
||||
|
||||
};
|
||||
@@ -1,49 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBLIFXSettingsPage</class>
|
||||
<widget class="QWidget" name="OpenRGBLIFXSettingsPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">LIFX Settings Page</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="AddLIFXDeviceButton">
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="RemoveLIFXDeviceButton">
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="SaveLIFXConfigurationButton">
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QListWidget" name="LIFXDeviceList">
|
||||
<property name="verticalScrollMode">
|
||||
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,62 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBNanoleafSettingsPage</class>
|
||||
<widget class="QWidget" name="OpenRGBNanoleafSettingsPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Nanoleaf Settings Page</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="2" column="0">
|
||||
<widget class="QPushButton" name="AddNanoleafDeviceButton">
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="RemoveNanoleafDeviceButton">
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="ScanForNanoleafDevicesButton">
|
||||
<property name="text">
|
||||
<string>Scan</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="3">
|
||||
<widget class="QListWidget" name="NanoleafDeviceList">
|
||||
<property name="verticalScrollMode">
|
||||
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QLabel" name="SyncLabel">
|
||||
<property name="text">
|
||||
<string>To pair, hold the on-off button down for 5-7 seconds until the LED starts flashing in a pattern, then click the "Pair" button within 30 seconds.</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,115 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBPhilipsHueSettingsPage.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB Philips Hue settings page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBPhilipsHueSettingsPage.h"
|
||||
#include "ui_OpenRGBPhilipsHueSettingsPage.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "SettingsManager.h"
|
||||
|
||||
OpenRGBPhilipsHueSettingsPage::OpenRGBPhilipsHueSettingsPage(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::OpenRGBPhilipsHueSettingsPage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
json hue_settings;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Get Philips Hue settings |
|
||||
\*-------------------------------------------------*/
|
||||
hue_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("PhilipsHueDevices");
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| If the Hue settings contains bridges, process |
|
||||
\*-------------------------------------------------*/
|
||||
if(hue_settings.contains("bridges"))
|
||||
{
|
||||
for(unsigned int device_idx = 0; device_idx < hue_settings["bridges"].size(); device_idx++)
|
||||
{
|
||||
OpenRGBPhilipsHueSettingsEntry* entry = new OpenRGBPhilipsHueSettingsEntry;
|
||||
|
||||
entry->loadFromSettings(hue_settings["bridges"][device_idx]);
|
||||
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->PhilipsHueDeviceList->addItem(item);
|
||||
ui->PhilipsHueDeviceList->setItemWidget(item, entry);
|
||||
ui->PhilipsHueDeviceList->show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OpenRGBPhilipsHueSettingsPage::~OpenRGBPhilipsHueSettingsPage()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBPhilipsHueSettingsPage::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBPhilipsHueSettingsPage::on_AddPhilipsHueDeviceButton_clicked()
|
||||
{
|
||||
OpenRGBPhilipsHueSettingsEntry* entry = new OpenRGBPhilipsHueSettingsEntry;
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->PhilipsHueDeviceList->addItem(item);
|
||||
ui->PhilipsHueDeviceList->setItemWidget(item, entry);
|
||||
ui->PhilipsHueDeviceList->show();
|
||||
}
|
||||
|
||||
void OpenRGBPhilipsHueSettingsPage::on_RemovePhilipsHueDeviceButton_clicked()
|
||||
{
|
||||
int cur_row = ui->PhilipsHueDeviceList->currentRow();
|
||||
|
||||
if(cur_row < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QListWidgetItem* item = ui->PhilipsHueDeviceList->takeItem(cur_row);
|
||||
|
||||
ui->PhilipsHueDeviceList->removeItemWidget(item);
|
||||
delete item;
|
||||
|
||||
delete entries[cur_row];
|
||||
entries.erase(entries.begin() + cur_row);
|
||||
}
|
||||
|
||||
void OpenRGBPhilipsHueSettingsPage::on_SavePhilipsHueConfigurationButton_clicked()
|
||||
{
|
||||
json hue_settings;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Get Philips Hue settings |
|
||||
\*-------------------------------------------------*/
|
||||
hue_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("PhilipsHueDevices");
|
||||
|
||||
hue_settings["bridges"].clear();
|
||||
|
||||
for(unsigned int device_idx = 0; device_idx < entries.size(); device_idx++)
|
||||
{
|
||||
hue_settings["bridges"][device_idx] = entries[device_idx]->saveSettings();
|
||||
}
|
||||
|
||||
ResourceManager::get()->GetSettingsManager()->SetSettings("PhilipsHueDevices", hue_settings);
|
||||
ResourceManager::get()->GetSettingsManager()->SaveSettings();
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBPhilipsHueSettingsPage.h |
|
||||
| |
|
||||
| User interface for OpenRGB Philips Hue settings page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "OpenRGBPhilipsHueSettingsEntry.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBPhilipsHueSettingsPage;
|
||||
}
|
||||
|
||||
class OpenRGBPhilipsHueSettingsPage : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBPhilipsHueSettingsPage(QWidget *parent = nullptr);
|
||||
~OpenRGBPhilipsHueSettingsPage();
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void on_AddPhilipsHueDeviceButton_clicked();
|
||||
|
||||
void on_RemovePhilipsHueDeviceButton_clicked();
|
||||
|
||||
void on_SavePhilipsHueConfigurationButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::OpenRGBPhilipsHueSettingsPage *ui;
|
||||
std::vector<OpenRGBPhilipsHueSettingsEntry*> entries;
|
||||
};
|
||||
@@ -1,62 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBPhilipsHueSettingsPage</class>
|
||||
<widget class="QWidget" name="OpenRGBPhilipsHueSettingsPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Philips Hue Settings Page</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="RemovePhilipsHueDeviceButton">
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QPushButton" name="AddPhilipsHueDeviceButton">
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="3">
|
||||
<widget class="QListWidget" name="PhilipsHueDeviceList">
|
||||
<property name="verticalScrollMode">
|
||||
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="SavePhilipsHueConfigurationButton">
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QLabel" name="SyncLabel">
|
||||
<property name="text">
|
||||
<string>After adding a Hue entry and saving, restart OpenRGB and press the Sync button on your Hue bridge to pair it.</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,115 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBPhilipsWizSettingsPage.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB Philips Wiz settings page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBPhilipsWizSettingsPage.h"
|
||||
#include "ui_OpenRGBPhilipsWizSettingsPage.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "SettingsManager.h"
|
||||
|
||||
OpenRGBPhilipsWizSettingsPage::OpenRGBPhilipsWizSettingsPage(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::OpenRGBPhilipsWizSettingsPage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
json wiz_settings;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Get Philips Wiz settings |
|
||||
\*-------------------------------------------------*/
|
||||
wiz_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("PhilipsWizDevices");
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| If the Wiz settings contains devices, process |
|
||||
\*-------------------------------------------------*/
|
||||
if(wiz_settings.contains("devices"))
|
||||
{
|
||||
for(unsigned int device_idx = 0; device_idx < wiz_settings["devices"].size(); device_idx++)
|
||||
{
|
||||
OpenRGBPhilipsWizSettingsEntry* entry = new OpenRGBPhilipsWizSettingsEntry;
|
||||
|
||||
entry->loadFromSettings(wiz_settings["devices"][device_idx]);
|
||||
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->PhilipsWizDeviceList->addItem(item);
|
||||
ui->PhilipsWizDeviceList->setItemWidget(item, entry);
|
||||
ui->PhilipsWizDeviceList->show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OpenRGBPhilipsWizSettingsPage::~OpenRGBPhilipsWizSettingsPage()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBPhilipsWizSettingsPage::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBPhilipsWizSettingsPage::on_AddPhilipsWizDeviceButton_clicked()
|
||||
{
|
||||
OpenRGBPhilipsWizSettingsEntry* entry = new OpenRGBPhilipsWizSettingsEntry;
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->PhilipsWizDeviceList->addItem(item);
|
||||
ui->PhilipsWizDeviceList->setItemWidget(item, entry);
|
||||
ui->PhilipsWizDeviceList->show();
|
||||
}
|
||||
|
||||
void OpenRGBPhilipsWizSettingsPage::on_RemovePhilipsWizDeviceButton_clicked()
|
||||
{
|
||||
int cur_row = ui->PhilipsWizDeviceList->currentRow();
|
||||
|
||||
if(cur_row < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QListWidgetItem* item = ui->PhilipsWizDeviceList->takeItem(cur_row);
|
||||
|
||||
ui->PhilipsWizDeviceList->removeItemWidget(item);
|
||||
delete item;
|
||||
|
||||
delete entries[cur_row];
|
||||
entries.erase(entries.begin() + cur_row);
|
||||
}
|
||||
|
||||
void OpenRGBPhilipsWizSettingsPage::on_SavePhilipsWizConfigurationButton_clicked()
|
||||
{
|
||||
json wiz_settings;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Get Philips Wiz settings |
|
||||
\*-------------------------------------------------*/
|
||||
wiz_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("PhilipsWizDevices");
|
||||
|
||||
wiz_settings["devices"].clear();
|
||||
|
||||
for(unsigned int device_idx = 0; device_idx < entries.size(); device_idx++)
|
||||
{
|
||||
wiz_settings["devices"][device_idx] = entries[device_idx]->saveSettings();
|
||||
}
|
||||
|
||||
ResourceManager::get()->GetSettingsManager()->SetSettings("PhilipsWizDevices", wiz_settings);
|
||||
ResourceManager::get()->GetSettingsManager()->SaveSettings();
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBPhilipsWizSettingsPage.h |
|
||||
| |
|
||||
| User interface for OpenRGB Philips Wiz settings page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "OpenRGBPhilipsWizSettingsEntry.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBPhilipsWizSettingsPage;
|
||||
}
|
||||
|
||||
class OpenRGBPhilipsWizSettingsPage : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBPhilipsWizSettingsPage(QWidget *parent = nullptr);
|
||||
~OpenRGBPhilipsWizSettingsPage();
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void on_AddPhilipsWizDeviceButton_clicked();
|
||||
|
||||
void on_RemovePhilipsWizDeviceButton_clicked();
|
||||
|
||||
void on_SavePhilipsWizConfigurationButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::OpenRGBPhilipsWizSettingsPage *ui;
|
||||
std::vector<OpenRGBPhilipsWizSettingsEntry*> entries;
|
||||
|
||||
};
|
||||
@@ -1,49 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBPhilipsWizSettingsPage</class>
|
||||
<widget class="QWidget" name="OpenRGBPhilipsWizSettingsPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Philips Wiz Settings Page</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="AddPhilipsWizDeviceButton">
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="RemovePhilipsWizDeviceButton">
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="SavePhilipsWizConfigurationButton">
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QListWidget" name="PhilipsWizDeviceList">
|
||||
<property name="verticalScrollMode">
|
||||
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,118 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBQMKORGBSettingsPage.cpp |
|
||||
| |
|
||||
| User interface for OpenRGB QMK device configuration page|
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBQMKORGBSettingsPage.h"
|
||||
#include "ui_OpenRGBQMKORGBSettingsPage.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "SettingsManager.h"
|
||||
|
||||
OpenRGBQMKORGBSettingsPage::OpenRGBQMKORGBSettingsPage(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::OpenRGBQMKORGBSettingsPage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
json qmk_settings;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Get QMKOpenRGB settings |
|
||||
\*-------------------------------------------------*/
|
||||
qmk_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("QMKOpenRGBDevices");
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| If the LEDStrip settings contains devices, process|
|
||||
\*-------------------------------------------------*/
|
||||
if(qmk_settings.contains("devices"))
|
||||
{
|
||||
for(unsigned int device_idx = 0; device_idx < qmk_settings["devices"].size(); device_idx++)
|
||||
{
|
||||
OpenRGBQMKORGBSettingsEntry* entry = new OpenRGBQMKORGBSettingsEntry;
|
||||
|
||||
entry->loadFromSettings(qmk_settings["devices"][device_idx]);
|
||||
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->QMKORGBDeviceList->addItem(item);
|
||||
ui->QMKORGBDeviceList->setItemWidget(item, entry);
|
||||
ui->QMKORGBDeviceList->show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OpenRGBQMKORGBSettingsPage::~OpenRGBQMKORGBSettingsPage()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBQMKORGBSettingsPage::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBQMKORGBSettingsPage::on_AddQMKORGBDeviceButton_clicked()
|
||||
{
|
||||
OpenRGBQMKORGBSettingsEntry* entry = new OpenRGBQMKORGBSettingsEntry;
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->QMKORGBDeviceList->addItem(item);
|
||||
ui->QMKORGBDeviceList->setItemWidget(item, entry);
|
||||
ui->QMKORGBDeviceList->show();
|
||||
}
|
||||
|
||||
void OpenRGBQMKORGBSettingsPage::on_RemoveQMKORGBDeviceButton_clicked()
|
||||
{
|
||||
int cur_row = ui->QMKORGBDeviceList->currentRow();
|
||||
|
||||
if(cur_row < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QListWidgetItem* item = ui->QMKORGBDeviceList->takeItem(cur_row);
|
||||
|
||||
ui->QMKORGBDeviceList->removeItemWidget(item);
|
||||
delete item;
|
||||
|
||||
delete entries[cur_row];
|
||||
entries.erase(entries.begin() + cur_row);
|
||||
}
|
||||
|
||||
void OpenRGBQMKORGBSettingsPage::on_SaveQMKORGBConfigurationButton_clicked()
|
||||
{
|
||||
json qmk_settings;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Get QMKOpenRGB settings |
|
||||
\*-------------------------------------------------*/
|
||||
qmk_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("QMKOpenRGBDevices");
|
||||
|
||||
qmk_settings["devices"].clear();
|
||||
|
||||
for(unsigned int device_idx = 0; device_idx < entries.size(); device_idx++)
|
||||
{
|
||||
/*-------------------------------------------------*\
|
||||
| Required parameters |
|
||||
\*-------------------------------------------------*/
|
||||
qmk_settings["devices"][device_idx] = entries[device_idx]->saveSettings();
|
||||
}
|
||||
|
||||
ResourceManager::get()->GetSettingsManager()->SetSettings("QMKOpenRGBDevices", qmk_settings);
|
||||
ResourceManager::get()->GetSettingsManager()->SaveSettings();
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBQMKORGBSettingsPage.h |
|
||||
| |
|
||||
| User interface for OpenRGB QMK device configuration page|
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "OpenRGBQMKORGBSettingsEntry.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBQMKORGBSettingsPage;
|
||||
}
|
||||
|
||||
class OpenRGBQMKORGBSettingsPage : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBQMKORGBSettingsPage(QWidget *parent = nullptr);
|
||||
~OpenRGBQMKORGBSettingsPage();
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void on_AddQMKORGBDeviceButton_clicked();
|
||||
|
||||
void on_RemoveQMKORGBDeviceButton_clicked();
|
||||
|
||||
void on_SaveQMKORGBConfigurationButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::OpenRGBQMKORGBSettingsPage *ui;
|
||||
std::vector<OpenRGBQMKORGBSettingsEntry*> entries;
|
||||
|
||||
};
|
||||
@@ -1,49 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBQMKORGBSettingsPage</class>
|
||||
<widget class="QWidget" name="OpenRGBQMKORGBSettingsPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">OpenRGB QMK Settings Page</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="AddQMKORGBDeviceButton">
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="RemoveQMKORGBDeviceButton">
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="SaveQMKORGBConfigurationButton">
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QListWidget" name="QMKORGBDeviceList">
|
||||
<property name="verticalScrollMode">
|
||||
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,115 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBSerialSettingsPage.cpp |
|
||||
| |
|
||||
| User interface for serial device configuration page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBSerialSettingsPage.h"
|
||||
#include "ui_OpenRGBSerialSettingsPage.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "SettingsManager.h"
|
||||
|
||||
OpenRGBSerialSettingsPage::OpenRGBSerialSettingsPage(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::OpenRGBSerialSettingsPage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
json ledstrip_settings;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Get LED Strip settings from settings manager |
|
||||
\*-------------------------------------------------*/
|
||||
ledstrip_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("LEDStripDevices");
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| If the LEDStrip settings contains devices, process|
|
||||
\*-------------------------------------------------*/
|
||||
if(ledstrip_settings.contains("devices"))
|
||||
{
|
||||
for(unsigned int device_idx = 0; device_idx < ledstrip_settings["devices"].size(); device_idx++)
|
||||
{
|
||||
OpenRGBSerialSettingsEntry* entry = new OpenRGBSerialSettingsEntry;
|
||||
|
||||
entry->loadFromSettings(ledstrip_settings["devices"][device_idx]);
|
||||
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->SerialDeviceList->addItem(item);
|
||||
ui->SerialDeviceList->setItemWidget(item, entry);
|
||||
ui->SerialDeviceList->show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OpenRGBSerialSettingsPage::~OpenRGBSerialSettingsPage()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBSerialSettingsPage::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBSerialSettingsPage::on_AddSerialDeviceButton_clicked()
|
||||
{
|
||||
OpenRGBSerialSettingsEntry* entry = new OpenRGBSerialSettingsEntry;
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->SerialDeviceList->addItem(item);
|
||||
ui->SerialDeviceList->setItemWidget(item, entry);
|
||||
ui->SerialDeviceList->show();
|
||||
}
|
||||
|
||||
void OpenRGBSerialSettingsPage::on_RemoveSerialDeviceButton_clicked()
|
||||
{
|
||||
int cur_row = ui->SerialDeviceList->currentRow();
|
||||
|
||||
if(cur_row < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QListWidgetItem* item = ui->SerialDeviceList->takeItem(cur_row);
|
||||
|
||||
ui->SerialDeviceList->removeItemWidget(item);
|
||||
delete item;
|
||||
|
||||
delete entries[cur_row];
|
||||
entries.erase(entries.begin() + cur_row);
|
||||
}
|
||||
|
||||
void OpenRGBSerialSettingsPage::on_SaveSerialConfigurationButton_clicked()
|
||||
{
|
||||
json ledstrip_settings;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Get E1.31 settings from settings manager |
|
||||
\*-------------------------------------------------*/
|
||||
ledstrip_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("LEDStripDevices");
|
||||
|
||||
ledstrip_settings["devices"].clear();
|
||||
|
||||
for(unsigned int device_idx = 0; device_idx < entries.size(); device_idx++)
|
||||
{
|
||||
ledstrip_settings["devices"][device_idx] = entries[device_idx]->saveSettings();
|
||||
}
|
||||
|
||||
ResourceManager::get()->GetSettingsManager()->SetSettings("LEDStripDevices", ledstrip_settings);
|
||||
ResourceManager::get()->GetSettingsManager()->SaveSettings();
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBSerialSettingsPage.h |
|
||||
| |
|
||||
| User interface for serial device configuration page |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "OpenRGBSerialSettingsEntry.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBSerialSettingsPage;
|
||||
}
|
||||
|
||||
class OpenRGBSerialSettingsPage : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBSerialSettingsPage(QWidget *parent = nullptr);
|
||||
~OpenRGBSerialSettingsPage();
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void on_AddSerialDeviceButton_clicked();
|
||||
|
||||
void on_RemoveSerialDeviceButton_clicked();
|
||||
|
||||
void on_SaveSerialConfigurationButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::OpenRGBSerialSettingsPage *ui;
|
||||
std::vector<OpenRGBSerialSettingsEntry*> entries;
|
||||
|
||||
};
|
||||
@@ -1,49 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBSerialSettingsPage</class>
|
||||
<widget class="QWidget" name="OpenRGBSerialSettingsPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Serial Settings Page</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="AddSerialDeviceButton">
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="RemoveSerialDeviceButton">
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="SaveSerialConfigurationButton">
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QListWidget" name="SerialDeviceList">
|
||||
<property name="verticalScrollMode">
|
||||
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,115 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBYeelightSettingsPage.cpp |
|
||||
| |
|
||||
| User interface for configuring Yeelight settings |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBYeelightSettingsPage.h"
|
||||
#include "ui_OpenRGBYeelightSettingsPage.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "SettingsManager.h"
|
||||
|
||||
OpenRGBYeelightSettingsPage::OpenRGBYeelightSettingsPage(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::OpenRGBYeelightSettingsPage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
json yeelight_settings;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Get Philips Wiz settings |
|
||||
\*-------------------------------------------------*/
|
||||
yeelight_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("YeelightDevices");
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| If the Wiz settings contains devices, process |
|
||||
\*-------------------------------------------------*/
|
||||
if(yeelight_settings.contains("devices"))
|
||||
{
|
||||
for(unsigned int device_idx = 0; device_idx < yeelight_settings["devices"].size(); device_idx++)
|
||||
{
|
||||
OpenRGBYeelightSettingsEntry* entry = new OpenRGBYeelightSettingsEntry;
|
||||
|
||||
entry->loadFromSettings(yeelight_settings["devices"][device_idx]);
|
||||
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->YeelightDeviceList->addItem(item);
|
||||
ui->YeelightDeviceList->setItemWidget(item, entry);
|
||||
ui->YeelightDeviceList->show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OpenRGBYeelightSettingsPage::~OpenRGBYeelightSettingsPage()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBYeelightSettingsPage::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBYeelightSettingsPage::on_AddYeelightDeviceButton_clicked()
|
||||
{
|
||||
OpenRGBYeelightSettingsEntry* entry = new OpenRGBYeelightSettingsEntry;
|
||||
entries.push_back(entry);
|
||||
|
||||
QListWidgetItem* item = new QListWidgetItem;
|
||||
|
||||
item->setSizeHint(entry->sizeHint());
|
||||
|
||||
ui->YeelightDeviceList->addItem(item);
|
||||
ui->YeelightDeviceList->setItemWidget(item, entry);
|
||||
ui->YeelightDeviceList->show();
|
||||
}
|
||||
|
||||
void OpenRGBYeelightSettingsPage::on_RemoveYeelightDeviceButton_clicked()
|
||||
{
|
||||
int cur_row = ui->YeelightDeviceList->currentRow();
|
||||
|
||||
if(cur_row < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QListWidgetItem* item = ui->YeelightDeviceList->takeItem(cur_row);
|
||||
|
||||
ui->YeelightDeviceList->removeItemWidget(item);
|
||||
delete item;
|
||||
|
||||
delete entries[cur_row];
|
||||
entries.erase(entries.begin() + cur_row);
|
||||
}
|
||||
|
||||
void OpenRGBYeelightSettingsPage::on_SaveYeelightConfigurationButton_clicked()
|
||||
{
|
||||
json yeelight_settings;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Get Philips Wiz settings |
|
||||
\*-------------------------------------------------*/
|
||||
yeelight_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("YeelightDevices");
|
||||
|
||||
yeelight_settings["devices"].clear();
|
||||
|
||||
for(unsigned int device_idx = 0; device_idx < entries.size(); device_idx++)
|
||||
{
|
||||
yeelight_settings["devices"][device_idx] = entries[device_idx]->saveSettings();
|
||||
}
|
||||
|
||||
ResourceManager::get()->GetSettingsManager()->SetSettings("YeelightDevices", yeelight_settings);
|
||||
ResourceManager::get()->GetSettingsManager()->SaveSettings();
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBYeelightSettingsPage.h |
|
||||
| |
|
||||
| User interface for configuring Yeelight settings |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-only |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "OpenRGBYeelightSettingsEntry.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBYeelightSettingsPage;
|
||||
}
|
||||
|
||||
class OpenRGBYeelightSettingsPage : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBYeelightSettingsPage(QWidget *parent = nullptr);
|
||||
~OpenRGBYeelightSettingsPage();
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void on_AddYeelightDeviceButton_clicked();
|
||||
|
||||
void on_RemoveYeelightDeviceButton_clicked();
|
||||
|
||||
void on_SaveYeelightConfigurationButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::OpenRGBYeelightSettingsPage *ui;
|
||||
std::vector<OpenRGBYeelightSettingsEntry*> entries;
|
||||
};
|
||||
@@ -1,49 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBYeelightSettingsPage</class>
|
||||
<widget class="QWidget" name="OpenRGBYeelightSettingsPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Yeelight Settings Page</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="AddYeelightDeviceButton">
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="RemoveYeelightDeviceButton">
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="SaveYeelightConfigurationButton">
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QListWidget" name="YeelightDeviceList">
|
||||
<property name="verticalScrollMode">
|
||||
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user