mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-09-26 04:15:05 -04:00
Add visible field to schema for hiding entries from the UI. Use it to hide the no show dialog hashes
This commit is contained in:
1 parent
0a201edbc1
commit
9a6cfaf021
4 files changed
+23
No files matched your search
@@ -280,6 +280,12 @@ ResourceManager::ResourceManager()
|
||||
logmanager_settings_schema["file_count_limit"]["default"] = 10;
|
||||
logmanager_settings_schema["file_count_limit"]["minimum"] = 0;
|
||||
|
||||
logmanager_settings_schema["dialog_no_show_hashes"]["title"] = QT_TRANSLATE_NOOP("Settings", "Dialog No-Show Hashes");
|
||||
logmanager_settings_schema["dialog_no_show_hashes"]["type"] = "array";
|
||||
logmanager_settings_schema["dialog_no_show_hashes"]["description"] = QT_TRANSLATE_NOOP("Settings", "A list of hashes of dialog text that should not be shown. Selecting \"Do Not Show Again\" on a dialog adds it to this list.");
|
||||
logmanager_settings_schema["dialog_no_show_hashes"]["items"]["type"] = "integer";
|
||||
logmanager_settings_schema["dialog_no_show_hashes"]["visible"] = false;
|
||||
|
||||
settings_manager->RegisterSettingsSchema("LogManager", QT_TRANSLATE_NOOP("Settings", "Log Manager"), logmanager_settings_schema);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "JsonUtils.h"
|
||||
#include "OpenRGBDynamicSettingsWidget.h"
|
||||
#include "OpenRGBDeviceEditorDialog.h"
|
||||
#include "ProfileManager.h"
|
||||
@@ -125,6 +126,11 @@ OpenRGBDeviceEditorDialog::OpenRGBDeviceEditorDialog(RGBController *dev, QWidget
|
||||
\*-----------------------------------------------------*/
|
||||
for(std::size_t configuration_idx = 0; configuration_idx < configuration_entries.size(); configuration_idx++)
|
||||
{
|
||||
if(JsonUtils::JsonGetBool(configuration_entries[configuration_idx].value, "visible", true) == false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
OpenRGBDynamicSettingsWidget* item_widget = new OpenRGBDynamicSettingsWidget(configuration_entries[configuration_idx].key, configuration_entries[configuration_idx].value, configuration_value);
|
||||
|
||||
item_widget->SetCallback(Callback, this);
|
||||
|
||||
@@ -146,6 +146,11 @@ OpenRGBDynamicSettingsWidget::OpenRGBDynamicSettingsWidget(std::string key, nloh
|
||||
\*---------------------------------------------*/
|
||||
for(std::size_t setting_idx = 0; setting_idx < setting_entries.size(); setting_idx++)
|
||||
{
|
||||
if(JsonUtils::JsonGetBool(setting_entries[setting_idx].value, "visible", true) == false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
OpenRGBDynamicSettingsWidget* item_widget = new OpenRGBDynamicSettingsWidget(setting_entries[setting_idx].key, setting_entries[setting_idx].value, settings_json);
|
||||
|
||||
item_widget->SetCallback(&OpenRGBDynamicSettingsWidget::NestedCallback, this);
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <QLayoutItem>
|
||||
#include <QSpacerItem>
|
||||
#include <QVBoxLayout>
|
||||
#include "JsonUtils.h"
|
||||
#include "OpenRGBDynamicSettingsWidget.h"
|
||||
#include "OpenRGBSettingsPage.h"
|
||||
#include "ResourceManager.h"
|
||||
@@ -139,6 +140,11 @@ void OpenRGBSettingsPage::UpdateInterface()
|
||||
\*-----------------------------------------------------*/
|
||||
for(std::size_t setting_idx = 0; setting_idx < setting_entries.size(); setting_idx++)
|
||||
{
|
||||
if(JsonUtils::JsonGetBool(setting_entries[setting_idx].value, "visible", true) == false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
nlohmann::json setting_value;
|
||||
setting_value[setting_entries[setting_idx].key] = ResourceManager::get()->GetSettingsManager()->GetSettings(setting_entries[setting_idx].key);
|
||||
OpenRGBDynamicSettingsWidget* item_widget = new OpenRGBDynamicSettingsWidget(setting_entries[setting_idx].key, setting_entries[setting_idx].value, setting_value);
|
||||
|
||||
Reference in new issue
Block a user