Compare commits

...

10 Commits

@ -69,3 +69,7 @@ OpenRGB is written in C++, uses the Qt framework for UI, and uses the QMake buil
Translation files are located in [`OpenRGB/qt/i18n/`](https://gitlab.com/CalcProgrammer1/OpenRGB/-/tree/master/qt/i18n), where languages are formatted using ISO 639-1 format: `OpenRGB_xx_XX.ts``xx_XX` representing the language code.
In order to translate a file, you need to [fork](https://gitlab.com/CalcProgrammer1/OpenRGB/-/forks/new) the project, create a new file for your language with `lupdate` (or edit an exisiting one), edit the file with `qtlinguist`, commit, push, and create a merge request.
## AI Guidelines
OpenRGB is an open source project developed by humans for humans. As a general rule, AI generated submissions are not permitted. The licensing behind AI generated code is problematic. If you choose to use AI for assistance in your development process, we can't stop you, but do not credit the AI in commits (no AI authorship/co-authorship). Ultimately, you as a human developer are responsible for the code you submit and it is expected that any code you submit you fully understand and have manually vetted before submission. Merge requests that appear to be straight from an AI output, commits with AI tool authorship or co-authorship tags, or otherwise AI generated submissions are subject to closure.

@ -105,6 +105,7 @@ void DetectGigabyteRGBFusionGPUControllers(i2c_smbus_interface* bus, uint8_t i2c
}
} /* DetectGigabyteRGBFusionGPUControllers() */
REGISTER_I2C_PCI_DETECTOR("Gigabyte GTX 1050 G1 Gaming", DetectGigabyteRGBFusionGPUControllers, NVIDIA_VEN, NVIDIA_GTX1050_DEV, GIGABYTE_SUB_VEN, GIGABYTE_GTX1050_G1_GAMING_SUB_DEV, 0x47);
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce GTX 1050 Ti G1 Gaming Rev A1", DetectGigabyteRGBFusionGPUControllers, NVIDIA_VEN, NVIDIA_GTX1050TI_DEV, GIGABYTE_SUB_VEN, GIGABYTE_GTX1050TI_G1_GAMING_SUB_DEV, 0x47);
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce GTX 1050 Ti G1 Gaming", DetectGigabyteRGBFusionGPUControllers, NVIDIA_VEN, NVIDIA_GTX1050TI_DEV, GIGABYTE_SUB_VEN, GIGABYTE_GTX1050TI_G1_GAMING_SUB_DEV, 0x48);
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce GTX 1060 G1 Gaming", DetectGigabyteRGBFusionGPUControllers, NVIDIA_VEN, NVIDIA_GTX1060_DEV, GIGABYTE_SUB_VEN, GIGABYTE_GTX1060_G1_GAMING_SUB_DEV, 0x48);

@ -67,7 +67,8 @@ static const std::string board_names[] =
"MSI MAG B850 TOMAHAWK MAX WIFI (MS-7E62)",
"MSI PRO B850M-P WIFI (MS-7E71)",
"MSI MAG Z890 TOMAHAWK WIFI (MS-7E32)",
"MSI MPG B850 EDGE TI WIFI (MS-7E62)"
"MSI MPG B850 EDGE TI WIFI (MS-7E62)",
"MSI PRO B850M-VC WIFI6E (MS-7E71)",
};
static const mystic_light_761_config board_configs[] =
@ -93,6 +94,7 @@ static const mystic_light_761_config board_configs[] =
{ &(board_names[18]), 0, 0, 0, 1, &zone_set1, MSIMysticLight761Controller::DIRECT_MODE_ZONE_BASED }, // MSI PRO B850M-P WIFI (MS-7E71)
{ &(board_names[19]), 0, 0, 0, 1, &zone_set1, MSIMysticLight761Controller::DIRECT_MODE_ZONE_BASED }, // MSI MAG Z890 TOMAHAWK WIFI (MS-7E32)
{ &(board_names[20]), 0, 0, 0, 1, &zone_set1, MSIMysticLight761Controller::DIRECT_MODE_ZONE_BASED }, // MSI MPG B850 EDGE TI WIFI (MS-7E62)
{ &(board_names[21]), 0, 0, 0, 1, &zone_set1, MSIMysticLight761Controller::DIRECT_MODE_ZONE_BASED }, // MSI PRO B850M-VC WIFI6E (MS-7E71)
};
enum MSI_ZONE setup_map [] =

