Fix related to [#31157]: Tips (descriptions) of macro operators were not set into...
authorBastien Montagne <montagne29@wanadoo.fr>
Sat, 5 May 2012 19:26:53 +0000 (19:26 +0000)
committerBastien Montagne <montagne29@wanadoo.fr>
Sat, 5 May 2012 19:26:53 +0000 (19:26 +0000)
source/blender/editors/armature/armature_ops.c
source/blender/editors/curve/curve_ops.c
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/object/object_ops.c
source/blender/editors/space_action/action_ops.c
source/blender/editors/space_clip/clip_ops.c
source/blender/editors/space_graph/graph_ops.c
source/blender/editors/space_node/node_ops.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/intern/wm_operators.c

index aeecbc1fd28fac786c275f5b4b498e232fe6ef32..9a15a100179335d650b70a8a1e839ea6bdd4afb6 100644 (file)
@@ -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");
index 94ec7c7ce93fabd7c54b6d73fa3a9831077dea68..dea7ccb161da10d5149b5b1033108890bb72b29c 100644 (file)
@@ -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);
index 1b87e7813db0976f46870036cb79ecc391280b7d..e57285cca25ce2fb5f652601b630b0ba59b5ac68 100644 (file)
@@ -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);
index 4cd18d912499c9db282d6306ca08b5a402f78872..feb7c07526452127a41f9f9c67c018fb108ff9d2 100644 (file)
@@ -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");
index f502a97967f58d976f37730a29c868bea3687723..da3e88ba188836c6110404eb73349ba16055ab91 100644 (file)
@@ -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);
index b05d204b07bada030940ca6441d95e88749e624d..485830dbe6cf0ef0626b48ab56437f14f7565938 100644 (file)
@@ -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);
index 2887fa1c8811b6a89ebcff985d91d46b0e6838c5..49c56ec75e47eb8af681c88c52b08eaf69b0c2c8 100644 (file)
@@ -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);
index 1c681220016ec8a8be0e02832589280eb2f4346f..7d9d7d736f601d0e869150d5033339bc09e7ceb8 100644 (file)
@@ -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);
index 4c81a0a865469f38f1df7b11bda92cdf1754440b..f3872cb9594897f375a6d64da8562dc0ec8aa226 100644 (file)
@@ -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);
 
 
index e9915361833a50960a96eed6edc4658d6c105534..36bacd34dfe8f58118b9e95113f857a5fe246359 100644 (file)
@@ -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;