Revision: 37247
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37247
Author:   campbellbarton
Date:     2011-06-06 11:56:54 +0000 (Mon, 06 Jun 2011)
Log Message:
-----------
bug [#27582] Screen Editing > Split and Join area don't work.
added 'INTERNAL' operator flag so operators which are only meant to be called 
by other operators or internal use are not displayed to the user.

Currently only use this flag for the operator search toolbox, is ignored in 
debug mode.

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_operators/wm.py
    trunk/blender/source/blender/editors/screen/screen_ops.c
    trunk/blender/source/blender/editors/util/undo.c
    trunk/blender/source/blender/makesrna/intern/rna_wm.c
    trunk/blender/source/blender/windowmanager/WM_types.h
    trunk/blender/source/blender/windowmanager/intern/wm_operators.c

Modified: trunk/blender/release/scripts/startup/bl_operators/wm.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_operators/wm.py    2011-06-06 
11:04:54 UTC (rev 37246)
+++ trunk/blender/release/scripts/startup/bl_operators/wm.py    2011-06-06 
11:56:54 UTC (rev 37247)
@@ -106,7 +106,7 @@
     '''Set a context value.'''
     bl_idname = "wm.context_set_boolean"
     bl_label = "Context Set Boolean"
-    bl_options = {'UNDO'}
+    bl_options = {'UNDO', 'INTERNAL'}
 
     data_path = rna_path_prop
     value = BoolProperty(name="Value",
@@ -119,7 +119,7 @@
     '''Set a context value.'''
     bl_idname = "wm.context_set_int"
     bl_label = "Context Set"
-    bl_options = {'UNDO'}
+    bl_options = {'UNDO', 'INTERNAL'}
 
     data_path = rna_path_prop
     value = IntProperty(name="Value", description="Assign value", default=0)
@@ -132,7 +132,7 @@
     '''Scale an int context value.'''
     bl_idname = "wm.context_scale_int"
     bl_label = "Context Set"
-    bl_options = {'UNDO'}
+    bl_options = {'UNDO', 'INTERNAL'}
 
     data_path = rna_path_prop
     value = FloatProperty(name="Value", description="Assign value", 
default=1.0)
@@ -168,7 +168,7 @@
     '''Set a context value.'''
     bl_idname = "wm.context_set_float"
     bl_label = "Context Set Float"
-    bl_options = {'UNDO'}
+    bl_options = {'UNDO', 'INTERNAL'}
 
     data_path = rna_path_prop
     value = FloatProperty(name="Value",
@@ -182,7 +182,7 @@
     '''Set a context value.'''
     bl_idname = "wm.context_set_string"
     bl_label = "Context Set String"
-    bl_options = {'UNDO'}
+    bl_options = {'UNDO', 'INTERNAL'}
 
     data_path = rna_path_prop
     value = StringProperty(name="Value",
@@ -195,7 +195,7 @@
     '''Set a context value.'''
     bl_idname = "wm.context_set_enum"
     bl_label = "Context Set Enum"
-    bl_options = {'UNDO'}
+    bl_options = {'UNDO', 'INTERNAL'}
 
     data_path = rna_path_prop
     value = StringProperty(name="Value",
@@ -209,7 +209,7 @@
     '''Set a context value.'''
     bl_idname = "wm.context_set_value"
     bl_label = "Context Set Value"
-    bl_options = {'UNDO'}
+    bl_options = {'UNDO', 'INTERNAL'}
 
     data_path = rna_path_prop
     value = StringProperty(name="Value",
@@ -227,7 +227,7 @@
     '''Toggle a context value.'''
     bl_idname = "wm.context_toggle"
     bl_label = "Context Toggle"
-    bl_options = {'UNDO'}
+    bl_options = {'UNDO', 'INTERNAL'}
 
     data_path = rna_path_prop
 
@@ -246,7 +246,7 @@
     '''Toggle a context value.'''
     bl_idname = "wm.context_toggle_enum"
     bl_label = "Context Toggle Values"
-    bl_options = {'UNDO'}
+    bl_options = {'UNDO', 'INTERNAL'}
 
     data_path = rna_path_prop
     value_1 = StringProperty(name="Value", \
@@ -273,7 +273,7 @@
     '''vertex keys, groups' etc.'''
     bl_idname = "wm.context_cycle_int"
     bl_label = "Context Int Cycle"
-    bl_options = {'UNDO'}
+    bl_options = {'UNDO', 'INTERNAL'}
 
     data_path = rna_path_prop
     reverse = rna_reverse_prop
@@ -307,7 +307,7 @@
     '''Toggle a context value.'''
     bl_idname = "wm.context_cycle_enum"
     bl_label = "Context Enum Cycle"
-    bl_options = {'UNDO'}
+    bl_options = {'UNDO', 'INTERNAL'}
 
     data_path = rna_path_prop
     reverse = rna_reverse_prop
@@ -360,7 +360,7 @@
     Useful for cycling the active mesh edit mode.'''
     bl_idname = "wm.context_cycle_array"
     bl_label = "Context Array Cycle"
-    bl_options = {'UNDO'}
+    bl_options = {'UNDO', 'INTERNAL'}
 
     data_path = rna_path_prop
     reverse = rna_reverse_prop
@@ -406,7 +406,7 @@
 class WM_OT_context_menu_enum(bpy.types.Operator):
     bl_idname = "wm.context_menu_enum"
     bl_label = "Context Enum Menu"
-    bl_options = {'UNDO'}
+    bl_options = {'UNDO', 'INTERNAL'}
     data_path = rna_path_prop
 
     def execute(self, context):
@@ -420,7 +420,7 @@
     '''Toggle a context value.'''
     bl_idname = "wm.context_set_id"
     bl_label = "Set Library ID"
-    bl_options = {'UNDO'}
+    bl_options = {'UNDO', 'INTERNAL'}
 
     data_path = rna_path_prop
     value = StringProperty(name="Value",
@@ -462,6 +462,7 @@
     '''Adjust arbitrary values with mouse input'''
     bl_idname = "wm.context_modal_mouse"
     bl_label = "Context Modal Mouse"
+    bl_options = {'INTERNAL'}
 
     data_path_iter = StringProperty(description="The data path relative to the 
context, must point to an iterable.")
     data_path_item = StringProperty(description="The data path from each 
iterable to the value (int or float)")

Modified: trunk/blender/source/blender/editors/screen/screen_ops.c
===================================================================
--- trunk/blender/source/blender/editors/screen/screen_ops.c    2011-06-06 
11:04:54 UTC (rev 37246)
+++ trunk/blender/source/blender/editors/screen/screen_ops.c    2011-06-06 
11:56:54 UTC (rev 37247)
@@ -2277,7 +2277,7 @@
        ot->poll= screen_active_editable;
        ot->cancel= area_join_cancel;
        
-       ot->flag= OPTYPE_BLOCKING;
+       ot->flag= OPTYPE_BLOCKING|OPTYPE_INTERNAL;
        
        /* rna */
        RNA_def_int(ot->srna, "min_x", -100, INT_MIN, INT_MAX, "X 1", "", 
INT_MIN, INT_MAX);

Modified: trunk/blender/source/blender/editors/util/undo.c
===================================================================
--- trunk/blender/source/blender/editors/util/undo.c    2011-06-06 11:04:54 UTC 
(rev 37246)
+++ trunk/blender/source/blender/editors/util/undo.c    2011-06-06 11:56:54 UTC 
(rev 37247)
@@ -307,6 +307,8 @@
        /* api callbacks */
        ot->exec= ed_undo_push_exec;
 
+       ot->flag= OPTYPE_INTERNAL;
+
        RNA_def_string(ot->srna, "message", "Add an undo step *function may be 
moved*", MAXUNDONAME, "Undo Message", "");
 }
 

Modified: trunk/blender/source/blender/makesrna/intern/rna_wm.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_wm.c       2011-06-06 
11:04:54 UTC (rev 37246)
+++ trunk/blender/source/blender/makesrna/intern/rna_wm.c       2011-06-06 
11:56:54 UTC (rev 37247)
@@ -272,10 +272,11 @@
 EnumPropertyItem operator_flag_items[] = {
                {OPTYPE_REGISTER, "REGISTER", 0, "Register", ""},
                {OPTYPE_UNDO, "UNDO", 0, "Undo", ""},
-               {OPTYPE_BLOCKING, "BLOCKING", 0, "Finished", ""},
+               {OPTYPE_BLOCKING, "BLOCKING", 0, "Blocking", ""},
                {OPTYPE_MACRO, "MACRO", 0, "Macro", ""},
                {OPTYPE_GRAB_POINTER, "GRAB_POINTER", 0, "Grab Pointer", ""},
                {OPTYPE_PRESET, "PRESET", 0, "Preset", ""},
+               {OPTYPE_INTERNAL, "INTERNAL", 0, "Internal", ""},
                {0, NULL, 0, NULL, NULL}};
 
 EnumPropertyItem operator_return_items[] = {

Modified: trunk/blender/source/blender/windowmanager/WM_types.h
===================================================================
--- trunk/blender/source/blender/windowmanager/WM_types.h       2011-06-06 
11:04:54 UTC (rev 37246)
+++ trunk/blender/source/blender/windowmanager/WM_types.h       2011-06-06 
11:56:54 UTC (rev 37247)
@@ -61,6 +61,10 @@
 #define OPTYPE_MACRO           8
 #define OPTYPE_GRAB_POINTER    16      /* */
 #define OPTYPE_PRESET          32      /* show preset menu */
+#define OPTYPE_INTERNAL                64      /* some operators are mainly 
for internal use
+                                                                * and don't 
make sense to be accessed from the
+                                                                * search menu, 
even if poll() returns TRUE.
+                                                                * currently 
only used for the search toolbox */
 
 /* context to call operator in for WM_operator_name_call */
 /* rna_ui.c contains EnumPropertyItem's of these, keep in sync */

Modified: trunk/blender/source/blender/windowmanager/intern/wm_operators.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_operators.c    
2011-06-06 11:04:54 UTC (rev 37246)
+++ trunk/blender/source/blender/windowmanager/intern/wm_operators.c    
2011-06-06 11:56:54 UTC (rev 37247)
@@ -1277,7 +1277,10 @@
        wmOperatorType *ot = WM_operatortype_first();
        
        for(; ot; ot= ot->next) {
-               
+
+               if((ot->flag & OPTYPE_INTERNAL) && (G.f & G_DEBUG) == 0)
+                       continue;
+
                if(BLI_strcasestr(ot->name, str)) {
                        if(WM_operator_poll((bContext*)C, ot)) {
                                char name[256];
@@ -1389,6 +1392,8 @@
        ot->exec= wm_call_menu_exec;
        ot->poll= WM_operator_winactive;
 
+       ot->flag= OPTYPE_INTERNAL;
+
        RNA_def_string(ot->srna, "name", "", BKE_ST_MAXNAME, "Name", "Name of 
the menu");
 }
 

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to