@ -39,6 +39,7 @@ void DetectPNYARGBEpicXGPULargeControllers(i2c_smbus_interface* bus, uint8_t i2c
}
}
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 5060Ti ARGB Epic-X OC", DetectPNYARGBEpicXGPUSmallControllers, NVIDIA_VEN, NVIDIA_RTX5060TI_DEV, PNY_SUB_VEN, PNY_RTX_5060TI_ARGB_EPIC_X_OC_SUB_DEV, 0x60);
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 5070 ARGB Epic-X OC", DetectPNYARGBEpicXGPUSmallControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, PNY_SUB_VEN, PNY_RTX_5070_ARGB_EPIC_X_OC_SUB_DEV, 0x60);
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 5070Ti ARGB Epic-X OC", DetectPNYARGBEpicXGPUSmallControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, PNY_SUB_VEN, PNY_RTX_5070TI_ARGB_EPIC_X_OC_SUB_DEV, 0x60);
REGISTER_I2C_PCI_DETECTOR("PNY GeForce RTX 5080 ARGB Epic-X OC", DetectPNYARGBEpicXGPULargeControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, PNY_SUB_VEN, PNY_RTX_5080_ARGB_EPIC_X_OC_SUB_DEV, 0x60);

@ -175,7 +175,7 @@ bool i2c_smbus_linux_detect()
if(read(test_fd, buff, sizeof(buff)) < 0)
{
LOG_WARNING("[i2c_smbus_linux] Failed to read i2c device PCI vendor ID");
LOG_INFO("[i2c_smbus_linux] Failed to read i2c device PCI vendor ID");
}
if(strlen(buff) > 0 && strlen(buff) < sizeof(buff))
@ -195,7 +195,7 @@ bool i2c_smbus_linux_detect()
if(read(test_fd, buff, sizeof(buff)) < 0)
{
LOG_WARNING("[i2c_smbus_linux] Failed to read i2c device PCI device ID");
LOG_INFO("[i2c_smbus_linux] Failed to read i2c device PCI device ID");
}
if(strlen(buff) > 0 && strlen(buff) < sizeof(buff))
@ -215,7 +215,7 @@ bool i2c_smbus_linux_detect()
if(read(test_fd, buff, sizeof(buff)) < 0)
{
LOG_WARNING("[i2c_smbus_linux] Failed to read i2c device PCI subvendor ID");
LOG_INFO("[i2c_smbus_linux] Failed to read i2c device PCI subvendor ID");
}
if(strlen(buff) > 0 && strlen(buff) < sizeof(buff))
@ -235,7 +235,7 @@ bool i2c_smbus_linux_detect()
if(read(test_fd, buff, sizeof(buff)) < 0)
{
LOG_WARNING("[i2c_smbus_linux] Failed to read i2c device PCI subdevice ID");
LOG_INFO("[i2c_smbus_linux] Failed to read i2c device PCI subdevice ID");
}
if(strlen(buff) > 0 && strlen(buff) < sizeof(buff))

@ -574,6 +574,7 @@
| _D, _H and _P suffixes belong to many-HDMI Aorus GPUs |
| switching their ID depending on boot-plugged display |
\*-----------------------------------------------------*/
#define GIGABYTE_GTX1050_G1_GAMING_SUB_DEV 0x372B
#define GIGABYTE_GTX1050TI_G1_GAMING_SUB_DEV 0x372A
#define GIGABYTE_GTX1060_G1_GAMING_SUB_DEV 0x3716
#define GIGABYTE_GTX1060_G1_GAMING_OC_SUB_DEV 0x3739
@ -871,6 +872,7 @@
#define PNY_RTX_4090_VERTO_EPIC_X_OC_SUB_DEV 0x13D9
#define PNY_RTX_5070_ARGB_EPIC_X_OC_SUB_DEV 0x1439
#define PNY_RTX_5070TI_ARGB_EPIC_X_OC_SUB_DEV 0x143A
#define PNY_RTX_5060TI_ARGB_EPIC_X_OC_SUB_DEV 0x143E
#define PNY_RTX_5080_ARGB_EPIC_X_OC_SUB_DEV 0x1435
#define PNY_RTX_5090_ARGB_EPIC_X_OC_SUB_DEV 0x1446

