mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-06-13 16:35:03 -04:00
Add display name fields to controller and zone instead of editing the existing name field
This commit is contained in:
@@ -220,7 +220,7 @@ void RGBController_Debug::SetupZones()
|
||||
/*-------------------------------------------------*\
|
||||
| Clear any existing color/LED configuration |
|
||||
\*-------------------------------------------------*/
|
||||
led_alt_names.clear();
|
||||
led_display_names.clear();
|
||||
leds.clear();
|
||||
colors.clear();
|
||||
|
||||
@@ -409,7 +409,7 @@ void RGBController_Debug::SetupZones()
|
||||
|
||||
leds.push_back(single_led);
|
||||
|
||||
led_alt_names.push_back("");
|
||||
led_display_names.push_back("");
|
||||
|
||||
nlohmann::json configuration_json;
|
||||
JsonUtils::JsonParse(configuration, configuration_json);
|
||||
@@ -461,7 +461,7 @@ void RGBController_Debug::SetupZones()
|
||||
|
||||
leds.push_back(linear_led);
|
||||
|
||||
led_alt_names.push_back("");
|
||||
led_display_names.push_back("");
|
||||
}
|
||||
|
||||
zone_idx++;
|
||||
@@ -604,7 +604,7 @@ void RGBController_Debug::SetupZones()
|
||||
|
||||
leds.push_back(keyboard_led);
|
||||
|
||||
led_alt_names.push_back(new_kb.GetKeyAltNameAt(led_idx));
|
||||
led_display_names.push_back(new_kb.GetKeyAltNameAt(led_idx));
|
||||
}
|
||||
|
||||
if(first_run)
|
||||
@@ -663,7 +663,7 @@ void RGBController_Debug::SetupZones()
|
||||
|
||||
leds.push_back(underglow_led);
|
||||
|
||||
led_alt_names.push_back("");
|
||||
led_display_names.push_back("");
|
||||
}
|
||||
|
||||
zone_idx++;
|
||||
@@ -719,7 +719,7 @@ void RGBController_Debug::SetupZones()
|
||||
|
||||
leds.push_back(resizable_led);
|
||||
|
||||
led_alt_names.push_back("");
|
||||
led_display_names.push_back("");
|
||||
}
|
||||
|
||||
zone_idx++;
|
||||
|
||||
@@ -161,8 +161,8 @@ The Device Data block represents an entire `RGBController`. This data block is
|
||||
| Variable | LED Data[num_leds] | leds | 0 | See [LED Data](#led-data) block format table. Repeat num_leds times |
|
||||
| 2 | unsigned short | num_colors | 0 | Number of colors in RGBController |
|
||||
| 4 * num_colors | RGBColor[num_colors] | colors | 0 | RGBController colors field values |
|
||||
| 2 | unsigned short | num_led_alt_names | 5 | Number of LED alternate name strings |
|
||||
| Variable | LED Alternate Name[num_led_alt_names] | led_alt_names | 5 | See [LED Alternate Name Data](#led-alternate-names-data) block format table. Repeat num_led_alt_names times |
|
||||
| 2 | unsigned short | num_led_display_names | 5 | Number of LED alternate name strings |
|
||||
| Variable | LED Alternate Name[num_led_display_names] | led_display_names | 5 | See [LED Alternate Name Data](#led-alternate-names-data) block format table. Repeat num_led_display_names times |
|
||||
| 4 | unsigned int | flags | 5 | RGBController flags field value |
|
||||
| 4 | unsigned int | configuration_len | 6 | Length of RGBController configuration field string, including null termination |
|
||||
| configuration_len | char[configuration_len] | configuration | | RGBController configuration field string value, including null termination |
|
||||
@@ -248,7 +248,7 @@ The LED Data block represents one entry in the `RGBController::leds` vector. Th
|
||||
|
||||
## LED Alternate Name Data
|
||||
|
||||
The LED Alternate Name Data block represents one entry in the `RGBController::led_alt_names` vector. This data block was introduced in protocol version 5.
|
||||
The LED Alternate Name Data block represents one entry in the `RGBController::led_display_names` vector. This data block was introduced in protocol version 5.
|
||||
|
||||
| Size | Format | Name | Protocol Version | Description |
|
||||
| ---------------- | ---------------------- | ---------------- | ---------------- | --------------------------------------------------------------- |
|
||||
|
||||
@@ -188,26 +188,15 @@ bool ProfileManager::CompareControllers(RGBController* controller_1, RGBControll
|
||||
location_check = controller_2->GetLocation() == controller_1->GetLocation();
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Do not check zonedevice name if manually configured |
|
||||
\*-----------------------------------------------------*/
|
||||
bool check_device_name = true;
|
||||
|
||||
if((controller_1->GetFlags() & CONTROLLER_FLAG_MANUALLY_CONFIGURED_NAME)
|
||||
|| (controller_2->GetFlags() & CONTROLLER_FLAG_MANUALLY_CONFIGURED_NAME))
|
||||
{
|
||||
check_device_name = false;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Compare top-level controller information |
|
||||
\*-----------------------------------------------------*/
|
||||
if( (controller_1->GetDeviceType() != controller_2->GetDeviceType() )
|
||||
|| (check_device_name && (controller_1->GetName() != controller_2->GetName() ))
|
||||
|| (controller_1->GetDescription() != controller_2->GetDescription())
|
||||
|| (controller_1->GetVersion() != controller_2->GetVersion() )
|
||||
|| (controller_1->GetSerial() != controller_2->GetSerial() )
|
||||
|| (location_check != true ))
|
||||
if((controller_1->GetDeviceType() != controller_2->GetDeviceType() )
|
||||
|| (controller_1->GetName() != controller_2->GetName() )
|
||||
|| (controller_1->GetDescription() != controller_2->GetDescription())
|
||||
|| (controller_1->GetVersion() != controller_2->GetVersion() )
|
||||
|| (controller_1->GetSerial() != controller_2->GetSerial() )
|
||||
|| (location_check != true ))
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
@@ -249,18 +238,8 @@ bool ProfileManager::CompareControllers(RGBController* controller_1, RGBControll
|
||||
for(std::size_t zone_index = 0; zone_index < controller_1->zones.size(); zone_index++)
|
||||
{
|
||||
bool check_zone_geometry = true;
|
||||
bool check_zone_name = true;
|
||||
bool check_zone_type = true;
|
||||
|
||||
/*---------------------------------------------*\
|
||||
| Do not check zone name if manually configured |
|
||||
\*---------------------------------------------*/
|
||||
if((controller_1->GetZoneFlags(zone_index) & ZONE_FLAG_MANUALLY_CONFIGURED_NAME)
|
||||
|| (controller_2->GetZoneFlags(zone_index) & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
|
||||
{
|
||||
check_zone_name = false;
|
||||
}
|
||||
|
||||
/*---------------------------------------------*\
|
||||
| Do not check zone type if manually configured |
|
||||
\*---------------------------------------------*/
|
||||
@@ -276,7 +255,7 @@ bool ProfileManager::CompareControllers(RGBController* controller_1, RGBControll
|
||||
check_zone_geometry = false;
|
||||
}
|
||||
|
||||
if((check_zone_name && (controller_1->GetZoneName(zone_index) != controller_2->GetZoneName(zone_index) ))
|
||||
if(( (controller_1->GetZoneName(zone_index) != controller_2->GetZoneName(zone_index) ))
|
||||
|| (check_zone_type && (controller_1->GetZoneType(zone_index) != controller_2->GetZoneType(zone_index) ))
|
||||
|| (check_zone_geometry && ((controller_1->GetZoneLEDsMin(zone_index) != controller_2->GetZoneLEDsMin(zone_index) )
|
||||
|| (controller_1->GetZoneLEDsMax(zone_index) != controller_2->GetZoneLEDsMax(zone_index) )))
|
||||
@@ -1202,7 +1181,7 @@ bool ProfileManager::LoadControllerFromListWithOptions
|
||||
nlohmann::json configuration_json;
|
||||
JsonUtils::JsonParse(profile_controller->configuration, configuration_json);
|
||||
|
||||
load_controller->ConfigureDevice(profile_controller->flags, profile_controller->name);
|
||||
load_controller->ConfigureDevice(profile_controller->flags, profile_controller->display_name);
|
||||
load_controller->SetDeviceSpecificConfiguration(configuration_json["configuration"]);
|
||||
|
||||
/*-----------------------------------------*\
|
||||
|
||||
@@ -107,7 +107,7 @@ RGBController::~RGBController()
|
||||
/*-----------------------------------------------------*\
|
||||
| Clear member vectors |
|
||||
\*-----------------------------------------------------*/
|
||||
led_alt_names.clear();
|
||||
led_display_names.clear();
|
||||
leds.clear();
|
||||
colors.clear();
|
||||
zones.clear();
|
||||
@@ -147,6 +147,24 @@ std::string RGBController::GetLocation()
|
||||
return(location);
|
||||
}
|
||||
|
||||
std::string RGBController::GetDisplayName()
|
||||
{
|
||||
std::string display_name_value;
|
||||
|
||||
AccessMutex.lock_shared();
|
||||
if(flags & CONTROLLER_FLAG_MANUALLY_CONFIGURED_NAME)
|
||||
{
|
||||
display_name_value = display_name;
|
||||
}
|
||||
else
|
||||
{
|
||||
display_name_value = name;
|
||||
}
|
||||
AccessMutex.unlock_shared();
|
||||
|
||||
return(display_name_value);
|
||||
}
|
||||
|
||||
device_type RGBController::GetDeviceType()
|
||||
{
|
||||
return(type);
|
||||
@@ -272,6 +290,31 @@ std::size_t RGBController::GetZoneCount()
|
||||
return(zones.size());
|
||||
}
|
||||
|
||||
std::string RGBController::GetZoneDisplayName(unsigned int zone)
|
||||
{
|
||||
std::string display_name_value;
|
||||
|
||||
AccessMutex.lock_shared();
|
||||
if(zone < zones.size())
|
||||
{
|
||||
if(zones[zone].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME)
|
||||
{
|
||||
display_name_value = zones[zone].display_name;
|
||||
}
|
||||
else
|
||||
{
|
||||
display_name_value = zones[zone].name;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
display_name_value = "";
|
||||
}
|
||||
AccessMutex.unlock_shared();
|
||||
|
||||
return(display_name_value);
|
||||
}
|
||||
|
||||
zone_flags RGBController::GetZoneFlags(unsigned int zone)
|
||||
{
|
||||
zone_flags flags_value;
|
||||
@@ -1556,9 +1599,9 @@ std::string RGBController::GetLEDDisplayName(unsigned int led)
|
||||
std::string name;
|
||||
|
||||
AccessMutex.lock_shared();
|
||||
if((led < led_alt_names.size()) && (led_alt_names[led] != ""))
|
||||
if((led < led_display_names.size()) && (led_display_names[led] != ""))
|
||||
{
|
||||
name = led_alt_names[led];
|
||||
name = led_display_names[led];
|
||||
}
|
||||
else if(led < leds.size())
|
||||
{
|
||||
@@ -2031,63 +2074,63 @@ void RGBController::ConfigureZone(int zone_idx, zone new_zone)
|
||||
|
||||
if(new_zone.flags & ZONE_FLAG_MANUALLY_CONFIGURED_SIZE)
|
||||
{
|
||||
zones[zone_idx].flags |= ZONE_FLAG_MANUALLY_CONFIGURED_SIZE;
|
||||
zones[zone_idx].leds_count = new_zone.leds_count;
|
||||
zones[zone_idx].flags |= ZONE_FLAG_MANUALLY_CONFIGURED_SIZE;
|
||||
zones[zone_idx].leds_count = new_zone.leds_count;
|
||||
}
|
||||
else
|
||||
{
|
||||
zones[zone_idx].flags &= ~ZONE_FLAG_MANUALLY_CONFIGURED_SIZE;
|
||||
new_zone.leds_count = 0;
|
||||
zones[zone_idx].flags &= ~ZONE_FLAG_MANUALLY_CONFIGURED_SIZE;
|
||||
new_zone.leds_count = 0;
|
||||
}
|
||||
|
||||
if(new_zone.flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME)
|
||||
{
|
||||
zones[zone_idx].flags |= ZONE_FLAG_MANUALLY_CONFIGURED_NAME;
|
||||
zones[zone_idx].name = new_zone.name;
|
||||
zones[zone_idx].flags |= ZONE_FLAG_MANUALLY_CONFIGURED_NAME;
|
||||
zones[zone_idx].display_name = new_zone.display_name;
|
||||
}
|
||||
else
|
||||
{
|
||||
zones[zone_idx].flags &= ~ZONE_FLAG_MANUALLY_CONFIGURED_NAME;
|
||||
zones[zone_idx].flags &= ~ZONE_FLAG_MANUALLY_CONFIGURED_NAME;
|
||||
}
|
||||
|
||||
if(new_zone.flags & ZONE_FLAG_MANUALLY_CONFIGURED_TYPE)
|
||||
{
|
||||
zones[zone_idx].flags |= ZONE_FLAG_MANUALLY_CONFIGURED_TYPE;
|
||||
zones[zone_idx].type = new_zone.type;
|
||||
zones[zone_idx].flags |= ZONE_FLAG_MANUALLY_CONFIGURED_TYPE;
|
||||
zones[zone_idx].type = new_zone.type;
|
||||
}
|
||||
else
|
||||
{
|
||||
zones[zone_idx].flags &= ~ZONE_FLAG_MANUALLY_CONFIGURED_TYPE;
|
||||
zones[zone_idx].flags &= ~ZONE_FLAG_MANUALLY_CONFIGURED_TYPE;
|
||||
}
|
||||
|
||||
if(new_zone.flags & ZONE_FLAG_MANUALLY_CONFIGURED_MATRIX_MAP)
|
||||
{
|
||||
zones[zone_idx].flags |= ZONE_FLAG_MANUALLY_CONFIGURED_MATRIX_MAP;
|
||||
zones[zone_idx].matrix_map = new_zone.matrix_map;
|
||||
zones[zone_idx].flags |= ZONE_FLAG_MANUALLY_CONFIGURED_MATRIX_MAP;
|
||||
zones[zone_idx].matrix_map = new_zone.matrix_map;
|
||||
}
|
||||
else
|
||||
{
|
||||
zones[zone_idx].flags &= ~ZONE_FLAG_MANUALLY_CONFIGURED_MATRIX_MAP;
|
||||
zones[zone_idx].flags &= ~ZONE_FLAG_MANUALLY_CONFIGURED_MATRIX_MAP;
|
||||
}
|
||||
|
||||
if(new_zone.flags & ZONE_FLAG_MANUALLY_CONFIGURED_SEGMENTS)
|
||||
{
|
||||
zones[zone_idx].flags |= ZONE_FLAG_MANUALLY_CONFIGURED_SEGMENTS;
|
||||
zones[zone_idx].segments = new_zone.segments;
|
||||
zones[zone_idx].flags |= ZONE_FLAG_MANUALLY_CONFIGURED_SEGMENTS;
|
||||
zones[zone_idx].segments = new_zone.segments;
|
||||
}
|
||||
else
|
||||
{
|
||||
zones[zone_idx].flags &= ~ZONE_FLAG_MANUALLY_CONFIGURED_SEGMENTS;
|
||||
zones[zone_idx].flags &= ~ZONE_FLAG_MANUALLY_CONFIGURED_SEGMENTS;
|
||||
zones[zone_idx].segments.clear();
|
||||
}
|
||||
|
||||
if(new_zone.flags & ZONE_FLAG_MANUALLY_CONFIGURED_DEVICE_SPECIFIC)
|
||||
{
|
||||
zones[zone_idx].flags |= ZONE_FLAG_MANUALLY_CONFIGURED_DEVICE_SPECIFIC;
|
||||
zones[zone_idx].flags |= ZONE_FLAG_MANUALLY_CONFIGURED_DEVICE_SPECIFIC;
|
||||
}
|
||||
else
|
||||
{
|
||||
zones[zone_idx].flags &= ~ZONE_FLAG_MANUALLY_CONFIGURED_DEVICE_SPECIFIC;
|
||||
zones[zone_idx].flags &= ~ZONE_FLAG_MANUALLY_CONFIGURED_DEVICE_SPECIFIC;
|
||||
}
|
||||
|
||||
DeviceConfigureZone(zone_idx);
|
||||
@@ -2122,11 +2165,12 @@ void RGBController::ConfigureDevice(controller_flags new_flags, std::string new_
|
||||
if(new_flags & CONTROLLER_FLAG_MANUALLY_CONFIGURED_NAME)
|
||||
{
|
||||
flags |= CONTROLLER_FLAG_MANUALLY_CONFIGURED_NAME;
|
||||
name = new_name;
|
||||
display_name = new_name;
|
||||
}
|
||||
else
|
||||
{
|
||||
flags &= ~CONTROLLER_FLAG_MANUALLY_CONFIGURED_NAME;
|
||||
display_name = "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2350,10 +2394,11 @@ unsigned char * RGBController::GetDeviceDescriptionData(unsigned char* data_ptr,
|
||||
unsigned short version_len = (unsigned short)strlen(controller->version.c_str()) + 1;
|
||||
unsigned short serial_len = (unsigned short)strlen(controller->serial.c_str()) + 1;
|
||||
unsigned short location_len = (unsigned short)strlen(controller->location.c_str()) + 1;
|
||||
unsigned short display_name_len = (unsigned short)strlen(controller->display_name.c_str())+ 1;
|
||||
unsigned short num_modes = (unsigned short)controller->modes.size();
|
||||
unsigned short num_zones = (unsigned short)controller->zones.size();
|
||||
unsigned short num_leds = (unsigned short)controller->leds.size();
|
||||
unsigned short num_led_alt_names = (unsigned short)controller->led_alt_names.size();
|
||||
unsigned short num_led_display_names = (unsigned short)controller->led_display_names.size();
|
||||
unsigned int configuration_len = (unsigned int )strlen(controller->configuration.c_str()) + 1;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
@@ -2480,20 +2525,20 @@ unsigned char * RGBController::GetDeviceDescriptionData(unsigned char* data_ptr,
|
||||
/*-------------------------------------------------*\
|
||||
| Number of LED alternate name strings |
|
||||
\*-------------------------------------------------*/
|
||||
memcpy(data_ptr, &num_led_alt_names, sizeof(num_led_alt_names));
|
||||
data_ptr += sizeof(num_led_alt_names);
|
||||
memcpy(data_ptr, &num_led_display_names, sizeof(num_led_display_names));
|
||||
data_ptr += sizeof(num_led_display_names);
|
||||
|
||||
for(std::size_t led_idx = 0; led_idx < controller->led_alt_names.size(); led_idx++)
|
||||
for(std::size_t led_idx = 0; led_idx < controller->led_display_names.size(); led_idx++)
|
||||
{
|
||||
/*---------------------------------------------*\
|
||||
| Copy in LED alternate name (size+data) |
|
||||
\*---------------------------------------------*/
|
||||
unsigned short string_length = (unsigned short)strlen(controller->led_alt_names[led_idx].c_str()) + 1;
|
||||
unsigned short string_length = (unsigned short)strlen(controller->led_display_names[led_idx].c_str()) + 1;
|
||||
|
||||
memcpy(data_ptr, &string_length, sizeof(string_length));
|
||||
data_ptr += sizeof(string_length);
|
||||
|
||||
strcpy((char *)data_ptr, controller->led_alt_names[led_idx].c_str());
|
||||
strcpy((char *)data_ptr, controller->led_display_names[led_idx].c_str());
|
||||
data_ptr += string_length;
|
||||
}
|
||||
}
|
||||
@@ -2512,6 +2557,12 @@ unsigned char * RGBController::GetDeviceDescriptionData(unsigned char* data_ptr,
|
||||
\*-----------------------------------------------------*/
|
||||
if(protocol_version >= 6)
|
||||
{
|
||||
memcpy(data_ptr, &display_name_len, sizeof(display_name_len));
|
||||
data_ptr += sizeof(display_name_len);
|
||||
|
||||
strcpy((char *)data_ptr, controller->display_name.c_str());
|
||||
data_ptr += display_name_len;
|
||||
|
||||
memcpy(data_ptr, &configuration_len, sizeof(configuration_len));
|
||||
data_ptr += sizeof(configuration_len);
|
||||
|
||||
@@ -2538,10 +2589,11 @@ unsigned int RGBController::GetDeviceDescriptionSize(RGBController* controller,
|
||||
unsigned short version_len = (unsigned short)strlen(controller->version.c_str()) + 1;
|
||||
unsigned short serial_len = (unsigned short)strlen(controller->serial.c_str()) + 1;
|
||||
unsigned short location_len = (unsigned short)strlen(controller->location.c_str()) + 1;
|
||||
unsigned short display_name_len = (unsigned short)strlen(controller->display_name.c_str())+ 1;
|
||||
unsigned short num_modes = (unsigned short)controller->modes.size();
|
||||
unsigned short num_zones = (unsigned short)controller->zones.size();
|
||||
unsigned short num_leds = (unsigned short)controller->leds.size();
|
||||
unsigned short num_led_alt_names = (unsigned short)controller->led_alt_names.size();
|
||||
unsigned short num_led_display_names = (unsigned short)controller->led_display_names.size();
|
||||
unsigned int configuration_len = (unsigned int )strlen(controller->configuration.c_str()) + 1;
|
||||
|
||||
data_size += sizeof(device_type);
|
||||
@@ -2589,12 +2641,12 @@ unsigned int RGBController::GetDeviceDescriptionSize(RGBController* controller,
|
||||
|
||||
if(protocol_version >= 5)
|
||||
{
|
||||
data_size += sizeof(num_led_alt_names);
|
||||
data_size += sizeof(num_led_display_names);
|
||||
|
||||
for(std::size_t led_idx = 0; led_idx < controller->led_alt_names.size(); led_idx++)
|
||||
for(std::size_t led_idx = 0; led_idx < controller->led_display_names.size(); led_idx++)
|
||||
{
|
||||
data_size += sizeof(unsigned short);
|
||||
data_size += (unsigned int)strlen(controller->led_alt_names[led_idx].c_str()) + 1;
|
||||
data_size += (unsigned int)strlen(controller->led_display_names[led_idx].c_str()) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2605,6 +2657,8 @@ unsigned int RGBController::GetDeviceDescriptionSize(RGBController* controller,
|
||||
|
||||
if(protocol_version >= 6)
|
||||
{
|
||||
data_size += sizeof(display_name_len);
|
||||
data_size += display_name_len;
|
||||
data_size += sizeof(configuration_len);
|
||||
data_size += configuration_len;
|
||||
}
|
||||
@@ -2948,6 +3002,7 @@ unsigned char * RGBController::GetZoneDescriptionData(unsigned char* data_ptr, z
|
||||
| Initialize variables |
|
||||
\*-----------------------------------------------------*/
|
||||
unsigned short zone_name_len = (unsigned short)strlen(zone.name.c_str()) + 1;
|
||||
unsigned short zone_display_name_len = (unsigned short)strlen(zone.display_name.c_str()) + 1;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Copy in zone name (size+data) |
|
||||
@@ -3081,6 +3136,15 @@ unsigned char * RGBController::GetZoneDescriptionData(unsigned char* data_ptr, z
|
||||
{
|
||||
data_ptr = GetModeDescriptionData(data_ptr, zone.modes[mode_index], protocol_version);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Copy in zone display name (size+data) |
|
||||
\*-------------------------------------------------*/
|
||||
memcpy(data_ptr, &zone_display_name_len, sizeof(zone_display_name_len));
|
||||
data_ptr += sizeof(unsigned short);
|
||||
|
||||
strcpy((char *)data_ptr, zone.display_name.c_str());
|
||||
data_ptr += zone_display_name_len;
|
||||
}
|
||||
|
||||
return(data_ptr);
|
||||
@@ -3145,6 +3209,9 @@ unsigned int RGBController::GetZoneDescriptionSize(zone zone, unsigned int proto
|
||||
{
|
||||
data_size += GetModeDescriptionSize(zone.modes[mode_index], protocol_version);
|
||||
}
|
||||
|
||||
data_size += sizeof(unsigned short);
|
||||
data_size += (unsigned short)strlen(zone.display_name.c_str()) + 1;
|
||||
}
|
||||
|
||||
return(data_size);
|
||||
@@ -3307,19 +3374,19 @@ unsigned char* RGBController::SetDeviceDescription(unsigned char* data_ptr, unsi
|
||||
/*-------------------------------------------------*\
|
||||
| Copy in number of LED alternate names |
|
||||
\*-------------------------------------------------*/
|
||||
unsigned short num_led_alt_names;
|
||||
COPY_DATA_FIELD_UNLOCK(data_ptr, data_start, num_led_alt_names, controller);
|
||||
unsigned short num_led_display_names;
|
||||
COPY_DATA_FIELD_UNLOCK(data_ptr, data_start, num_led_display_names, controller);
|
||||
|
||||
controller->led_alt_names.resize(num_led_alt_names);
|
||||
controller->led_display_names.resize(num_led_display_names);
|
||||
|
||||
for(unsigned short led_idx = 0; led_idx < num_led_alt_names; led_idx++)
|
||||
for(unsigned short led_idx = 0; led_idx < num_led_display_names; led_idx++)
|
||||
{
|
||||
/*---------------------------------------------*\
|
||||
| Copy in LED alternate name string (size+data) |
|
||||
\*---------------------------------------------*/
|
||||
unsigned short string_length = 0;
|
||||
COPY_DATA_FIELD_UNLOCK(data_ptr, data_start, string_length, controller);
|
||||
COPY_STRING_FIELD_UNLOCK(data_ptr, data_start, string_length, controller->led_alt_names[led_idx], controller);
|
||||
COPY_STRING_FIELD_UNLOCK(data_ptr, data_start, string_length, controller->led_display_names[led_idx], controller);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3336,6 +3403,13 @@ unsigned char* RGBController::SetDeviceDescription(unsigned char* data_ptr, unsi
|
||||
\*-----------------------------------------------------*/
|
||||
if(protocol_version >= 6)
|
||||
{
|
||||
/*-------------------------------------------------*\
|
||||
| Copy in display name |
|
||||
\*-------------------------------------------------*/
|
||||
unsigned short display_name_len;
|
||||
COPY_DATA_FIELD_UNLOCK(data_ptr, data_start, display_name_len, controller);
|
||||
COPY_STRING_FIELD_UNLOCK(data_ptr, data_start, display_name_len, controller->display_name, controller);
|
||||
|
||||
unsigned int configuration_len;
|
||||
COPY_DATA_FIELD_UNLOCK(data_ptr, data_start, configuration_len, controller);
|
||||
COPY_STRING_FIELD_UNLOCK(data_ptr, data_start, configuration_len, controller->configuration, controller);
|
||||
@@ -3758,6 +3832,13 @@ unsigned char* RGBController::SetZoneDescription(unsigned char* data_ptr, unsign
|
||||
return(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Copy in zone display name |
|
||||
\*-------------------------------------------------*/
|
||||
unsigned short zonedisplayname_len;
|
||||
COPY_DATA_FIELD(data_ptr, data_start, zonedisplayname_len);
|
||||
COPY_STRING_FIELD(data_ptr, data_start, zonedisplayname_len, zone->display_name);
|
||||
}
|
||||
|
||||
return(data_ptr);
|
||||
@@ -3784,6 +3865,7 @@ nlohmann::json RGBController::GetDeviceDescriptionJSON(RGBController* controller
|
||||
controller_json["serial"] = controller->serial;
|
||||
controller_json["vendor"] = controller->vendor;
|
||||
controller_json["version"] = controller->version;
|
||||
controller_json["display_name"] = controller->display_name;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -3819,9 +3901,9 @@ nlohmann::json RGBController::GetDeviceDescriptionJSON(RGBController* controller
|
||||
/*-----------------------------------------------------*\
|
||||
| LED alternate names |
|
||||
\*-----------------------------------------------------*/
|
||||
for(std::size_t led_alt_name_idx = 0; led_alt_name_idx < controller->led_alt_names.size(); led_alt_name_idx++)
|
||||
for(std::size_t led_display_name_idx = 0; led_display_name_idx < controller->led_display_names.size(); led_display_name_idx++)
|
||||
{
|
||||
controller_json["led_alt_names"][led_alt_name_idx] = controller->led_alt_names[led_alt_name_idx];
|
||||
controller_json["led_display_names"][led_display_name_idx] = controller->led_display_names[led_display_name_idx];
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
@@ -3934,6 +4016,7 @@ nlohmann::json RGBController::GetZoneDescriptionJSON(zone zone)
|
||||
| Zone Information |
|
||||
\*-----------------------------------------------------*/
|
||||
zone_json["name"] = zone.name;
|
||||
zone_json["display_name"] = zone.display_name;
|
||||
zone_json["type"] = zone.type;
|
||||
zone_json["leds_count"] = zone.leds_count;
|
||||
zone_json["leds_min"] = zone.leds_min;
|
||||
@@ -4000,6 +4083,11 @@ void RGBController::SetDeviceDescriptionJSON(nlohmann::json controller_json, RGB
|
||||
controller->version = controller_json["version"];
|
||||
}
|
||||
|
||||
if(controller_json.contains("display_name"))
|
||||
{
|
||||
controller->display_name = controller_json["display_name"];
|
||||
}
|
||||
|
||||
if(controller_json.contains("configuration"))
|
||||
{
|
||||
controller->configuration = controller_json["configuration"].dump();
|
||||
@@ -4052,13 +4140,13 @@ void RGBController::SetDeviceDescriptionJSON(nlohmann::json controller_json, RGB
|
||||
/*-----------------------------------------------------*\
|
||||
| LED alternate names |
|
||||
\*-----------------------------------------------------*/
|
||||
if(controller_json.contains("led_alt_names"))
|
||||
if(controller_json.contains("led_display_names"))
|
||||
{
|
||||
controller->led_alt_names.resize(controller_json["led_alt_names"].size());
|
||||
controller->led_display_names.resize(controller_json["led_display_names"].size());
|
||||
|
||||
for(std::size_t led_alt_name_idx = 0; led_alt_name_idx < controller->led_alt_names.size(); led_alt_name_idx++)
|
||||
for(std::size_t led_display_name_idx = 0; led_display_name_idx < controller->led_display_names.size(); led_display_name_idx++)
|
||||
{
|
||||
controller->led_alt_names[led_alt_name_idx] = controller_json["led_alt_names"][led_alt_name_idx];
|
||||
controller->led_display_names[led_display_name_idx] = controller_json["led_display_names"][led_display_name_idx];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4281,6 +4369,11 @@ zone RGBController::SetZoneDescriptionJSON(nlohmann::json zone_json)
|
||||
new_zone.name = zone_json["name"];
|
||||
}
|
||||
|
||||
if(zone_json.contains("display_name"))
|
||||
{
|
||||
new_zone.display_name = zone_json["display_name"];
|
||||
}
|
||||
|
||||
if(zone_json.contains("type"))
|
||||
{
|
||||
new_zone.type = zone_json["type"];
|
||||
|
||||
@@ -37,6 +37,7 @@ public:
|
||||
std::string GetVersion();
|
||||
std::string GetSerial();
|
||||
std::string GetLocation();
|
||||
std::string GetDisplayName();
|
||||
|
||||
device_type GetDeviceType();
|
||||
controller_flags GetFlags();
|
||||
@@ -55,6 +56,7 @@ public:
|
||||
RGBColor GetZoneColor(unsigned int zone, unsigned int color_index);
|
||||
RGBColor* GetZoneColorsPointer(unsigned int zone);
|
||||
std::size_t GetZoneCount();
|
||||
std::string GetZoneDisplayName(unsigned int zone);
|
||||
zone_flags GetZoneFlags(unsigned int zone);
|
||||
unsigned int GetZoneLEDsCount(unsigned int zone);
|
||||
unsigned int GetZoneLEDsMax(unsigned int zone);
|
||||
@@ -271,6 +273,7 @@ protected:
|
||||
std::string version; /* controller version */
|
||||
std::string configuration; /* controller device- */
|
||||
/* specific config JSON */
|
||||
std::string display_name; /* display name */
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Controller variables |
|
||||
@@ -285,7 +288,8 @@ protected:
|
||||
std::vector<RGBColor> colors; /* Color buffer */
|
||||
std::vector<led> leds; /* LEDs */
|
||||
std::vector<std::string>
|
||||
led_alt_names; /* alternate LED names */
|
||||
led_display_names;
|
||||
/* LED display names */
|
||||
std::vector<mode> modes; /* Modes */
|
||||
std::vector<zone> zones; /* Zones */
|
||||
|
||||
|
||||
@@ -410,6 +410,7 @@ class zone
|
||||
{
|
||||
public:
|
||||
std::string name; /* Zone name */
|
||||
std::string display_name; /* Display name */
|
||||
zone_type type; /* Zone type */
|
||||
led * leds; /* List of LEDs in zone */
|
||||
RGBColor * colors; /* Colors of LEDs in zone */
|
||||
@@ -512,6 +513,7 @@ public:
|
||||
virtual std::string GetVersion() = 0;
|
||||
virtual std::string GetSerial() = 0;
|
||||
virtual std::string GetLocation() = 0;
|
||||
virtual std::string GetDisplayName() = 0;
|
||||
|
||||
virtual device_type GetDeviceType() = 0;
|
||||
virtual controller_flags GetFlags() = 0;
|
||||
@@ -530,6 +532,7 @@ public:
|
||||
virtual RGBColor GetZoneColor(unsigned int zone, unsigned int color_index) = 0;
|
||||
virtual RGBColor* GetZoneColorsPointer(unsigned int zone) = 0;
|
||||
virtual std::size_t GetZoneCount() = 0;
|
||||
virtual std::string GetZoneDisplayName(unsigned int zone) = 0;
|
||||
virtual zone_flags GetZoneFlags(unsigned int zone) = 0;
|
||||
virtual unsigned int GetZoneLEDsCount(unsigned int zone) = 0;
|
||||
virtual unsigned int GetZoneLEDsMax(unsigned int zone) = 0;
|
||||
|
||||
8
cli.cpp
8
cli.cpp
@@ -345,7 +345,7 @@ unsigned int ParseMode(DeviceOptions& options, std::vector<RGBController *> &rgb
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "Error: Mode '" + options.mode + "' not available for device '" + rgb_controllers[options.device]->GetName() + "'" << std::endl;
|
||||
std::cout << "Error: Mode '" + options.mode + "' not available for device '" + rgb_controllers[options.device]->GetDisplayName() + "'" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -467,7 +467,7 @@ void OptionListDevices(std::vector<RGBController *>& rgb_controllers)
|
||||
/*---------------------------------------------------------*\
|
||||
| Print device name |
|
||||
\*---------------------------------------------------------*/
|
||||
std::cout << controller_idx << ": " << controller->GetName() << std::endl;
|
||||
std::cout << controller_idx << ": " << controller->GetDisplayName() << std::endl;
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Print device type |
|
||||
@@ -536,7 +536,7 @@ void OptionListDevices(std::vector<RGBController *>& rgb_controllers)
|
||||
|
||||
for(std::size_t zone_idx = 0; zone_idx < controller->GetZoneCount(); zone_idx++)
|
||||
{
|
||||
std::cout << " " << QuoteIfNecessary(controller->GetZoneName(zone_idx));
|
||||
std::cout << " " << QuoteIfNecessary(controller->GetZoneDisplayName(zone_idx));
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
@@ -602,7 +602,7 @@ bool OptionDevice(std::vector<DeviceOptions>* current_devices, std::string argum
|
||||
| If the argument is not a number then check all the |
|
||||
| controllers names for a match |
|
||||
\*---------------------------------------------------------*/
|
||||
std::string name = rgb_controllers[i]->GetName();
|
||||
std::string name = rgb_controllers[i]->GetDisplayName();
|
||||
std::transform(name.begin(), name.end(), name.begin(), ::tolower);
|
||||
LOG_TRACE("[CLI] Comparing to %s", name.c_str());
|
||||
|
||||
|
||||
@@ -1026,7 +1026,7 @@ void DeviceView::paintEvent(QPaintEvent* /* event */)
|
||||
/*-------------------------------------------------*\
|
||||
| Draw zone name |
|
||||
\*-------------------------------------------------*/
|
||||
painter.drawText(posx, posy + posh, QString(controller->GetZoneName((unsigned int)zone_idx).c_str()));
|
||||
painter.drawText(posx, posy + posh, QString(controller->GetZoneDisplayName((unsigned int)zone_idx).c_str()));
|
||||
|
||||
for(std::size_t segment_idx = 0; segment_idx < controller->GetZoneSegmentCount(zone_idx); segment_idx++)
|
||||
{
|
||||
|
||||
@@ -221,7 +221,7 @@ void OpenRGBClientInfoPage::UpdateInfo()
|
||||
| names in them |
|
||||
\*-----------------------------------------------------*/
|
||||
QTreeWidgetItem* new_item = new QTreeWidgetItem(new_top_item);
|
||||
new_item->setText(0, QString::fromStdString(ResourceManager::get()->GetClients()[client_idx]->GetRGBControllers()[dev_idx]->GetName()));
|
||||
new_item->setText(0, QString::fromStdString(ResourceManager::get()->GetClients()[client_idx]->GetRGBControllers()[dev_idx]->GetDisplayName()));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Add child items for each zone in the device |
|
||||
@@ -234,7 +234,7 @@ void OpenRGBClientInfoPage::UpdateInfo()
|
||||
\*-----------------------------------------------------*/
|
||||
QTreeWidgetItem* new_child = new QTreeWidgetItem();
|
||||
|
||||
std::string zone_str = ResourceManager::get()->GetClients()[client_idx]->GetRGBControllers()[dev_idx]->GetZoneName(zone_idx) + ", ";
|
||||
std::string zone_str = ResourceManager::get()->GetClients()[client_idx]->GetRGBControllers()[dev_idx]->GetZoneDisplayName(zone_idx) + ", ";
|
||||
zone_str.append(std::to_string(ResourceManager::get()->GetClients()[client_idx]->GetRGBControllers()[dev_idx]->GetZoneLEDsCount(zone_idx)));
|
||||
zone_str.append(" LEDs, ");
|
||||
// TODO : translate
|
||||
|
||||
@@ -41,7 +41,7 @@ OpenRGBDeviceEditorDialog::OpenRGBDeviceEditorDialog(RGBController *dev, QWidget
|
||||
\*-----------------------------------------------------*/
|
||||
QString currentTitle = windowTitle();
|
||||
|
||||
QString newTitle = currentTitle + " - " + QString::fromStdString(edit_dev->GetName());
|
||||
QString newTitle = currentTitle + " - " + QString::fromStdString(edit_dev->GetDisplayName());
|
||||
|
||||
setWindowTitle(newTitle);
|
||||
|
||||
@@ -49,7 +49,7 @@ OpenRGBDeviceEditorDialog::OpenRGBDeviceEditorDialog(RGBController *dev, QWidget
|
||||
| Initialize device name |
|
||||
\*-----------------------------------------------------*/
|
||||
ui->LineEditDeviceName->blockSignals(true);
|
||||
ui->LineEditDeviceName->setText(QString::fromStdString(dev->GetName()));
|
||||
ui->LineEditDeviceName->setText(QString::fromStdString(dev->GetDisplayName()));
|
||||
ui->LineEditDeviceName->blockSignals(false);
|
||||
|
||||
if((edit_flags & CONTROLLER_FLAG_MANUALLY_CONFIGURABLE_NAME) == 0)
|
||||
|
||||
@@ -67,6 +67,7 @@ void OpenRGBDeviceInfoPage::UpdateInterface()
|
||||
{
|
||||
ui->TypeValue->setText(RGBController::DeviceTypeToString(controller->GetDeviceType()).c_str());
|
||||
|
||||
ui->DisplayNameValue->setText(QString::fromStdString(controller->GetDisplayName()));
|
||||
ui->NameValue->setText(QString::fromStdString(controller->GetName()));
|
||||
ui->VendorValue->setText(QString::fromStdString(controller->GetVendor()));
|
||||
ui->DescriptionValue->setText(QString::fromStdString(controller->GetDescription()));
|
||||
@@ -119,6 +120,42 @@ void OpenRGBDeviceInfoPage::UpdateInterface()
|
||||
flags_string += "Reset Before Update";
|
||||
need_separator = true;
|
||||
}
|
||||
if(flags & CONTROLLER_FLAG_MANUALLY_CONFIGURABLE_NAME)
|
||||
{
|
||||
if(need_separator)
|
||||
{
|
||||
flags_string += ", ";
|
||||
}
|
||||
flags_string += "Manually Configurable Name";
|
||||
need_separator = true;
|
||||
}
|
||||
if(flags & CONTROLLER_FLAG_MANUALLY_CONFIGURABLE_DEVICE_SPECIFIC)
|
||||
{
|
||||
if(need_separator)
|
||||
{
|
||||
flags_string += ", ";
|
||||
}
|
||||
flags_string += "Manually Configurable Device Specific";
|
||||
need_separator = true;
|
||||
}
|
||||
if(flags & CONTROLLER_FLAG_MANUALLY_CONFIGURED_NAME)
|
||||
{
|
||||
if(need_separator)
|
||||
{
|
||||
flags_string += ", ";
|
||||
}
|
||||
flags_string += "Manually Configured Name";
|
||||
need_separator = true;
|
||||
}
|
||||
if(flags & CONTROLLER_FLAG_MANUALLY_CONFIGURED_DEVICE_SPECIFIC)
|
||||
{
|
||||
if(need_separator)
|
||||
{
|
||||
flags_string += ", ";
|
||||
}
|
||||
flags_string += "Manually Configured Device Specific";
|
||||
need_separator = true;
|
||||
}
|
||||
|
||||
ui->FlagsValue->setText(QString::fromStdString(flags_string));
|
||||
}
|
||||
|
||||
@@ -35,24 +35,7 @@
|
||||
<enum>QFrame::Shadow::Sunken</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2" columnstretch="0,1">
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="VersionValue">
|
||||
<property name="text">
|
||||
<string notr="true">Version Value</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="SerialLabel">
|
||||
<property name="text">
|
||||
<string>Serial:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<item row="7" column="1">
|
||||
<widget class="QLabel" name="SerialValue">
|
||||
<property name="text">
|
||||
<string notr="true">Serial Value</string>
|
||||
@@ -62,48 +45,21 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="NameLabel">
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="NameValue">
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="SerialLabel">
|
||||
<property name="text">
|
||||
<string notr="true">Name Value</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
<string>Serial:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="VendorLabel">
|
||||
<property name="text">
|
||||
<string>Vendor:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="VendorValue">
|
||||
<property name="text">
|
||||
<string notr="true">Vendor Value</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="TypeLabel">
|
||||
<property name="text">
|
||||
<string>Type:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="TypeValue">
|
||||
<property name="text">
|
||||
<string notr="true">Type Value</string>
|
||||
@@ -113,7 +69,14 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="DescriptionLabel">
|
||||
<property name="text">
|
||||
<string>Description:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="DescriptionValue">
|
||||
<property name="text">
|
||||
<string notr="true">Description Value</string>
|
||||
@@ -123,28 +86,14 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="DescriptionLabel">
|
||||
<property name="text">
|
||||
<string>Description:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="VersionLabel">
|
||||
<property name="text">
|
||||
<string>Version:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="LocationLabel">
|
||||
<property name="text">
|
||||
<string>Location:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<item row="6" column="1">
|
||||
<widget class="QLabel" name="LocationValue">
|
||||
<property name="text">
|
||||
<string notr="true">Location Value</string>
|
||||
@@ -154,14 +103,14 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="FlagsLabel">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="VendorLabel">
|
||||
<property name="text">
|
||||
<string>Flags:</string>
|
||||
<string>Vendor:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<item row="8" column="1">
|
||||
<widget class="QLabel" name="FlagsValue">
|
||||
<property name="text">
|
||||
<string notr="true">Flags Value</string>
|
||||
@@ -171,6 +120,71 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="VersionLabel">
|
||||
<property name="text">
|
||||
<string>Version:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="TypeLabel">
|
||||
<property name="text">
|
||||
<string>Type:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="VendorValue">
|
||||
<property name="text">
|
||||
<string notr="true">Vendor Value</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="NameValue">
|
||||
<property name="text">
|
||||
<string notr="true">Name Value</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="FlagsLabel">
|
||||
<property name="text">
|
||||
<string>Flags:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLabel" name="VersionValue">
|
||||
<property name="text">
|
||||
<string notr="true">Version Value</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="DisplayNameLabel">
|
||||
<property name="text">
|
||||
<string>Display Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="DisplayNameValue">
|
||||
<property name="text">
|
||||
<string notr="true">Display Name Value</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -1684,7 +1684,7 @@ void OpenRGBDevicePage::UpdateModeUi()
|
||||
|
||||
for(std::size_t zone_idx = 0; zone_idx < device->GetZoneCount(); zone_idx++)
|
||||
{
|
||||
ui->ZoneBox->addItem(device->GetZoneName((unsigned int)zone_idx).c_str());
|
||||
ui->ZoneBox->addItem(device->GetZoneDisplayName((unsigned int)zone_idx).c_str());
|
||||
|
||||
for(std::size_t segment_idx = 0; segment_idx < device->GetZoneSegmentCount(zone_idx); segment_idx++)
|
||||
{
|
||||
@@ -1772,7 +1772,7 @@ void OpenRGBDevicePage::UpdateZoneList()
|
||||
|
||||
for(std::size_t zone_idx = 0; zone_idx < device->GetZoneCount(); zone_idx++)
|
||||
{
|
||||
ui->ZoneBox->addItem(device->GetZoneName((unsigned int)zone_idx).c_str());
|
||||
ui->ZoneBox->addItem(device->GetZoneDisplayName((unsigned int)zone_idx).c_str());
|
||||
|
||||
for(std::size_t segment_idx = 0; segment_idx < device->GetZoneSegmentCount(zone_idx); segment_idx++)
|
||||
{
|
||||
|
||||
@@ -986,7 +986,7 @@ void OpenRGBDialog::UpdateDevicesList()
|
||||
/*-------------------------------------*\
|
||||
| Update the device name on the tab |
|
||||
\*-------------------------------------*/
|
||||
((TabLabel*)(ui->DevicesTabBar->tabBar()->tabButton(tab_idx, QTabBar::LeftSide)))->SetText((char *)controllers[controller_idx]->GetName().c_str());
|
||||
((TabLabel*)(ui->DevicesTabBar->tabBar()->tabButton(tab_idx, QTabBar::LeftSide)))->SetText((char *)controllers[controller_idx]->GetDisplayName().c_str());
|
||||
|
||||
/*-------------------------------------*\
|
||||
| If the controller for this page is |
|
||||
@@ -1059,7 +1059,7 @@ void OpenRGBDialog::UpdateDevicesList()
|
||||
/*---------------------------------*\
|
||||
| Create the tab label |
|
||||
\*---------------------------------*/
|
||||
TabLabel* NewTabLabel = new TabLabel(OpenRGBFont::GetIconIDFromDeviceType(controllers[controller_idx]->GetDeviceType()), (char *)controllers[controller_idx]->GetName().c_str(), (char *)context, false);
|
||||
TabLabel* NewTabLabel = new TabLabel(OpenRGBFont::GetIconIDFromDeviceType(controllers[controller_idx]->GetDeviceType()), (char *)controllers[controller_idx]->GetDisplayName().c_str(), (char *)context, false);
|
||||
|
||||
ui->DevicesTabBar->tabBar()->setTabButton(ui->DevicesTabBar->count() - 1, QTabBar::LeftSide, NewTabLabel);
|
||||
|
||||
@@ -1126,7 +1126,7 @@ void OpenRGBDialog::UpdateDevicesList()
|
||||
/*-----------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*-----------------------------------------*/
|
||||
TabLabel* NewTabLabel = new TabLabel(OpenRGBFont::GetIconIDFromDeviceType(controllers[controller_idx]->GetDeviceType()), (char *)controllers[controller_idx]->GetName().c_str(), (char *)context, false);
|
||||
TabLabel* NewTabLabel = new TabLabel(OpenRGBFont::GetIconIDFromDeviceType(controllers[controller_idx]->GetDeviceType()), (char *)controllers[controller_idx]->GetDisplayName().c_str(), (char *)context, false);
|
||||
|
||||
NewTabLabel->SetTextHidden(isCompactTabMode());
|
||||
|
||||
@@ -1172,7 +1172,7 @@ void OpenRGBDialog::UpdateDevicesList()
|
||||
/*-------------------------------------*\
|
||||
| Update the device name on the tab |
|
||||
\*-------------------------------------*/
|
||||
((TabLabel*)(ui->InformationTabBar->tabBar()->tabButton(tab_idx, QTabBar::LeftSide)))->SetText((char *)controllers[controller_idx]->GetName().c_str());
|
||||
((TabLabel*)(ui->InformationTabBar->tabBar()->tabButton(tab_idx, QTabBar::LeftSide)))->SetText((char *)controllers[controller_idx]->GetDisplayName().c_str());
|
||||
|
||||
ui->InformationTabBar->tabBar()->moveTab(tab_idx, controller_idx);
|
||||
break;
|
||||
@@ -1193,12 +1193,12 @@ void OpenRGBDialog::UpdateDevicesList()
|
||||
/*---------------------------------------------*\
|
||||
| Create the tab label |
|
||||
\*---------------------------------------------*/
|
||||
TabLabel* NewTabLabel = new TabLabel(OpenRGBFont::GetIconIDFromDeviceType(controllers[controller_idx]->GetDeviceType()), (char *)controllers[controller_idx]->GetName().c_str(), (char *)context, false);
|
||||
TabLabel* NewTabLabel = new TabLabel(OpenRGBFont::GetIconIDFromDeviceType(controllers[controller_idx]->GetDeviceType()), (char *)controllers[controller_idx]->GetDisplayName().c_str(), (char *)context, false);
|
||||
|
||||
NewTabLabel->SetTextHidden(isCompactTabMode());
|
||||
|
||||
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()));
|
||||
ui->InformationTabBar->tabBar()->setTabToolTip(ui->InformationTabBar->count() - 1, QString::fromStdString(controllers[controller_idx]->GetDisplayName()));
|
||||
|
||||
/*---------------------------------------------*\
|
||||
| Now move the new tab to the correct position |
|
||||
|
||||
@@ -173,7 +173,7 @@ OpenRGBProfileEditorDialog::OpenRGBProfileEditorDialog(std::string name, QWidget
|
||||
|
||||
new_item->setFont(0, font);
|
||||
new_item->setText(0, OpenRGBFont::icon(OpenRGBFont::GetIconIDFromDeviceType(updated_controllers[controller_idx]->GetDeviceType())));
|
||||
new_item->setText(1, QString::fromStdString(updated_controllers[controller_idx]->GetName()));
|
||||
new_item->setText(1, QString::fromStdString(updated_controllers[controller_idx]->GetDisplayName()));
|
||||
new_item->setText(2, "Update");
|
||||
new_item->setCheckState(3, state);
|
||||
|
||||
@@ -196,7 +196,7 @@ OpenRGBProfileEditorDialog::OpenRGBProfileEditorDialog(std::string name, QWidget
|
||||
|
||||
new_item->setFont(0, font);
|
||||
new_item->setText(0, OpenRGBFont::icon(OpenRGBFont::GetIconIDFromDeviceType(new_controllers[controller_idx]->GetDeviceType())));
|
||||
new_item->setText(1, QString::fromStdString(new_controllers[controller_idx]->GetName()));
|
||||
new_item->setText(1, QString::fromStdString(new_controllers[controller_idx]->GetDisplayName()));
|
||||
new_item->setText(2, "Add");
|
||||
new_item->setCheckState(3, state);
|
||||
|
||||
@@ -219,7 +219,7 @@ OpenRGBProfileEditorDialog::OpenRGBProfileEditorDialog(std::string name, QWidget
|
||||
|
||||
new_item->setFont(0, font);
|
||||
new_item->setText(0, OpenRGBFont::icon(OpenRGBFont::GetIconIDFromDeviceType(old_controllers[controller_idx]->GetDeviceType())));
|
||||
new_item->setText(1, QString::fromStdString(old_controllers[controller_idx]->GetName()));
|
||||
new_item->setText(1, QString::fromStdString(old_controllers[controller_idx]->GetDisplayName()));
|
||||
new_item->setText(2, "Keep");
|
||||
new_item->setCheckState(3, state);
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ OpenRGBZoneEditorDialog::OpenRGBZoneEditorDialog(RGBController* edit_dev_ptr, un
|
||||
\*-----------------------------------------------------*/
|
||||
QString currentTitle = windowTitle();
|
||||
|
||||
QString newTitle = currentTitle + " - " + QString::fromStdString(edit_dev->GetZoneName(edit_zone_idx));
|
||||
QString newTitle = currentTitle + " - " + QString::fromStdString(edit_dev->GetZoneDisplayName(edit_zone_idx));
|
||||
|
||||
setWindowTitle(newTitle);
|
||||
|
||||
@@ -63,6 +63,7 @@ OpenRGBZoneEditorDialog::OpenRGBZoneEditorDialog(RGBController* edit_dev_ptr, un
|
||||
else if(edit_zone.flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME)
|
||||
{
|
||||
ui->LabelZoneName->setText("Zone Name (*):");
|
||||
ui->LineEditZoneName->setText(QString::fromStdString(edit_zone.display_name));
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
@@ -369,7 +370,7 @@ int OpenRGBZoneEditorDialog::show()
|
||||
/*-------------------------------------------------*\
|
||||
| Update zone with new settings |
|
||||
\*-------------------------------------------------*/
|
||||
edit_zone.name = ui->LineEditZoneName->text().toStdString();
|
||||
edit_zone.display_name = ui->LineEditZoneName->text().toStdString();
|
||||
edit_zone.leds_count = ui->SliderZoneSize->value();
|
||||
edit_zone.type = ui->ComboBoxZoneType->currentIndex();
|
||||
|
||||
@@ -868,7 +869,7 @@ void OpenRGBZoneEditorDialog::on_ButtonZoneMatrixMap_clicked()
|
||||
{
|
||||
unsigned int total_leds_count = ui->SliderZoneSize->value();
|
||||
|
||||
OpenRGBMatrixMapEditorDialog dialog(QString::fromStdString(edit_dev->GetZoneName(edit_zone_idx)), &edit_zone.matrix_map, total_leds_count);
|
||||
OpenRGBMatrixMapEditorDialog dialog(QString::fromStdString(edit_dev->GetZoneDisplayName(edit_zone_idx)), &edit_zone.matrix_map, total_leds_count);
|
||||
|
||||
int ret = dialog.show();
|
||||
|
||||
|
||||
@@ -146,10 +146,10 @@ void OpenRGBZoneInitializationDialog::CreateZoneWidget(RGBController* controller
|
||||
| Labels: controller name + zone name |
|
||||
\*---------------------------------------------------------*/
|
||||
QLabel* controller_label = new QLabel(this);
|
||||
controller_label->setText(QString::fromStdString(controller->GetName()));
|
||||
controller_label->setText(QString::fromStdString(controller->GetDisplayName()));
|
||||
|
||||
QLabel* zone_label = new QLabel(this);
|
||||
zone_label->setText(QString::fromStdString(controller->GetZoneName(zone_index)));
|
||||
zone_label->setText(QString::fromStdString(controller->GetZoneDisplayName(zone_index)));
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Spin box: controls the zone size |
|
||||
|
||||
Reference in New Issue
Block a user