diff options
author | Andrea Weikert <elubie@gmx.net> | 2009-07-06 02:26:43 +0400 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2009-07-06 02:26:43 +0400 |
commit | f08124a3e2e853443d1a2745d66bb9eb0fd4565d (patch) | |
tree | 772152a7ca54ed4ecc9dc9e43d6f36f32fc9ed45 /source/blender/editors/space_file/file_ops.c | |
parent | d390ee1b60a51701b1ba1377a8ac3b999bdfb15c (diff) |
2.5 filebrowser
* bringing back file numbering operator (PADPLUSKEY, PADMINUS)
* Note: discovered conflicting key with View2D zooming that causes it to not work in panel area.
Diffstat (limited to 'source/blender/editors/space_file/file_ops.c')
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index aaa1793efbb..fa377c06184 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -685,3 +685,32 @@ void FILE_OT_bookmark_toggle(struct wmOperatorType *ot) ot->exec= file_bookmark_toggle_exec; ot->poll= ED_operator_file_active; /* <- important, handler is on window level */ } + + +int file_filenum_exec(bContext *C, wmOperator *op) +{ + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + + int inc = RNA_int_get(op->ptr, "increment"); + if(sfile->params && (inc != 0)) { + BLI_newname(sfile->params->file, inc); + WM_event_add_notifier(C, NC_WINDOW, NULL); + } + + return OPERATOR_FINISHED; + +} + +void FILE_OT_filenum(struct wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Increment Number in Filename"; + ot->idname= "FILE_OT_filenum"; + + /* api callbacks */ + ot->exec= file_filenum_exec; + ot->poll= ED_operator_file_active; /* <- important, handler is on window level */ + + /* props */ + RNA_def_int(ot->srna, "increment", 1, 0, 100, "Increment", "", 0,100); +}
\ No newline at end of file |