@ -736,7 +736,7 @@ void DeviceView::paintEvent(QPaintEvent* /* event */)
/*-----------------------------------------------------*\
| If controller has resized, reinitialize local data |
\*-----------------------------------------------------*/
if(controller->leds.size() != led_pos.size())
if((controller->zones.size() != zone_pos.size()) || (controller->leds.size() != led_pos.size()))
{
InitDeviceView();
}

@ -711,7 +711,7 @@ void OpenRGBDialog::AddPluginsPage()
/*-----------------------------------------------------*\
| Create the tab label |
\*-----------------------------------------------------*/
TabLabel* PluginTabLabel = new TabLabel(OpenRGBFont::extension, tr("Plugins"), (char *)"Plugins", (char *)context);
TabLabel* PluginTabLabel = new TabLabel(OpenRGBFont::extension, (char *)"Plugins", (char *)context, true);
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, PluginTabLabel);
}
@ -728,7 +728,7 @@ void OpenRGBDialog::AddSoftwareInfoPage()
/*-----------------------------------------------------*\
| Create the tab label |
\*-----------------------------------------------------*/
TabLabel* SoftwareTabLabel = new TabLabel(OpenRGBFont::info, tr("About OpenRGB"), (char *)"About OpenRGB", (char *)context);
TabLabel* SoftwareTabLabel = new TabLabel(OpenRGBFont::info, (char *)"About OpenRGB", (char *)context, true);
ui->InformationTabBar->tabBar()->setTabButton(ui->InformationTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SoftwareTabLabel);
}
@ -745,7 +745,7 @@ void OpenRGBDialog::AddSupportedDevicesPage()
/*-----------------------------------------------------*\
| Create the tab label |
\*-----------------------------------------------------*/
TabLabel* SupportedTabLabel = new TabLabel(OpenRGBFont::controller, tr("Supported Devices"), (char *)"Supported Devices", (char *)context);
TabLabel* SupportedTabLabel = new TabLabel(OpenRGBFont::controller, (char *)"Supported Devices", (char *)context, true);
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SupportedTabLabel);
}
@ -762,7 +762,7 @@ void OpenRGBDialog::AddSettingsPage()
/*-----------------------------------------------------*\
| Create the tab label |
\*-----------------------------------------------------*/
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::options, tr("General Settings"), (char *)"General Settings", (char *)context);
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::options, (char *)"General Settings", (char *)context, true);
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
@ -785,7 +785,7 @@ void OpenRGBDialog::AddManualDevicesSettingsPage()
/*-----------------------------------------------------*\
| Create the tab label |
\*-----------------------------------------------------*/
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::bulb, tr("Manually Added Devices"), (char *)"Manually Added Devices", (char *)context);
TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::bulb, (char *)"Manually Added Devices", (char *)context, true);
ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel);
}
@ -795,7 +795,7 @@ void OpenRGBDialog::AddPlugin(OpenRGBPluginEntry* plugin)
/*-----------------------------------------------------*\
| Create the tab label |
\*-----------------------------------------------------*/
TabLabel* PluginTabLabel = new TabLabel(OpenRGBFont::extension, QString::fromStdString(plugin->info.Label), (char *)plugin->info.Label.c_str(), (char *)context);
TabLabel* PluginTabLabel = new TabLabel(OpenRGBFont::extension, (char *)plugin->info.Label.c_str(), (char *)context, false);
/*-----------------------------------------------------*\
| Place plugin as its own top level tab |
@ -948,7 +948,7 @@ void OpenRGBDialog::AddI2CToolsPage()
/*-----------------------------------------------------*\
| Create the tab label |
\*-----------------------------------------------------*/
TabLabel* SMBusToolsTabLabel = new TabLabel(OpenRGBFont::toolbox, tr("SMBus Tools"), (char *)"SMBus Tools", (char *)context);
TabLabel* SMBusToolsTabLabel = new TabLabel(OpenRGBFont::toolbox, (char *)"SMBus Tools", (char *)context, true);
ui->InformationTabBar->tabBar()->setTabButton(ui->InformationTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SMBusToolsTabLabel);
}
@ -1062,7 +1062,7 @@ void OpenRGBDialog::UpdateDevicesList()
/*---------------------------------------------*\
| Create the tab label |
\*---------------------------------------------*/
TabLabel* NewTabLabel = new TabLabel(GetIcon(controllers[controller_idx]->type), QString::fromStdString(controllers[controller_idx]->GetName()), (char *)controllers[controller_idx]->GetName().c_str(), (char *)context);
TabLabel* NewTabLabel = new TabLabel(GetIcon(controllers[controller_idx]->type), (char *)controllers[controller_idx]->GetName().c_str(), (char *)context, false);
ui->DevicesTabBar->tabBar()->setTabButton(ui->DevicesTabBar->count() - 1, QTabBar::LeftSide, NewTabLabel);
ui->DevicesTabBar->tabBar()->setTabToolTip(ui->DevicesTabBar->count() - 1, QString::fromStdString(controllers[controller_idx]->GetName()));
@ -1115,7 +1115,7 @@ void OpenRGBDialog::UpdateDevicesList()
/*---------------------------------------------*\
| Create the tab label |
\*---------------------------------------------*/
TabLabel* NewTabLabel = new TabLabel(GetIcon(controllers[controller_idx]->type), QString::fromStdString(controllers[controller_idx]->GetName()), (char *)controllers[controller_idx]->GetName().c_str(), (char *)context);
TabLabel* NewTabLabel = new TabLabel(GetIcon(controllers[controller_idx]->type), (char *)controllers[controller_idx]->GetName().c_str(), (char *)context, false);
ui->InformationTabBar->tabBar()->setTabButton(ui->InformationTabBar->count() - 1, QTabBar::LeftSide, NewTabLabel);
ui->InformationTabBar->tabBar()->setTabToolTip(ui->InformationTabBar->count() - 1, QString::fromStdString(controllers[controller_idx]->GetName()));
@ -1815,7 +1815,7 @@ void OpenRGBDialog::AddConsolePage()
/*-----------------------------------------------------*\
| Create the tab label |
\*-----------------------------------------------------*/
TabLabel* ConsoleTabLabel = new TabLabel(OpenRGBFont::terminal, tr("Log Console"), (char *)"Log Console", (char *)context);
TabLabel* ConsoleTabLabel = new TabLabel(OpenRGBFont::terminal, (char *)"Log Console", (char *)context, true);
ui->InformationTabBar->tabBar()->setTabButton(ui->InformationTabBar->tabBar()->count() - 1, QTabBar::LeftSide, ConsoleTabLabel);
}

