Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2013-12-20 04:38:07 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2013-12-20 04:40:33 +0400
commitb2fdc591c36cf5125eaa528b7f735c3c4393d390 (patch)
tree8f0525ef93d8336a373810b821155bf04995f0bd /source/blender/editors/space_action
parent29e3b098253270d4c5cf8337ad068bf4e98d7bdb (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_action')
-rw-r--r--source/blender/editors/space_action/action_edit.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c
index aafbc6af558..7142a6339a3 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -823,17 +823,17 @@ static bool delete_action_keys(bAnimContext *ac)
/* ------------------- */
-static int actkeys_delete_exec(bContext *C, wmOperator *op)
+static int actkeys_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_action_keys(&ac);
+ if (!delete_action_keys(&ac))
+ return OPERATOR_CANCELLED;
/* validate keyframes after editing */
if (!ELEM(ac.datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK))
@@ -842,9 +842,6 @@ static int actkeys_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;
}
@@ -856,6 +853,7 @@ void ACTION_OT_delete(wmOperatorType *ot)
ot->description = "Remove all selected keyframes";
/* api callbacks */
+ ot->invoke = WM_operator_confirm;
ot->exec = actkeys_delete_exec;
ot->poll = ED_operator_action_active;