mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-11-26 23:29:38 -05:00
Say menu item, not menu row, in the MCP commands and docs
The MCP command descriptions, docs and code called an entry of the app's menus a "row", the word they also use for the rows of the object list and the app's other lists. They now say "menu item", so a row is only ever a row of a list or table. Command names, arguments and Speed Dial tile ids are unchanged.
This commit is contained in:
1 parent
ba02e96c27
commit
bbda030f4d
68 files changed
+1270
-1258
No files matched your search
@@ -49,10 +49,10 @@ compiled against it cannot drift apart:
|
||||
| `gen_offer_table.py` | `tool_atlas.json` — the Design tab's table: every offer verb with its row, key, icon, accepted selections and refusal string, and every Design command's silent form (a `tool` block) | `src/slic3r/GUI/CAD/DesignOffer.hpp` |
|
||||
| `mate-glyph/emit_glyph_table.py` | `mate-glyph/bear_outline.json`, measured off `mate-glyph/bear.step` by `extract_outline.py` | the `kBear…` tables in `DesignSketchTool.cpp` |
|
||||
|
||||
The atlas's `verbs` are one table for three things: the right-click menu (a verb with a `slot` has a
|
||||
row there), the Speed Dial's Design tiles and the Design commands. Every verb but `align` is a command
|
||||
whose key is its `id`. A verb with an `action` does what its menu row does when called with no
|
||||
arguments, in the mode the row belongs to, and has a tile; one with a `tool` block also runs silently
|
||||
The atlas's `verbs` are one table for three things: the right-click menu (a verb with a `slot` has an
|
||||
item there), the Speed Dial's Design tiles and the Design commands. Every verb but `align` is a command
|
||||
whose key is its `id`. A verb with an `action` does what its menu item does when called with no
|
||||
arguments, in the mode the item belongs to, and has a tile; one with a `tool` block also runs silently
|
||||
with arguments, and the block holds what that form takes and does: its `access` (`read`, `change` or
|
||||
`sketch`, which decides what a busy Design tab lets through), `ok_false` (it reports a rejected rebuild
|
||||
in its reply), a `summary` of one sentence,
|
||||
|
||||
@@ -34,9 +34,9 @@ ENUM = {
|
||||
ACCESS = {"read": "Read", "change": "Change", "sketch": "Sketch", "ui": "Ui"}
|
||||
|
||||
# The headings of tool_search's index of the Design commands (Mcp::design_command_index()), in its order: every
|
||||
# command's `section` is one of them. Menu rows holds the commands that take no arguments and only do what their row
|
||||
# command's `section` is one of them. Menu items holds the commands that take no arguments and only do what their menu item
|
||||
# does.
|
||||
SECTIONS = ("Document", "Sketch", "Solid", "Surface", "Construct", "Inspect", "Bodies", "History", "Menu rows")
|
||||
SECTIONS = ("Document", "Sketch", "Solid", "Surface", "Construct", "Inspect", "Bodies", "History", "Menu items")
|
||||
|
||||
# The keys of a tool block that its command's description, schema and examples are made from.
|
||||
DOC_KEYS = ("summary", "details", "params", "examples", "ids")
|
||||
@@ -90,9 +90,9 @@ def doc_literal(block, indent):
|
||||
|
||||
|
||||
def arg_faults(vid, args, into):
|
||||
"""Why `args`, the arguments that choose entry `vid`'s row, are not arguments `into`'s block takes."""
|
||||
"""Why `args`, the arguments that choose entry `vid`'s item, are not arguments `into`'s block takes."""
|
||||
if not isinstance(args, dict):
|
||||
return [f"{vid}: args must be an object of the arguments that choose its row, not {args!r}"]
|
||||
return [f"{vid}: args must be an object of the arguments that choose its item, not {args!r}"]
|
||||
params = {p.get("name"): p for p in into["tool"].get("params", [])}
|
||||
out = []
|
||||
for name, value in args.items():
|
||||
@@ -106,27 +106,27 @@ def arg_faults(vid, args, into):
|
||||
|
||||
def faults(A):
|
||||
"""Every fault of the atlas A, each naming its entry: what the header cannot represent, and what would leave
|
||||
a call of a command unable to tell which of its rows it opens.
|
||||
a call of a command unable to tell which of its items it opens.
|
||||
|
||||
An unknown slot or selection would surface as a bare ValueError from .index() below, and a
|
||||
duplicate verb id would not surface at all: a verb is looked up by id (DesignPanel::mcp_run_verb,
|
||||
the catalog's command keys) and the first match taken, so the second row would be unreachable.
|
||||
An entry with no row, no action and no tool block is nothing; a row with neither is greyed (Align to,
|
||||
the catalog's command keys) and the first match taken, so the second item would be unreachable.
|
||||
An entry with no menu item, no action and no tool block is nothing; an item with neither is greyed (Align to,
|
||||
until it has a GUI path), and no command.
|
||||
|
||||
A folded row (`fold`) is a way of calling the command `into` names with `args`: it keeps its row and
|
||||
A folded item (`fold`) is a way of calling the command `into` names with `args`: it keeps its row and
|
||||
its action and has no block of its own, and its command is an entry with a block that is no folded
|
||||
row. An entry with an action and a block may name the `args` that choose its own row. The arguments
|
||||
that choose a row are ones its command takes, and choose that row only (Mcp::opened_row()): no two
|
||||
rows of one command with equal args and different actions, and no folded row with the args its
|
||||
command's own row takes, which a call with none also gives. A command's rows are in one mode.
|
||||
item. An entry with an action and a block may name the `args` that choose its own item. The arguments
|
||||
that choose an item are ones its command takes, and choose that item only (Mcp::opened_item()): no two
|
||||
items of one command with equal args and different actions, and no folded item with the args its
|
||||
command's own item takes, which a call with none also gives. A command's items are in one mode.
|
||||
|
||||
Every command, an entry with an action or a block that is no folded row, has a `section`, its heading in
|
||||
tool_search's index (SECTIONS); a folded or greyed row, which is no command, has none.
|
||||
Every command, an entry with an action or a block that is no folded item, has a `section`, its heading in
|
||||
tool_search's index (SECTIONS); a folded or greyed item, which is no command, has none.
|
||||
|
||||
`feature_row` marks a row whose action acts on the selected row of the Feature list, which a call of its
|
||||
command takes as its target when nothing is picked in the view (Mcp::open_refusal()): only a command with a row
|
||||
of its own has one, an entry with an action that is no folded row.
|
||||
`feature_row` marks an item whose action acts on the selected row of the Feature list, which a call of its
|
||||
command takes as its target when nothing is picked in the view (Mcp::open_refusal()): only a command with a menu item
|
||||
of its own has one, an entry with an action that is no folded item.
|
||||
"""
|
||||
slot_ids = {s["id"] for s in A["slots"]}
|
||||
sel_ids = {s["id"] for s in A["selections"]}
|
||||
@@ -134,7 +134,7 @@ def faults(A):
|
||||
for v in A["verbs"]:
|
||||
vid = v["id"]
|
||||
if v["slot"] is None:
|
||||
# A command only: no menu row, so no action the menu could run either.
|
||||
# A command only: no menu item, so no action the menu could run either.
|
||||
if v.get("action"):
|
||||
errs.append(f"{vid}: an action needs a slot")
|
||||
elif v["slot"] not in slot_ids:
|
||||
@@ -147,18 +147,18 @@ def faults(A):
|
||||
seen.add(vid)
|
||||
block = v.get("tool")
|
||||
if v["slot"] is None and not v.get("action") and block is None:
|
||||
errs.append(f"{vid}: neither a row, an action nor a tool block")
|
||||
errs.append(f"{vid}: neither a menu item, an action nor a tool block")
|
||||
if v.get("modal") and not v.get("action"):
|
||||
errs.append(f"{vid}: modal without an action")
|
||||
command = (v.get("action") or block is not None) and "fold" not in v
|
||||
if not command and "section" in v:
|
||||
errs.append(f"{vid}: a folded or greyed row is no command and has no section")
|
||||
errs.append(f"{vid}: a folded or greyed item is no command and has no section")
|
||||
elif command and "section" not in v:
|
||||
errs.append(f"{vid}: a command needs a section, its heading in tool_search's index: one of {list(SECTIONS)}")
|
||||
elif command and v["section"] not in SECTIONS:
|
||||
errs.append(f'{vid}: section {v["section"]!r} is not one of {list(SECTIONS)}')
|
||||
if v.get("feature_row") and (not v.get("action") or "fold" in v):
|
||||
errs.append(f"{vid}: feature_row needs a row of its own: an action, and no fold")
|
||||
errs.append(f"{vid}: feature_row needs a menu item of its own: an action, and no fold")
|
||||
if block is not None:
|
||||
if block.get("access") not in ACCESS:
|
||||
errs.append(f'{vid}: tool access {block.get("access")!r} is not one of {sorted(ACCESS)}')
|
||||
@@ -184,7 +184,7 @@ def faults(A):
|
||||
by_id = {}
|
||||
for v in A["verbs"]:
|
||||
by_id.setdefault(v["id"], v)
|
||||
folded = {} # a command's id -> the rows folded into it so far
|
||||
folded = {} # a command's id -> the items folded into it so far
|
||||
for v in A["verbs"]:
|
||||
if "fold" not in v:
|
||||
continue
|
||||
@@ -193,15 +193,15 @@ def faults(A):
|
||||
errs.append(f"{vid}: fold must be an object {{into, args}}, not {fold!r}")
|
||||
continue
|
||||
if not v.get("action"):
|
||||
errs.append(f"{vid}: a fold needs an action, the row's own")
|
||||
errs.append(f"{vid}: a fold needs an action, the item's own")
|
||||
if v.get("tool") is not None:
|
||||
errs.append(f"{vid}: a folded row has no tool block: its command has it")
|
||||
errs.append(f"{vid}: a folded item has no tool block: its command has it")
|
||||
into = by_id.get(fold.get("into"))
|
||||
if into is None:
|
||||
errs.append(f"{vid}: fold's into {fold.get('into')!r} names no entry")
|
||||
continue
|
||||
if "fold" in into:
|
||||
errs.append(f"{vid}: fold's into {into['id']} is itself a folded row")
|
||||
errs.append(f"{vid}: fold's into {into['id']} is itself a folded item")
|
||||
continue
|
||||
if into.get("tool") is None:
|
||||
errs.append(f"{vid}: fold's into {into['id']} has no tool block")
|
||||
@@ -212,9 +212,9 @@ def faults(A):
|
||||
if bad:
|
||||
continue
|
||||
if into.get("action") and (same(args, {}) or ("args" in into and same(args, into["args"]))):
|
||||
errs.append(f"{vid}: its args are the args {into['id']}'s own row takes")
|
||||
errs.append(f"{vid}: its args are the args {into['id']}'s own item takes")
|
||||
if into["slot"] is not None and mode_of(v) != mode_of(into):
|
||||
errs.append(f"{vid}: in another mode than {into['id']}'s own row")
|
||||
errs.append(f"{vid}: in another mode than {into['id']}'s own item")
|
||||
for other in folded.get(into["id"], []):
|
||||
if mode_of(other) != mode_of(v):
|
||||
errs.append(f"{vid}: in another mode than {other['id']}, folded into {into['id']} too")
|
||||
@@ -249,11 +249,11 @@ def main():
|
||||
"// ratified 2026-07-31; changing an index is a breaking change to every user's muscle memory.",
|
||||
"// An entry with an action or a tool block, and no fold_into, is a command of the catalog's group Design",
|
||||
"// (Mcp::register_cad_commands(), Mcp::is_design_command()), under its section in tool_search's index. A",
|
||||
"// call whose arguments are exactly those that choose one of its rows opens that row's tool for a person",
|
||||
"// (Mcp::opened_row()): none choose the entry's own row where it has an action, else the rows folded into it",
|
||||
"// with {}; a folded row's args, or the entry's own, choose that row. Any other call runs its tool block's",
|
||||
"// silent form. A folded row (fold_into) is no command: it is a way of calling the command it names. A row",
|
||||
"// with neither an action nor a tool block is greyed, and no command. An entry with no row is a command only.",
|
||||
"// call whose arguments are exactly those that choose one of its items opens that item's tool for a person",
|
||||
"// (Mcp::opened_item()): none choose the entry's own item where it has an action, else the items folded into it",
|
||||
"// with {}; a folded item's args, or the entry's own, choose that item. Any other call runs its tool block's",
|
||||
"// silent form. A folded item (fold_into) is no command: it is a way of calling the command it names. An item",
|
||||
"// with neither an action nor a tool block is greyed, and no command. An entry with no menu item is a command only.",
|
||||
"#ifndef slic3r_GUI_DesignOffer_hpp_",
|
||||
"#define slic3r_GUI_DesignOffer_hpp_",
|
||||
"",
|
||||
@@ -303,15 +303,15 @@ def main():
|
||||
'// "key:L" -> m_keys_sketch[\'L\']',
|
||||
'// "fly:material#4" -> row 4 of the "material" feature flyout',
|
||||
'// "btn:delete" -> a standalone toolbar button',
|
||||
"// nullptr -> no GUI path (the row, if it has one, shows disabled)",
|
||||
"// nullptr -> no GUI path (the item, if it has one, shows disabled)",
|
||||
"struct DesignTool {",
|
||||
" const char* id; // also the key of its Design command",
|
||||
" const char* name; // drawing-office word (L10); msgctxt \"Design\", translated at use",
|
||||
" int row; // index into kOfferRowNames, the ratified address — NEVER reorder;",
|
||||
" // -1: no menu row, a command only",
|
||||
" const char* key; // shortcut shown in the row, or nullptr",
|
||||
" // -1: no menu item, a command only",
|
||||
" const char* key; // shortcut shown in the item, or nullptr",
|
||||
" const char* action;",
|
||||
" const char* refusal; // why this row is greyed, in the product's own words",
|
||||
" const char* refusal; // why this item is greyed, in the product's own words",
|
||||
" uint32_t accepts; // bitmask over OfferSel",
|
||||
" int need_bodies;",
|
||||
" int need_sketches;",
|
||||
@@ -322,7 +322,7 @@ def main():
|
||||
" // address fixed (L4.1) while the variants hang one level below it, mirroring the toolbar's",
|
||||
" // grouping instead of flattening 19 create tools into one wall.",
|
||||
" const char* family;",
|
||||
" const char* icon; // resources/images name, or nullptr — the offer draws it beside the row",
|
||||
" const char* icon; // resources/images name, or nullptr — the offer draws it beside the item",
|
||||
" const char* hint; // what the verb does / what to click; shown on hover",
|
||||
" bool modal; // its action opens a dialog that waits for an answer: a modal one, which holds",
|
||||
" // the call until it is answered, or Text's, which is modeless and does not",
|
||||
@@ -330,22 +330,22 @@ def main():
|
||||
" bool ok_false; // its silent form reports a rejected rebuild in its reply (ok false)",
|
||||
" // Its silent form's summary, details, params, examples and ids as JSON text, the parameter",
|
||||
" // schema of record, and closed when its schema refuses an argument it does not name; nullptr for an",
|
||||
" // entry whose command only does what its row does.",
|
||||
" // entry whose command only does what its menu item does.",
|
||||
" const char* doc;",
|
||||
" const char* fold_into; // the id of the command this row is a variant of, or nullptr",
|
||||
" // The arguments that choose this row, as JSON text: a folded row's, or those that choose the own row of",
|
||||
" const char* fold_into; // the id of the command this item is a variant of, or nullptr",
|
||||
" // The arguments that choose this item, as JSON text: a folded item's, or those that choose the own item of",
|
||||
" // an entry with an action and a tool block as a call with none does; nullptr for none.",
|
||||
" const char* args;",
|
||||
" // The heading its command is listed under in tool_search's index (kDesignSections,",
|
||||
" // Mcp::design_command_index()); nullptr for an entry that is no command.",
|
||||
" const char* section;",
|
||||
" // Its action acts on the selected row of the Feature list, which a call of its command, not a person's",
|
||||
" // pick, takes as what the row is for while nothing is picked in the view (Mcp::open_refusal()).",
|
||||
" // pick, takes as what the item is for while nothing is picked in the view (Mcp::open_refusal()).",
|
||||
" bool feature_row;",
|
||||
"};",
|
||||
"",
|
||||
"// The headings of tool_search's index of the Design commands, in its order. Menu rows holds the commands",
|
||||
"// that take no arguments and only do what their row does.",
|
||||
"// The headings of tool_search's index of the Design commands, in its order. Menu items holds the commands",
|
||||
"// that take no arguments and only do what their menu item does.",
|
||||
"static const char* const kDesignSections[] = {",
|
||||
]
|
||||
for s in SECTIONS:
|
||||
@@ -391,9 +391,9 @@ def main():
|
||||
n = v.get("needs") or {}
|
||||
block = v.get("tool")
|
||||
in_menu = v["slot"] is not None
|
||||
# Every name is marked, an entry's with no row too: it is its command's title, which a person
|
||||
# Every name is marked, an entry's with no menu item too: it is its command's title, which a person
|
||||
# sees translated in the Design context in the Action Replay window and a recording's caption,
|
||||
# and on the tile of an entry with a row. A table with an unmarked name is refused, written or
|
||||
# and on the tile of an entry with a menu item. A table with an unmarked name is refused, written or
|
||||
# checked, since nothing at run time can tell (L_CONTEXT compiles to the bare string).
|
||||
name = tstr_design(v["name"])
|
||||
if not (name.startswith('L_CONTEXT("') and name.endswith('", "Design")')):
|
||||
|
||||
@@ -28,7 +28,7 @@ def block(params=None, **extra):
|
||||
|
||||
|
||||
def atlas():
|
||||
"""One slot, two selections, a command with a block and a row (paint), and a second row (tint), a command with
|
||||
"""One slot, two selections, a command with a block and a menu item (paint), and a second item (tint), a command with
|
||||
an action only; each under its heading."""
|
||||
return {
|
||||
"slots": [{"id": "make", "label": "Make"}],
|
||||
@@ -37,7 +37,7 @@ def atlas():
|
||||
{"id": "paint", "name": "Paint", "section": "Solid", "slot": "make", "key": None,
|
||||
"accepts": ["none", "body_solid"], "action": "btn:paint", "icon": "paint", "hint": "Paint the body",
|
||||
"tool": block()},
|
||||
{"id": "tint", "name": "Tint", "section": "Menu rows", "slot": "make", "key": None, "accepts": ["body_solid"],
|
||||
{"id": "tint", "name": "Tint", "section": "Menu items", "slot": "make", "key": None, "accepts": ["body_solid"],
|
||||
"action": "btn:tint", "icon": "tint", "hint": "Tint the body"},
|
||||
],
|
||||
}
|
||||
@@ -47,7 +47,7 @@ def entry(A, vid):
|
||||
return next(v for v in A["verbs"] if v["id"] == vid)
|
||||
|
||||
|
||||
def row(vid, action, **extra):
|
||||
def item(vid, action, **extra):
|
||||
v = {"id": vid, "name": vid.title(), "slot": "make", "key": None, "accepts": ["body_solid"],
|
||||
"action": action, "icon": vid, "hint": "Do " + vid}
|
||||
v.update(extra)
|
||||
@@ -70,25 +70,25 @@ class Faults(unittest.TestCase):
|
||||
with open(gen.ATLAS, encoding="utf-8") as f:
|
||||
self.assertEqual(gen.faults(json.load(f)), [])
|
||||
|
||||
def test_a_folded_row_with_args_its_command_takes_passes(self):
|
||||
def test_a_folded_item_with_args_its_command_takes_passes(self):
|
||||
A = atlas()
|
||||
entry(A, "tint")["fold"] = {"into": "paint", "args": {"shade": "blue"}}
|
||||
del entry(A, "tint")["section"]
|
||||
entry(A, "paint")["args"] = {"shade": "red"}
|
||||
self.assertEqual(gen.faults(A), [])
|
||||
|
||||
def test_a_greyed_row_passes_whatever_its_id(self):
|
||||
def test_a_greyed_item_passes_whatever_its_id(self):
|
||||
A = atlas()
|
||||
del entry(A, "tint")["action"]
|
||||
del entry(A, "tint")["section"]
|
||||
entry(A, "tint")["id"] = "anything"
|
||||
self.assertEqual(gen.faults(A), [])
|
||||
|
||||
def test_rows_of_one_command_with_equal_args_and_one_action_pass(self):
|
||||
def test_items_of_one_command_with_equal_args_and_one_action_pass(self):
|
||||
A = atlas()
|
||||
entry(A, "tint")["fold"] = {"into": "paint", "args": {"shade": "blue"}}
|
||||
del entry(A, "tint")["section"]
|
||||
A["verbs"].append(row("tint_again", "btn:tint", fold={"into": "paint", "args": {"shade": "blue"}}))
|
||||
A["verbs"].append(item("tint_again", "btn:tint", fold={"into": "paint", "args": {"shade": "blue"}}))
|
||||
self.assertEqual(gen.faults(A), [])
|
||||
|
||||
def test_a_block_with_access_ui_passes(self):
|
||||
@@ -115,7 +115,7 @@ class Faults(unittest.TestCase):
|
||||
A = atlas()
|
||||
entry(A, "tint")["tool"] = block()
|
||||
entry(A, "tint")["fold"] = {"into": "paint", "args": {}}
|
||||
self.assertFault(A, "tint", "a folded row has no tool block")
|
||||
self.assertFault(A, "tint", "a folded item has no tool block")
|
||||
|
||||
def test_a_fold_that_is_no_object(self):
|
||||
A = atlas()
|
||||
@@ -129,16 +129,16 @@ class Faults(unittest.TestCase):
|
||||
|
||||
def test_an_into_that_names_an_entry_with_no_block(self):
|
||||
A = atlas()
|
||||
A["verbs"].append(row("wash", "btn:wash", fold={"into": "tint", "args": {}}))
|
||||
A["verbs"].append(item("wash", "btn:wash", fold={"into": "tint", "args": {}}))
|
||||
self.assertFault(A, "wash", "has no tool block")
|
||||
|
||||
def test_an_into_that_names_a_folded_row(self):
|
||||
def test_an_into_that_names_a_folded_item(self):
|
||||
A = atlas()
|
||||
entry(A, "tint")["fold"] = {"into": "paint", "args": {"shade": "blue"}}
|
||||
A["verbs"].append(row("wash", "btn:wash", fold={"into": "tint", "args": {}}))
|
||||
self.assertFault(A, "wash", "is itself a folded row")
|
||||
A["verbs"].append(item("wash", "btn:wash", fold={"into": "tint", "args": {}}))
|
||||
self.assertFault(A, "wash", "is itself a folded item")
|
||||
|
||||
# --- the arguments that choose a row ---------------------------------------------------------
|
||||
# --- the arguments that choose an item -------------------------------------------------------
|
||||
|
||||
def test_a_folds_args_that_are_no_object(self):
|
||||
A = atlas()
|
||||
@@ -170,23 +170,23 @@ class Faults(unittest.TestCase):
|
||||
entry(A, "paint")["args"] = {"shade": "green"}
|
||||
self.assertFault(A, "paint", "'green'")
|
||||
|
||||
def test_two_rows_of_one_command_with_equal_args_and_different_actions(self):
|
||||
def test_two_items_of_one_command_with_equal_args_and_different_actions(self):
|
||||
A = atlas()
|
||||
entry(A, "tint")["fold"] = {"into": "paint", "args": {"shade": "blue"}}
|
||||
A["verbs"].append(row("wash", "btn:wash", fold={"into": "paint", "args": {"shade": "blue"}}))
|
||||
A["verbs"].append(item("wash", "btn:wash", fold={"into": "paint", "args": {"shade": "blue"}}))
|
||||
self.assertFault(A, "wash", "the same args as tint")
|
||||
|
||||
def test_a_rows_args_equal_to_its_commands_own(self):
|
||||
def test_an_items_args_equal_to_its_commands_own(self):
|
||||
A = atlas()
|
||||
entry(A, "paint")["args"] = {"shade": "blue"}
|
||||
entry(A, "tint")["fold"] = {"into": "paint", "args": {"shade": "blue"}}
|
||||
self.assertFault(A, "tint", "the args paint's own row takes")
|
||||
self.assertFault(A, "tint", "the args paint's own item takes")
|
||||
|
||||
def test_no_args_for_a_row_of_a_command_with_a_row_of_its_own(self):
|
||||
# A call with none opens the command's own row.
|
||||
def test_no_args_for_an_item_of_a_command_with_a_menu_item_of_its_own(self):
|
||||
# A call with none opens the command's own item.
|
||||
A = atlas()
|
||||
entry(A, "tint")["fold"] = {"into": "paint", "args": {}}
|
||||
self.assertFault(A, "tint", "the args paint's own row takes")
|
||||
self.assertFault(A, "tint", "the args paint's own item takes")
|
||||
|
||||
def test_own_args_on_an_entry_with_no_action(self):
|
||||
A = atlas()
|
||||
@@ -205,18 +205,18 @@ class Faults(unittest.TestCase):
|
||||
|
||||
# --- modes -----------------------------------------------------------------------------------
|
||||
|
||||
def test_rows_of_one_command_in_different_modes(self):
|
||||
def test_items_of_one_command_in_different_modes(self):
|
||||
A = atlas()
|
||||
A["verbs"].append({"id": "rinse", "name": "Rinse", "slot": None, "tool": block()})
|
||||
entry(A, "tint")["fold"] = {"into": "rinse", "args": {"shade": "blue"}}
|
||||
A["verbs"].append(row("wash", "btn:wash", mode="sketch", fold={"into": "rinse", "args": {"shade": "red"}}))
|
||||
A["verbs"].append(item("wash", "btn:wash", mode="sketch", fold={"into": "rinse", "args": {"shade": "red"}}))
|
||||
self.assertFault(A, "wash", "in another mode than tint")
|
||||
|
||||
def test_a_row_in_another_mode_than_its_commands_own_row(self):
|
||||
def test_an_item_in_another_mode_than_its_commands_own_item(self):
|
||||
A = atlas()
|
||||
entry(A, "tint")["mode"] = "sketch"
|
||||
entry(A, "tint")["fold"] = {"into": "paint", "args": {"shade": "blue"}}
|
||||
self.assertFault(A, "tint", "in another mode than paint's own row")
|
||||
self.assertFault(A, "tint", "in another mode than paint's own item")
|
||||
|
||||
# --- headings --------------------------------------------------------------------------------
|
||||
|
||||
@@ -230,19 +230,19 @@ class Faults(unittest.TestCase):
|
||||
entry(A, "paint")["section"] = "Painting"
|
||||
self.assertFault(A, "paint", "section 'Painting' is not one of")
|
||||
|
||||
def test_a_section_on_a_folded_row(self):
|
||||
def test_a_section_on_a_folded_item(self):
|
||||
A = atlas()
|
||||
entry(A, "tint")["fold"] = {"into": "paint", "args": {"shade": "blue"}}
|
||||
self.assertFault(A, "tint", "is no command and has no section")
|
||||
|
||||
def test_a_section_on_a_greyed_row(self):
|
||||
def test_a_section_on_a_greyed_item(self):
|
||||
A = atlas()
|
||||
del entry(A, "tint")["action"]
|
||||
self.assertFault(A, "tint", "is no command and has no section")
|
||||
|
||||
# --- the rows that act on the Feature list's row ---------------------------------------------
|
||||
# --- the items that act on the Feature list's row --------------------------------------------
|
||||
|
||||
def test_feature_row_on_a_command_with_a_row_of_its_own_passes(self):
|
||||
def test_feature_row_on_a_command_with_a_menu_item_of_its_own_passes(self):
|
||||
A = atlas()
|
||||
entry(A, "tint")["feature_row"] = True
|
||||
entry(A, "paint")["feature_row"] = True
|
||||
@@ -252,21 +252,21 @@ class Faults(unittest.TestCase):
|
||||
A = atlas()
|
||||
A["verbs"].append({"id": "rinse", "name": "Rinse", "section": "Solid", "slot": None, "tool": block(),
|
||||
"feature_row": True})
|
||||
self.assertFault(A, "rinse", "feature_row needs a row of its own")
|
||||
self.assertFault(A, "rinse", "feature_row needs a menu item of its own")
|
||||
|
||||
def test_feature_row_on_a_folded_row(self):
|
||||
def test_feature_row_on_a_folded_item(self):
|
||||
A = atlas()
|
||||
entry(A, "tint")["fold"] = {"into": "paint", "args": {"shade": "blue"}}
|
||||
del entry(A, "tint")["section"]
|
||||
entry(A, "tint")["feature_row"] = True
|
||||
self.assertFault(A, "tint", "feature_row needs a row of its own")
|
||||
self.assertFault(A, "tint", "feature_row needs a menu item of its own")
|
||||
|
||||
# --- entries and blocks ----------------------------------------------------------------------
|
||||
|
||||
def test_an_entry_with_no_slot_no_action_and_no_block(self):
|
||||
A = atlas()
|
||||
A["verbs"].append({"id": "nothing", "name": "Nothing", "slot": None})
|
||||
self.assertFault(A, "nothing", "neither a row, an action nor a tool block")
|
||||
self.assertFault(A, "nothing", "neither a menu item, an action nor a tool block")
|
||||
|
||||
def test_a_closed_that_is_no_boolean(self):
|
||||
A = atlas()
|
||||
|
||||
@@ -2148,7 +2148,7 @@
|
||||
{
|
||||
"id": "rename_selected",
|
||||
"name": "Rename…",
|
||||
"section": "Menu rows",
|
||||
"section": "Menu items",
|
||||
"slot": "top",
|
||||
"key": "F2",
|
||||
"feature": "Tree",
|
||||
@@ -2238,7 +2238,7 @@
|
||||
{
|
||||
"id": "zoom_to_selection",
|
||||
"name": "Zoom to selection",
|
||||
"section": "Menu rows",
|
||||
"section": "Menu items",
|
||||
"slot": "top",
|
||||
"key": null,
|
||||
"feature": null,
|
||||
@@ -2894,7 +2894,7 @@
|
||||
{
|
||||
"id": "sketch_polygon_inscribed",
|
||||
"name": "Inscribed",
|
||||
"section": "Menu rows",
|
||||
"section": "Menu items",
|
||||
"slot": "create",
|
||||
"key": null,
|
||||
"feature": "Sketch",
|
||||
@@ -2917,7 +2917,7 @@
|
||||
{
|
||||
"id": "sketch_polygon_circumscribed",
|
||||
"name": "Circumscribed",
|
||||
"section": "Menu rows",
|
||||
"section": "Menu items",
|
||||
"slot": "create",
|
||||
"key": null,
|
||||
"feature": "Sketch",
|
||||
@@ -3525,7 +3525,7 @@
|
||||
{
|
||||
"id": "sketch_constrain_selected",
|
||||
"name": "Constrain sketch",
|
||||
"section": "Menu rows",
|
||||
"section": "Menu items",
|
||||
"slot": "reference",
|
||||
"key": null,
|
||||
"feature": "Sketch",
|
||||
@@ -3544,7 +3544,7 @@
|
||||
"feature_row": true,
|
||||
"note": [
|
||||
"Same verb, model-mode vocabulary: offered when a SKETCH is selected (bit 14, SkLoop), the",
|
||||
"state a user is in right after finishing one. Without this row the only way in was the",
|
||||
"state a user is in right after finishing one. Without this item the only way in was the",
|
||||
"toolbar icon, and constraints read as absent — see the Onshape-comparison report.",
|
||||
"It sits in the Reference row, the address the sketch-mode Constrain has: one verb, one row."
|
||||
]
|
||||
@@ -3700,7 +3700,7 @@
|
||||
"icon": "design_dimension",
|
||||
"hint": "Type the length of this line",
|
||||
"note": [
|
||||
"Typing the defining number of the element you pointed at. Three rows rather than one so",
|
||||
"Typing the defining number of the element you pointed at. Three items rather than one so",
|
||||
"each names the quantity in the drawing-office word for THAT element; all three land on",
|
||||
"the same handler, because dimension_kind() already resolves the quantity from the",
|
||||
"selection. Without these, an element's own numbers were reachable only by arming the",
|
||||
@@ -4872,7 +4872,7 @@
|
||||
"ok_false": false,
|
||||
"closed": true,
|
||||
"summary": "Select a body, a face, edges, a vertex, a reference plane, a sketch's loop or a feature by id, as a click selects it.",
|
||||
"details": "One form: body; body with face, edges (the last the current edge, as in a Shift+click set) or vertex; plane; sketch with loop; feature; or nothing, which clears the selection. A body is selected as a click on its row of the Bodies list selects it, a face, edges or a vertex as a click in the view picks them, a loop as a click on it, which also selects its Sketch's row, and a feature as a click on its row of the Feature list. A plane is picked only where a click can pick one: while the Origin row shows the planes, or while Sketch waits for its plane (sketch_create {}), where picking it opens the sketch. A loop is numbered as sketch_describe {sketch} numbers closed_loops and extrude {sketch, loop} takes it, and is selected only while the view shows it: an extrude that takes the whole sketch hides the sketch, and one that takes a loop hides that loop. Whatever was selected goes first, of every kind. The menu-row forms then act on the selection: feature_edit, rename_selected, feature_delete and sketch_constrain_selected called with no arguments act on the selected row of the Feature list while nothing is picked in the view, and zoom_to_selection acts on what is picked in the view, so a sketch is zoomed to through sketch with loop, not through feature. Refused, changing nothing, for an id the model does not have, and while a card, a sketch, Constrain mode, a body Move or the Text dialog is open, where a click means something else. Reply: selection {kind, id}, plane and feature, as describe_design reports selection, picked_plane and feature_row; for a vertex also point, as body_describe gives it, and placed_point, where the view draws it (the same unless the body was moved).",
|
||||
"details": "One form: body; body with face, edges (the last the current edge, as in a Shift+click set) or vertex; plane; sketch with loop; feature; or nothing, which clears the selection. A body is selected as a click on its row of the Bodies list selects it, a face, edges or a vertex as a click in the view picks them, a loop as a click on it, which also selects its Sketch's row, and a feature as a click on its row of the Feature list. A plane is picked only where a click can pick one: while the Origin row shows the planes, or while Sketch waits for its plane (sketch_create {}), where picking it opens the sketch. A loop is numbered as sketch_describe {sketch} numbers closed_loops and extrude {sketch, loop} takes it, and is selected only while the view shows it: an extrude that takes the whole sketch hides the sketch, and one that takes a loop hides that loop. Whatever was selected goes first, of every kind. The menu-item forms then act on the selection: feature_edit, rename_selected, feature_delete and sketch_constrain_selected called with no arguments act on the selected row of the Feature list while nothing is picked in the view, and zoom_to_selection acts on what is picked in the view, so a sketch is zoomed to through sketch with loop, not through feature. Refused, changing nothing, for an id the model does not have, and while a card, a sketch, Constrain mode, a body Move or the Text dialog is open, where a click means something else. Reply: selection {kind, id}, plane and feature, as describe_design reports selection, picked_plane and feature_row; for a vertex also point, as body_describe gives it, and placed_point, where the view draws it (the same unless the body was moved).",
|
||||
"params": [
|
||||
{"name": "body", "type": "integer", "default": null, "min": 0, "description": "body index (describe_design); alone, the whole body"},
|
||||
{"name": "face", "type": "integer", "default": null, "min": 0, "description": "a face id of body (body_describe)"},
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
# Generate candidates with: python3 scripts/check_operation_calls.py --print
|
||||
|
||||
[src/slic3r/GUI/NativeCommands.cpp]
|
||||
# The asking path of a command, its menu row's tile (Rows): the row's function calls the owner's method, which asks
|
||||
# the person what an operation would be told (project_open {}, project_save {save_as: true}, project_import {archive:
|
||||
# true}, project_export with a tile's arguments, filament_sync_ams {}).
|
||||
# The asking path of a command, its menu item's tile (MenuItems): the item's function calls the owner's method, which
|
||||
# asks the person what an operation would be told (project_open {}, project_save {save_as: true}, project_import
|
||||
# {archive: true}, project_export with a tile's arguments, filament_sync_ams {}).
|
||||
plater->load_project();
|
||||
return NativeCommands::project_save_result(plater->save_project(true));
|
||||
plater->import_zip_archive();
|
||||
|
||||
Reference in new issue
Block a user