mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 03:43:52 +00:00
Fix unicode preset name issue (#13503)
This commit is contained in:
@@ -1355,16 +1355,16 @@ void PlaterPresetComboBox::update()
|
|||||||
bool unsupported = group == "Unsupported presets";
|
bool unsupported = group == "Unsupported presets";
|
||||||
for (auto it : list) {
|
for (auto it : list) {
|
||||||
// ORCA add sorting support for vendor / type for user presets
|
// ORCA add sorting support for vendor / type for user presets
|
||||||
auto groupName2 = groupName == "by_bundle" ? (preset_bundle_names[it->first].empty() ? _L("Unspecified") : preset_bundle_names[it->first])
|
auto groupName2 = groupName == "by_bundle" ? (preset_bundle_names[it->first].empty() ? _L("Unspecified") : from_u8(preset_bundle_names[it->first]))
|
||||||
: groupName == "by_type" ? (preset_filament_types[it->first].empty() ? _L("Unspecified") : preset_filament_types[it->first])
|
: groupName == "by_type" ? (preset_filament_types[it->first].empty() ? _L("Unspecified") : from_u8(preset_filament_types[it->first]))
|
||||||
: groupName == "by_vendor" ? (preset_filament_vendors[it->first].empty() ? _L("Unspecified") : preset_filament_vendors[it->first])
|
: groupName == "by_vendor" ? (preset_filament_vendors[it->first].empty() ? _L("Unspecified") : from_u8(preset_filament_vendors[it->first]))
|
||||||
: groupByGroup ? groupName
|
: groupByGroup ? groupName
|
||||||
: preset_filament_vendors[it->first];
|
: from_u8(preset_filament_vendors[it->first]);
|
||||||
int index = groupName == "by_bundle"
|
int index = groupName == "by_bundle"
|
||||||
? Append(preset_aliases[it->first], *it->second,
|
? Append(from_u8(preset_aliases[it->first]), *it->second,
|
||||||
from_u8(preset_bundle_ids[it->first]), groupName2, nullptr,
|
from_u8(preset_bundle_ids[it->first]), groupName2, nullptr,
|
||||||
unsupported ? DD_ITEM_STYLE_DISABLED : 0)
|
unsupported ? DD_ITEM_STYLE_DISABLED : 0)
|
||||||
: Append(preset_aliases[it->first], *it->second, groupName2, nullptr,
|
: Append(from_u8(preset_aliases[it->first]), *it->second, groupName2, nullptr,
|
||||||
unsupported ? DD_ITEM_STYLE_DISABLED : 0);
|
unsupported ? DD_ITEM_STYLE_DISABLED : 0);
|
||||||
SetItemAlias(index, it->first);
|
SetItemAlias(index, it->first);
|
||||||
if (unsupported)
|
if (unsupported)
|
||||||
@@ -1380,7 +1380,7 @@ void PlaterPresetComboBox::update()
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (std::map<wxString, wxBitmap *>::const_iterator it = presets.begin(); it != presets.end(); ++it) {
|
for (std::map<wxString, wxBitmap *>::const_iterator it = presets.begin(); it != presets.end(); ++it) {
|
||||||
int index = Append(preset_aliases[it->first], *it->second);
|
int index = Append(from_u8(preset_aliases[it->first]), *it->second);
|
||||||
SetItemAlias(index, it->first);
|
SetItemAlias(index, it->first);
|
||||||
SetItemTooltip(index, preset_descriptions[it->first]);
|
SetItemTooltip(index, preset_descriptions[it->first]);
|
||||||
if (group == "System presets")
|
if (group == "System presets")
|
||||||
@@ -1767,10 +1767,10 @@ void TabPresetComboBox::update()
|
|||||||
// Get bundle name for grouping
|
// Get bundle name for grouping
|
||||||
wxString bundle_name = _L("Unspecified");
|
wxString bundle_name = _L("Unspecified");
|
||||||
if (preset_bundle_names.count(it->first) > 0 && !preset_bundle_names[it->first].empty()) {
|
if (preset_bundle_names.count(it->first) > 0 && !preset_bundle_names[it->first].empty()) {
|
||||||
bundle_name = preset_bundle_names[it->first];
|
bundle_name = from_u8(preset_bundle_names[it->first]);
|
||||||
}
|
}
|
||||||
// Use Append with group parameter for sub-dropdown grouping
|
// Use Append with group parameter for sub-dropdown grouping
|
||||||
int item_id = Append(preset_aliases[it->first], *it->second.first, from_u8(preset_bundle_ids[it->first]), bundle_name);
|
int item_id = Append(from_u8(preset_aliases[it->first]), *it->second.first, from_u8(preset_bundle_ids[it->first]), bundle_name);
|
||||||
SetItemAlias(item_id, it->first);
|
SetItemAlias(item_id, it->first);
|
||||||
SetItemTooltip(item_id, preset_descriptions[it->first]);
|
SetItemTooltip(item_id, preset_descriptions[it->first]);
|
||||||
bool is_enabled = it->second.second;
|
bool is_enabled = it->second.second;
|
||||||
|
|||||||
Reference in New Issue
Block a user