diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-31 21:03:31 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-31 21:03:31 +0400 |
commit | d705c52e659e63e07d22433c517fdddb2a5643bf (patch) | |
tree | 2bcdbbcfb17f6af17971c67314809b6ae10b9852 /source/blender/windowmanager/intern/wm_event_system.c | |
parent | 5dfe20d87ba8ea9957e679a1e9cd7926ac8d1cd8 (diff) |
no longer use 'check_existing' to see if we need to have a save popup, instead use 'exec' operator on a saved file and
invoke on unsaved files.
correct missing memset --> CustomData_reset switch too.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_event_system.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 87 |
1 files changed, 35 insertions, 52 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 031deb1f010..1900966b5bd 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1576,72 +1576,55 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa /* needed for uiPupMenuReports */ if (event->val == EVT_FILESELECT_EXEC) { -#if 0 // use REDALERT now + int retval; - /* a bit weak, might become arg for WM_event_fileselect? */ - /* XXX also extension code in image-save doesnt work for this yet */ - if (RNA_struct_find_property(handler->op->ptr, "check_existing") && - RNA_boolean_get(handler->op->ptr, "check_existing")) - { - char *path = RNA_string_get_alloc(handler->op->ptr, "filepath", NULL, 0); - /* this gives ownership to pupmenu */ - uiPupMenuSaveOver(C, handler->op, (path) ? path : ""); - if (path) - MEM_freeN(path); - } - else -#endif - { - int retval; - - if (handler->op->type->flag & OPTYPE_UNDO) - wm->op_undo_depth++; - - retval = handler->op->type->exec(C, handler->op); + if (handler->op->type->flag & OPTYPE_UNDO) + wm->op_undo_depth++; - /* XXX check this carefully, CTX_wm_manager(C) == wm is a bit hackish */ - if (handler->op->type->flag & OPTYPE_UNDO && CTX_wm_manager(C) == wm) - wm->op_undo_depth--; + retval = handler->op->type->exec(C, handler->op); - if (retval & OPERATOR_FINISHED) - if (G.debug & G_DEBUG_WM) - wm_operator_print(C, handler->op); + /* XXX check this carefully, CTX_wm_manager(C) == wm is a bit hackish */ + if (handler->op->type->flag & OPTYPE_UNDO && CTX_wm_manager(C) == wm) + wm->op_undo_depth--; + + if (retval & OPERATOR_FINISHED) + if (G.debug & G_DEBUG_WM) + wm_operator_print(C, handler->op); - /* XXX check this carefully, CTX_wm_manager(C) == wm is a bit hackish */ - if (CTX_wm_manager(C) == wm && wm->op_undo_depth == 0) - if (handler->op->type->flag & OPTYPE_UNDO) - ED_undo_push_op(C, handler->op); + /* XXX check this carefully, CTX_wm_manager(C) == wm is a bit hackish */ + if (CTX_wm_manager(C) == wm && wm->op_undo_depth == 0) + if (handler->op->type->flag & OPTYPE_UNDO) + ED_undo_push_op(C, handler->op); - if (handler->op->reports->list.first) { + if (handler->op->reports->list.first) { - /* FIXME, temp setting window, this is really bad! + /* FIXME, temp setting window, this is really bad! * only have because lib linking errors need to be seen by users :( * it can be removed without breaking anything but then no linking errors - campbell */ - wmWindow *win_prev = CTX_wm_window(C); - ScrArea *area_prev = CTX_wm_area(C); - ARegion *ar_prev = CTX_wm_region(C); + wmWindow *win_prev = CTX_wm_window(C); + ScrArea *area_prev = CTX_wm_area(C); + ARegion *ar_prev = CTX_wm_region(C); - if (win_prev == NULL) - CTX_wm_window_set(C, CTX_wm_manager(C)->windows.first); + if (win_prev == NULL) + CTX_wm_window_set(C, CTX_wm_manager(C)->windows.first); - handler->op->reports->printlevel = RPT_WARNING; - uiPupMenuReports(C, handler->op->reports); + handler->op->reports->printlevel = RPT_WARNING; + uiPupMenuReports(C, handler->op->reports); - /* XXX - copied from 'wm_operator_finished()' */ - /* add reports to the global list, otherwise they are not seen */ - BLI_movelisttolist(&CTX_wm_reports(C)->list, &handler->op->reports->list); - - CTX_wm_window_set(C, win_prev); - CTX_wm_area_set(C, area_prev); - CTX_wm_region_set(C, ar_prev); - } + /* XXX - copied from 'wm_operator_finished()' */ + /* add reports to the global list, otherwise they are not seen */ + BLI_movelisttolist(&CTX_wm_reports(C)->list, &handler->op->reports->list); - if (retval & OPERATOR_FINISHED) { - WM_operator_last_properties_store(handler->op); - } + CTX_wm_window_set(C, win_prev); + CTX_wm_area_set(C, area_prev); + CTX_wm_region_set(C, ar_prev); + } - WM_operator_free(handler->op); + if (retval & OPERATOR_FINISHED) { + WM_operator_last_properties_store(handler->op); } + + WM_operator_free(handler->op); } else { if (handler->op->type->cancel) { |