Commit: cfe9c7b3bd533379b6a52380fd62d7cdfaefd183 Author: Jacques Lucke Date: Wed Apr 24 11:54:40 2019 +0200 Branches: master https://developer.blender.org/rBcfe9c7b3bd533379b6a52380fd62d7cdfaefd183
Refactor: Separate template selection from read_homefile operator This is a first step towards T61599. This way the invoke function can be used for the confirm dialog in a separate patch. Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D4723 =================================================================== M release/scripts/presets/keyconfig/keymap_data/blender_default.py M source/blender/windowmanager/intern/wm_files.c =================================================================== diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index 7435f25210d..11e9a6958dc 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -326,7 +326,7 @@ def km_window(params): if params.apple: # Apple standard shortcuts. Cmd+F for search since F-keys are not easy to use. items.extend([ - ("wm.read_homefile", {"type": 'N', "value": 'PRESS', "oskey": True}, None), + op_menu("TOPBAR_MT_file_new", {"type": 'N', "value": 'PRESS', "oskey": True}), op_menu("TOPBAR_MT_file_open_recent", {"type": 'O', "value": 'PRESS', "shift": True, "oskey": True}), ("wm.open_mainfile", {"type": 'O', "value": 'PRESS', "oskey": True}, None), ("wm.save_mainfile", {"type": 'S', "value": 'PRESS', "oskey": True}, None), @@ -356,7 +356,7 @@ def km_window(params): items.extend([ # File operations - ("wm.read_homefile", {"type": 'N', "value": 'PRESS', "ctrl": True}, None), + op_menu("TOPBAR_MT_file_new", {"type": 'N', "value": 'PRESS', "ctrl": True}), op_menu("TOPBAR_MT_file_open_recent", {"type": 'O', "value": 'PRESS', "shift": True, "ctrl": True}), ("wm.open_mainfile", {"type": 'O', "value": 'PRESS', "ctrl": True}, None), ("wm.save_mainfile", {"type": 'S', "value": 'PRESS', "ctrl": True}, None), diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index f9e420a987f..c3642e7f7e7 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -1846,24 +1846,6 @@ static int wm_homefile_read_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int wm_homefile_read_invoke(bContext *C, - wmOperator *UNUSED(op), - const wmEvent *UNUSED(event)) -{ - /* Draw menu which includes default startup and application templates. */ - uiPopupMenu *pup = UI_popup_menu_begin(C, IFACE_("New File"), ICON_FILE_NEW); - uiLayout *layout = UI_popup_menu_layout(pup); - - MenuType *mt = WM_menutype_find("TOPBAR_MT_file_new", false); - if (mt) { - UI_menutype_draw(C, mt, layout); - } - - UI_popup_menu_end(C, pup); - - return OPERATOR_INTERFACE; -} - void WM_OT_read_homefile(wmOperatorType *ot) { PropertyRNA *prop; @@ -1871,7 +1853,6 @@ void WM_OT_read_homefile(wmOperatorType *ot) ot->idname = "WM_OT_read_homefile"; ot->description = "Open the default file (doesn't save the current file)"; - ot->invoke = wm_homefile_read_invoke; ot->exec = wm_homefile_read_exec; prop = RNA_def_string_file_path( _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs