replace WM_OT_ndof_menu with a key->menu assignment.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 2 Aug 2011 06:40:40 +0000 (06:40 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 2 Aug 2011 06:40:40 +0000 (06:40 +0000)
source/blender/windowmanager/intern/wm_operators.c

index d9c3300fcef5e2a7130461ad5deabceb36ef9542..7dc4bfb65a620faa33972b07d1fd445fcf103045 100644 (file)
@@ -1411,22 +1411,6 @@ static void WM_OT_search_menu(wmOperatorType *ot)
        ot->poll= wm_search_menu_poll;
 }
 
-static int wm_ndof_menu_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event))
-{
-       uiPupMenuInvoke(C,"VIEW3D_MT_ndof_settings");
-
-       return OPERATOR_FINISHED; // <-- correct?
-       return OPERATOR_CANCELLED; // <-- correct?
-}
-
-static void WM_OT_ndof_menu(wmOperatorType *ot)
-{
-       ot->name = "NDOF Menu";
-       ot->idname = "WM_OT_ndof_menu";
-       
-       ot->invoke = wm_ndof_menu_invoke;
-}
-
 static int wm_call_menu_exec(bContext *C, wmOperator *op)
 {
        char idname[BKE_ST_MAXNAME];
@@ -3517,7 +3501,6 @@ void wm_operatortype_init(void)
        WM_operatortype_append(WM_OT_debug_menu);
        WM_operatortype_append(WM_OT_splash);
        WM_operatortype_append(WM_OT_search_menu);
-       WM_operatortype_append(WM_OT_ndof_menu);
        WM_operatortype_append(WM_OT_call_menu);
        WM_operatortype_append(WM_OT_radial_control);
        WM_operatortype_append(WM_OT_ndof_sensitivity_change);
@@ -3743,7 +3726,7 @@ void wm_window_keymap(wmKeyConfig *keyconf)
 
        /* menus that can be accessed anywhere in blender */
        WM_keymap_verify_item(keymap, "WM_OT_search_menu", SPACEKEY, KM_PRESS, 0, 0);
-       WM_keymap_add_item(keymap, "WM_OT_ndof_menu", NDOF_BUTTON_MENU, KM_PRESS, 0, 0);
+       WM_keymap_add_menu(keymap, "VIEW3D_MT_ndof_settings", NDOF_BUTTON_MENU, KM_PRESS, 0, 0);
 
        /* Space switching */
        kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F2KEY, KM_PRESS, KM_SHIFT, 0); /* new in 2.5x, was DXF export */