Am Sonntag, 5. November 2006 04:13 schrieb Zurd:
> Finally, here it is, GPRename for gtk2-perl !
Hi,
good work! I sadly have to say, that i had no time todo GTK2 porting.
My Job took a lot of time the last half year. Fortunately I'll have vacatio=
n=20
in dezember :)
>
> Since they switch gtk-perl 1.x to gtk-perl 2.0, I think it makes
> sense to change gprename version from 1.x to 2.0. But note that
> this is GPRename 2.0 Beta, read on for why it's still in Beta.
>
> Even tough I say "finally here comes the new gprename", I must say
> it was a good thing that we waited. The function of the tree we
> were using was CList which is now deprecated, to replace it you
> must use TreeView and it is quite complex. To create a tree with
> this new function would have taken me quite some time. Fortunately,
> someone else already made a tree using TreeView and posted it for
> everyone to see at :
> http://mail.gnome.org/archives/gtk-perl-list/2006-October/msg00003.html
> which date from october 1. Only a month ago. Would have been quite
> hard to port to gtk2-perl before that.
>
> It took me a week of about 6 hours a day to port to gtk2-perl. I had
> to recode about 70% of the code. Especially because the code was really
> bad and I'm the one to blame for that :-) I didn't use an object-oriented
> way of coding and I just put new stuff in it before understanding the
> code first (I'm really lazy). But now since I had to use new functions
> instead of the deprecated ones, I had to understand everything. Also,
> the code is now much better in term of comments for documentation.
>
>
> Now, as for what as changed :
>
> On the first line we could see before :
> use strict;
> no strict "vars";
> Which is kind of funny, first use strict, and after use no strict,
> there's no point in it, use it or do not use it. Now we see :
> use strict 'vars'; # require variables to be declared before
> using them use strict 'subs';
>
> We also now use :
> use warnings; # print warning messages on the command line
> So if anyone sees warnings messages, tell the mailing list or fix it.
> Getting rid of the warning messages is a good programming habit of course.
>
> Because of the use strict now, we have to declare every variable that
> comes from other files, like the languages file, which is why there's a
> bunch of :
> our $str_button_apply;
> our $str_button_preview;
> our $str_button_undo;
> our $str_case_all_lo;
> our $str_case_all_up;
> ...
>
> The file bin/langs.pl changed to languages/langs.pl
>
> The section :
> ######################################
> # Tree and file/folder list #
> ######################################
> Is almost completely new since CList as I said was deprecated
> and so are all the functions related to it. Old functions like
> expand_tree, collapse_tree, has_sub_trees, select_item, show_files
> and show_files_recursive have been deleted in favor of the new
> ones : process_dir_at_iter, pathname_from_iter,
> populate_node, list_files_dirs, list_dir_in_tree
>
> The "at the end" option in "Insert / Delete" has been removed
> See "Help / Tips" in the menu on how to insert/delete text at
> the end. Looks more clear, simple and precise without showing
> the option.
>
> The position of the manipulation items at the bottom (insert/delete,
> case, replace/remove and numeric) have been changed, it's in a new
> order, kind of the less complicated to the more complicated from a
> user point of view.
>
> Now renaming the case with accents work, like e acute will give E
> acute (=E9 to =C9), before with version 1.7 it didn't work.
>
> New function : language_selected, that one is call when GPRename
> opens and when a user change the language, everything is rename
> automatically, no need to restart GPRename for the changes to take
> effect. There's only 2 label that I don't know how to change their
> text tough, see line 607 and 608. It's in the To Do.
>
> Now gtk2-perl finally comes with a Dialog window function. No
> need to create one from scratch, just call Gtk2::MessageDialog->new
> Very very handy.
>
> The function apply has now been broken into 2 smaller functions, it's
> so much more easy to read now. There is check_before_renaming,
> which checks for error (like if a file already exist with the name
> we want to rename it to) and there is also the function rename_now
> which do the actual renaming if everything is ok with
> check_before_renaming.
>
> The function : insdel, case, replace and numeric have been recoded
> completely, I especially like the new insdel with his 40 lines of code,
> before with gprename 1.7 it was 100 and looks so ugly ;)
> Tough with other functions it might be larger than with version 1.7
> because of all the initialisation of variables (good programming habit).
>
> In the insert/delete tab, the position has changed. Before, to insert
> text at the start, the position had to be 1, now it has to be 0.
>
> You can now see hidden files and folders in the tree, it's on by default,
> very nice from gtk2-perl.
>
> See the start of the file gprename.pl for URL links on documentation of
> gtk2-perl
>
> The language files TW for Taiwan has been removed, they contained too many
> empty strings.
>
>
> Now why this is GPRename 2.0 **Beta** : because I coded almost everything
> GPRename 1.7 had, but not all. To do :
>
> The undo function, now it doesn't work. I'm thinking of everytime there
> is a renaming to log it into ~/gprename-renaming.log and to undo the
> rename just read that file backwards.
>
> The recursive function doesn't work anymore. Have to recode it
> completely and that is a complex one :(
>
> The tree will not open in the directory you're in when you open it.
> Have to recode that also.
>
> The option "do not use the preview button" do not work also, I could
> code it right now and be finish with it in 5 minutes, but I'm
> thinking of getting rid of it in favor of an automatic preview.
> Everytime you change something in the manipulation items, it automatically
> call preview.
>
> Some strings in the language files have been changed. Other than
> english or french the other files have many empty strings.
> Translators : please help! :)
>
> So new version but less features. That is why it's in Beta, let's fix
> these things first and release an official version.
>
>
> So that's about it, I may have forgotten 1 or 2 things tough. It's
> quite a big update, next time I'll do a smaller one. I just couldn't
> stop coding for that past week.
>
> As usual, call "svn co https://svn.sourceforge.net/svnroot/gprename
> gprename" to get the new changes. Also the "Last log entry" column in SVN
> Browse doesn't show anything because I have no idea how to put something
> there, I never finished reading a book on SVN ;)
I'll have a look at the new code, to get to know it. I also will do the wor=
k=20
for the german translation.
Regards
Marvin Stark
=2D-=20
.""`. Marvin Stark <marv@...>
: :" : Homepage: http://www.der-marv.de
`. `"`
`- Debian - when you have better things to do than fix a system
|