[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39934] trunk/blender/source/blender: Fix #28404: certain keyboard shortcuts not shown in menus, e.g.
Brecht Van Lommel
brechtvanlommel at pandora.be
Mon Sep 5 19:57:04 CEST 2011
Revision: 39934
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39934
Author: blendix
Date: 2011-09-05 17:57:04 +0000 (Mon, 05 Sep 2011)
Log Message:
-----------
Fix #28404: certain keyboard shortcuts not shown in menus, e.g. move operators
in graph editor > channel menu. Problem was these did not inherit operator
execution context correctly.
Fix found by Sergey, also needed to fix logic operators which were not working
when invoked instead of executed.
Modified Paths:
--------------
trunk/blender/source/blender/editors/interface/interface_layout.c
trunk/blender/source/blender/editors/space_logic/logic_ops.c
trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
Modified: trunk/blender/source/blender/editors/interface/interface_layout.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_layout.c 2011-09-05 17:06:09 UTC (rev 39933)
+++ trunk/blender/source/blender/editors/interface/interface_layout.c 2011-09-05 17:57:04 UTC (rev 39934)
@@ -1526,7 +1526,7 @@
{
MenuItemLevel *lvl= (MenuItemLevel*)(((uiBut*)arg)->func_argN);
- uiLayoutSetOperatorContext(layout, WM_OP_EXEC_REGION_WIN);
+ uiLayoutSetOperatorContext(layout, lvl->opcontext);
uiItemsEnumO(layout, lvl->opname, lvl->propname);
}
Modified: trunk/blender/source/blender/editors/space_logic/logic_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_logic/logic_ops.c 2011-09-05 17:06:09 UTC (rev 39933)
+++ trunk/blender/source/blender/editors/space_logic/logic_ops.c 2011-09-05 17:57:04 UTC (rev 39934)
@@ -322,7 +322,7 @@
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, SENS_ALWAYS, "Type", "Type of sensor to add");
+ ot->prop= prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, SENS_ALWAYS, "Type", "Type of sensor to add");
RNA_def_enum_funcs(prop, rna_Sensor_type_itemf);
RNA_def_string(ot->srna, "name", "", 32, "Name", "Name of the Sensor to add");
RNA_def_string(ot->srna, "object", "", 32, "Object", "Name of the Object to add the Sensor to");
@@ -437,7 +437,7 @@
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_enum(ot->srna, "type", controller_type_items, CONT_LOGIC_AND, "Type", "Type of controller to add");
+ ot->prop= RNA_def_enum(ot->srna, "type", controller_type_items, CONT_LOGIC_AND, "Type", "Type of controller to add");
RNA_def_string(ot->srna, "name", "", 32, "Name", "Name of the Controller to add");
RNA_def_string(ot->srna, "object", "", 32, "Object", "Name of the Object to add the Controller to");
}
@@ -539,7 +539,7 @@
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, CONT_LOGIC_AND, "Type", "Type of actuator to add");
+ ot->prop= prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, CONT_LOGIC_AND, "Type", "Type of actuator to add");
RNA_def_enum_funcs(prop, rna_Actuator_type_itemf);
RNA_def_string(ot->srna, "name", "", 32, "Name", "Name of the Actuator to add");
RNA_def_string(ot->srna, "object", "", 32, "Object", "Name of the Object to add the Actuator to");
Modified: trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_event_system.c 2011-09-05 17:06:09 UTC (rev 39933)
+++ trunk/blender/source/blender/windowmanager/intern/wm_event_system.c 2011-09-05 17:57:04 UTC (rev 39934)
@@ -886,8 +886,8 @@
CTX_wm_region_set(C, NULL);
CTX_wm_area_set(C, NULL);
retval= wm_operator_invoke(C, ot, event, properties, reports, poll_only);
+ CTX_wm_area_set(C, area);
CTX_wm_region_set(C, ar);
- CTX_wm_area_set(C, area);
return retval;
}
More information about the Bf-blender-cvs
mailing list