mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-15 11:51:33 +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
@@ -651,6 +651,15 @@ std::vector<ImexMode> imex_mode_table(const ConfigBase& cfg)
|
||||
return table;
|
||||
}
|
||||
|
||||
std::vector<std::string> imex_plate_mode_choices(const ConfigBase& cfg)
|
||||
{
|
||||
std::vector<std::string> choices{ kImexPrimaryMode };
|
||||
for (const ImexMode& m : imex_mode_table(cfg))
|
||||
if (!m.name.empty() && std::find(choices.begin(), choices.end(), m.name) == choices.end())
|
||||
choices.push_back(m.name);
|
||||
return choices;
|
||||
}
|
||||
|
||||
bool imex_hull_violates_zones(const std::vector<BoundingBoxf3>& zones, const Polygon& hull)
|
||||
{
|
||||
if (hull.points.empty())
|
||||
|
||||
Reference in New Issue
Block a user