@ -239,24 +239,28 @@ OpenRGBSettingsPage::OpenRGBSettingsPage(QWidget *parent) :
ui->TextDetectionDelay->setValue(0);
}
#if defined(_MACOSX_X86_X64)
/*---------------------------------------------------------*\
| Load drivers settings (Windows only or Mac) |
| Load drivers settings (MacOS only) |
\*---------------------------------------------------------*/
#if defined(WIN32) || defined(_MACOSX_X86_X64)
json drivers_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("Drivers");
ui->CheckboxSharedSMBusAccess->hide();
ui->LabelSMBusSleepMode->hide();
ui->ComboBoxSMBusSleepMode->hide();
if(drivers_settings.contains("amd_smbus_reduce_cpu"))
{
ui->CheckboxAMDSMBusReduceCPU->setChecked(drivers_settings["amd_smbus_reduce_cpu"]);
}
#else
ui->DriversSettingsLabel->hide();
ui->CheckboxAMDSMBusReduceCPU->hide();
#endif
#elif defined(_WIN32)
/*---------------------------------------------------------*\
| Load drivers settings (Windows only) |
\*---------------------------------------------------------*/
#ifdef _WIN32
json drivers_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("Drivers");
ui->CheckboxAMDSMBusReduceCPU->hide();
if(drivers_settings.contains("shared_smbus_access"))
{
ui->CheckboxSharedSMBusAccess->setChecked(drivers_settings["shared_smbus_access"]);
@ -265,10 +269,29 @@ OpenRGBSettingsPage::OpenRGBSettingsPage(QWidget *parent) :
{
ui->CheckboxSharedSMBusAccess->setChecked(true);
}
ui->ComboBoxSMBusSleepMode->addItem("Always Busy");
ui->ComboBoxSMBusSleepMode->addItem("Short Busy");
ui->ComboBoxSMBusSleepMode->addItem("Always Sleep");
if(drivers_settings.contains("smbus_sleep_mode") && (drivers_settings["smbus_sleep_mode"] <= 2))
{
ui->ComboBoxSMBusSleepMode->setCurrentIndex(drivers_settings["smbus_sleep_mode"]);
}
else
{
ui->ComboBoxSMBusSleepMode->setCurrentIndex(2);
}
#else
/*---------------------------------------------------------*\
| Hide all drivers settings otherwise |
\*---------------------------------------------------------*/
ui->DriversSettingsLabel->hide();
ui->CheckboxAMDSMBusReduceCPU->hide();
ui->CheckboxSharedSMBusAccess->hide();
ui->LabelSMBusSleepMode->hide();
ui->ComboBoxSMBusSleepMode->hide();
#endif
UpdateProfiles();
/*---------------------------------------------------------*\
@ -1072,6 +1095,14 @@ void OpenRGBSettingsPage::on_CheckboxSharedSMBusAccess_clicked()
SaveSettings();
}
void OpenRGBSettingsPage::on_ComboBoxSMBusSleepMode_currentIndexChanged(int index)
{
json drivers_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("Drivers");
drivers_settings["smbus_sleep_mode"] = index;
ResourceManager::get()->GetSettingsManager()->SetSettings("Drivers", drivers_settings);
SaveSettings();
}
void OpenRGBSettingsPage::on_CheckboxDisableKeyExpansion_clicked()
{
json ui_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("UserInterface");

@ -82,6 +82,7 @@ private slots:
void on_TextDetectionDelay_valueChanged(int);
void on_CheckboxAMDSMBusReduceCPU_clicked();
void on_CheckboxSharedSMBusAccess_clicked();
void on_ComboBoxSMBusSleepMode_currentIndexChanged(int index);
void on_CheckboxSetOnExit_clicked(bool checked);
void on_ComboBoxExitProfile_currentTextChanged(const QString exit_profile_name);

@ -30,47 +30,60 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-328</y>
<y>-321</y>
<width>508</width>
<height>1105</height>
<height>1137</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="15" column="0">
<widget class="QCheckBox" name="CheckboxLogConsole">
<item row="16" column="0">
<widget class="QLabel" name="DetectionSettingsLabel">
<property name="text">
<string>Enable Log Console (restart required)</string>
<string>Detection Settings:</string>
</property>
</widget>
</item>
<item row="36" column="0">
<widget class="QCheckBox" name="CheckboxAutoStartProfile">
<item row="33" column="0">
<widget class="QCheckBox" name="CheckboxAutoStartSetServerHost">
<property name="text">
<string>Load Profile</string>
<string>Set Server Host</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QCheckBox" name="CheckboxDisableKeyExpansion">
<property name="text">
<string>Disable Key Expansion in Device View</string>
<item row="34" column="1">
<widget class="QSpinBox" name="TextServerPort">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>65535</number>
</property>
<property name="value">
<number>6742</number>
</property>
</widget>
</item>
<item row="21" column="0">
<widget class="QCheckBox" name="CheckboxSharedSMBusAccess">
<item row="2" column="0">
<widget class="QLabel" name="UserInterfaceSettingsLabel">
<property name="text">
<string>Shared SMBus Access (restart required)</string>
<string>User Interface Settings:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="ComboBoxLanguage"/>
<item row="40" column="1">
<widget class="QComboBox" name="ComboBoxExitProfile"/>
</item>
<item row="40" column="0">
<widget class="QLabel" name="AutoStartStatusLabel">
<item row="4" column="0">
<widget class="QLabel" name="ThemeLabel">
<property name="text">
<string>Start at Login Status</string>
<string>Theme (restart required)</string>
</property>
</widget>
</item>
<item row="38" column="0">
<widget class="QCheckBox" name="CheckboxSetOnSuspend">
<property name="text">
<string>Set Profile on Suspend</string>
</property>
</widget>
</item>
@ -81,133 +94,154 @@
</property>
</widget>
</item>
<item row="12" column="0">
<widget class="QLabel" name="HexFormatLabel">
<item row="3" column="1">
<widget class="QComboBox" name="ComboBoxLanguage"/>
</item>
<item row="23" column="0">
<widget class="QLabel" name="ServerSettingsLabel">
<property name="text">
<string>Hex Format</string>
<string>Server Settings:</string>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QCheckBox" name="CheckboxShowLEDView">
<item row="14" column="0">
<widget class="QCheckBox" name="CheckboxLogFile">
<property name="text">
<string>Show LED View by Default</string>
<string>Enable Log File (restart required)</string>
</property>
</widget>
</item>
<item row="24" column="0">
<widget class="QCheckBox" name="CheckboxLegacyWorkaround">
<item row="19" column="0">
<widget class="QLabel" name="DriversSettingsLabel">
<property name="text">
<string>Legacy Workaround</string>
<string>Drivers Settings:</string>
</property>
</widget>
</item>
<item row="38" column="1">
<widget class="QComboBox" name="ComboBoxResumeProfile"/>
<item row="3" column="0">
<widget class="QLabel" name="LabelLanguage">
<property name="text">
<string>Language</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="ThemeLabel">
<item row="25" column="0">
<widget class="QCheckBox" name="CheckboxLegacyWorkaround">
<property name="text">
<string>Theme (restart required)</string>
<string>Legacy Workaround</string>
</property>
</widget>
</item>
<item row="12" column="1">
<widget class="QComboBox" name="ComboBoxHexFormat"/>
<item row="18" column="1">
<widget class="QSpinBox" name="TextDetectionDelay">
<property name="maximum">
<number>2147483647</number>
</property>
</widget>
</item>
<item row="16" column="0">
<widget class="QLabel" name="DetectionSettingsLabel">
<item row="41" column="0">
<widget class="QLabel" name="AutoStartStatusLabel">
<property name="text">
<string>Detection Settings:</string>
<string>Start at Login Status</string>
</property>
</widget>
</item>
<item row="23" column="0">
<widget class="QCheckBox" name="CheckboxAllDevices">
<item row="5" column="0">
<widget class="QCheckBox" name="CheckboxMinimizeOnClose">
<property name="text">
<string>Serve All Devices (Including those from client connections)</string>
<string>Minimize on Close</string>
</property>
</widget>
</item>
<item row="32" column="1">
<widget class="QLineEdit" name="TextServerHost"/>
<item row="35" column="1">
<widget class="QLineEdit" name="TextClientHost"/>
</item>
<item row="20" column="0">
<widget class="QCheckBox" name="CheckboxAMDSMBusReduceCPU">
<item row="21" column="0">
<widget class="QCheckBox" name="CheckboxSharedSMBusAccess">
<property name="text">
<string>AMD SMBus: Reduce CPU Usage (restart required)</string>
<string>Shared SMBus Access (restart required)</string>
</property>
</widget>
</item>
<item row="37" column="1">
<widget class="QComboBox" name="ComboBoxSuspendProfile"/>
</item>
<item row="25" column="0">
<widget class="QLabel" name="AutoStartLabel">
<item row="6" column="0">
<widget class="QCheckBox" name="CheckboxTrayIconGreyscale">
<property name="text">
<string>Start at Login Settings:</string>
<string>Greyscale Tray Icon</string>
</property>
</widget>
</item>
<item row="32" column="0">
<widget class="QCheckBox" name="CheckboxAutoStartSetServerHost">
<item row="15" column="0">
<widget class="QCheckBox" name="CheckboxLogConsole">
<property name="text">
<string>Set Server Host</string>
<string>Enable Log Console (restart required)</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="CheckboxTrayIconGreyscale">
<item row="34" column="0">
<widget class="QCheckBox" name="CheckboxAutoStartSetServerPort">
<property name="text">
<string>Greyscale Tray Icon</string>
<string>Set Server Port</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="ComboBoxTheme"/>
<item row="39" column="1">
<widget class="QComboBox" name="ComboBoxResumeProfile"/>
</item>
<item row="30" column="0">
<widget class="QCheckBox" name="CheckboxAutoStartMinimized">
<item row="26" column="0">
<widget class="QLabel" name="AutoStartLabel">
<property name="text">
<string>Start Minimized</string>
<string>Start at Login Settings:</string>
</property>
</widget>
</item>
<item row="36" column="1">
<item row="35" column="0">
<widget class="QCheckBox" name="CheckboxAutoStartClient">
<property name="text">
<string>Start Client</string>
</property>
</widget>
</item>
<item row="37" column="1">
<widget class="QComboBox" name="ComboBoxAutoStartProfile"/>
</item>
<item row="26" column="0">
<widget class="QCheckBox" name="CheckboxAutoStart">
<item row="37" column="0">
<widget class="QCheckBox" name="CheckboxAutoStartProfile">
<property name="text">
<string>Start at Login</string>
<string>Load Profile</string>
</property>
</widget>
</item>
<item row="39" column="1">
<widget class="QComboBox" name="ComboBoxExitProfile"/>
<item row="33" column="1">
<widget class="QLineEdit" name="TextServerHost"/>
</item>
<item row="17" column="0">
<widget class="QCheckBox" name="CheckboxHIDSafeMode">
<item row="40" column="0">
<widget class="QCheckBox" name="CheckboxSetOnExit">
<property name="text">
<string>HID Safe Mode</string>
<string>Set Profile on Exit</string>
</property>
</widget>
</item>
<item row="34" column="0">
<widget class="QCheckBox" name="CheckboxAutoStartClient">
<item row="12" column="1">
<widget class="QComboBox" name="ComboBoxHexFormat"/>
</item>
<item row="12" column="0">
<widget class="QLabel" name="HexFormatLabel">
<property name="text">
<string>Start Client</string>
<string>Hex Format</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="UserInterfaceSettingsLabel">
<item row="27" column="0">
<widget class="QCheckBox" name="CheckboxAutoStart">
<property name="text">
<string>User Interface Settings:</string>
<string>Start at Login</string>
</property>
</widget>
</item>
<item row="41" column="0">
<item row="36" column="1">
<widget class="QLineEdit" name="TextCustomArgs"/>
</item>
<item row="42" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
@ -223,136 +257,112 @@
</property>
</spacer>
</item>
<item row="35" column="1">
<widget class="QLineEdit" name="TextCustomArgs"/>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="CheckboxMinimizeOnClose">
<property name="text">
<string>Minimize on Close</string>
</property>
</widget>
</item>
<item row="22" column="0">
<widget class="QLabel" name="ServerSettingsLabel">
<item row="8" column="0">
<widget class="QCheckBox" name="CheckboxSaveGeometry">
<property name="text">
<string>Server Settings:</string>
<string>Save Geometry on Close</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QCheckBox" name="CheckboxSaveGeometry">
<item row="20" column="0">
<widget class="QCheckBox" name="CheckboxAMDSMBusReduceCPU">
<property name="text">
<string>Save Geometry on Close</string>
<string>AMD SMBus: Reduce CPU Usage (restart required)</string>
</property>
</widget>
</item>
<item row="31" column="0">
<item row="32" column="0">
<widget class="QCheckBox" name="CheckboxAutoStartServer">
<property name="text">
<string>Start Server</string>
</property>
</widget>
</item>
<item row="33" column="0">
<widget class="QCheckBox" name="CheckboxAutoStartSetServerPort">
<item row="17" column="0">
<widget class="QCheckBox" name="CheckboxHIDSafeMode">
<property name="text">
<string>Set Server Port</string>
<string>HID Safe Mode</string>
</property>
</widget>
</item>
<item row="37" column="0">
<widget class="QCheckBox" name="CheckboxSetOnSuspend">
<item row="18" column="0">
<widget class="QLabel" name="DetectionDelayLabel">
<property name="text">
<string>Set Profile on Suspend</string>
<string>Initial Detection Delay (milliseconds, 0 to disable)</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QCheckBox" name="CheckboxRunZoneChecks">
<item row="10" column="0">
<widget class="QCheckBox" name="CheckboxDisableKeyExpansion">
<property name="text">
<string>Run Zone Checks on Rescan</string>
<string>Disable Key Expansion in Device View</string>
</property>
</widget>
</item>
<item row="13" column="0">
<widget class="QLabel" name="LogManagerSettingsLabel">
<item row="24" column="0">
<widget class="QCheckBox" name="CheckboxAllDevices">
<property name="text">
<string>Log Manager Settings:</string>
<string>Serve All Devices (Including those from client connections)</string>
</property>
</widget>
</item>
<item row="14" column="0">
<widget class="QCheckBox" name="CheckboxLogFile">
<item row="4" column="1">
<widget class="QComboBox" name="ComboBoxTheme"/>
</item>
<item row="31" column="0">
<widget class="QCheckBox" name="CheckboxAutoStartMinimized">
<property name="text">
<string>Enable Log File (restart required)</string>
<string>Start Minimized</string>
</property>
</widget>
</item>
<item row="33" column="1">
<widget class="QSpinBox" name="TextServerPort">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>65535</number>
</property>
<property name="value">
<number>6742</number>
<item row="11" column="0">
<widget class="QCheckBox" name="CheckboxShowLEDView">
<property name="text">
<string>Show LED View by Default</string>
</property>
</widget>
</item>
<item row="38" column="0">
<widget class="QCheckBox" name="CheckboxSetOnResume">
<item row="38" column="1">
<widget class="QComboBox" name="ComboBoxSuspendProfile"/>
</item>
<item row="13" column="0">
<widget class="QLabel" name="LogManagerSettingsLabel">
<property name="text">
<string>Set Profile on Resume</string>
<string>Log Manager Settings:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="LabelLanguage">
<item row="39" column="0">
<widget class="QCheckBox" name="CheckboxSetOnResume">
<property name="text">
<string>Language</string>
<string>Set Profile on Resume</string>
</property>
</widget>
</item>
<item row="19" column="0">
<widget class="QLabel" name="DriversSettingsLabel">
<item row="9" column="0">
<widget class="QCheckBox" name="CheckboxRunZoneChecks">
<property name="text">
<string>Drivers Settings:</string>
<string>Run Zone Checks on Rescan</string>
</property>
</widget>
</item>
<item row="35" column="0">
<item row="36" column="0">
<widget class="QCheckBox" name="CheckboxAutoStartCustom">
<property name="text">
<string>Custom Arguments</string>
</property>
</widget>
</item>
<item row="34" column="1">
<widget class="QLineEdit" name="TextClientHost"/>
</item>
<item row="39" column="0">
<widget class="QCheckBox" name="CheckboxSetOnExit">
<property name="text">
<string>Set Profile on Exit</string>
</property>
</widget>
</item>
<item row="18" column="0">
<widget class="QLabel" name="DetectionDelayLabel">
<item row="22" column="0">
<widget class="QLabel" name="LabelSMBusSleepMode">
<property name="text">
<string>Initial Detection Delay (milliseconds, 0 to disable)</string>
<string>SMBus Sleep Mode (restart required)</string>
</property>
</widget>
</item>
<item row="18" column="1">
<widget class="QSpinBox" name="TextDetectionDelay">
<property name="maximum">
<number>2147483647</number>
</property>
</widget>
<item row="22" column="1">
<widget class="QComboBox" name="ComboBoxSMBusSleepMode"/>
</item>
</layout>
</widget>

@ -12,7 +12,7 @@
#include "OpenRGBFont.h"
#include "ui_TabLabel.h"
TabLabel::TabLabel(int icon, QString name, char* original, char* context) :
TabLabel::TabLabel(int icon, char* label, char* context, bool translatable) :
QWidget(nullptr),
ui(new Ui::TabLabel)
{
@ -24,10 +24,11 @@ TabLabel::TabLabel(int icon, QString name, char* original, char* context) :
ui->icon->setFont(font);
ui->icon->setText(OpenRGBFont::icon(icon));
ui->name->setText(name);
this->translatable = translatable;
this->label = label;
this->context = context;
label = original;
ctxt = context;
UpdateLabel(true);
}
TabLabel::~TabLabel()
@ -39,14 +40,29 @@ void TabLabel::changeEvent(QEvent *event)
{
if(event->type() == QEvent::LanguageChange)
{
/*-----------------------------------------------------*\
UpdateLabel(false);
}
}
void TabLabel::UpdateLabel(bool in_constructor)
{
if(translatable)
{
/*-------------------------------------------------*\
| Storing the base string in label |
| enables switching between multiple languages |
| The context needs to be stored as the translation |
| file requires the originating context |
\*-----------------------------------------------------*/
\*-------------------------------------------------*/
QApplication* app = static_cast<QApplication *>(QApplication::instance());
ui->name->setText(app->translate(ctxt, label));
ui->name->setText(app->translate(context, label));
}
else if(in_constructor)
{
/*-------------------------------------------------*\
| Must only be called during constructor if not |
| translatable as label buffer may not exist |
\*-------------------------------------------------*/
ui->name->setText(label);
}
}

@ -21,13 +21,16 @@ class TabLabel : public QWidget
Q_OBJECT
public:
TabLabel(int icon, QString name, char* original, char* context);
TabLabel(int icon, char* label, char* context, bool translatable);
~TabLabel();
private:
Ui::TabLabel *ui;
Ui::TabLabel* ui;
char* label;
char* ctxt;
char* context;
bool translatable;
void UpdateLabel(bool in_constructor);
private slots:
void changeEvent(QEvent *event);

Loading…
Cancel
Save