mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-12 10:21:17 +00:00
Stop duplicate mode names from trapping a plate's mode cycle
The editor only replaced an empty name, so a row could be given a name another row already had. A plate stores its mode by name and find_imex_mode() takes the first row with it, so the second row was unreachable, and the plate's mode list repeated the name: left-click stuck on it, or looped without getting back to Primary. An edited name that another row already carries, or the reserved Primary name in any case, is now replaced when the edit is committed: "copy" becomes "copy 2". The edited row yields, so plates keep resolving to the row they meant, and tabbing through a field without changing it checks nothing. Resetting a row to a saved name that another row has since taken does the same. The plate's mode list comes from imex_plate_mode_choices(), which lists each name once, so a profile that already has duplicates still cycles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
8af5fa45e7
commit
9c5f4ebe47
@@ -22909,12 +22909,9 @@ int Plater::select_plate_by_hover_id(int hover_id, bool right_click, bool isModi
|
||||
ret = select_plate(plate_index);
|
||||
if (!ret) {
|
||||
PartPlate* curr_plate = p->partplate_list.get_curr_plate();
|
||||
// Build ordered mode list: kImexPrimaryMode first, then all named modes.
|
||||
std::vector<std::string> modes;
|
||||
modes.push_back(kImexPrimaryMode);
|
||||
const DynamicPrintConfig& printer_cfg = wxGetApp().preset_bundle->printers.get_edited_preset().config;
|
||||
for (const ImexMode& m : imex_mode_table(printer_cfg))
|
||||
if (!m.name.empty() && m.name != kImexPrimaryMode) modes.push_back(m.name);
|
||||
// Ordered mode list: kImexPrimaryMode first, then each named mode once.
|
||||
const std::vector<std::string> modes =
|
||||
imex_plate_mode_choices(wxGetApp().preset_bundle->printers.get_edited_preset().config);
|
||||
|
||||
if (right_click) {
|
||||
// Show a popup menu with all modes.
|
||||
|
||||
Reference in New Issue
Block a user