Added new macro "file.select_execute", by default mapped to LMB doubleclick in file selector.

This selects+opens the file under the mouse pointer, can be customised.

This somewhat fixes [#20727] MMB don't load .blend from the file browser
This commit is contained in:
2010-01-19 03:59:05 +00:00
parent b34a0fd18a
commit ba36b848eb
4 changed files with 17 additions and 3 deletions

View File

@@ -567,7 +567,7 @@ int file_exec(bContext *C, wmOperator *unused)
if(sfile->op) {
wmOperator *op= sfile->op;
sfile->op = NULL;
RNA_string_set(op->ptr, "filename", sfile->params->file);
BLI_strncpy(name, sfile->params->dir, sizeof(name));
@@ -1090,3 +1090,13 @@ void FILE_OT_delete(struct wmOperatorType *ot)
ot->poll= file_delete_poll; /* <- important, handler is on window level */
}
void ED_operatormacros_file(void)
{
wmOperatorType *ot;
ot= WM_operatortype_append_macro("FILE_OT_select_execute", "Select and Execute", OPTYPE_UNDO|OPTYPE_REGISTER);
WM_operatortype_macro_define(ot, "FILE_OT_select");
WM_operatortype_macro_define(ot, "FILE_OT_execute");
}