diff options
author | Ton Roosendaal <ton@blender.org> | 2009-01-31 22:40:40 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-01-31 22:40:40 +0300 |
commit | 51ded6696a7a3efee923a4420a1ebde46a03753f (patch) | |
tree | 6f3715fc1bf8a9272647a7b3a486d57b0c13d50c /source/blender/editors/space_sequencer/sequencer_edit.c | |
parent | 59534ac58976515500fc174883d9a6f6d3217d62 (diff) |
2.5
Big commit, but mainly adminstration.
- Enabled ot->flag OPTYPE_UNDO to work.
- Removed all redundant ED_undo_pushes, but I'd
recommend everyone to check it while testing. :)
- Added view manipulations as OPTYPE_REGISTER,
although this will flood the redo stack a bit...
Nevertheless; for a "redo last action" panel we
can simply check if both flags are set for redo.
- Bugfix in editmode undo: selectmode was cleared,
so you couldn't select after undo
- Bugfix in mixing tweaks and keymaps... solution
works but is weak, need to think over a while.
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_edit.c')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 94 |
1 files changed, 53 insertions, 41 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 8771f85670e..8c70e1d9b2d 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -95,7 +95,6 @@ //static Sequence *_last_seq=0; //static int _last_seq_init=0; /* XXX */ -static void BIF_undo_push() {} static void error() {} static void waitcursor() {} static void activate_fileselect() {} @@ -211,7 +210,6 @@ static void change_plugin_seq(Scene *scene, char *str) /* called from fileselect if( seq_test_overlap(ed->seqbasep, last_seq) ) shuffle_seq(ed->seqbasep, last_seq); - BIF_undo_push("Load/Change Plugin, Sequencer"); } @@ -485,7 +483,6 @@ void deselect_all_seq(Scene *scene) } SEQ_END - //BIF_undo_push("(De)select all Strips, Sequencer"); - manage undo elsewhere for 2.5, campbell } void recurs_sel_seq(Sequence *seqm) @@ -693,7 +690,6 @@ void change_sequence(Scene *scene) } update_changed_seq_and_deps(scene, last_seq, 0, 1); - BIF_undo_push("Change Strip Effect, Sequencer"); } } else if(last_seq->type == SEQ_IMAGE) { @@ -1334,7 +1330,6 @@ void seq_remap_paths(Scene *scene) } SEQ_END - BIF_undo_push("Remap Paths, Sequencer"); } @@ -1360,7 +1355,6 @@ void no_gaps(Scene *scene) } } - BIF_undo_push("No Gaps, Sequencer"); } #if 0 @@ -1430,7 +1424,6 @@ void seq_snap(Scene *scene, short event) /* as last: */ sort_seq(scene); - BIF_undo_push("Snap Strips, Sequencer"); } void seq_snap_menu(Scene *scene) @@ -1473,8 +1466,6 @@ static int sequencer_mute_exec(bContext *C, wmOperator *op) } } - ED_undo_push(C, "Mute Strips, Sequencer"); - ED_area_tag_redraw(CTX_wm_area(C)); return OPERATOR_FINISHED; @@ -1490,8 +1481,10 @@ void SEQUENCER_OT_mute(struct wmOperatorType *ot) ot->exec= sequencer_mute_exec; ot->poll= ED_operator_sequencer_active; - ot->flag= OPTYPE_REGISTER; - + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + RNA_def_enum(ot->srna, "type", sequencer_prop_operate_types, SEQ_SELECTED, "Type", ""); } @@ -1525,8 +1518,6 @@ static int sequencer_unmute_exec(bContext *C, wmOperator *op) } } - ED_undo_push(C, "UnMute Strips, Sequencer"); - ED_area_tag_redraw(CTX_wm_area(C)); return OPERATOR_FINISHED; @@ -1542,8 +1533,10 @@ void SEQUENCER_OT_unmute(struct wmOperatorType *ot) ot->exec= sequencer_unmute_exec; ot->poll= ED_operator_sequencer_active; - ot->flag= OPTYPE_REGISTER; - + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + RNA_def_enum(ot->srna, "type", sequencer_prop_operate_types, SEQ_SELECTED, "Type", ""); } @@ -1564,8 +1557,6 @@ static int sequencer_lock_exec(bContext *C, wmOperator *op) } } - ED_undo_push(C, "Lock Strips, Sequencer"); - ED_area_tag_redraw(CTX_wm_area(C)); return OPERATOR_FINISHED; @@ -1581,7 +1572,9 @@ void SEQUENCER_OT_lock(struct wmOperatorType *ot) ot->exec= sequencer_lock_exec; ot->poll= ED_operator_sequencer_active; - ot->flag= OPTYPE_REGISTER; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } /* unlock operator */ @@ -1600,7 +1593,6 @@ static int sequencer_unlock_exec(bContext *C, wmOperator *op) } } - ED_undo_push(C, "UnLock Strips, Sequencer"); ED_area_tag_redraw(CTX_wm_area(C)); return OPERATOR_FINISHED; @@ -1616,7 +1608,9 @@ void SEQUENCER_OT_unlock(struct wmOperatorType *ot) ot->exec= sequencer_unlock_exec; ot->poll= ED_operator_sequencer_active; - ot->flag= OPTYPE_REGISTER; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } /* reload operator */ @@ -1635,8 +1629,6 @@ static int sequencer_reload_exec(bContext *C, wmOperator *op) } } - ED_undo_push(C, "UnLock Strips, Sequencer"); - ED_area_tag_redraw(CTX_wm_area(C)); return OPERATOR_FINISHED; @@ -1652,7 +1644,9 @@ void SEQUENCER_OT_reload(struct wmOperatorType *ot) ot->exec= sequencer_reload_exec; ot->poll= ED_operator_sequencer_active; - ot->flag= OPTYPE_REGISTER; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } /* reload operator */ @@ -1666,8 +1660,6 @@ static int sequencer_refresh_all_exec(bContext *C, wmOperator *op) free_imbuf_seq(&ed->seqbase); - ED_undo_push(C, "Refresh, Sequencer"); - ED_area_tag_redraw(CTX_wm_area(C)); return OPERATOR_FINISHED; @@ -1683,7 +1675,9 @@ void SEQUENCER_OT_refresh_all(struct wmOperatorType *ot) ot->exec= sequencer_refresh_all_exec; ot->poll= ED_operator_sequencer_active; - ot->flag= OPTYPE_REGISTER; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } /* cut operator */ @@ -1742,7 +1736,6 @@ static int sequencer_cut_exec(bContext *C, wmOperator *op) } if (changed) { - ED_undo_push(C, "Cut Strips, Sequencer"); ED_area_tag_redraw(CTX_wm_area(C)); } @@ -1780,8 +1773,10 @@ void SEQUENCER_OT_cut(struct wmOperatorType *ot) ot->exec= sequencer_cut_exec; ot->poll= ED_operator_sequencer_active; - ot->flag= OPTYPE_REGISTER; - + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + RNA_def_int(ot->srna, "frame", 0, INT_MIN, INT_MAX, "Frame", "Frame where selected strips will be cut", INT_MIN, INT_MAX); RNA_def_enum(ot->srna, "type", prop_cut_types, SEQ_CUT_SOFT, "Type", "the type of cut operation to perform on strips"); RNA_def_enum(ot->srna, "side", prop_side_types, SEQ_SIDE_BOTH, "Side", "The side that remains selected after cutting"); @@ -1801,7 +1796,6 @@ static int sequencer_add_duplicate_exec(bContext *C, wmOperator *op) recurs_dupli_seq(scene, ed->seqbasep, &new); addlisttolist(ed->seqbasep, &new); - ED_undo_push(C, "Cut Strips, Sequencer"); ED_area_tag_redraw(CTX_wm_area(C)); return OPERATOR_FINISHED; @@ -1829,7 +1823,10 @@ void SEQUENCER_OT_add_duplicate(wmOperatorType *ot) ot->exec= sequencer_add_duplicate_exec; ot->poll= ED_operator_sequencer_active; - + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + /* to give to transform */ RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX); } @@ -1889,7 +1886,6 @@ static int sequencer_delete_exec(bContext *C, wmOperator *op) ms= ms->prev; } - ED_undo_push(C, "Delete Strip(s), Sequencer"); //ED_area_tag_redraw(CTX_wm_area(C)); WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, NULL); /* redraw other sequencer views */ @@ -1909,6 +1905,9 @@ void SEQUENCER_OT_delete(wmOperatorType *ot) ot->exec= sequencer_delete_exec; ot->poll= ED_operator_sequencer_active; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } @@ -1982,7 +1981,6 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op) /* as last: */ sort_seq(scene); - ED_undo_push(C, "Separate Image Strips, Sequencer"); ED_area_tag_redraw(CTX_wm_area(C)); return OPERATOR_FINISHED; @@ -2000,6 +1998,9 @@ void SEQUENCER_OT_separate_images(wmOperatorType *ot) ot->exec= sequencer_separate_images_exec; ot->poll= ED_operator_sequencer_active; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } @@ -2027,7 +2028,6 @@ static int sequencer_meta_toggle_exec(bContext *C, wmOperator *op) set_last_seq(scene, NULL); - ED_undo_push(C, "Enter Meta Strip, Sequence"); } else { /* Exit Metastrip (if possible) */ @@ -2053,7 +2053,6 @@ static int sequencer_meta_toggle_exec(bContext *C, wmOperator *op) MEM_freeN(ms); - ED_undo_push(C, "Exit Meta Strip, Sequence"); } ED_area_tag_redraw(CTX_wm_area(C)); @@ -2070,6 +2069,9 @@ void SEQUENCER_OT_meta_toggle(wmOperatorType *ot) ot->exec= sequencer_meta_toggle_exec; ot->poll= ED_operator_sequencer_active; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } @@ -2157,8 +2159,6 @@ static int sequencer_meta_make_exec(bContext *C, wmOperator *op) if( seq_test_overlap(ed->seqbasep, seqm) ) shuffle_seq(ed->seqbasep, seqm); - ED_undo_push(C, "Make Meta Strip, Sequencer"); - ED_area_tag_redraw(CTX_wm_area(C)); return OPERATOR_FINISHED; } @@ -2174,6 +2174,9 @@ void SEQUENCER_OT_meta_make(wmOperatorType *ot) ot->exec= sequencer_meta_make_exec; ot->poll= ED_operator_sequencer_active; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } @@ -2225,8 +2228,6 @@ static int sequencer_meta_separate_exec(bContext *C, wmOperator *op) sort_seq(scene); - ED_undo_push(C, "UnMeta Strip, Sequencer"); - ED_area_tag_redraw(CTX_wm_area(C)); return OPERATOR_FINISHED; } @@ -2242,6 +2243,9 @@ void SEQUENCER_OT_meta_separate(wmOperatorType *ot) ot->exec= sequencer_meta_separate_exec; ot->poll= ED_operator_sequencer_active; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } /* view_all operator */ @@ -2304,6 +2308,9 @@ void SEQUENCER_OT_view_all(wmOperatorType *ot) ot->exec= sequencer_view_all_exec; ot->poll= ED_operator_sequencer_active; + + /* flags */ + ot->flag= OPTYPE_REGISTER; } @@ -2381,6 +2388,9 @@ void SEQUENCER_OT_view_selected(wmOperatorType *ot) ot->exec= sequencer_view_selected_exec; ot->poll= ED_operator_sequencer_active; + + /* flags */ + ot->flag= OPTYPE_REGISTER; } @@ -2415,7 +2425,6 @@ static int sequencer_view_zoom_exec(bContext *C, wmOperator *op) UI_view2d_curRect_validate(v2d); UI_view2d_sync(sc, area, v2d, V2D_LOCK_COPY); - ED_undo_push(C,"Zoom View, Sequencer"); return OPERATOR_FINISHED; } @@ -2433,7 +2442,10 @@ void SEQUENCER_OT_view_zoom(wmOperatorType *ot) ot->modal= WM_border_select_modal; ot->poll= ED_operator_sequencer_active; - + + /* flags */ + ot->flag= OPTYPE_REGISTER; + /* rna */ RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX); RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX); |