diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-10 23:56:13 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-10 23:56:13 +0400 |
commit | 2e3e044d27e90dc87bdce6af9cef77d9543e4d89 (patch) | |
tree | 4d87ed9c283fd99baf9d23d4b8ace0868972f156 /source/blender/editors/space_sequencer/sequencer_edit.c | |
parent | a95c68a3eaa692f742e7f2e626b65daa71727c17 (diff) |
RNA
* Enums can now be dynamically created in the _itemf callback,
using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking
for enum items now need to potentially free the items.
* This callback now also gets context, this was added specifically
for operators. This doesn't fit design well at all, needed to do
some ugly hacks, but can't find a good solution at the moment.
* All enums must have a default list of items too, even with an
_itemf callback, for docs and fallback in case there is no context.
* Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation.
* Also changes some operator properties that were enums to booleas
(unselected, deselect), to make them consistent with other ops.
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_edit.c')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index a030603996c..868897b76ac 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -122,11 +122,6 @@ EnumPropertyItem sequencer_prop_effect_types[] = { }; /* mute operator */ -EnumPropertyItem sequencer_prop_operate_types[] = { /* better name? */ - {SEQ_SELECTED, "SELECTED", 0, "Selected", ""}, - {SEQ_UNSELECTED, "UNSELECTED", 0, "Unselected ", ""}, - {0, NULL, 0, NULL, NULL} -}; EnumPropertyItem prop_side_types[] = { {SEQ_SIDE_LEFT, "LEFT", 0, "Left", ""}, @@ -1491,8 +1486,7 @@ static int sequencer_mute_exec(bContext *C, wmOperator *op) if(ed==NULL) return OPERATOR_CANCELLED; - selected= RNA_enum_is_equal(op->ptr, "type", "SELECTED"); - + selected= !RNA_boolean_get(op->ptr, "unselected"); for(seq= ed->seqbasep->first; seq; seq= seq->next) { if ((seq->flag & SEQ_LOCK)==0) { @@ -1528,7 +1522,7 @@ void SEQUENCER_OT_mute(struct wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_enum(ot->srna, "type", sequencer_prop_operate_types, SEQ_SELECTED, "Type", ""); + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Mute unselected rather than selected strips."); } @@ -1543,8 +1537,7 @@ static int sequencer_unmute_exec(bContext *C, wmOperator *op) if(ed==NULL) return OPERATOR_CANCELLED; - selected= RNA_enum_is_equal(op->ptr, "type", "SELECTED"); - + selected= !RNA_boolean_get(op->ptr, "unselected"); for(seq= ed->seqbasep->first; seq; seq= seq->next) { if ((seq->flag & SEQ_LOCK)==0) { @@ -1580,7 +1573,7 @@ void SEQUENCER_OT_unmute(struct wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_enum(ot->srna, "type", sequencer_prop_operate_types, SEQ_SELECTED, "Type", ""); + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "UnMute unselected rather than selected strips."); } |