feature request: xffm: multi-rename

edscott wilson garcia edscott at imp.mx
Sun Jan 18 15:22:46 CET 2004


On Sat, 2004-01-17 at 21:39, purslow at sympatico.ca wrote:

> 
> hmm, this is not very clear.  my picture of the utility is roughly:
> the user selects multiple files in Xffm, then clicks on 'rename';
> there appears a small window which says:
> 'rename selected files: replace 1st instance of [input box] with [input box]';
> after the user fills in the boxes & clicks 'ok',

All the best reason to try writing the code since you best understand
the way it should be presented.

> the simple 'rename' utility (above) is called invisibly
> & the change of names takes place & appears in the Xffm listing.
> it wb nice to have a 'test' or 'pretend' feature too, but that wb more work.

The pretend is not difficult. Just put a section of the code to print
out the "would be" commands to the diagnostics window and add a checkbox
to the dialog window. Probably a good idea to start with the pretend
mode until you are sure the constructed command is right. Use the
print_diagnostics() function for that (examples all over xffm).  I
always do a pretend while coding features, although I don't usually
leave the option open unless configured with --enable-debug.

> 
> i'm willing to treat this as an exercise in learning more programming,
> but it wb nice if you cb a bit clearer now you know what i have in mind.
> if i do it, it won't be immediate, but wb on my list,
> as i believe this is an important missing feature in Xffm.

The dialog is very easy to code --if you use glade--. Take one of the
glade files in xffm/glade as an example and use glade to build all
tedious gtk code. Link the glade_gui code into xffm by modifying
libs/Makefile.am and running ./autogen. After that all you have to do is
worry about when to create the window, modifying libs/menu.i to change
the callback for the rename function. Ok, so now you got your dialog
running when rename is selected, then all that remains is to interact
with the user and create command and execute. libs/find.c is a good
example of a self-contained dialog with all necesary callbacks you could
use.





More information about the Xfce-dev mailing list