diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2013-11-26 03:38:50 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2013-11-29 20:49:01 +0400 |
commit | cedc90b6077a01a60f589f09a5c82f4b7a359a4b (patch) | |
tree | e6c24bf3fdb0aa2286c744e30ce45b10c8cb0085 /source/blender | |
parent | 77719bfd0669cc675ad729f4c51672173842faca (diff) |
Fix errors and inconsistencies in confirmation popup removal.
* Improve some clip editor messages
* Remove popup for metastrips, seems unnecessary
* Renamed some variables for consistency
* Avoid unnecessary call to CTX_DATA_COUNT
Reviewed By: sergey, campbellbarton, aligorith
Differential Revision: http://developer.blender.org/D44
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 8 | ||||
-rw-r--r-- | source/blender/editors/armature/armature_edit.c | 12 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_ops.c | 16 | ||||
-rw-r--r-- | source/blender/editors/object/object_add.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_graph_ops.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_clip/tracking_ops.c | 15 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 6 |
7 files changed, 37 insertions, 32 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 6711df5f63a..07cc16aa5b6 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -1476,7 +1476,7 @@ void ANIM_OT_keyframe_delete(wmOperatorType *ot) static int clear_anim_v3d_exec(bContext *C, wmOperator *op) { - int removed_tot = 0; + int num_deleted = 0; CTX_DATA_BEGIN (C, Object *, ob, selected_objects) { @@ -1517,7 +1517,7 @@ static int clear_anim_v3d_exec(bContext *C, wmOperator *op) /* delete F-Curve completely */ if (can_delete) { ANIM_fcurve_delete_from_animdata(NULL, adt, fcu); - removed_tot++; + num_deleted++; } } } @@ -1527,8 +1527,8 @@ static int clear_anim_v3d_exec(bContext *C, wmOperator *op) } CTX_DATA_END; - if (removed_tot > 0) - BKE_reportf(op->reports, RPT_INFO, "Deleted %d animation f-curves from selected objects", removed_tot); + if (num_deleted > 0) + BKE_reportf(op->reports, RPT_INFO, "Deleted %d animation F-Curves from selected objects", num_deleted); /* send updates */ WM_event_add_notifier(C, NC_OBJECT | ND_KEYS, NULL); diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c index e5fc6c910c0..c284769ff5c 100644 --- a/source/blender/editors/armature/armature_edit.c +++ b/source/blender/editors/armature/armature_edit.c @@ -989,6 +989,7 @@ static int armature_align_bones_exec(bContext *C, wmOperator *op) bArmature *arm = (bArmature *)ob->data; EditBone *actbone = CTX_data_active_bone(C); EditBone *actmirb = NULL; + int num_selected_bones; /* there must be an active bone */ if (actbone == NULL) { @@ -1011,7 +1012,8 @@ static int armature_align_bones_exec(bContext *C, wmOperator *op) /* if there is only 1 selected bone, we assume that that is the active bone, * since a user will need to have clicked on a bone (thus selecting it) to make it active */ - if (CTX_DATA_COUNT(C, selected_editable_bones) <= 1) { + num_selected_bones = CTX_DATA_COUNT(C, selected_editable_bones); + if (num_selected_bones <= 1) { /* When only the active bone is selected, and it has a parent, * align it to the parent, as that is the only possible outcome. */ @@ -1045,7 +1047,7 @@ static int armature_align_bones_exec(bContext *C, wmOperator *op) } CTX_DATA_END; - BKE_reportf(op->reports, RPT_INFO, "%d bones aligned to bone '%s'", CTX_DATA_COUNT(C, selected_editable_bones), actbone->name); + BKE_reportf(op->reports, RPT_INFO, "%d bones aligned to bone '%s'", num_selected_bones, actbone->name); } /* note, notifier might evolve */ @@ -1117,7 +1119,7 @@ static int armature_delete_selected_exec(bContext *C, wmOperator *op) EditBone *curBone, *ebone_next; bConstraint *con; Object *obedit = CTX_data_edit_object(C); // XXX get from context - int removed_tot = 0; + int num_deleted = 0; arm = obedit->data; /* cancel if nothing selected */ @@ -1174,12 +1176,12 @@ static int armature_delete_selected_exec(bContext *C, wmOperator *op) if (curBone->flag & BONE_SELECTED) { if (curBone == arm->act_edbone) arm->act_edbone = NULL; ED_armature_edit_bone_remove(arm, curBone); - removed_tot++; + num_deleted++; } } } - BKE_reportf(op->reports, RPT_INFO, "Deleted %d bones", removed_tot); + BKE_reportf(op->reports, RPT_INFO, "Deleted %d bones", num_deleted); ED_armature_sync_selection(arm->edbo); diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c index a4943373288..7d7960d2e86 100644 --- a/source/blender/editors/mask/mask_ops.c +++ b/source/blender/editors/mask/mask_ops.c @@ -1036,19 +1036,17 @@ static int delete_exec(bContext *C, wmOperator *op) } } - if (num_deleted == 0) { + if (num_deleted == 0) return OPERATOR_CANCELLED; - } - else { - /* TODO: only update edited splines */ - BKE_mask_update_display(mask, CFRA); - WM_event_add_notifier(C, NC_MASK | NA_EDITED, mask); + /* TODO: only update edited splines */ + BKE_mask_update_display(mask, CFRA); - BKE_reportf(op->reports, RPT_INFO, "Deleted selected control points from mask '%s'", mask->id.name); + WM_event_add_notifier(C, NC_MASK | NA_EDITED, mask); - return OPERATOR_FINISHED; - } + BKE_reportf(op->reports, RPT_INFO, "Deleted %d control points from mask '%s'", num_deleted, mask->id.name); + + return OPERATOR_FINISHED; } void MASK_OT_delete(wmOperatorType *ot) diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 8496aaaab4c..798bf7c6318 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1057,7 +1057,7 @@ static int object_delete_exec(bContext *C, wmOperator *op) wmWindowManager *wm = CTX_wm_manager(C); wmWindow *win; const short use_global = RNA_boolean_get(op->ptr, "use_global"); - int deleted_num = 0; + int num_deleted = 0; if (CTX_data_edit_object(C)) return OPERATOR_CANCELLED; @@ -1069,7 +1069,7 @@ static int object_delete_exec(bContext *C, wmOperator *op) /* remove from current scene only */ ED_base_object_free_and_unlink(bmain, scene, base); - deleted_num++; + num_deleted++; if (use_global) { Scene *scene_iter; @@ -1104,8 +1104,8 @@ static int object_delete_exec(bContext *C, wmOperator *op) } } - if (deleted_num > 0) - BKE_reportf(op->reports, RPT_INFO, "Deleted %d objects", deleted_num); + if (num_deleted > 0) + BKE_reportf(op->reports, RPT_INFO, "Deleted %d objects", num_deleted); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_clip/clip_graph_ops.c b/source/blender/editors/space_clip/clip_graph_ops.c index 2a9bc497215..ffb805cdc5f 100644 --- a/source/blender/editors/space_clip/clip_graph_ops.c +++ b/source/blender/editors/space_clip/clip_graph_ops.c @@ -482,7 +482,7 @@ static int delete_curve_exec(bContext *C, wmOperator *op) if (act_track) { clip_delete_track(C, clip, act_track); - BKE_report(op->reports, RPT_INFO, "Deleted all selected curves"); + BKE_report(op->reports, RPT_INFO, "Deleted track"); } return OPERATOR_FINISHED; @@ -492,7 +492,7 @@ void CLIP_OT_graph_delete_curve(wmOperatorType *ot) { /* identifiers */ ot->name = "Delete Curve"; - ot->description = "Delete selected curves"; + ot->description = "Delete track corresponding to the selected curve"; ot->idname = "CLIP_OT_graph_delete_curve"; /* api callbacks */ diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index 3e3e8d81d79..b198b68b95a 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -263,8 +263,10 @@ static int delete_track_exec(bContext *C, wmOperator *op) while (track) { next = track->next; - if (TRACK_VIEW_SELECTED(sc, track)) + if (TRACK_VIEW_SELECTED(sc, track)) { clip_delete_track(C, clip, track); + changed = true; + } track = next; } @@ -273,7 +275,7 @@ static int delete_track_exec(bContext *C, wmOperator *op) sc->flag &= ~SC_LOCK_SELECTION; if (changed) { - BKE_report(op->reports, RPT_INFO, "Deleted all selected tracks"); + BKE_report(op->reports, RPT_INFO, "Deleted selected tracks"); WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, clip); } @@ -307,6 +309,7 @@ static int delete_marker_exec(bContext *C, wmOperator *op) MovieTrackingPlaneTrack *plane_track, *plane_track_next; int framenr = ED_space_clip_get_clip_frame_number(sc); int has_selection = 0; + bool changed = false; while (track) { next = track->next; @@ -318,6 +321,7 @@ static int delete_marker_exec(bContext *C, wmOperator *op) has_selection |= track->markersnr > 1; clip_delete_marker(C, clip, track, marker); + changed = true; } } @@ -341,6 +345,8 @@ static int delete_marker_exec(bContext *C, wmOperator *op) else { BKE_tracking_plane_marker_delete(plane_track, framenr); } + + changed = true; } } } @@ -350,7 +356,10 @@ static int delete_marker_exec(bContext *C, wmOperator *op) sc->flag &= ~SC_LOCK_SELECTION; } - BKE_report(op->reports, RPT_INFO, "Deleted all selected markers"); + if (!changed) + return OPERATOR_CANCELLED; + + BKE_report(op->reports, RPT_INFO, "Deleted markers for current frame from selected tracks"); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index f7a44eac464..a0224b98cbb 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -2064,8 +2064,6 @@ static int sequencer_meta_make_exec(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); - BKE_report(op->reports, RPT_INFO, "Grouped selected strips into a metastrip"); - return OPERATOR_FINISHED; } @@ -2095,7 +2093,7 @@ static int seq_depends_on_meta(Sequence *seq, Sequence *seqm) } /* separate_meta_make operator */ -static int sequencer_meta_separate_exec(bContext *C, wmOperator *op) +static int sequencer_meta_separate_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); Editing *ed = BKE_sequencer_editing_get(scene, FALSE); @@ -2136,8 +2134,6 @@ static int sequencer_meta_separate_exec(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); - BKE_report(op->reports, RPT_INFO, "Metastrip content put back into the sequencer"); - return OPERATOR_FINISHED; } |