From fef40eda72ab1a37d9b779757fb326825b5c6c10 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sat, 5 May 2012 19:26:53 +0000 Subject: Fix related to [#31157]: Tips (descriptions) of macro operators were not set into underlying RNA struct, hence did not show up in UI. --- source/blender/editors/armature/armature_ops.c | 15 +++++++----- source/blender/editors/curve/curve_ops.c | 8 +++---- source/blender/editors/mesh/mesh_ops.c | 28 +++++++++++----------- source/blender/editors/object/object_ops.c | 12 +++++----- source/blender/editors/space_action/action_ops.c | 6 +++-- source/blender/editors/space_clip/clip_ops.c | 9 +++---- source/blender/editors/space_graph/graph_ops.c | 5 ++-- source/blender/editors/space_node/node_ops.c | 21 ++++++++-------- source/blender/windowmanager/WM_api.h | 2 +- source/blender/windowmanager/intern/wm_operators.c | 3 ++- 10 files changed, 59 insertions(+), 50 deletions(-) (limited to 'source') diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c index aeecbc1fd28..9a15a100179 100644 --- a/source/blender/editors/armature/armature_ops.c +++ b/source/blender/editors/armature/armature_ops.c @@ -171,17 +171,19 @@ void ED_operatormacros_armature(void) wmOperatorType *ot; wmOperatorTypeMacro *otmacro; - ot = WM_operatortype_append_macro("ARMATURE_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("ARMATURE_OT_duplicate_move", "Duplicate", + "Make copies of the selected bones within the same armature and move them", + OPTYPE_UNDO|OPTYPE_REGISTER); if (ot) { - ot->description = "Make copies of the selected bones within the same armature and move them"; WM_operatortype_macro_define(ot, "ARMATURE_OT_duplicate"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", 0); } - ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_move", "Extrude", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_move", "Extrude", + "Create new bones from the selected joints and move them", + OPTYPE_UNDO|OPTYPE_REGISTER); if (ot) { - ot->description = "Create new bones from the selected joints and move them"; otmacro=WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude"); RNA_boolean_set(otmacro->ptr, "forked", FALSE); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); @@ -190,9 +192,10 @@ void ED_operatormacros_armature(void) // XXX would it be nicer to just be able to have standard extrude_move, but set the forked property separate? // that would require fixing a properties bug 19733 - ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_forked", "Extrude Forked", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_forked", "Extrude Forked", + "Create new bones from the selected joints and move them", + OPTYPE_UNDO|OPTYPE_REGISTER); if (ot) { - ot->description = "Create new bones from the selected joints and move them"; otmacro=WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude"); RNA_boolean_set(otmacro->ptr, "forked", TRUE); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c index 94ec7c7ce93..dea7ccb161d 100644 --- a/source/blender/editors/curve/curve_ops.c +++ b/source/blender/editors/curve/curve_ops.c @@ -140,15 +140,15 @@ void ED_operatormacros_curve(void) wmOperatorType *ot; wmOperatorTypeMacro *otmacro; - ot = WM_operatortype_append_macro("CURVE_OT_duplicate_move", "Add Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER); - ot->description = "Duplicate curve and move"; + ot = WM_operatortype_append_macro("CURVE_OT_duplicate_move", "Add Duplicate", "Duplicate curve and move", + OPTYPE_UNDO|OPTYPE_REGISTER); WM_operatortype_macro_define(ot, "CURVE_OT_duplicate"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", 0); RNA_boolean_set(otmacro->ptr, "mirror", FALSE); - ot = WM_operatortype_append_macro("CURVE_OT_extrude_move", "Extrude Curve and Move", OPTYPE_UNDO|OPTYPE_REGISTER); - ot->description = "Extrude curve and move result"; + ot = WM_operatortype_append_macro("CURVE_OT_extrude_move", "Extrude Curve and Move", + "Extrude curve and move result", OPTYPE_UNDO|OPTYPE_REGISTER); WM_operatortype_macro_define(ot, "CURVE_OT_extrude"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", 0); diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index 1b87e7813db..e57285cca25 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -197,49 +197,49 @@ void ED_operatormacros_mesh(void) wmOperatorType *ot; wmOperatorTypeMacro *otmacro; - ot = WM_operatortype_append_macro("MESH_OT_loopcut_slide", "Loop Cut and Slide", OPTYPE_UNDO | OPTYPE_REGISTER); - ot->description = "Cut mesh loop and slide it"; + ot = WM_operatortype_append_macro("MESH_OT_loopcut_slide", "Loop Cut and Slide", "Cut mesh loop and slide it", + OPTYPE_UNDO | OPTYPE_REGISTER); WM_operatortype_macro_define(ot, "MESH_OT_loopcut"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_edge_slide"); RNA_struct_idprops_unset(otmacro->ptr, "release_confirm"); - ot = WM_operatortype_append_macro("MESH_OT_duplicate_move", "Add Duplicate", OPTYPE_UNDO | OPTYPE_REGISTER); - ot->description = "Duplicate mesh and move"; + ot = WM_operatortype_append_macro("MESH_OT_duplicate_move", "Add Duplicate", "Duplicate mesh and move", + OPTYPE_UNDO | OPTYPE_REGISTER); WM_operatortype_macro_define(ot, "MESH_OT_duplicate"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", 0); RNA_boolean_set(otmacro->ptr, "mirror", FALSE); - ot = WM_operatortype_append_macro("MESH_OT_rip_move", "Rip", OPTYPE_UNDO | OPTYPE_REGISTER); - ot->description = "Rip polygons and move the result"; + ot = WM_operatortype_append_macro("MESH_OT_rip_move", "Rip", "Rip polygons and move the result", + OPTYPE_UNDO | OPTYPE_REGISTER); WM_operatortype_macro_define(ot, "MESH_OT_rip"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", 0); RNA_boolean_set(otmacro->ptr, "mirror", FALSE); - ot = WM_operatortype_append_macro("MESH_OT_extrude_region_move", "Extrude Region and Move", OPTYPE_UNDO | OPTYPE_REGISTER); - ot->description = "Extrude region and move result"; + ot = WM_operatortype_append_macro("MESH_OT_extrude_region_move", "Extrude Region and Move", + "Extrude region and move result", OPTYPE_UNDO | OPTYPE_REGISTER); otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_region"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", 0); RNA_boolean_set(otmacro->ptr, "mirror", FALSE); - ot = WM_operatortype_append_macro("MESH_OT_extrude_faces_move", "Extrude Individual Faces and Move", OPTYPE_UNDO | OPTYPE_REGISTER); - ot->description = "Extrude faces and move result"; + ot = WM_operatortype_append_macro("MESH_OT_extrude_faces_move", "Extrude Individual Faces and Move", + "Extrude faces and move result", OPTYPE_UNDO | OPTYPE_REGISTER); otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_faces_indiv"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_shrink_fatten"); RNA_enum_set(otmacro->ptr, "proportional", 0); RNA_boolean_set(otmacro->ptr, "mirror", FALSE); - ot = WM_operatortype_append_macro("MESH_OT_extrude_edges_move", "Extrude Only Edges and Move", OPTYPE_UNDO | OPTYPE_REGISTER); - ot->description = "Extrude edges and move result"; + ot = WM_operatortype_append_macro("MESH_OT_extrude_edges_move", "Extrude Only Edges and Move", + "Extrude edges and move result", OPTYPE_UNDO | OPTYPE_REGISTER); otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_edges_indiv"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", 0); RNA_boolean_set(otmacro->ptr, "mirror", FALSE); - ot = WM_operatortype_append_macro("MESH_OT_extrude_vertices_move", "Extrude Only Vertices and Move", OPTYPE_UNDO | OPTYPE_REGISTER); - ot->description = "Extrude vertices and move result"; + ot = WM_operatortype_append_macro("MESH_OT_extrude_vertices_move", "Extrude Only Vertices and Move", + "Extrude vertices and move result", OPTYPE_UNDO | OPTYPE_REGISTER); otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_verts_indiv"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", 0); diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 4cd18d91249..feb7c075264 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -222,18 +222,18 @@ void ED_operatormacros_object(void) wmOperatorType *ot; wmOperatorTypeMacro *otmacro; - ot = WM_operatortype_append_macro("OBJECT_OT_duplicate_move", "Duplicate Objects", OPTYPE_UNDO | OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("OBJECT_OT_duplicate_move", "Duplicate Objects", + "Duplicate selected objects and move them", OPTYPE_UNDO | OPTYPE_REGISTER); if (ot) { - ot->description = "Duplicate selected objects and move them"; WM_operatortype_macro_define(ot, "OBJECT_OT_duplicate"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", PROP_EDIT_OFF); } /* grr, should be able to pass options on... */ - ot = WM_operatortype_append_macro("OBJECT_OT_duplicate_move_linked", "Duplicate Linked", OPTYPE_UNDO | OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("OBJECT_OT_duplicate_move_linked", "Duplicate Linked", + "Duplicate selected objects and move them", OPTYPE_UNDO | OPTYPE_REGISTER); if (ot) { - ot->description = "Duplicate selected objects and move them"; otmacro = WM_operatortype_macro_define(ot, "OBJECT_OT_duplicate"); RNA_boolean_set(otmacro->ptr, "linked", TRUE); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); @@ -241,9 +241,9 @@ void ED_operatormacros_object(void) } /* XXX */ - ot = WM_operatortype_append_macro("OBJECT_OT_add_named_cursor", "Add named object at cursor", OPTYPE_UNDO | OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("OBJECT_OT_add_named_cursor", "Add Named At Cursor", + "Add named object at cursor", OPTYPE_UNDO | OPTYPE_REGISTER); if (ot) { - ot->description = "Add named object at cursor"; RNA_def_string(ot->srna, "name", "Cube", MAX_ID_NAME - 2, "Name", "Object name to add"); WM_operatortype_macro_define(ot, "VIEW3D_OT_cursor3d"); diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c index f502a97967f..da3e88ba188 100644 --- a/source/blender/editors/space_action/action_ops.c +++ b/source/blender/editors/space_action/action_ops.c @@ -45,6 +45,7 @@ #include "action_intern.h" #include "RNA_access.h" +#include "RNA_define.h" #include "WM_api.h" #include "WM_types.h" @@ -93,9 +94,10 @@ void ED_operatormacros_action(void) wmOperatorType *ot; wmOperatorTypeMacro *otmacro; - ot = WM_operatortype_append_macro("ACTION_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("ACTION_OT_duplicate_move", "Duplicate", + "Make a copy of all selected keyframes and move them", + OPTYPE_UNDO|OPTYPE_REGISTER); if (ot) { - ot->description = "Make a copy of all selected keyframes and move them"; WM_operatortype_macro_define(ot, "ACTION_OT_duplicate"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform"); RNA_enum_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE); diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index b05d204b07b..485830dbe6c 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -1093,14 +1093,15 @@ void ED_operatormacros_clip(void) wmOperatorType *ot; wmOperatorTypeMacro *otmacro; - ot = WM_operatortype_append_macro("CLIP_OT_add_marker_move", "Add Marker and Move", OPTYPE_UNDO|OPTYPE_REGISTER); - ot->description = "Add new marker and move it on movie"; + ot = WM_operatortype_append_macro("CLIP_OT_add_marker_move", "Add Marker and Move", + "Add new marker and move it on movie", OPTYPE_UNDO|OPTYPE_REGISTER); WM_operatortype_macro_define(ot, "CLIP_OT_add_marker"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_struct_idprops_unset(otmacro->ptr, "release_confirm"); - ot = WM_operatortype_append_macro("CLIP_OT_add_marker_slide", "Add Marker and Slide", OPTYPE_UNDO|OPTYPE_REGISTER); - ot->description = "Add new marker and slide it with mouse until mouse button release"; + ot = WM_operatortype_append_macro("CLIP_OT_add_marker_slide", "Add Marker and Slide", + "Add new marker and slide it with mouse until mouse button release", + OPTYPE_UNDO|OPTYPE_REGISTER); WM_operatortype_macro_define(ot, "CLIP_OT_add_marker"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_boolean_set(otmacro->ptr, "release_confirm", TRUE); diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index 2887fa1c881..49c56ec75e4 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -241,9 +241,10 @@ void ED_operatormacros_graph(void) wmOperatorType *ot; wmOperatorTypeMacro *otmacro; - ot = WM_operatortype_append_macro("GRAPH_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("GRAPH_OT_duplicate_move", "Duplicate", + "Make a copy of all selected keyframes and move them", + OPTYPE_UNDO|OPTYPE_REGISTER); if (ot) { - ot->description = "Make a copy of all selected keyframes and move them"; WM_operatortype_macro_define(ot, "GRAPH_OT_duplicate"); otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform"); RNA_enum_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE); diff --git a/source/blender/editors/space_node/node_ops.c b/source/blender/editors/space_node/node_ops.c index 1c681220016..7d9d7d736f6 100644 --- a/source/blender/editors/space_node/node_ops.c +++ b/source/blender/editors/space_node/node_ops.c @@ -111,30 +111,31 @@ void ED_operatormacros_node(void) wmOperatorType *ot; wmOperatorTypeMacro *mot; - ot = WM_operatortype_append_macro("NODE_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER); - ot->description = "Duplicate selected nodes and move them"; + ot = WM_operatortype_append_macro("NODE_OT_duplicate_move", "Duplicate", "Duplicate selected nodes and move them", + OPTYPE_UNDO|OPTYPE_REGISTER); WM_operatortype_macro_define(ot, "NODE_OT_duplicate"); WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); /* modified operator call for duplicating with input links */ - ot = WM_operatortype_append_macro("NODE_OT_duplicate_move_keep_inputs", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER); - ot->description = "Duplicate selected nodes keeping input links and move them"; + ot = WM_operatortype_append_macro("NODE_OT_duplicate_move_keep_inputs", "Duplicate", + "Duplicate selected nodes keeping input links and move them", + OPTYPE_UNDO|OPTYPE_REGISTER); mot = WM_operatortype_macro_define(ot, "NODE_OT_duplicate"); RNA_boolean_set(mot->ptr, "keep_inputs", TRUE); WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - ot = WM_operatortype_append_macro("NODE_OT_select_link_viewer", "Link Viewer", OPTYPE_UNDO); - ot->description = "Select node and link it to a viewer node"; + ot = WM_operatortype_append_macro("NODE_OT_select_link_viewer", "Link Viewer", + "Select node and link it to a viewer node", OPTYPE_UNDO); WM_operatortype_macro_define(ot, "NODE_OT_select"); WM_operatortype_macro_define(ot, "NODE_OT_link_viewer"); - ot = WM_operatortype_append_macro("NODE_OT_move_detach_links", "Detach", OPTYPE_UNDO|OPTYPE_REGISTER); - ot->description = "Move a node to detach links"; + ot = WM_operatortype_append_macro("NODE_OT_move_detach_links", "Detach", "Move a node to detach links", + OPTYPE_UNDO|OPTYPE_REGISTER); WM_operatortype_macro_define(ot, "NODE_OT_links_detach"); WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - ot = WM_operatortype_append_macro("NODE_OT_move_detach_links_release", "Detach", OPTYPE_UNDO|OPTYPE_REGISTER); - ot->description = "Move a node to detach links"; + ot = WM_operatortype_append_macro("NODE_OT_move_detach_links_release", "Detach", "Move a node to detach links", + OPTYPE_UNDO|OPTYPE_REGISTER); WM_operatortype_macro_define(ot, "NODE_OT_links_detach"); mot = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_boolean_set(mot->ptr, "release_confirm", TRUE); diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 4c81a0a8654..f3872cb9594 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -188,7 +188,7 @@ void WM_operatortype_append_ptr (void (*opfunc)(struct wmOperatorType*, void *) void WM_operatortype_append_macro_ptr (void (*opfunc)(struct wmOperatorType*, void *), void *userdata); int WM_operatortype_remove(const char *idname); -struct wmOperatorType *WM_operatortype_append_macro(const char *idname, const char *name, int flag); +struct wmOperatorType *WM_operatortype_append_macro(const char *idname, const char *name, const char *description, int flag); struct wmOperatorTypeMacro *WM_operatortype_macro_define(struct wmOperatorType *ot, const char *idname); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index e9915361833..36bacd34dfe 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -346,7 +346,7 @@ static int wm_macro_cancel(bContext *C, wmOperator *op) } /* Names have to be static for now */ -wmOperatorType *WM_operatortype_append_macro(const char *idname, const char *name, int flag) +wmOperatorType *WM_operatortype_append_macro(const char *idname, const char *name, const char *description, int flag) { wmOperatorType *ot; @@ -360,6 +360,7 @@ wmOperatorType *WM_operatortype_append_macro(const char *idname, const char *nam ot->idname = idname; ot->name = name; + ot->description = description; ot->flag = OPTYPE_MACRO | flag; ot->exec = wm_macro_exec; -- cgit v1.2.3