mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-04-03 22:01:20 -04:00
RGBController API changes and segment configuration updates
* Make the Get/Set RGBControler descriptor functions static * Add functions for getting the matrix_map_type for zone and segment matrix maps * Rename zone resize dialog to zone editor dialog * Add additional segment types * Add option to import segments configuration from JSON file in zone editor dialog * Update device view to be able to display matrix segment types * Add matrix map editor dialog for creating/editing segment matrix maps * Add option to export segments configuration to JSON file in zone editor dialog
This commit is contained in:
@@ -1194,7 +1194,7 @@ void NetworkClient::ProcessReply_ControllerData(unsigned int data_size, char * d
|
||||
\*-------------------------------------------------*/
|
||||
RGBController_Network * new_controller = new RGBController_Network(this, dev_id);
|
||||
|
||||
new_controller->SetDeviceDescription((unsigned char *)data, GetProtocolVersion());
|
||||
RGBController::SetDeviceDescription((unsigned char *)data, new_controller, GetProtocolVersion());
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Mark this controller as remote owned |
|
||||
@@ -1459,7 +1459,7 @@ void NetworkClient::ProcessRequest_RGBController_SignalUpdate(unsigned int data_
|
||||
| UpdateLEDs() sends color description |
|
||||
\*-------------------------------------------------*/
|
||||
case RGBCONTROLLER_UPDATE_REASON_UPDATELEDS:
|
||||
controller->SetColorDescription((unsigned char *)data_ptr, GetProtocolVersion());
|
||||
RGBController::SetColorDescription((unsigned char *)data_ptr, controller, GetProtocolVersion());
|
||||
break;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
@@ -1474,7 +1474,7 @@ void NetworkClient::ProcessRequest_RGBController_SignalUpdate(unsigned int data_
|
||||
case RGBCONTROLLER_UPDATE_REASON_HIDDEN:
|
||||
case RGBCONTROLLER_UPDATE_REASON_UNHIDDEN:
|
||||
default:
|
||||
controller->SetDeviceDescription((unsigned char *)data_ptr, GetProtocolVersion());
|
||||
RGBController::SetDeviceDescription((unsigned char *)data_ptr, controller, GetProtocolVersion());
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -1818,7 +1818,7 @@ void NetworkServer::ProcessRequest_RGBController_UpdateLEDs(unsigned int control
|
||||
/*-----------------------------------------------------*\
|
||||
| Update colors |
|
||||
\*-----------------------------------------------------*/
|
||||
controllers[controller_idx]->SetColorDescription(data_ptr, protocol_version);
|
||||
RGBController::SetColorDescription(data_ptr, controllers[controller_idx], protocol_version);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Unlock access mutex |
|
||||
@@ -2199,7 +2199,7 @@ void NetworkServer::SendReply_ControllerData(SOCKET client_sock, unsigned int de
|
||||
| Get data size |
|
||||
\*-----------------------------------------------------*/
|
||||
reply_size = sizeof(reply_size);
|
||||
reply_size += controllers[dev_idx]->GetDeviceDescriptionSize(protocol_version);
|
||||
reply_size += RGBController::GetDeviceDescriptionSize(controllers[dev_idx], protocol_version);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create data buffer |
|
||||
@@ -2216,7 +2216,7 @@ void NetworkServer::SendReply_ControllerData(SOCKET client_sock, unsigned int de
|
||||
/*-----------------------------------------------------*\
|
||||
| Copy in data |
|
||||
\*-----------------------------------------------------*/
|
||||
data_ptr = controllers[dev_idx]->GetDeviceDescriptionData(data_ptr, protocol_version);
|
||||
data_ptr = RGBController::GetDeviceDescriptionData(data_ptr, controllers[dev_idx], protocol_version);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Unlock controller's access mutex |
|
||||
@@ -2736,7 +2736,7 @@ void NetworkServer::SendRequest_RGBController_SignalUpdate(RGBController * contr
|
||||
| UpdateLEDs() sends color description |
|
||||
\*-------------------------------------*/
|
||||
case RGBCONTROLLER_UPDATE_REASON_UPDATELEDS:
|
||||
reply_size += controller_ptr->GetColorDescriptionSize(protocol_version);
|
||||
reply_size += RGBController::GetColorDescriptionSize(controller_ptr, protocol_version);
|
||||
break;
|
||||
|
||||
/*-------------------------------------*\
|
||||
@@ -2751,7 +2751,7 @@ void NetworkServer::SendRequest_RGBController_SignalUpdate(RGBController * contr
|
||||
case RGBCONTROLLER_UPDATE_REASON_HIDDEN:
|
||||
case RGBCONTROLLER_UPDATE_REASON_UNHIDDEN:
|
||||
default:
|
||||
reply_size += controller_ptr->GetDeviceDescriptionSize(protocol_version);
|
||||
reply_size += RGBController::GetDeviceDescriptionSize(controller_ptr, protocol_version);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2782,7 +2782,7 @@ void NetworkServer::SendRequest_RGBController_SignalUpdate(RGBController * contr
|
||||
| UpdateLEDs() sends color description |
|
||||
\*-------------------------------------*/
|
||||
case RGBCONTROLLER_UPDATE_REASON_UPDATELEDS:
|
||||
data_ptr = controller_ptr->GetColorDescriptionData(data_ptr, protocol_version);
|
||||
data_ptr = RGBController::GetColorDescriptionData(data_ptr, controller_ptr, protocol_version);
|
||||
break;
|
||||
|
||||
/*-------------------------------------*\
|
||||
@@ -2797,7 +2797,7 @@ void NetworkServer::SendRequest_RGBController_SignalUpdate(RGBController * contr
|
||||
case RGBCONTROLLER_UPDATE_REASON_HIDDEN:
|
||||
case RGBCONTROLLER_UPDATE_REASON_UNHIDDEN:
|
||||
default:
|
||||
data_ptr = controller_ptr->GetDeviceDescriptionData(data_ptr, protocol_version);
|
||||
data_ptr = RGBController::GetDeviceDescriptionData(data_ptr, controller_ptr, protocol_version);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -285,7 +285,7 @@ std::vector<RGBController*> ProfileManager::GetControllerListFromProfileJson(nlo
|
||||
{
|
||||
RGBController_Dummy * profile_controller = new RGBController_Dummy();
|
||||
|
||||
profile_controller->SetDeviceDescriptionJSON(profile_json["controllers"][controller_idx]);
|
||||
RGBController::SetDeviceDescriptionJSON(profile_json["controllers"][controller_idx], profile_controller);
|
||||
|
||||
profile_controllers.push_back(profile_controller);
|
||||
}
|
||||
@@ -590,7 +590,7 @@ bool ProfileManager::SaveProfile(std::string profile_name)
|
||||
| Read the controller data for this |
|
||||
| controller into the profile json |
|
||||
\*-----------------------------------------*/
|
||||
profile_json["controllers"][new_profile_controller_index] = controllers[controller_index]->GetDeviceDescriptionJSON();
|
||||
profile_json["controllers"][new_profile_controller_index] = RGBController::GetDeviceDescriptionJSON(controllers[controller_index]);
|
||||
new_profile_controller_index++;
|
||||
}
|
||||
|
||||
@@ -618,7 +618,7 @@ bool ProfileManager::SaveProfile(std::string profile_name)
|
||||
| Read the controller data for this |
|
||||
| controller into the profile json |
|
||||
\*-----------------------------------------*/
|
||||
profile_json["controllers"][new_profile_controller_index] = manually_configured_rgb_controllers[existing_controller_index]->GetDeviceDescriptionJSON();
|
||||
profile_json["controllers"][new_profile_controller_index] = RGBController::GetDeviceDescriptionJSON(manually_configured_rgb_controllers[existing_controller_index]);
|
||||
new_profile_controller_index++;
|
||||
}
|
||||
}
|
||||
@@ -709,7 +709,7 @@ bool ProfileManager::SaveProfileCustom(std::string profile_name, std::vector<RGB
|
||||
| Read the controller data for this controller |
|
||||
| into the profile json |
|
||||
\*---------------------------------------------*/
|
||||
profile_json["controllers"][controller_index] = controllers[controller_index]->GetDeviceDescriptionJSON();
|
||||
profile_json["controllers"][controller_index] = RGBController::GetDeviceDescriptionJSON(controllers[controller_index]);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
@@ -834,7 +834,7 @@ bool ProfileManager::SaveSizes()
|
||||
| Read the controller data for this controller |
|
||||
| into the profile json if manually configured |
|
||||
\*---------------------------------------------*/
|
||||
profile_json["controllers"][new_saved_controller_index] = controllers[controller_index]->GetDeviceDescriptionJSON();
|
||||
profile_json["controllers"][new_saved_controller_index] = RGBController::GetDeviceDescriptionJSON(controllers[controller_index]);
|
||||
new_saved_controller_index++;
|
||||
|
||||
break;
|
||||
@@ -866,7 +866,7 @@ bool ProfileManager::SaveSizes()
|
||||
| Read the controller data for this controller |
|
||||
| into the profile json |
|
||||
\*---------------------------------------------*/
|
||||
profile_json["controllers"][new_saved_controller_index] = manually_configured_rgb_controllers[old_saved_controller_index]->GetDeviceDescriptionJSON();
|
||||
profile_json["controllers"][new_saved_controller_index] = RGBController::GetDeviceDescriptionJSON(manually_configured_rgb_controllers[old_saved_controller_index]);
|
||||
new_saved_controller_index++;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -319,8 +319,9 @@ public:
|
||||
virtual unsigned int GetZoneLEDsCount(unsigned int zone) = 0;
|
||||
virtual unsigned int GetZoneLEDsMax(unsigned int zone) = 0;
|
||||
virtual unsigned int GetZoneLEDsMin(unsigned int zone) = 0;
|
||||
virtual matrix_map_type GetZoneMatrixMap(unsigned int zone) = 0;
|
||||
virtual const unsigned int* GetZoneMatrixMapData(unsigned int zone) = 0;
|
||||
virtual unsigned int GetZoneMatrixMapHeight(unsigned int zone) = 0;
|
||||
virtual const unsigned int * GetZoneMatrixMap(unsigned int zone) = 0;
|
||||
virtual unsigned int GetZoneMatrixMapWidth(unsigned int zone) = 0;
|
||||
virtual std::size_t GetZoneModeCount(unsigned int zone) = 0;
|
||||
virtual unsigned int GetZoneModeBrightness(unsigned int zone, unsigned int mode) = 0;
|
||||
@@ -341,8 +342,9 @@ public:
|
||||
virtual std::string GetZoneName(unsigned int zone) = 0;
|
||||
virtual std::size_t GetZoneSegmentCount(unsigned int zone) = 0;
|
||||
virtual unsigned int GetZoneSegmentLEDsCount(unsigned int zone, unsigned int segment) = 0;
|
||||
virtual matrix_map_type GetZoneSegmentMatrixMap(unsigned int zone, unsigned int segment) = 0;
|
||||
virtual const unsigned int * GetZoneSegmentMatrixMapData(unsigned int zone, unsigned int segment) = 0;
|
||||
virtual unsigned int GetZoneSegmentMatrixMapHeight(unsigned int zone, unsigned int segment) = 0;
|
||||
virtual const unsigned int * GetZoneSegmentMatrixMap(unsigned int zone, unsigned int segment) = 0;
|
||||
virtual unsigned int GetZoneSegmentMatrixMapWidth(unsigned int zone, unsigned int segment) = 0;
|
||||
virtual std::string GetZoneSegmentName(unsigned int zone, unsigned int segment) = 0;
|
||||
virtual unsigned int GetZoneSegmentStartIndex(unsigned int zone, unsigned int segment) = 0;
|
||||
@@ -413,49 +415,6 @@ public:
|
||||
virtual void SetAllColors(RGBColor color) = 0;
|
||||
virtual void SetAllZoneColors(int zone, RGBColor color) = 0;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Serialized Description Functions |
|
||||
\*-----------------------------------------------------*/
|
||||
virtual unsigned char * GetColorDescriptionData(unsigned char* data_ptr, unsigned int protocol_version) = 0;
|
||||
virtual unsigned int GetColorDescriptionSize(unsigned int protocol_version) = 0;
|
||||
virtual unsigned char * GetDeviceDescriptionData(unsigned char* data_ptr, unsigned int protocol_version) = 0;
|
||||
virtual unsigned int GetDeviceDescriptionSize(unsigned int protocol_version) = 0;
|
||||
virtual unsigned char * GetLEDDescriptionData(unsigned char* data_ptr, led led, unsigned int protocol_version) = 0;
|
||||
virtual unsigned int GetLEDDescriptionSize(led led, unsigned int protocol_version) = 0;
|
||||
virtual unsigned char * GetMatrixMapDescriptionData(unsigned char* data_ptr, matrix_map_type matrix_map, unsigned int protocol_version) = 0;
|
||||
virtual unsigned int GetMatrixMapDescriptionSize(matrix_map_type matrix_map, unsigned int protocol_version) = 0;
|
||||
virtual unsigned char * GetModeDescriptionData(unsigned char* data_ptr, mode mode, unsigned int protocol_version) = 0;
|
||||
virtual unsigned int GetModeDescriptionSize(mode mode, unsigned int protocol_version) = 0;
|
||||
virtual unsigned char * GetSegmentDescriptionData(unsigned char* data_ptr, segment segment, unsigned int protocol_version) = 0;
|
||||
virtual unsigned int GetSegmentDescriptionSize(segment segment, unsigned int protocol_version) = 0;
|
||||
virtual unsigned char * GetZoneDescriptionData(unsigned char* data_ptr, zone zone, unsigned int protocol_version) = 0;
|
||||
virtual unsigned int GetZoneDescriptionSize(zone zone, unsigned int protocol_version) = 0;
|
||||
|
||||
virtual unsigned char* SetColorDescription(unsigned char* data_ptr, unsigned int protocol_version, bool resize = false) = 0;
|
||||
virtual unsigned char* SetDeviceDescription(unsigned char* data_ptr, unsigned int protocol_version) = 0;
|
||||
virtual unsigned char* SetLEDDescription(unsigned char* data_ptr, led* led, unsigned int protocol_version) = 0;
|
||||
virtual unsigned char* SetMatrixMapDescription(unsigned char* data_ptr, matrix_map_type* matrix_map, unsigned int protocol_version) = 0;
|
||||
virtual unsigned char* SetModeDescription(unsigned char* data_ptr, mode* mode, unsigned int protocol_version) = 0;
|
||||
virtual unsigned char* SetSegmentDescription(unsigned char* data_ptr, segment* segment, unsigned int protocol_version) = 0;
|
||||
virtual unsigned char* SetZoneDescription(unsigned char* data_ptr, zone* zone, unsigned int protocol_version) = 0;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| JSON Description Functions |
|
||||
\*-----------------------------------------------------*/
|
||||
virtual nlohmann::json GetDeviceDescriptionJSON() = 0;
|
||||
virtual nlohmann::json GetLEDDescriptionJSON(led led) = 0;
|
||||
virtual nlohmann::json GetMatrixMapDescriptionJSON(matrix_map_type matrix_map) = 0;
|
||||
virtual nlohmann::json GetModeDescriptionJSON(mode mode) = 0;
|
||||
virtual nlohmann::json GetSegmentDescriptionJSON(segment segment) = 0;
|
||||
virtual nlohmann::json GetZoneDescriptionJSON(zone zone) = 0;
|
||||
|
||||
virtual void SetDeviceDescriptionJSON(nlohmann::json controller_json) = 0;
|
||||
virtual led SetLEDDescriptionJSON(nlohmann::json led_json) = 0;
|
||||
virtual matrix_map_type SetMatrixMapDescriptionJSON(nlohmann::json matrix_map_json) = 0;
|
||||
virtual mode SetModeDescriptionJSON(nlohmann::json mode_json) = 0;
|
||||
virtual segment SetSegmentDescriptionJSON(nlohmann::json segment_json) = 0;
|
||||
virtual zone SetZoneDescriptionJSON(nlohmann::json zone_json) = 0;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Update Callback Functions |
|
||||
\*-----------------------------------------------------*/
|
||||
@@ -520,8 +479,9 @@ public:
|
||||
unsigned int GetZoneLEDsCount(unsigned int zone);
|
||||
unsigned int GetZoneLEDsMax(unsigned int zone);
|
||||
unsigned int GetZoneLEDsMin(unsigned int zone);
|
||||
matrix_map_type GetZoneMatrixMap(unsigned int zone);
|
||||
const unsigned int* GetZoneMatrixMapData(unsigned int zone);
|
||||
unsigned int GetZoneMatrixMapHeight(unsigned int zone);
|
||||
const unsigned int* GetZoneMatrixMap(unsigned int zone);
|
||||
unsigned int GetZoneMatrixMapWidth(unsigned int zone);
|
||||
std::size_t GetZoneModeCount(unsigned int zone);
|
||||
unsigned int GetZoneModeBrightness(unsigned int zone, unsigned int mode);
|
||||
@@ -542,8 +502,9 @@ public:
|
||||
std::string GetZoneName(unsigned int zone);
|
||||
std::size_t GetZoneSegmentCount(unsigned int zone);
|
||||
unsigned int GetZoneSegmentLEDsCount(unsigned int zone, unsigned int segment);
|
||||
matrix_map_type GetZoneSegmentMatrixMap(unsigned int zone, unsigned int segment);
|
||||
const unsigned int * GetZoneSegmentMatrixMapData(unsigned int zone, unsigned int segment);
|
||||
unsigned int GetZoneSegmentMatrixMapHeight(unsigned int zone, unsigned int segment);
|
||||
const unsigned int * GetZoneSegmentMatrixMap(unsigned int zone, unsigned int segment);
|
||||
unsigned int GetZoneSegmentMatrixMapWidth(unsigned int zone, unsigned int segment);
|
||||
std::string GetZoneSegmentName(unsigned int zone, unsigned int segment);
|
||||
unsigned int GetZoneSegmentStartIndex(unsigned int zone, unsigned int segment);
|
||||
@@ -613,49 +574,6 @@ public:
|
||||
void SetAllColors(RGBColor color);
|
||||
void SetAllZoneColors(int zone, RGBColor color);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Serialized Description Functions |
|
||||
\*-----------------------------------------------------*/
|
||||
unsigned char * GetColorDescriptionData(unsigned char* data_ptr, unsigned int protocol_version);
|
||||
unsigned int GetColorDescriptionSize(unsigned int protocol_version);
|
||||
unsigned char * GetDeviceDescriptionData(unsigned char* data_ptr, unsigned int protocol_version);
|
||||
unsigned int GetDeviceDescriptionSize(unsigned int protocol_version);
|
||||
unsigned char * GetLEDDescriptionData(unsigned char* data_ptr, led led, unsigned int protocol_version);
|
||||
unsigned int GetLEDDescriptionSize(led led, unsigned int protocol_version);
|
||||
unsigned char * GetMatrixMapDescriptionData(unsigned char* data_ptr, matrix_map_type matrix_map, unsigned int protocol_version);
|
||||
unsigned int GetMatrixMapDescriptionSize(matrix_map_type matrix_map, unsigned int protocol_version);
|
||||
unsigned char * GetModeDescriptionData(unsigned char* data_ptr, mode mode, unsigned int protocol_version);
|
||||
unsigned int GetModeDescriptionSize(mode mode, unsigned int protocol_version);
|
||||
unsigned char * GetSegmentDescriptionData(unsigned char* data_ptr, segment segment, unsigned int protocol_version);
|
||||
unsigned int GetSegmentDescriptionSize(segment segment, unsigned int protocol_version);
|
||||
unsigned char * GetZoneDescriptionData(unsigned char* data_ptr, zone zone, unsigned int protocol_version);
|
||||
unsigned int GetZoneDescriptionSize(zone zone, unsigned int protocol_version);
|
||||
|
||||
unsigned char* SetColorDescription(unsigned char* data_ptr, unsigned int protocol_version, bool resize = false);
|
||||
unsigned char* SetDeviceDescription(unsigned char* data_ptr, unsigned int protocol_version);
|
||||
unsigned char* SetLEDDescription(unsigned char* data_ptr, led* led, unsigned int protocol_version);
|
||||
unsigned char* SetMatrixMapDescription(unsigned char* data_ptr, matrix_map_type* matrix_map, unsigned int protocol_version);
|
||||
unsigned char* SetModeDescription(unsigned char* data_ptr, mode* mode, unsigned int protocol_version);
|
||||
unsigned char* SetSegmentDescription(unsigned char* data_ptr, segment* segment, unsigned int protocol_version);
|
||||
unsigned char* SetZoneDescription(unsigned char* data_ptr, zone* zone, unsigned int protocol_version);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| JSON Description Functions |
|
||||
\*-----------------------------------------------------*/
|
||||
nlohmann::json GetDeviceDescriptionJSON();
|
||||
nlohmann::json GetLEDDescriptionJSON(led led);
|
||||
nlohmann::json GetMatrixMapDescriptionJSON(matrix_map_type matrix_map);
|
||||
nlohmann::json GetModeDescriptionJSON(mode mode);
|
||||
nlohmann::json GetSegmentDescriptionJSON(segment segment);
|
||||
nlohmann::json GetZoneDescriptionJSON(zone zone);
|
||||
|
||||
void SetDeviceDescriptionJSON(nlohmann::json controller_json);
|
||||
led SetLEDDescriptionJSON(nlohmann::json led_json);
|
||||
matrix_map_type SetMatrixMapDescriptionJSON(nlohmann::json matrix_map_json);
|
||||
mode SetModeDescriptionJSON(nlohmann::json mode_json);
|
||||
segment SetSegmentDescriptionJSON(nlohmann::json segment_json);
|
||||
zone SetZoneDescriptionJSON(nlohmann::json zone_json);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Update Callback Functions |
|
||||
\*-----------------------------------------------------*/
|
||||
@@ -697,6 +615,49 @@ public:
|
||||
virtual void DeviceUpdateZoneMode(int zone);
|
||||
virtual void DeviceSaveMode();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Static Serialized Description Functions |
|
||||
\*-----------------------------------------------------*/
|
||||
static unsigned char * GetColorDescriptionData(unsigned char* data_ptr, RGBController* controller, unsigned int protocol_version);
|
||||
static unsigned int GetColorDescriptionSize(RGBController* controller, unsigned int protocol_version);
|
||||
static unsigned char * GetDeviceDescriptionData(unsigned char* data_ptr, RGBController* controller, unsigned int protocol_version);
|
||||
static unsigned int GetDeviceDescriptionSize(RGBController* controller, unsigned int protocol_version);
|
||||
static unsigned char * GetLEDDescriptionData(unsigned char* data_ptr, led led, unsigned int protocol_version);
|
||||
static unsigned int GetLEDDescriptionSize(led led, unsigned int protocol_version);
|
||||
static unsigned char * GetMatrixMapDescriptionData(unsigned char* data_ptr, matrix_map_type matrix_map, unsigned int protocol_version);
|
||||
static unsigned int GetMatrixMapDescriptionSize(matrix_map_type matrix_map, unsigned int protocol_version);
|
||||
static unsigned char * GetModeDescriptionData(unsigned char* data_ptr, mode mode, unsigned int protocol_version);
|
||||
static unsigned int GetModeDescriptionSize(mode mode, unsigned int protocol_version);
|
||||
static unsigned char * GetSegmentDescriptionData(unsigned char* data_ptr, segment segment, unsigned int protocol_version);
|
||||
static unsigned int GetSegmentDescriptionSize(segment segment, unsigned int protocol_version);
|
||||
static unsigned char * GetZoneDescriptionData(unsigned char* data_ptr, zone zone, unsigned int protocol_version);
|
||||
static unsigned int GetZoneDescriptionSize(zone zone, unsigned int protocol_version);
|
||||
|
||||
static unsigned char* SetColorDescription(unsigned char* data_ptr, RGBController* controller, unsigned int protocol_version, bool resize = false);
|
||||
static unsigned char* SetDeviceDescription(unsigned char* data_ptr, RGBController* controller, unsigned int protocol_version);
|
||||
static unsigned char* SetLEDDescription(unsigned char* data_ptr, led* led, unsigned int protocol_version);
|
||||
static unsigned char* SetMatrixMapDescription(unsigned char* data_ptr, matrix_map_type* matrix_map, unsigned int protocol_version);
|
||||
static unsigned char* SetModeDescription(unsigned char* data_ptr, mode* mode, unsigned int protocol_version);
|
||||
static unsigned char* SetSegmentDescription(unsigned char* data_ptr, segment* segment, unsigned int protocol_version);
|
||||
static unsigned char* SetZoneDescription(unsigned char* data_ptr, zone* zone, unsigned int protocol_version);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Static JSON Description Functions |
|
||||
\*-----------------------------------------------------*/
|
||||
static nlohmann::json GetDeviceDescriptionJSON(RGBController* controller);
|
||||
static nlohmann::json GetLEDDescriptionJSON(led led);
|
||||
static nlohmann::json GetMatrixMapDescriptionJSON(matrix_map_type matrix_map);
|
||||
static nlohmann::json GetModeDescriptionJSON(mode mode);
|
||||
static nlohmann::json GetSegmentDescriptionJSON(segment segment);
|
||||
static nlohmann::json GetZoneDescriptionJSON(zone zone);
|
||||
|
||||
static void SetDeviceDescriptionJSON(nlohmann::json controller_json, RGBController* controller);
|
||||
static led SetLEDDescriptionJSON(nlohmann::json led_json);
|
||||
static matrix_map_type SetMatrixMapDescriptionJSON(nlohmann::json matrix_map_json);
|
||||
static mode SetModeDescriptionJSON(nlohmann::json mode_json);
|
||||
static segment SetSegmentDescriptionJSON(nlohmann::json segment_json);
|
||||
static zone SetZoneDescriptionJSON(nlohmann::json zone_json);
|
||||
|
||||
protected:
|
||||
/*-----------------------------------------------------*\
|
||||
| Controller information strings |
|
||||
|
||||
@@ -217,7 +217,7 @@ unsigned char * RGBController_Network::CreateUpdateLEDsPacket(unsigned int proto
|
||||
| Calculate data size |
|
||||
\*-----------------------------------------------------*/
|
||||
data_size += sizeof(data_size);
|
||||
data_size += GetColorDescriptionSize(protocol_version);
|
||||
data_size += RGBController::GetColorDescriptionSize(this, protocol_version);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create data buffer |
|
||||
@@ -234,7 +234,7 @@ unsigned char * RGBController_Network::CreateUpdateLEDsPacket(unsigned int proto
|
||||
/*-----------------------------------------------------*\
|
||||
| Copy in color data |
|
||||
\*-----------------------------------------------------*/
|
||||
data_ptr = GetColorDescriptionData(data_ptr, protocol_version);
|
||||
data_ptr = RGBController::GetColorDescriptionData(data_ptr, this, protocol_version);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Unlock access mutex |
|
||||
|
||||
@@ -34,6 +34,7 @@ DeviceView::DeviceView(QWidget *parent) :
|
||||
mouseDown(false)
|
||||
{
|
||||
controller = NULL;
|
||||
changed = false;
|
||||
numerical_labels = false;
|
||||
per_led = true;
|
||||
setMouseTracking(1);
|
||||
@@ -231,6 +232,11 @@ static const std::map<std::string, led_label> led_label_lookup =
|
||||
{ KEY_BR_TILDE, { "~" , "~" }}
|
||||
};
|
||||
|
||||
void DeviceView::setChanged()
|
||||
{
|
||||
changed = true;
|
||||
}
|
||||
|
||||
void DeviceView::setController(RGBController * controller_ptr)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
@@ -297,10 +303,17 @@ void DeviceView::InitDeviceView()
|
||||
{
|
||||
for(std::size_t segment_idx = 0; segment_idx < controller->GetZoneSegmentCount(zone_idx); segment_idx++)
|
||||
{
|
||||
unsigned int count = controller->GetZoneSegmentLEDsCount(zone_idx, segment_idx);
|
||||
zone_pos[zone_idx].matrix_w = std::min(count, (unsigned int)MAX_COLS);
|
||||
totalHeight += (count / MAX_COLS) + ((count % MAX_COLS) > 0);
|
||||
|
||||
if(controller->GetZoneSegmentType(zone_idx, segment_idx) == ZONE_TYPE_MATRIX)
|
||||
{
|
||||
totalHeight += controller->GetZoneSegmentMatrixMapHeight(zone_idx, segment_idx);
|
||||
zone_pos[zone_idx].matrix_w = controller->GetZoneSegmentMatrixMapWidth(zone_idx, segment_idx);
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned int count = controller->GetZoneSegmentLEDsCount(zone_idx, segment_idx);
|
||||
zone_pos[zone_idx].matrix_w = std::min(count, (unsigned int)MAX_COLS);
|
||||
totalHeight += (count / MAX_COLS) + ((count % MAX_COLS) > 0);
|
||||
}
|
||||
segment_count++;
|
||||
}
|
||||
}
|
||||
@@ -352,9 +365,9 @@ void DeviceView::InitDeviceView()
|
||||
for(unsigned int led_y = 0; led_y < controller->GetZoneMatrixMapHeight(zone_idx); led_y++)
|
||||
{
|
||||
unsigned int map_idx = led_y * controller->GetZoneMatrixMapWidth(zone_idx) + led_x;
|
||||
unsigned int color_idx = controller->GetZoneMatrixMap(zone_idx)[map_idx] + controller->GetZoneStartIndex(zone_idx);
|
||||
unsigned int color_idx = controller->GetZoneMatrixMapData(zone_idx)[map_idx] + controller->GetZoneStartIndex(zone_idx);
|
||||
|
||||
if(controller->GetZoneMatrixMap(zone_idx)[map_idx] != 0xFFFFFFFF && color_idx < led_pos.size())
|
||||
if(controller->GetZoneMatrixMapData(zone_idx)[map_idx] != 0xFFFFFFFF && color_idx < led_pos.size())
|
||||
{
|
||||
led_pos[color_idx].matrix_x = (zone_pos[zone_idx].matrix_x + led_x + PAD_LED);
|
||||
led_pos[color_idx].matrix_y = current_y + (led_y + PAD_LED);
|
||||
@@ -385,7 +398,7 @@ void DeviceView::InitDeviceView()
|
||||
| Fill Wide: |
|
||||
| Space |
|
||||
\*-----------------------------------------------------*/
|
||||
if(led_x < controller->GetZoneMatrixMapWidth(zone_idx) - 1 && controller->GetZoneMatrixMap(zone_idx)[map_idx + 1] == 0xFFFFFFFF)
|
||||
if(led_x < controller->GetZoneMatrixMapWidth(zone_idx) - 1 && controller->GetZoneMatrixMapData(zone_idx)[map_idx + 1] == 0xFFFFFFFF)
|
||||
{
|
||||
if( ( controller->GetLEDDisplayName(color_idx) == KEY_EN_TAB )
|
||||
|| ( controller->GetLEDDisplayName(color_idx) == KEY_EN_CAPS_LOCK )
|
||||
@@ -400,12 +413,12 @@ void DeviceView::InitDeviceView()
|
||||
if( ( controller->GetLEDDisplayName(color_idx) == KEY_EN_NUMPAD_ENTER )
|
||||
|| ( controller->GetLEDDisplayName(color_idx) == KEY_EN_NUMPAD_PLUS ) )
|
||||
{
|
||||
if(led_y < controller->GetZoneMatrixMapHeight(zone_idx) - 1 && controller->GetZoneMatrixMap(zone_idx)[map_idx + controller->GetZoneMatrixMapWidth(zone_idx)] == 0xFFFFFFFF)
|
||||
if(led_y < controller->GetZoneMatrixMapHeight(zone_idx) - 1 && controller->GetZoneMatrixMapData(zone_idx)[map_idx + controller->GetZoneMatrixMapWidth(zone_idx)] == 0xFFFFFFFF)
|
||||
{
|
||||
led_pos[color_idx].matrix_h += 1.0f;
|
||||
}
|
||||
/* TODO: check if there isn't another widened key above */
|
||||
else if(led_y > 0 && controller->GetZoneMatrixMap(zone_idx)[map_idx - controller->GetZoneMatrixMapWidth(zone_idx)] == 0xFFFFFFFF)
|
||||
else if(led_y > 0 && controller->GetZoneMatrixMapData(zone_idx)[map_idx - controller->GetZoneMatrixMapWidth(zone_idx)] == 0xFFFFFFFF)
|
||||
{
|
||||
led_pos[color_idx].matrix_y -= 1.0f;
|
||||
led_pos[color_idx].matrix_h += 1.0f;
|
||||
@@ -413,12 +426,12 @@ void DeviceView::InitDeviceView()
|
||||
}
|
||||
else if(controller->GetLEDDisplayName(color_idx) == KEY_EN_SPACE)
|
||||
{
|
||||
for(unsigned int map_idx2 = map_idx - 1; map_idx2 > led_y * controller->GetZoneMatrixMapWidth(zone_idx) && controller->GetZoneMatrixMap(zone_idx)[map_idx2] == 0xFFFFFFFF; map_idx2--)
|
||||
for(unsigned int map_idx2 = map_idx - 1; map_idx2 > led_y * controller->GetZoneMatrixMapWidth(zone_idx) && controller->GetZoneMatrixMapData(zone_idx)[map_idx2] == 0xFFFFFFFF; map_idx2--)
|
||||
{
|
||||
led_pos[color_idx].matrix_x -= 1.0f;
|
||||
led_pos[color_idx].matrix_w += 1.0f;
|
||||
}
|
||||
for(unsigned int map_idx2 = map_idx + 1; map_idx2 < (led_y + 1) * controller->GetZoneMatrixMapWidth(zone_idx) && controller->GetZoneMatrixMap(zone_idx)[map_idx2] == 0xFFFFFFFF; map_idx2++)
|
||||
for(unsigned int map_idx2 = map_idx + 1; map_idx2 < (led_y + 1) * controller->GetZoneMatrixMapWidth(zone_idx) && controller->GetZoneMatrixMapData(zone_idx)[map_idx2] == 0xFFFFFFFF; map_idx2++)
|
||||
{
|
||||
led_pos[color_idx].matrix_w += 1.0f;
|
||||
}
|
||||
@@ -445,26 +458,54 @@ void DeviceView::InitDeviceView()
|
||||
|
||||
segment_count++;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Calculate LED box positions for segmented zones |
|
||||
\*-----------------------------------------------------*/
|
||||
unsigned int leds_count = controller->GetZoneSegmentLEDsCount(zone_idx, segment_idx);
|
||||
|
||||
for(unsigned int led_idx = 0; led_idx < leds_count; led_idx++)
|
||||
if(controller->GetZoneSegmentType(zone_idx, segment_idx) == ZONE_TYPE_MATRIX)
|
||||
{
|
||||
unsigned int led_pos_idx = controller->GetZoneStartIndex(zone_idx) + controller->GetZoneSegmentStartIndex(zone_idx, segment_idx) + led_idx;
|
||||
for(unsigned int led_x = 0; led_x < controller->GetZoneSegmentMatrixMapWidth(zone_idx, segment_idx); led_x++)
|
||||
{
|
||||
for(unsigned int led_y = 0; led_y < controller->GetZoneSegmentMatrixMapHeight(zone_idx, segment_idx); led_y++)
|
||||
{
|
||||
unsigned int map_idx = led_y * controller->GetZoneSegmentMatrixMapWidth(zone_idx, segment_idx) + led_x;
|
||||
unsigned int color_idx = controller->GetZoneSegmentMatrixMapData(zone_idx, segment_idx)[map_idx] + controller->GetZoneSegmentStartIndex(zone_idx, segment_idx);
|
||||
|
||||
led_pos[led_pos_idx].matrix_x = zone_pos[zone_idx].matrix_x + ((led_idx % MAX_COLS) + PAD_LED);
|
||||
led_pos[led_pos_idx].matrix_y = current_y + ((led_idx / MAX_COLS) + PAD_LED);
|
||||
if(controller->GetZoneSegmentMatrixMapData(zone_idx, segment_idx)[map_idx] != 0xFFFFFFFF && color_idx < led_pos.size())
|
||||
{
|
||||
led_pos[color_idx].matrix_x = (segment_pos[zone_idx].matrix_x + led_x + PAD_LED);
|
||||
led_pos[color_idx].matrix_y = current_y + (led_y + PAD_LED);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| LED is a 1x1 square, minus padding on all sides |
|
||||
\*-----------------------------------------------------*/
|
||||
led_pos[led_pos_idx].matrix_w = (1.0f - (2.0f * PAD_LED));
|
||||
led_pos[led_pos_idx].matrix_h = (1.0f - (2.0f * PAD_LED));
|
||||
/*-----------------------------------------------------*\
|
||||
| LED is a 1x1 square, minus padding on all sides |
|
||||
\*-----------------------------------------------------*/
|
||||
led_pos[color_idx].matrix_w = (1.0f - (2.0f * PAD_LED));
|
||||
led_pos[color_idx].matrix_h = (1.0f - (2.0f * PAD_LED));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
current_y += controller->GetZoneSegmentMatrixMapHeight(zone_idx, segment_idx);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Calculate LED box positions for segmented zones |
|
||||
\*-----------------------------------------------------*/
|
||||
unsigned int leds_count = controller->GetZoneSegmentLEDsCount(zone_idx, segment_idx);
|
||||
|
||||
current_y += (leds_count / MAX_COLS) + ((leds_count % MAX_COLS) > 0);
|
||||
for(unsigned int led_idx = 0; led_idx < leds_count; led_idx++)
|
||||
{
|
||||
unsigned int led_pos_idx = controller->GetZoneStartIndex(zone_idx) + controller->GetZoneSegmentStartIndex(zone_idx, segment_idx) + led_idx;
|
||||
|
||||
led_pos[led_pos_idx].matrix_x = zone_pos[zone_idx].matrix_x + ((led_idx % MAX_COLS) + PAD_LED);
|
||||
led_pos[led_pos_idx].matrix_y = current_y + ((led_idx / MAX_COLS) + PAD_LED);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| LED is a 1x1 square, minus padding on all sides |
|
||||
\*-----------------------------------------------------*/
|
||||
led_pos[led_pos_idx].matrix_w = (1.0f - (2.0f * PAD_LED));
|
||||
led_pos[led_pos_idx].matrix_h = (1.0f - (2.0f * PAD_LED));
|
||||
}
|
||||
|
||||
current_y += (leds_count / MAX_COLS) + ((leds_count % MAX_COLS) > 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -734,9 +775,10 @@ void DeviceView::paintEvent(QPaintEvent* /* event */)
|
||||
/*-----------------------------------------------------*\
|
||||
| If controller has resized, reinitialize local data |
|
||||
\*-----------------------------------------------------*/
|
||||
if(controller->GetLEDCount() != led_pos.size())
|
||||
if(changed || (controller->GetLEDCount() != led_pos.size()))
|
||||
{
|
||||
InitDeviceView();
|
||||
changed = false;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
|
||||
@@ -32,6 +32,7 @@ public:
|
||||
virtual QSize sizeHint () const;
|
||||
virtual QSize minimumSizeHint () const;
|
||||
|
||||
void setChanged();
|
||||
void setController(RGBController * controller_ptr);
|
||||
void setNumericalLabels(bool enable);
|
||||
void setPerLED(bool per_led_mode);
|
||||
@@ -48,6 +49,7 @@ private:
|
||||
bool mouseDown;
|
||||
bool ctrlDown;
|
||||
bool mouseMoved;
|
||||
bool changed;
|
||||
int size;
|
||||
int offset_x;
|
||||
QRect selectionRect;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "OpenRGBDevicePage.h"
|
||||
#include "OpenRGBZoneResizeDialog.h"
|
||||
#include "OpenRGBZoneEditorDialog.h"
|
||||
#include "ProfileManager.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "SettingsManager.h"
|
||||
@@ -2002,6 +2002,7 @@ void OpenRGBDevicePage::UpdateInterface(unsigned int update_reason)
|
||||
case RGBCONTROLLER_UPDATE_REASON_CLEARSEGMENTS:
|
||||
case RGBCONTROLLER_UPDATE_REASON_RESIZEZONE:
|
||||
UpdateModeUi();
|
||||
ui->DeviceViewBox->setChanged();
|
||||
ui->DeviceViewBox->repaint();
|
||||
break;
|
||||
}
|
||||
@@ -2166,7 +2167,7 @@ void OpenRGBDevicePage::on_EditZoneButton_clicked()
|
||||
\*-----------------------------------------*/
|
||||
if((device->GetZoneType(selected_zone) == ZONE_TYPE_LINEAR) || (device->GetZoneFlags(selected_zone) & ZONE_FLAG_RESIZE_EFFECTS_ONLY))
|
||||
{
|
||||
OpenRGBZoneResizeDialog dlg(device, selected_zone);
|
||||
OpenRGBZoneEditorDialog dlg(device, selected_zone);
|
||||
|
||||
int new_size = dlg.show();
|
||||
|
||||
|
||||
136
qt/OpenRGBMatrixMapEditorDialog/OpenRGBMatrixMapEditorDialog.cpp
Normal file
136
qt/OpenRGBMatrixMapEditorDialog/OpenRGBMatrixMapEditorDialog.cpp
Normal file
@@ -0,0 +1,136 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBMatrixMapEditorDialog.cpp |
|
||||
| |
|
||||
| User interface for editing matrix maps |
|
||||
| |
|
||||
| Adam Honse <calcprogrammer1@gmail.com> 21 Feb 2026 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <fstream>
|
||||
#include <QComboBox>
|
||||
#include <QFileDialog>
|
||||
#include <QLineEdit>
|
||||
#include "OpenRGBMatrixMapEditorDialog.h"
|
||||
#include "ui_OpenRGBMatrixMapEditorDialog.h"
|
||||
|
||||
OpenRGBMatrixMapEditorDialog::OpenRGBMatrixMapEditorDialog(QString name, matrix_map_type* edit_map_ptr, unsigned int led_count, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::OpenRGBMatrixMapEditorDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Save matrix map pointer |
|
||||
\*-----------------------------------------------------*/
|
||||
edit_map = edit_map_ptr;
|
||||
edit_led_count = led_count;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Append name to window title |
|
||||
\*-----------------------------------------------------*/
|
||||
if(name != "")
|
||||
{
|
||||
QString currentTitle = windowTitle();
|
||||
|
||||
QString newTitle = currentTitle + " - " + name;
|
||||
|
||||
setWindowTitle(newTitle);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Initialize matrix map table |
|
||||
\*-----------------------------------------------------*/
|
||||
ui->LineEditHeight->setText(QString::number(edit_map->height));
|
||||
ui->LineEditWidth->setText(QString::number(edit_map->width));
|
||||
|
||||
ui->TableWidgetMatrixMap->setRowCount(edit_map->height);
|
||||
ui->TableWidgetMatrixMap->setColumnCount(edit_map->width);
|
||||
|
||||
for(int row = 0; row < ui->TableWidgetMatrixMap->rowCount(); row++)
|
||||
{
|
||||
for(int column = 0; column < ui->TableWidgetMatrixMap->columnCount(); column++)
|
||||
{
|
||||
unsigned int table_value = edit_map->map[(row * edit_map->width) + column];
|
||||
QTableWidgetItem* table_item = new QTableWidgetItem;
|
||||
|
||||
if(table_value < edit_led_count)
|
||||
{
|
||||
table_item->setText(QString::number(table_value));
|
||||
}
|
||||
|
||||
ui->TableWidgetMatrixMap->setItem(row, column, table_item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OpenRGBMatrixMapEditorDialog::~OpenRGBMatrixMapEditorDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBMatrixMapEditorDialog::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
}
|
||||
|
||||
int OpenRGBMatrixMapEditorDialog::show()
|
||||
{
|
||||
int ret_val = 0;
|
||||
|
||||
int result = this->exec();
|
||||
|
||||
if(result == QDialog::Rejected)
|
||||
{
|
||||
ret_val = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
edit_map->height = ui->LineEditHeight->text().toInt();
|
||||
edit_map->width = ui->LineEditWidth->text().toInt();
|
||||
|
||||
edit_map->map.resize(edit_map->height * edit_map->width);
|
||||
|
||||
for(int row = 0; row < ui->TableWidgetMatrixMap->rowCount(); row++)
|
||||
{
|
||||
for(int column = 0; column < ui->TableWidgetMatrixMap->columnCount(); column++)
|
||||
{
|
||||
bool valid = false;
|
||||
QTableWidgetItem* table_item = ui->TableWidgetMatrixMap->item(row, column);
|
||||
QString table_string = "";
|
||||
unsigned int table_number = 0xFFFFFFFF;
|
||||
|
||||
if(table_item)
|
||||
{
|
||||
table_string = table_item->text();
|
||||
table_number = table_string.toUInt(&valid);
|
||||
}
|
||||
|
||||
if(!valid || (table_number >= edit_led_count))
|
||||
{
|
||||
table_number = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
edit_map->map[(row * edit_map->width) + column] = table_number;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return(ret_val);
|
||||
}
|
||||
|
||||
void OpenRGBMatrixMapEditorDialog::on_LineEditHeight_textChanged(const QString &arg1)
|
||||
{
|
||||
ui->TableWidgetMatrixMap->setRowCount(arg1.toInt());
|
||||
}
|
||||
|
||||
void OpenRGBMatrixMapEditorDialog::on_LineEditWidth_textChanged(const QString &arg1)
|
||||
{
|
||||
ui->TableWidgetMatrixMap->setColumnCount(arg1.toInt());
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBMatrixMapEditorDialog.h |
|
||||
| |
|
||||
| User interface for editing matrix maps |
|
||||
| |
|
||||
| Adam Honse <calcprogrammer1@gmail.com> 21 Feb 2026 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
#include "RGBController.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBMatrixMapEditorDialog;
|
||||
}
|
||||
|
||||
class OpenRGBMatrixMapEditorDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBMatrixMapEditorDialog(QString name, matrix_map_type* edit_map_ptr, unsigned int led_count, QWidget *parent = nullptr);
|
||||
~OpenRGBMatrixMapEditorDialog();
|
||||
|
||||
int show();
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
|
||||
void on_LineEditHeight_textChanged(const QString &arg1);
|
||||
|
||||
void on_LineEditWidth_textChanged(const QString &arg1);
|
||||
|
||||
private:
|
||||
Ui::OpenRGBMatrixMapEditorDialog* ui;
|
||||
matrix_map_type* edit_map;
|
||||
unsigned int edit_led_count;
|
||||
};
|
||||
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBMatrixMapEditorDialog</class>
|
||||
<widget class="QDialog" name="OpenRGBMatrixMapEditorDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>450</width>
|
||||
<height>250</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Matrix Map Editor</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout" columnstretch="1,0">
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QDialogButtonBox" name="ButtonBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="GridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="LabelHeight">
|
||||
<property name="text">
|
||||
<string>Height:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="LineEditHeight"/>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="LabelWidth">
|
||||
<property name="text">
|
||||
<string>Width:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLineEdit" name="LineEditWidth"/>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="4">
|
||||
<widget class="QTableWidget" name="TableWidgetMatrixMap"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>ButtonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>OpenRGBMatrixMapEditorDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>ButtonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>OpenRGBMatrixMapEditorDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
86
qt/OpenRGBSegmentExportDialog/OpenRGBSegmentExportDialog.cpp
Normal file
86
qt/OpenRGBSegmentExportDialog/OpenRGBSegmentExportDialog.cpp
Normal file
@@ -0,0 +1,86 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBSegmentExportDialog.cpp |
|
||||
| |
|
||||
| User interface entry for OpenRGB segment export dialog |
|
||||
| |
|
||||
| Adam Honse <calcprogrammer1@gmail.com> 22 Feb 2026 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <QFileDialog>
|
||||
#include "OpenRGBSegmentExportDialog.h"
|
||||
#include "ui_OpenRGBSegmentExportDialog.h"
|
||||
|
||||
OpenRGBSegmentExportDialog::OpenRGBSegmentExportDialog(QWidget *parent) :
|
||||
QDialog(parent), ui(new Ui::OpenRGBSegmentExportDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
}
|
||||
|
||||
OpenRGBSegmentExportDialog::~OpenRGBSegmentExportDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBSegmentExportDialog::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
}
|
||||
|
||||
bool OpenRGBSegmentExportDialog::show()
|
||||
{
|
||||
int result = this->exec();
|
||||
|
||||
if(result == QDialog::Rejected)
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
filename = ui->LineEditFile->text();
|
||||
vendor = ui->LineEditVendor->text();
|
||||
device = ui->LineEditDevice->text();
|
||||
}
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
QString OpenRGBSegmentExportDialog::GetDevice()
|
||||
{
|
||||
return(device);
|
||||
}
|
||||
|
||||
QString OpenRGBSegmentExportDialog::GetFilename()
|
||||
{
|
||||
return(filename);
|
||||
}
|
||||
|
||||
QString OpenRGBSegmentExportDialog::GetVendor()
|
||||
{
|
||||
return(vendor);
|
||||
}
|
||||
|
||||
void OpenRGBSegmentExportDialog::on_ButtonChooseFile_clicked()
|
||||
{
|
||||
QFileDialog file_dialog(this);
|
||||
|
||||
file_dialog.setFileMode(QFileDialog::AnyFile);
|
||||
file_dialog.setNameFilter("*.json");
|
||||
file_dialog.setDefaultSuffix(".json");
|
||||
file_dialog.setWindowTitle("Export Configuration");
|
||||
|
||||
if(file_dialog.exec())
|
||||
{
|
||||
QStringList selected_files = file_dialog.selectedFiles();
|
||||
QString filename = selected_files[0];
|
||||
|
||||
ui->LineEditFile->setText(filename);
|
||||
}
|
||||
}
|
||||
|
||||
44
qt/OpenRGBSegmentExportDialog/OpenRGBSegmentExportDialog.h
Normal file
44
qt/OpenRGBSegmentExportDialog/OpenRGBSegmentExportDialog.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBSegmentExportDialog.h |
|
||||
| |
|
||||
| User interface entry for OpenRGB segment export dialog |
|
||||
| |
|
||||
| Adam Honse <calcprogrammer1@gmail.com> 22 Feb 2026 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBSegmentExportDialog;
|
||||
}
|
||||
|
||||
class OpenRGBSegmentExportDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBSegmentExportDialog(QWidget *parent = nullptr);
|
||||
~OpenRGBSegmentExportDialog();
|
||||
|
||||
bool show();
|
||||
|
||||
QString GetDevice();
|
||||
QString GetFilename();
|
||||
QString GetVendor();
|
||||
|
||||
private:
|
||||
Ui::OpenRGBSegmentExportDialog* ui;
|
||||
QString device;
|
||||
QString filename;
|
||||
QString vendor;
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void on_ButtonChooseFile_clicked();
|
||||
};
|
||||
126
qt/OpenRGBSegmentExportDialog/OpenRGBSegmentExportDialog.ui
Normal file
126
qt/OpenRGBSegmentExportDialog/OpenRGBSegmentExportDialog.ui
Normal file
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBSegmentExportDialog</class>
|
||||
<widget class="QDialog" name="OpenRGBSegmentExportDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>300</width>
|
||||
<height>250</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Export Segment Configuration</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLineEdit" name="LineEditFile">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="ButtonChooseFile">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>8</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="LabelFile">
|
||||
<property name="text">
|
||||
<string>File:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QLabel" name="LabelVendor">
|
||||
<property name="text">
|
||||
<string>Vendor Name (Optional):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QLineEdit" name="LineEditVendor"/>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QLabel" name="LabelDevice">
|
||||
<property name="text">
|
||||
<string>Device Name (Optional):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="2">
|
||||
<widget class="QLineEdit" name="LineEditDevice"/>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="2">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>OpenRGBSegmentExportDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>OpenRGBSegmentExportDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
477
qt/OpenRGBZoneEditorDialog/OpenRGBZoneEditorDialog.cpp
Normal file
477
qt/OpenRGBZoneEditorDialog/OpenRGBZoneEditorDialog.cpp
Normal file
@@ -0,0 +1,477 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBZoneEditorDialog.cpp |
|
||||
| |
|
||||
| User interface for editing zones |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <fstream>
|
||||
#include <QPushButton>
|
||||
#include <QComboBox>
|
||||
#include <QFileDialog>
|
||||
#include <QLineEdit>
|
||||
#include "OpenRGBMatrixMapEditorDialog.h"
|
||||
#include "OpenRGBSegmentExportDialog.h"
|
||||
#include "OpenRGBZoneEditorDialog.h"
|
||||
#include "ui_OpenRGBZoneEditorDialog.h"
|
||||
|
||||
OpenRGBZoneEditorDialog::OpenRGBZoneEditorDialog(RGBController* edit_dev_ptr, unsigned int edit_zone_idx_val, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::OpenRGBZoneEditorDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Save device and zone |
|
||||
\*-----------------------------------------------------*/
|
||||
edit_dev = edit_dev_ptr;
|
||||
edit_zone_idx = edit_zone_idx_val;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Append zone name to window title |
|
||||
\*-----------------------------------------------------*/
|
||||
QString currentTitle = windowTitle();
|
||||
|
||||
QString newTitle = currentTitle + " - " + QString::fromStdString(edit_dev->GetZoneName(edit_zone_idx));
|
||||
|
||||
setWindowTitle(newTitle);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up zone size range |
|
||||
\*-----------------------------------------------------*/
|
||||
unsigned int size_min = edit_dev->GetZoneLEDsMin(edit_zone_idx);
|
||||
unsigned int size_max = edit_dev->GetZoneLEDsMax(edit_zone_idx);
|
||||
unsigned int size_current = edit_dev->GetZoneLEDsCount(edit_zone_idx);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Initialize segment list |
|
||||
\*-----------------------------------------------------*/
|
||||
QStringList header_labels;
|
||||
header_labels << "Name" << "Type" << "Matrix Map" << "Size" << "";
|
||||
ui->SegmentsTreeWidget->setHeaderLabels(header_labels);
|
||||
|
||||
ui->ResizeSlider->setRange(size_min, size_max);
|
||||
ui->ResizeBox->setRange(size_min, size_max);
|
||||
|
||||
ui->ResizeSlider->setValue(size_current);
|
||||
ui->ResizeBox->setValue(size_current);
|
||||
|
||||
for(unsigned int segment_idx = 0; segment_idx < edit_dev->GetZoneSegmentCount(edit_zone_idx); segment_idx++)
|
||||
{
|
||||
matrix_map_type new_matrix_map = edit_dev->GetZoneSegmentMatrixMap(edit_zone_idx, segment_idx);
|
||||
AddSegmentRow(QString::fromStdString(edit_dev->GetZoneSegmentName(edit_zone_idx, segment_idx)), edit_dev->GetZoneSegmentLEDsCount(edit_zone_idx, segment_idx), edit_dev->GetZoneSegmentType(edit_zone_idx, segment_idx), new_matrix_map);
|
||||
}
|
||||
}
|
||||
|
||||
OpenRGBZoneEditorDialog::~OpenRGBZoneEditorDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBZoneEditorDialog::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBZoneEditorDialog::on_ResizeSlider_valueChanged(int value)
|
||||
{
|
||||
ui->ResizeBox->blockSignals(true);
|
||||
ui->ResizeBox->setValue(value);
|
||||
ui->ResizeBox->blockSignals(false);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set maximum value for all segment sliders to new zone |
|
||||
| size |
|
||||
\*-----------------------------------------------------*/
|
||||
for(int item_idx = 0; item_idx < ui->SegmentsTreeWidget->topLevelItemCount(); item_idx++)
|
||||
{
|
||||
((QSlider*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(item_idx), 4))->setMaximum(value);
|
||||
}
|
||||
|
||||
CheckSegmentsValidity();
|
||||
}
|
||||
|
||||
void OpenRGBZoneEditorDialog::on_segment_lineedit_textChanged()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Update the Slider with the LineEdit value for each |
|
||||
| segment |
|
||||
\*-----------------------------------------------------*/
|
||||
for(int item_idx = 0; item_idx < ui->SegmentsTreeWidget->topLevelItemCount(); item_idx++)
|
||||
{
|
||||
int lineedit_value = ((QLineEdit*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(item_idx), 3))->text().toInt();
|
||||
((QSlider*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(item_idx), 4))->setValue(lineedit_value);
|
||||
}
|
||||
|
||||
CheckSegmentsValidity();
|
||||
}
|
||||
|
||||
void SegmentTreeWidgetItem::on_button_matrix_map_clicked()
|
||||
{
|
||||
QString segment_name = ((QLineEdit*)(treeWidget()->itemWidget(this, 0)))->text();
|
||||
unsigned int segment_led_count = ((QLineEdit*)(treeWidget()->itemWidget(this, 3)))->text().toInt();
|
||||
|
||||
OpenRGBMatrixMapEditorDialog dialog(segment_name, &matrix_map, segment_led_count);
|
||||
|
||||
dialog.show();
|
||||
|
||||
((QPushButton*)(treeWidget()->itemWidget(this, 2)))->setText(QString::number(matrix_map.height) + "x" + QString::number(matrix_map.width));
|
||||
}
|
||||
|
||||
void OpenRGBZoneEditorDialog::on_segment_slider_valueChanged(int)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Update the LineEdit with the Slider value for each |
|
||||
| segment |
|
||||
\*-----------------------------------------------------*/
|
||||
for(int item_idx = 0; item_idx < ui->SegmentsTreeWidget->topLevelItemCount(); item_idx++)
|
||||
{
|
||||
int slider_value = ((QSlider*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(item_idx), 4))->value();
|
||||
((QLineEdit*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(item_idx), 3))->setText(QString::number(slider_value));
|
||||
}
|
||||
|
||||
CheckSegmentsValidity();
|
||||
}
|
||||
|
||||
void OpenRGBZoneEditorDialog::on_ResizeBox_valueChanged(int value)
|
||||
{
|
||||
ui->ResizeSlider->blockSignals(true);
|
||||
ui->ResizeSlider->setValue(value);
|
||||
ui->ResizeSlider->blockSignals(false);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set maximum value for all segment sliders to new zone |
|
||||
| size |
|
||||
\*-----------------------------------------------------*/
|
||||
for(int item_idx = 0; item_idx < ui->SegmentsTreeWidget->topLevelItemCount(); item_idx++)
|
||||
{
|
||||
((QSlider*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(item_idx), 4))->setMaximum(value);
|
||||
}
|
||||
|
||||
CheckSegmentsValidity();
|
||||
}
|
||||
|
||||
int OpenRGBZoneEditorDialog::show()
|
||||
{
|
||||
int ret_val = 0;
|
||||
|
||||
int result = this->exec();
|
||||
|
||||
if(result == QDialog::Rejected)
|
||||
{
|
||||
ret_val = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret_val = ui->ResizeBox->value();
|
||||
}
|
||||
|
||||
if(ret_val >= 0 && edit_dev != NULL)
|
||||
{
|
||||
edit_dev->ResizeZone(edit_zone_idx, ret_val);
|
||||
|
||||
edit_dev->ClearSegments(edit_zone_idx);
|
||||
|
||||
unsigned int start_idx = 0;
|
||||
|
||||
for(int item_idx = 0; item_idx < ui->SegmentsTreeWidget->topLevelItemCount(); item_idx++)
|
||||
{
|
||||
segment new_segment;
|
||||
new_segment.type = ((QComboBox*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(item_idx), 1))->currentIndex();
|
||||
new_segment.name = ((QLineEdit*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(item_idx), 0))->text().toStdString();
|
||||
new_segment.start_idx = start_idx;
|
||||
new_segment.leds_count = ((QLineEdit*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(item_idx), 3))->text().toInt();
|
||||
new_segment.matrix_map = ((SegmentTreeWidgetItem*)(ui->SegmentsTreeWidget->topLevelItem(item_idx)))->matrix_map;
|
||||
|
||||
edit_dev->AddSegment(edit_zone_idx, new_segment);
|
||||
|
||||
start_idx += new_segment.leds_count;
|
||||
}
|
||||
}
|
||||
|
||||
return(ret_val);
|
||||
}
|
||||
|
||||
void OpenRGBZoneEditorDialog::AddSegmentRow(QString name, unsigned int length, zone_type type, matrix_map_type matrix_map)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Create new line in segments list tree |
|
||||
\*---------------------------------------------------------*/
|
||||
SegmentTreeWidgetItem* new_item = new SegmentTreeWidgetItem(ui->SegmentsTreeWidget);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Set the matrix map |
|
||||
\*---------------------------------------------------------*/
|
||||
new_item->matrix_map = matrix_map;
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Create new widgets for line |
|
||||
\*---------------------------------------------------------*/
|
||||
QComboBox* combobox_type = new QComboBox(ui->SegmentsTreeWidget);
|
||||
QLineEdit* lineedit_name = new QLineEdit(ui->SegmentsTreeWidget);
|
||||
QLineEdit* lineedit_length = new QLineEdit(ui->SegmentsTreeWidget);
|
||||
QSlider* slider_length = new QSlider(Qt::Horizontal, ui->SegmentsTreeWidget);
|
||||
QPushButton* button_matrix_map = new QPushButton();
|
||||
|
||||
button_matrix_map->setText(QString::number(new_item->matrix_map.height) + "x" + QString::number(new_item->matrix_map.width));
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Fill in Name field |
|
||||
\*---------------------------------------------------------*/
|
||||
lineedit_name->setText(name);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Set up segment type combo box |
|
||||
\*---------------------------------------------------------*/
|
||||
combobox_type->addItem("Single");
|
||||
combobox_type->addItem("Linear");
|
||||
combobox_type->addItem("Matrix");
|
||||
combobox_type->addItem("Linear Loop");
|
||||
combobox_type->addItem("Matrix Loop X");
|
||||
combobox_type->addItem("Matrix Loop Y");
|
||||
combobox_type->addItem("Segmented");
|
||||
|
||||
combobox_type->setCurrentIndex(type);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Fill in Length field |
|
||||
\*---------------------------------------------------------*/
|
||||
lineedit_length->setText(QString::number(length));
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Fill in slider length and maximum |
|
||||
\*---------------------------------------------------------*/
|
||||
slider_length->setMaximum(edit_dev->GetZoneLEDsCount(edit_zone_idx));
|
||||
slider_length->setValue(length);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Add new widgets to tree |
|
||||
\*---------------------------------------------------------*/
|
||||
ui->SegmentsTreeWidget->setItemWidget(new_item, 0, lineedit_name);
|
||||
ui->SegmentsTreeWidget->setItemWidget(new_item, 1, combobox_type);
|
||||
ui->SegmentsTreeWidget->setItemWidget(new_item, 2, button_matrix_map);
|
||||
ui->SegmentsTreeWidget->setItemWidget(new_item, 3, lineedit_length);
|
||||
ui->SegmentsTreeWidget->setItemWidget(new_item, 4, slider_length);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Connect signals for handling slider and line edits |
|
||||
\*---------------------------------------------------------*/
|
||||
connect(lineedit_name, &QLineEdit::textChanged, this, &OpenRGBZoneEditorDialog::on_segment_lineedit_textChanged);
|
||||
connect(slider_length, &QSlider::valueChanged, this, &OpenRGBZoneEditorDialog::on_segment_slider_valueChanged);
|
||||
connect(lineedit_length, &QLineEdit::textChanged, this, &OpenRGBZoneEditorDialog::on_segment_lineedit_textChanged);
|
||||
connect(button_matrix_map, SIGNAL(clicked()), new_item, SLOT(on_button_matrix_map_clicked()));
|
||||
}
|
||||
|
||||
void OpenRGBZoneEditorDialog::on_AddSegmentButton_clicked()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Create new empty row with name "Segment X" |
|
||||
\*---------------------------------------------------------*/
|
||||
QString new_name = "Segment " + QString::number(ui->SegmentsTreeWidget->topLevelItemCount() + 1);
|
||||
|
||||
matrix_map_type new_matrix_map;
|
||||
AddSegmentRow(new_name, 0, ZONE_TYPE_LINEAR, new_matrix_map);
|
||||
|
||||
CheckSegmentsValidity();
|
||||
}
|
||||
|
||||
void OpenRGBZoneEditorDialog::CheckSegmentsValidity()
|
||||
{
|
||||
bool segments_valid = true;
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Only check validity if segments are configured |
|
||||
\*---------------------------------------------------------*/
|
||||
if(ui->SegmentsTreeWidget->topLevelItemCount() != 0)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Verify all segments add up to zone size |
|
||||
\*-----------------------------------------------------*/
|
||||
int total_segment_leds = 0;
|
||||
|
||||
for(int segment_idx = 0; segment_idx < ui->SegmentsTreeWidget->topLevelItemCount(); segment_idx++)
|
||||
{
|
||||
unsigned int segment_leds = ((QLineEdit*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(segment_idx), 3))->text().toInt();
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Zero-length segment is not allowed |
|
||||
\*-------------------------------------------------*/
|
||||
if(segment_leds == 0)
|
||||
{
|
||||
segments_valid = false;
|
||||
}
|
||||
|
||||
total_segment_leds += segment_leds;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Empty name is not allowed |
|
||||
\*-------------------------------------------------*/
|
||||
if(((QLineEdit*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(segment_idx), 0))->text().isEmpty())
|
||||
{
|
||||
segments_valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(total_segment_leds != ui->ResizeBox->value())
|
||||
{
|
||||
segments_valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
ui->ButtonBox->setEnabled(segments_valid);
|
||||
}
|
||||
|
||||
void OpenRGBZoneEditorDialog::on_RemoveSegmentButton_clicked()
|
||||
{
|
||||
ui->SegmentsTreeWidget->takeTopLevelItem(ui->SegmentsTreeWidget->topLevelItemCount() - 1);
|
||||
|
||||
CheckSegmentsValidity();
|
||||
}
|
||||
|
||||
void OpenRGBZoneEditorDialog::on_ImportConfigurationButton_clicked()
|
||||
{
|
||||
QFileDialog file_dialog(this);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Show the file chooser dialog |
|
||||
\*-----------------------------------------------------*/
|
||||
file_dialog.setFileMode(QFileDialog::ExistingFile);
|
||||
file_dialog.setNameFilter("*.json");
|
||||
file_dialog.setWindowTitle("Import Configuration");
|
||||
|
||||
if(file_dialog.exec())
|
||||
{
|
||||
QStringList selected_files = file_dialog.selectedFiles();
|
||||
QString filename = selected_files[0];
|
||||
std::ifstream config_file(filename.toStdString(), std::ios::in);
|
||||
nlohmann::json config_json;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Import config file if a valid file was opened |
|
||||
\*-------------------------------------------------*/
|
||||
if(config_file)
|
||||
{
|
||||
try
|
||||
{
|
||||
config_file >> config_json;
|
||||
|
||||
/*-----------------------------------------*\
|
||||
| Read in all segments |
|
||||
\*-----------------------------------------*/
|
||||
if(config_json.contains("segments"))
|
||||
{
|
||||
unsigned int total_leds_count = ui->ResizeSlider->value();
|
||||
|
||||
for(std::size_t segment_idx = 0; segment_idx < config_json["segments"].size(); segment_idx++)
|
||||
{
|
||||
unsigned int segment_leds_count = 0;
|
||||
matrix_map_type segment_matrix_map;
|
||||
QString segment_name = "";
|
||||
zone_type segment_type = ZONE_TYPE_LINEAR;
|
||||
|
||||
if(config_json["segments"][segment_idx].contains("name"))
|
||||
{
|
||||
segment_name = QString::fromStdString(config_json["segments"][segment_idx]["name"]);
|
||||
}
|
||||
if(config_json["segments"][segment_idx].contains("leds_count"))
|
||||
{
|
||||
segment_leds_count = config_json["segments"][segment_idx]["leds_count"];
|
||||
}
|
||||
if(config_json["segments"][segment_idx].contains("type"))
|
||||
{
|
||||
segment_type = config_json["segments"][segment_idx]["type"];
|
||||
}
|
||||
|
||||
matrix_map_type new_matrix_map;
|
||||
new_matrix_map = RGBController::SetMatrixMapDescriptionJSON(config_json["segments"][segment_idx]["matrix_map"]);
|
||||
|
||||
AddSegmentRow(segment_name, segment_leds_count, segment_type, new_matrix_map);
|
||||
|
||||
total_leds_count += segment_leds_count;
|
||||
}
|
||||
|
||||
|
||||
ui->ResizeSlider->setValue(total_leds_count);
|
||||
ui->ResizeBox->setValue(total_leds_count);
|
||||
}
|
||||
}
|
||||
catch(const std::exception& e)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBZoneEditorDialog::on_ExportConfigurationButton_clicked()
|
||||
{
|
||||
OpenRGBSegmentExportDialog dialog;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Show the segment export dialog |
|
||||
\*-----------------------------------------------------*/
|
||||
if(dialog.show())
|
||||
{
|
||||
std::ofstream config_file(dialog.GetFilename().toStdString(), std::ios::out);
|
||||
nlohmann::json config_json;
|
||||
|
||||
if(config_file)
|
||||
{
|
||||
QString device = dialog.GetDevice();
|
||||
QString vendor = dialog.GetVendor();
|
||||
|
||||
/*---------------------------------------------*\
|
||||
| Fill in device string in the JSON |
|
||||
\*---------------------------------------------*/
|
||||
if(device != "")
|
||||
{
|
||||
config_json["device"] = device.toStdString();
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------*\
|
||||
| Fill in vendor string in the JSON |
|
||||
\*---------------------------------------------*/
|
||||
if(vendor != "")
|
||||
{
|
||||
config_json["vendor"] = vendor.toStdString();
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------*\
|
||||
| Fill in segment data in the JSON |
|
||||
\*---------------------------------------------*/
|
||||
unsigned int start_idx = 0;
|
||||
|
||||
for(int item_idx = 0; item_idx < ui->SegmentsTreeWidget->topLevelItemCount(); item_idx++)
|
||||
{
|
||||
segment new_segment;
|
||||
new_segment.type = ((QComboBox*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(item_idx), 1))->currentIndex();
|
||||
new_segment.name = ((QLineEdit*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(item_idx), 0))->text().toStdString();
|
||||
new_segment.start_idx = start_idx;
|
||||
new_segment.leds_count = ((QLineEdit*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(item_idx), 3))->text().toInt();
|
||||
new_segment.matrix_map = ((SegmentTreeWidgetItem*)(ui->SegmentsTreeWidget->topLevelItem(item_idx)))->matrix_map;
|
||||
|
||||
config_json["segments"][item_idx] = RGBController::GetSegmentDescriptionJSON(new_segment);
|
||||
|
||||
start_idx += new_segment.leds_count;
|
||||
}
|
||||
|
||||
/*---------------------------------------------*\
|
||||
| Write the JSON data to the file |
|
||||
\*---------------------------------------------*/
|
||||
config_file << std::setw(4) << config_json << std::endl;
|
||||
|
||||
/*---------------------------------------------*\
|
||||
| Close the file when done |
|
||||
\*---------------------------------------------*/
|
||||
config_file.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBZoneResizeDialog.h |
|
||||
| OpenRGBZoneEditorDialog.h |
|
||||
| |
|
||||
| User interface for resizing zones |
|
||||
| User interface for editing zones |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
@@ -10,43 +10,55 @@
|
||||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#include <QTreeWidgetItem>
|
||||
#include "RGBController.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBZoneResizeDialog;
|
||||
class OpenRGBZoneEditorDialog;
|
||||
}
|
||||
|
||||
class OpenRGBZoneResizeDialog : public QDialog
|
||||
|
||||
class SegmentTreeWidgetItem : public QObject, public QTreeWidgetItem
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBZoneResizeDialog(RGBController* edit_dev_ptr, unsigned int edit_zone_idx_val, QWidget *parent = nullptr);
|
||||
~OpenRGBZoneResizeDialog();
|
||||
using QTreeWidgetItem::QTreeWidgetItem;
|
||||
|
||||
matrix_map_type matrix_map;
|
||||
|
||||
private slots:
|
||||
void on_button_matrix_map_clicked();
|
||||
};
|
||||
|
||||
class OpenRGBZoneEditorDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBZoneEditorDialog(RGBController* edit_dev_ptr, unsigned int edit_zone_idx_val, QWidget *parent = nullptr);
|
||||
~OpenRGBZoneEditorDialog();
|
||||
|
||||
int show();
|
||||
|
||||
private slots:
|
||||
void changeEvent(QEvent *event);
|
||||
void on_ResizeSlider_valueChanged(int value);
|
||||
|
||||
void on_ResizeBox_valueChanged(int arg1);
|
||||
|
||||
void on_AddSegmentButton_clicked();
|
||||
|
||||
void on_RemoveSegmentButton_clicked();
|
||||
|
||||
void on_segment_slider_valueChanged(int);
|
||||
|
||||
void on_segment_lineedit_textChanged();
|
||||
void on_ImportConfigurationButton_clicked();
|
||||
|
||||
void on_ExportConfigurationButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::OpenRGBZoneResizeDialog *ui;
|
||||
Ui::OpenRGBZoneEditorDialog *ui;
|
||||
RGBController* edit_dev;
|
||||
unsigned int edit_zone_idx;
|
||||
|
||||
void AddSegmentRow(QString name, unsigned int length, zone_type type);
|
||||
void AddSegmentRow(QString name, unsigned int length, zone_type type, matrix_map_type matrix_map);
|
||||
void CheckSegmentsValidity();
|
||||
};
|
||||
173
qt/OpenRGBZoneEditorDialog/OpenRGBZoneEditorDialog.ui
Normal file
173
qt/OpenRGBZoneEditorDialog/OpenRGBZoneEditorDialog.ui
Normal file
@@ -0,0 +1,173 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBZoneEditorDialog</class>
|
||||
<widget class="QDialog" name="OpenRGBZoneEditorDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>750</width>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Zone Editor</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout" columnstretch="1,0,0">
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QGroupBox" name="GroupBoxZoneSize">
|
||||
<property name="title">
|
||||
<string>Zone Size</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTooltipedSlider" name="ResizeSlider">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="ResizeBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="3">
|
||||
<widget class="QGroupBox" name="GroupBoxSegments">
|
||||
<property name="title">
|
||||
<string>Segments</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="AddSegmentButton">
|
||||
<property name="text">
|
||||
<string>Add Segment</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="RemoveSegmentButton">
|
||||
<property name="text">
|
||||
<string>Remove Segment</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="4">
|
||||
<widget class="QTreeWidget" name="SegmentsTreeWidget">
|
||||
<property name="columnCount">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string notr="true">Name</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Type</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Length</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="ImportConfigurationButton">
|
||||
<property name="text">
|
||||
<string>Import Configuration</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QPushButton" name="ExportConfigurationButton">
|
||||
<property name="text">
|
||||
<string>Export Configuration</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="2">
|
||||
<widget class="QDialogButtonBox" name="ButtonBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QTooltipedSlider</class>
|
||||
<extends>QSlider</extends>
|
||||
<header location="global">QTooltipedSlider.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>ButtonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>OpenRGBZoneEditorDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>ButtonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>OpenRGBZoneEditorDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -1,283 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBZoneResizeDialog.cpp |
|
||||
| |
|
||||
| User interface for resizing zones |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QLineEdit>
|
||||
#include "OpenRGBZoneResizeDialog.h"
|
||||
#include "ui_OpenRGBZoneResizeDialog.h"
|
||||
|
||||
OpenRGBZoneResizeDialog::OpenRGBZoneResizeDialog(RGBController* edit_dev_ptr, unsigned int edit_zone_idx_val, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::OpenRGBZoneResizeDialog)
|
||||
{
|
||||
edit_dev = edit_dev_ptr;
|
||||
edit_zone_idx = edit_zone_idx_val;
|
||||
|
||||
unsigned int size_min = edit_dev->GetZoneLEDsMin(edit_zone_idx);
|
||||
unsigned int size_max = edit_dev->GetZoneLEDsMax(edit_zone_idx);
|
||||
unsigned int size_current = edit_dev->GetZoneLEDsCount(edit_zone_idx);
|
||||
|
||||
ui->setupUi(this);
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
QStringList header_labels;
|
||||
header_labels << "Name" << "Type" << "Size" << "";
|
||||
ui->SegmentsTreeWidget->setHeaderLabels(header_labels);
|
||||
|
||||
ui->ResizeSlider->setRange(size_min, size_max);
|
||||
ui->ResizeBox->setRange(size_min, size_max);
|
||||
|
||||
ui->ResizeSlider->setValue(size_current);
|
||||
ui->ResizeBox->setValue(size_current);
|
||||
|
||||
for(unsigned int segment_idx = 0; segment_idx < edit_dev->GetZoneSegmentCount(edit_zone_idx); segment_idx++)
|
||||
{
|
||||
AddSegmentRow(QString::fromStdString(edit_dev->GetZoneSegmentName(edit_zone_idx, segment_idx)), edit_dev->GetZoneSegmentLEDsCount(edit_zone_idx, segment_idx), edit_dev->GetZoneSegmentType(edit_zone_idx, segment_idx));
|
||||
}
|
||||
}
|
||||
|
||||
OpenRGBZoneResizeDialog::~OpenRGBZoneResizeDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void OpenRGBZoneResizeDialog::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::LanguageChange)
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenRGBZoneResizeDialog::on_ResizeSlider_valueChanged(int value)
|
||||
{
|
||||
ui->ResizeBox->blockSignals(true);
|
||||
ui->ResizeBox->setValue(value);
|
||||
ui->ResizeBox->blockSignals(false);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set maximum value for all segment sliders to new zone |
|
||||
| size |
|
||||
\*-----------------------------------------------------*/
|
||||
for(int item_idx = 0; item_idx < ui->SegmentsTreeWidget->topLevelItemCount(); item_idx++)
|
||||
{
|
||||
((QSlider*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(item_idx), 3))->setMaximum(value);
|
||||
}
|
||||
|
||||
CheckSegmentsValidity();
|
||||
}
|
||||
|
||||
void OpenRGBZoneResizeDialog::on_segment_lineedit_textChanged()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Update the Slider with the LineEdit value for each |
|
||||
| segment |
|
||||
\*-----------------------------------------------------*/
|
||||
for(int item_idx = 0; item_idx < ui->SegmentsTreeWidget->topLevelItemCount(); item_idx++)
|
||||
{
|
||||
int lineedit_value = ((QLineEdit*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(item_idx), 2))->text().toInt();
|
||||
((QSlider*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(item_idx), 3))->setValue(lineedit_value);
|
||||
}
|
||||
|
||||
CheckSegmentsValidity();
|
||||
}
|
||||
|
||||
void OpenRGBZoneResizeDialog::on_segment_slider_valueChanged(int)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Update the LineEdit with the Slider value for each |
|
||||
| segment |
|
||||
\*-----------------------------------------------------*/
|
||||
for(int item_idx = 0; item_idx < ui->SegmentsTreeWidget->topLevelItemCount(); item_idx++)
|
||||
{
|
||||
int slider_value = ((QSlider*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(item_idx), 3))->value();
|
||||
((QLineEdit*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(item_idx), 2))->setText(QString::number(slider_value));
|
||||
}
|
||||
|
||||
CheckSegmentsValidity();
|
||||
}
|
||||
|
||||
void OpenRGBZoneResizeDialog::on_ResizeBox_valueChanged(int value)
|
||||
{
|
||||
ui->ResizeSlider->blockSignals(true);
|
||||
ui->ResizeSlider->setValue(value);
|
||||
ui->ResizeSlider->blockSignals(false);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set maximum value for all segment sliders to new zone |
|
||||
| size |
|
||||
\*-----------------------------------------------------*/
|
||||
for(int item_idx = 0; item_idx < ui->SegmentsTreeWidget->topLevelItemCount(); item_idx++)
|
||||
{
|
||||
((QSlider*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(item_idx), 3))->setMaximum(value);
|
||||
}
|
||||
|
||||
CheckSegmentsValidity();
|
||||
}
|
||||
|
||||
int OpenRGBZoneResizeDialog::show()
|
||||
{
|
||||
int ret_val = 0;
|
||||
|
||||
int result = this->exec();
|
||||
|
||||
if(result == QDialog::Rejected)
|
||||
{
|
||||
ret_val = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret_val = ui->ResizeBox->value();
|
||||
}
|
||||
|
||||
if(ret_val >= 0 && edit_dev != NULL)
|
||||
{
|
||||
edit_dev->ResizeZone(edit_zone_idx, ret_val);
|
||||
|
||||
edit_dev->ClearSegments(edit_zone_idx);
|
||||
|
||||
unsigned int start_idx = 0;
|
||||
|
||||
for(int item_idx = 0; item_idx < ui->SegmentsTreeWidget->topLevelItemCount(); item_idx++)
|
||||
{
|
||||
segment new_segment;
|
||||
new_segment.type = ((QComboBox*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(item_idx), 1))->currentIndex();
|
||||
new_segment.name = ((QLineEdit*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(item_idx), 0))->text().toStdString();
|
||||
new_segment.start_idx = start_idx;
|
||||
new_segment.leds_count = ((QLineEdit*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(item_idx), 2))->text().toInt();
|
||||
|
||||
edit_dev->AddSegment(edit_zone_idx, new_segment);
|
||||
|
||||
start_idx += new_segment.leds_count;
|
||||
}
|
||||
}
|
||||
|
||||
return(ret_val);
|
||||
}
|
||||
|
||||
void OpenRGBZoneResizeDialog::AddSegmentRow(QString name, unsigned int length, zone_type type)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Create new line in segments list tree |
|
||||
\*---------------------------------------------------------*/
|
||||
QTreeWidgetItem* new_item = new QTreeWidgetItem(ui->SegmentsTreeWidget);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Create new widgets for line |
|
||||
\*---------------------------------------------------------*/
|
||||
QComboBox* combobox_type = new QComboBox(ui->SegmentsTreeWidget);
|
||||
QLineEdit* lineedit_name = new QLineEdit(ui->SegmentsTreeWidget);
|
||||
QLineEdit* lineedit_length = new QLineEdit(ui->SegmentsTreeWidget);
|
||||
QSlider* slider_length = new QSlider(Qt::Horizontal, ui->SegmentsTreeWidget);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Fill in Name field |
|
||||
\*---------------------------------------------------------*/
|
||||
lineedit_name->setText(name);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Set up segment type combo box |
|
||||
\*---------------------------------------------------------*/
|
||||
combobox_type->addItem("Single");
|
||||
combobox_type->addItem("Linear");
|
||||
//combobox_type->addItem("Matrix");
|
||||
|
||||
combobox_type->setCurrentIndex(type);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Fill in Length field |
|
||||
\*---------------------------------------------------------*/
|
||||
lineedit_length->setText(QString::number(length));
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Fill in slider length and maximum |
|
||||
\*---------------------------------------------------------*/
|
||||
slider_length->setMaximum(edit_dev->GetZoneLEDsCount(edit_zone_idx));
|
||||
slider_length->setValue(length);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Add new widgets to tree |
|
||||
\*---------------------------------------------------------*/
|
||||
ui->SegmentsTreeWidget->setItemWidget(new_item, 0, lineedit_name);
|
||||
ui->SegmentsTreeWidget->setItemWidget(new_item, 1, combobox_type);
|
||||
ui->SegmentsTreeWidget->setItemWidget(new_item, 2, lineedit_length);
|
||||
ui->SegmentsTreeWidget->setItemWidget(new_item, 3, slider_length);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Connect signals for handling slider and line edits |
|
||||
\*---------------------------------------------------------*/
|
||||
connect(lineedit_name, &QLineEdit::textChanged, this, &OpenRGBZoneResizeDialog::on_segment_lineedit_textChanged);
|
||||
connect(slider_length, &QSlider::valueChanged, this, &OpenRGBZoneResizeDialog::on_segment_slider_valueChanged);
|
||||
connect(lineedit_length, &QLineEdit::textChanged, this, &OpenRGBZoneResizeDialog::on_segment_lineedit_textChanged);
|
||||
}
|
||||
|
||||
void OpenRGBZoneResizeDialog::on_AddSegmentButton_clicked()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Create new empty row with name "Segment X" |
|
||||
\*---------------------------------------------------------*/
|
||||
QString new_name = "Segment " + QString::number(ui->SegmentsTreeWidget->topLevelItemCount() + 1);
|
||||
|
||||
AddSegmentRow(new_name, 0, ZONE_TYPE_LINEAR);
|
||||
|
||||
CheckSegmentsValidity();
|
||||
}
|
||||
|
||||
void OpenRGBZoneResizeDialog::CheckSegmentsValidity()
|
||||
{
|
||||
bool segments_valid = true;
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Only check validity if segments are configured |
|
||||
\*---------------------------------------------------------*/
|
||||
if(ui->SegmentsTreeWidget->topLevelItemCount() != 0)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Verify all segments add up to zone size |
|
||||
\*-----------------------------------------------------*/
|
||||
int total_segment_leds = 0;
|
||||
|
||||
for(int segment_idx = 0; segment_idx < ui->SegmentsTreeWidget->topLevelItemCount(); segment_idx++)
|
||||
{
|
||||
unsigned int segment_leds = ((QLineEdit*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(segment_idx), 2))->text().toInt();
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Zero-length segment is not allowed |
|
||||
\*-------------------------------------------------*/
|
||||
if(segment_leds == 0)
|
||||
{
|
||||
segments_valid = false;
|
||||
}
|
||||
|
||||
total_segment_leds += segment_leds;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Empty name is not allowed |
|
||||
\*-------------------------------------------------*/
|
||||
if(((QLineEdit*)ui->SegmentsTreeWidget->itemWidget(ui->SegmentsTreeWidget->topLevelItem(segment_idx), 0))->text().isEmpty())
|
||||
{
|
||||
segments_valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(total_segment_leds != ui->ResizeBox->value())
|
||||
{
|
||||
segments_valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
ui->ButtonBox->setEnabled(segments_valid);
|
||||
}
|
||||
|
||||
void OpenRGBZoneResizeDialog::on_RemoveSegmentButton_clicked()
|
||||
{
|
||||
ui->SegmentsTreeWidget->takeTopLevelItem(ui->SegmentsTreeWidget->topLevelItemCount() - 1);
|
||||
|
||||
CheckSegmentsValidity();
|
||||
}
|
||||
@@ -1,145 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBZoneResizeDialog</class>
|
||||
<widget class="QDialog" name="OpenRGBZoneResizeDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>450</width>
|
||||
<height>250</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Resize Zone</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout" columnstretch="1,0">
|
||||
<item row="3" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="AddSegmentButton">
|
||||
<property name="text">
|
||||
<string>Add Segment</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="RemoveSegmentButton">
|
||||
<property name="text">
|
||||
<string>Remove Segment</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QTooltipedSlider" name="ResizeSlider">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QTreeWidget" name="SegmentsTreeWidget">
|
||||
<property name="columnCount">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string notr="true">Name</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Type</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Length</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QDialogButtonBox" name="ButtonBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="ResizeBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QTooltipedSlider</class>
|
||||
<extends>QSlider</extends>
|
||||
<header location="global">QTooltipedSlider.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>ButtonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>OpenRGBZoneResizeDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>ButtonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>OpenRGBZoneResizeDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -1476,7 +1476,7 @@
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OpenRGBZoneResizeDialog</name>
|
||||
<name>OpenRGBZoneEditorDialog</name>
|
||||
<message>
|
||||
<source>Resize Zone</source>
|
||||
<translation>Змяніць памер зоны</translation>
|
||||
|
||||
@@ -1477,7 +1477,7 @@
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OpenRGBZoneResizeDialog</name>
|
||||
<name>OpenRGBZoneEditorDialog</name>
|
||||
<message>
|
||||
<source>Resize Zone</source>
|
||||
<translation>Größe der Zone ändern</translation>
|
||||
|
||||
@@ -1477,7 +1477,7 @@
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OpenRGBZoneResizeDialog</name>
|
||||
<name>OpenRGBZoneEditorDialog</name>
|
||||
<message>
|
||||
<source>Resize Zone</source>
|
||||
<translation>Επαναπροσδιορισμός μεγέθους ζώνης</translation>
|
||||
|
||||
@@ -1175,7 +1175,7 @@
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OpenRGBZoneResizeDialog</name>
|
||||
<name>OpenRGBZoneEditorDialog</name>
|
||||
<message>
|
||||
<source>Resize Zone</source>
|
||||
<translation></translation>
|
||||
|
||||
@@ -1175,7 +1175,7 @@
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OpenRGBZoneResizeDialog</name>
|
||||
<name>OpenRGBZoneEditorDialog</name>
|
||||
<message>
|
||||
<source>Resize Zone</source>
|
||||
<translation></translation>
|
||||
|
||||
@@ -1175,7 +1175,7 @@
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OpenRGBZoneResizeDialog</name>
|
||||
<name>OpenRGBZoneEditorDialog</name>
|
||||
<message>
|
||||
<source>Resize Zone</source>
|
||||
<translation type="unfinished"></translation>
|
||||
|
||||
@@ -1478,7 +1478,7 @@
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OpenRGBZoneResizeDialog</name>
|
||||
<name>OpenRGBZoneEditorDialog</name>
|
||||
<message>
|
||||
<source>Resize Zone</source>
|
||||
<translation>Redimensionar zona</translation>
|
||||
|
||||
@@ -1476,7 +1476,7 @@
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OpenRGBZoneResizeDialog</name>
|
||||
<name>OpenRGBZoneEditorDialog</name>
|
||||
<message>
|
||||
<source>Resize Zone</source>
|
||||
<translation>Changer la taille de la zone</translation>
|
||||
|
||||
@@ -1478,7 +1478,7 @@
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OpenRGBZoneResizeDialog</name>
|
||||
<name>OpenRGBZoneEditorDialog</name>
|
||||
<message>
|
||||
<source>Resize Zone</source>
|
||||
<translation>Zona prilagodljivih veličina</translation>
|
||||
|
||||
@@ -1476,7 +1476,7 @@
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OpenRGBZoneResizeDialog</name>
|
||||
<name>OpenRGBZoneEditorDialog</name>
|
||||
<message>
|
||||
<source>Resize Zone</source>
|
||||
<translation>Ridimensiona Zona</translation>
|
||||
|
||||
@@ -1476,7 +1476,7 @@
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OpenRGBZoneResizeDialog</name>
|
||||
<name>OpenRGBZoneEditorDialog</name>
|
||||
<message>
|
||||
<source>Resize Zone</source>
|
||||
<translation>ゾーンリサイズ</translation>
|
||||
|
||||
@@ -1476,7 +1476,7 @@
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OpenRGBZoneResizeDialog</name>
|
||||
<name>OpenRGBZoneEditorDialog</name>
|
||||
<message>
|
||||
<source>Resize Zone</source>
|
||||
<translation>구역 크기 조절</translation>
|
||||
|
||||
@@ -1476,7 +1476,7 @@
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OpenRGBZoneResizeDialog</name>
|
||||
<name>OpenRGBZoneEditorDialog</name>
|
||||
<message>
|
||||
<source>Resize Zone</source>
|
||||
<translation>Ubah saiz Zon</translation>
|
||||
|
||||
@@ -1476,7 +1476,7 @@
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OpenRGBZoneResizeDialog</name>
|
||||
<name>OpenRGBZoneEditorDialog</name>
|
||||
<message>
|
||||
<source>Resize Zone</source>
|
||||
<translation>Endre størrelse på sone</translation>
|
||||
|
||||
@@ -1476,7 +1476,7 @@
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OpenRGBZoneResizeDialog</name>
|
||||
<name>OpenRGBZoneEditorDialog</name>
|
||||
<message>
|
||||
<source>Resize Zone</source>
|
||||
<translation>Zmien rozmiar strefy</translation>
|
||||
|
||||
@@ -1476,7 +1476,7 @@
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OpenRGBZoneResizeDialog</name>
|
||||
<name>OpenRGBZoneEditorDialog</name>
|
||||
<message>
|
||||
<source>Resize Zone</source>
|
||||
<translation>Redimensionar zona</translation>
|
||||
|
||||
@@ -1177,7 +1177,7 @@
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OpenRGBZoneResizeDialog</name>
|
||||
<name>OpenRGBZoneEditorDialog</name>
|
||||
<message>
|
||||
<source>Resize Zone</source>
|
||||
<translation>Изменить размер области</translation>
|
||||
|
||||
@@ -1175,7 +1175,7 @@
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OpenRGBZoneResizeDialog</name>
|
||||
<name>OpenRGBZoneEditorDialog</name>
|
||||
<message>
|
||||
<source>Resize Zone</source>
|
||||
<translation>Bölgeyi Yeniden Boyutlandır</translation>
|
||||
|
||||
@@ -1476,7 +1476,7 @@
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OpenRGBZoneResizeDialog</name>
|
||||
<name>OpenRGBZoneEditorDialog</name>
|
||||
<message>
|
||||
<source>Resize Zone</source>
|
||||
<translation>Змінити розмір зони</translation>
|
||||
|
||||
@@ -1476,7 +1476,7 @@
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OpenRGBZoneResizeDialog</name>
|
||||
<name>OpenRGBZoneEditorDialog</name>
|
||||
<message>
|
||||
<source>Resize Zone</source>
|
||||
<translation>调整区域大小</translation>
|
||||
|
||||
@@ -1480,7 +1480,7 @@
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OpenRGBZoneResizeDialog</name>
|
||||
<name>OpenRGBZoneEditorDialog</name>
|
||||
<message>
|
||||
<source>Resize Zone</source>
|
||||
<translation>調整區域大小</translation>
|
||||
|
||||
Reference in New Issue
Block a user