From b2fdc591c36cf5125eaa528b7f735c3c4393d390 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 20 Dec 2013 01:38:07 +0100 Subject: UI: restore confirmation popups for delete operators. It turned out this was leading to accidental deleting in some cases when the info message was missed by users. Fixes T37801. --- source/blender/editors/space_graph/graph_edit.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/space_graph') diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index a35395abaf2..0f3ba9865c4 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -908,17 +908,17 @@ static bool delete_graph_keys(bAnimContext *ac) /* ------------------- */ -static int graphkeys_delete_exec(bContext *C, wmOperator *op) +static int graphkeys_delete_exec(bContext *C, wmOperator *UNUSED(op)) { bAnimContext ac; - bool changed; /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) return OPERATOR_CANCELLED; /* delete keyframes */ - changed = delete_graph_keys(&ac); + if (!delete_graph_keys(&ac)) + return OPERATOR_CANCELLED; /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); @@ -926,9 +926,6 @@ static int graphkeys_delete_exec(bContext *C, wmOperator *op) /* set notifier that keyframes have changed */ WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); - if (changed) - BKE_report(op->reports, RPT_INFO, "Deleted selected keyframes"); - return OPERATOR_FINISHED; } @@ -940,6 +937,7 @@ void GRAPH_OT_delete(wmOperatorType *ot) ot->description = "Remove all selected keyframes"; /* api callbacks */ + ot->invoke = WM_operator_confirm; ot->exec = graphkeys_delete_exec; ot->poll = graphop_editable_keyframes_poll; -- cgit v1.2.3