2.5
Bugfix in last commit: the read-file hotkey (enter) has to be in the window handler queue, so it nicely exits all queues without using free'd data.
This commit is contained in:
@@ -506,7 +506,7 @@ void ED_FILE_OT_load(struct wmOperatorType *ot)
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec= file_load_exec;
|
||||
ot->poll= ED_operator_file_active;
|
||||
ot->poll= ED_operator_file_active; /* <- important, handler is on window level */
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -261,6 +261,7 @@ void file_operatortypes(void)
|
||||
WM_operatortype_append(ED_FILE_OT_cancel);
|
||||
}
|
||||
|
||||
/* NOTE: do not add .blend file reading on this level */
|
||||
void file_keymap(struct wmWindowManager *wm)
|
||||
{
|
||||
ListBase *keymap= WM_keymap_listbase(wm, "File", SPACE_FILE, 0);
|
||||
@@ -268,7 +269,6 @@ void file_keymap(struct wmWindowManager *wm)
|
||||
WM_keymap_add_item(keymap, "ED_FILE_OT_select_all", AKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "ED_FILE_OT_border_select", BKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "ED_FILE_OT_highlight", MOUSEMOVE, KM_ANY, 0, 0);
|
||||
WM_keymap_add_item(keymap, "ED_FILE_OT_load", RETKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "ED_FILE_OT_cancel", ESCKEY, KM_PRESS, 0, 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "ED_FILE_OT_loadimages", TIMER1, KM_ANY, KM_ANY, 0);
|
||||
|
||||
@@ -529,6 +529,8 @@ void WM_read_file(bContext *C, char *name, ReportList *reports)
|
||||
|
||||
WM_event_add_notifier(C, NC_WM|ND_FILEREAD, NULL);
|
||||
// refresh_interface_font();
|
||||
|
||||
CTX_wm_window_set(C, NULL); /* exits queues */
|
||||
}
|
||||
// else if(retval==1)
|
||||
// XXX BIF_undo_push("Import file");
|
||||
|
||||
@@ -1171,5 +1171,6 @@ void wm_window_keymap(wmWindowManager *wm)
|
||||
WM_keymap_verify_item(keymap, "WM_OT_save_as_mainfile", F2KEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_verify_item(keymap, "WM_OT_window_fullscreen_toggle", F11KEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_verify_item(keymap, "WM_OT_exit_blender", QKEY, KM_PRESS, KM_CTRL, 0);
|
||||
WM_keymap_add_item(keymap, "ED_FILE_OT_load", RETKEY, KM_PRESS, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user