diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2013-12-20 04:38:07 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2013-12-20 04:40:33 +0400 |
commit | b2fdc591c36cf5125eaa528b7f735c3c4393d390 (patch) | |
tree | 8f0525ef93d8336a373810b821155bf04995f0bd /source/blender/editors/space_graph | |
parent | 29e3b098253270d4c5cf8337ad068bf4e98d7bdb (diff) |
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.
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r-- | source/blender/editors/space_graph/graph_edit.c | 10 |
1 files changed, 4 insertions, 6 deletions
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; |