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_clip/clip_graph_ops.c | |
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_clip/clip_graph_ops.c')
-rw-r--r-- | source/blender/editors/space_clip/clip_graph_ops.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/editors/space_clip/clip_graph_ops.c b/source/blender/editors/space_clip/clip_graph_ops.c index ffb805cdc5f..e0062ecd243 100644 --- a/source/blender/editors/space_clip/clip_graph_ops.c +++ b/source/blender/editors/space_clip/clip_graph_ops.c @@ -43,7 +43,6 @@ #include "BKE_movieclip.h" #include "BKE_tracking.h" #include "BKE_depsgraph.h" -#include "BKE_report.h" #include "WM_api.h" #include "WM_types.h" @@ -472,18 +471,17 @@ void CLIP_OT_graph_select_all_markers(wmOperatorType *ot) /******************** delete curve operator ********************/ -static int delete_curve_exec(bContext *C, wmOperator *op) +static int delete_curve_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking); - if (act_track) { - clip_delete_track(C, clip, act_track); + if (!act_track) + return OPERATOR_CANCELLED; - BKE_report(op->reports, RPT_INFO, "Deleted track"); - } + clip_delete_track(C, clip, act_track); return OPERATOR_FINISHED; } @@ -496,6 +494,7 @@ void CLIP_OT_graph_delete_curve(wmOperatorType *ot) ot->idname = "CLIP_OT_graph_delete_curve"; /* api callbacks */ + ot->invoke = WM_operator_confirm; ot->exec = delete_curve_exec; ot->poll = ED_space_clip_tracking_poll; |