diff -Nru gprename-2.6.6/bin/gprename gprename-20140325/bin/gprename --- gprename-2.6.6/bin/gprename 2011-12-01 02:43:43.000000000 +0000 +++ gprename-20140325/bin/gprename 2014-03-25 22:47:15.000000000 +0000 @@ -1,7 +1,8 @@ #!/usr/bin/perl # GPRename is a complete batch renamer for files and directories. -# GPRename 2.6.6 Copyright (C) 2011 gprename-users@lists.sourceforge.net + +# GPRename Copyright (C) 2014 gprename-users@lists.sourceforge.net # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License or @@ -23,9 +24,7 @@ # Linux Filesystem Hierarchy : http://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/usr.html # Tutorial on gettext : http://cpan.uwinnipeg.ca/htdocs/gettext/README.html # Gnu gettext : http://www.gnu.org/software/gettext/ - -# To get GPRename from SVN, install subversion and run : -# svn co https://gprename.svn.sourceforge.net/svnroot/gprename gprename +# .desktop specification : http://www.freedesktop.org/wiki/Howto_desktop_files/ # To create a gprename.po template file : # cd bin @@ -62,7 +61,7 @@ # set the locale setlocale(LC_ALL, ''); -bindtextdomain( 'gprename', '@INSTALLDIR@/share/locale'); +bindtextdomain( 'gprename', '/usr/local/share/locale'); textdomain( 'gprename' ); # Change the font to courier new for the Tree and the SimpleList @@ -92,7 +91,7 @@ my $status_bar_files=0; my $status_bar_dirs=0; my $status_bar_selected=0; -my $str_gprename_version='2.6'; +my $str_gprename_version='5'; # Hold a list of the Name and New Name column of files or directories # These are filled when calling &preview @@ -128,7 +127,7 @@ $window->add_accel_group( $accel_group ); # Set the window icon -my $icon = '@INSTALLDIR@/share/pixmaps/gprename/gprename.png'; +my $icon = '/usr/share/icons/gprename.png'; my $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file( $icon ); $window->set_icon( $pixbuf ); @@ -464,12 +463,12 @@ # in hbox1 my $numeric_start_label = new Gtk2::Label( decode('utf8',gettext('Add numbers starting at')) ); -my $numeric_start_adj = new Gtk2::Adjustment( 1, 0.0, 9000.0, 1.0, 5.0, 0.0 ); +my $numeric_start_adj = new Gtk2::Adjustment( 1, 0.0, 999999.0, 1.0, 5.0, 0.0 ); $numeric_start_adj->signal_connect( 'value_changed', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } } ); my $numeric_start_spin = new Gtk2::SpinButton( $numeric_start_adj, 0, 0 ); $numeric_start_spin->set_numeric(TRUE); my $numeric_increment_label = new Gtk2::Label( decode('utf8',gettext('and increment by')) ); -my $numeric_increment_adj = new Gtk2::Adjustment( 1, 1.0, 1000.0, 1.0, 1.0, 0.0 ); +my $numeric_increment_adj = new Gtk2::Adjustment( 1, 1.0, 9999.0, 1.0, 1.0, 0.0 ); $numeric_increment_adj->signal_connect( 'value_changed', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } } ); my $numeric_increment_spin = new Gtk2::SpinButton( $numeric_increment_adj, 0, 0 ); $numeric_increment_spin->set_numeric(TRUE); @@ -775,8 +774,8 @@ my @selected; my $treeview; my $page_file_or_dir = $file_dir_notebook->get_current_page; - if ( $page_file_or_dir == 0 ) { $treeview = $tv_files; } - if ( $page_file_or_dir == 1 ) { $treeview = $tv_dirs; } + if ( $page_file_or_dir == 0 ) { $treeview = $tv_files; } + if ( $page_file_or_dir == 1 ) { $treeview = $tv_dirs; } @selected = $treeview->get_selection->get_selected_rows; # Set $path @@ -786,7 +785,9 @@ $path = $tv_tree->get_model->get($iter_tmp) . '/' . $path; $iter_tmp = $tv_tree->get_model->iter_parent( $iter_tmp ); } - $path =~ s/\/{2,}/\//g; # replace double slash to only one + + # replace double dash to only one + $path =~ s/\/{2,}/\//g; $undo_path = $path; @@ -798,22 +799,30 @@ else { $name_old = substr( $column_name[$a], rindex($column_name[$a],'/')+1, length($column_name[$a]) ); } $name_new = $column_new_name[$a]; - # Check if a file or a directories already exist with the name we need + # Check if a file or a directory already exist with the name we need if ( $security == 1 and $exist == 0 and -e $path . $name_new ) { - my $dialog = Gtk2::MessageDialog->new ($window, 'modal', 'info', 'ok', decode('utf8',gettext('Cannot rename because it already exist.')) . '\n\n' . decode('utf8',gettext('Name')) . " : \$path$name_old\\n" . decode('utf8',gettext('New name')) . ": \$path$name_new\n"); + my $dialog = Gtk2::MessageDialog->new ($window, 'modal', 'info', 'ok', decode('utf8',gettext('Cannot rename because it already exist.')) . "\n\n" . decode('utf8',gettext('Name')) . " : $path$name_old" . "\n" . decode('utf8',gettext('New name')) . ": $path$name_new"); $dialog->run; $dialog->destroy; $exist=1; } + # Check if a file or a directory is more than 253 characters long, else after appending _gp the filename will be too long + if ( (length($name_old) >= 253) || (length($name_new) >= 253) ) { + my $dialog = Gtk2::MessageDialog->new ($window, 'modal', 'info', 'ok', decode('utf8',gettext('Cannot rename because the filename is too long.')) . "\n\n" . decode('utf8',gettext('Name')) . " : $path$name_old" . "\n\n" . decode('utf8',gettext('New name')) . ": $path$name_new"); + $dialog->run; + $dialog->destroy; + $exist=1; + } + # If the file or directory doesn't exist, then start renaming if ( $exist == 0 ) { # If the setting Trim Spaces is checked, then trim it if ( $settings{'trim_spaces'} == TRUE ) { - $name_new =~ s/^\s+//; #trim spaces at start - $name_new =~ s/\s+$//; #trim spaces at end - $name_new =~ s/\s{2,}/ /g; #replace more than 2 spaces to only 1 + $name_new =~ s/^\s+//; # trim spaces at start + $name_new =~ s/\s+$//; # trim spaces at end + $name_new =~ s/\s{2,}/ /g; # replace more than 2 spaces to only 1 } # Set $max_length for the log file @@ -824,10 +833,10 @@ $undo_newname[$a_undo] = $name_new; $a_undo++; - # We have to rename the files/dirs 2 times with "_tmp_gprename" because you can't + # We have to rename the files/dirs 2 times with "_gp" because you can't # rename the file "a" to "A" in one shot on a Windows filesystem $name_old = "$path$name_old"; - $name_tmp = "$name_old" . "_tmp_gprename"; + $name_tmp = "$name_old" . "_gp"; $name_new = "$path$name_new"; rename( $name_old, $name_tmp ) || print $! . "\n"; rename( $name_tmp, $name_new ); @@ -1294,8 +1303,8 @@ # We rename in reverse order to make sure we don't overwrite files/dirs foreach my $x (@undo_newname) { - rename( $undo_path . $x, $undo_path . $x . '_tmp_gprename' ); - rename( $undo_path . $x . '_tmp_gprename', $undo_path . $undo_oldname[$a] ); + rename( $undo_path . $x, $undo_path . $x . '_gp' ); + rename( $undo_path . $x . '_gp', $undo_path . $undo_oldname[$a] ); $a++; } @@ -1420,7 +1429,7 @@ my $dialog = Gtk2::Dialog->new( decode('utf8',gettext('About')), $window, 'destroy-with-parent', 'gtk-ok' => 'accept' ); $dialog->set_default_response( 'accept' ); $dialog->set_has_separator( TRUE ); - $dialog->set_default_size( 520, 410 ); + $dialog->set_default_size( 450, 260 ); my $about_sw = new Gtk2::ScrolledWindow( undef, undef ); $about_sw->set_policy( 'automatic', 'automatic' ); @@ -1431,51 +1440,18 @@ $buffer->create_tag( 'big', size => 15 * PANGO_SCALE ); $buffer->create_tag( 'italic', style => 'italic' ); my $iter = $buffer->get_start_iter; - my $icon = '@INSTALLDIR@/share/pixmaps/gprename/gprename.png'; + my $icon = '/usr/local/share/pixmaps/gprename/gprename.png'; my $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file( $icon ); $buffer->insert_pixbuf ($iter, $pixbuf); $buffer->insert_with_tags_by_name( $iter, "\n GPRename " . $str_gprename_version, 'bold', 'big' ); $buffer->insert_with_tags_by_name( $iter, "\n\nA complete batch renamer for files and directories." ); - $buffer->insert_with_tags_by_name( $iter, "\n\nCopyright (C) 2008 gprename-users\@lists.sourceforge.net" ); - $buffer->insert_with_tags_by_name( $iter, "\nSee the file COPYING for the license." ); $buffer->insert_with_tags_by_name( $iter, "\n\nMailing list", 'bold' ); $buffer->insert_with_tags_by_name( $iter, " - gprename-users\@lists.sourceforge.net" ); $buffer->insert_with_tags_by_name( $iter, "\nHome Page", 'bold' ); $buffer->insert_with_tags_by_name( $iter, " - http://gprename.sourceforge.net" ); $buffer->insert_with_tags_by_name( $iter, "\nWikipedia", 'bold' ); $buffer->insert_with_tags_by_name( $iter, " - http://en.wikipedia.org/wiki/GPRename" ); - $buffer->insert_with_tags_by_name( $iter, "\n\nCredits", 'bold' ); - $buffer->insert_with_tags_by_name( $iter, "\nAlbino Riganello", 'bold'); - $buffer->insert_with_tags_by_name( $iter, " - Translation: Italian (2.3)"); - $buffer->insert_with_tags_by_name( $iter, "\nBart'omiej Gródek", 'bold'); - $buffer->insert_with_tags_by_name( $iter, " - Translation: Polish (1.24-2.6)"); - $buffer->insert_with_tags_by_name( $iter, "\nDominik Fretz", 'bold'); - $buffer->insert_with_tags_by_name( $iter, " - Patch (<1.00)"); - $buffer->insert_with_tags_by_name( $iter, "\nDuane Toler", 'bold'); - $buffer->insert_with_tags_by_name( $iter, " - Bugs reports (<1.00)"); - $buffer->insert_with_tags_by_name( $iter, "\nJohan Spee", 'bold'); - $buffer->insert_with_tags_by_name( $iter, " - Logo, icon, bugs and features (2.1-2.2)"); - $buffer->insert_with_tags_by_name( $iter, "\nJose Oswaldo", 'bold'); - $buffer->insert_with_tags_by_name( $iter, " - Translation: Brazilian Portuguese (2.1-2.5)"); - $buffer->insert_with_tags_by_name( $iter, "\nMarcin Juszkiewicz", 'bold'); - $buffer->insert_with_tags_by_name( $iter, " - Debian package (0.92)"); - $buffer->insert_with_tags_by_name( $iter, "\nMartintxo", 'bold'); - $buffer->insert_with_tags_by_name( $iter, " - Translation: Spanish (1.21-2.1)"); - $buffer->insert_with_tags_by_name( $iter, "\nMarvin Stark", 'bold'); - $buffer->insert_with_tags_by_name( $iter, " - Maintainer, Debian packager (2.2-2.5)"); - $buffer->insert_with_tags_by_name( $iter, "\nnestor di", 'bold'); - $buffer->insert_with_tags_by_name( $iter, " - Logo and icon (1.20-2.0)"); - $buffer->insert_with_tags_by_name( $iter, "\nPetter Sundlöf", 'bold'); - $buffer->insert_with_tags_by_name( $iter, " - Install script (0.92-1.3)"); - $buffer->insert_with_tags_by_name( $iter, "\nSalman Farisy", 'bold'); - $buffer->insert_with_tags_by_name( $iter, " - Translation: Indonesian (2.4)"); - $buffer->insert_with_tags_by_name( $iter, "\nTristesse", 'bold'); - $buffer->insert_with_tags_by_name( $iter, " - Author (0.90-1.24)"); - $buffer->insert_with_tags_by_name( $iter, "\nWayne E. Nail", 'bold'); - $buffer->insert_with_tags_by_name( $iter, " - Bugs and features reports (2.0-2.5)"); - $buffer->insert_with_tags_by_name( $iter, "\nZurd", 'bold'); - $buffer->insert_with_tags_by_name( $iter, " - Maintainer (1.0-2.6)"); my $textview = Gtk2::TextView->new_with_buffer($buffer); $textview->set_editable( FALSE ); @@ -1528,7 +1504,12 @@ foreach my $x (@paths) { $path = $path . '/' . $x; if ( -e $path ) { - while ( decode('utf8',$x) ne $tv_tree->get_model->get($iter) and defined $iter ) { + if ( !defined $iter ) { + print "Permission denied for this folder!" . "\n"; + exit; + } + + while ( defined $iter and decode('utf8',$x) ne $tv_tree->get_model->get($iter) ) { $iter = $tv_tree->get_model->iter_next($iter); } if ( $iter ) { @@ -1540,6 +1521,10 @@ } } } + else { + print "Path doesn't exist!" . "\n"; + exit; + } } # List the files/directories diff -Nru gprename-2.6.6/bin/gprename.desktop gprename-20140325/bin/gprename.desktop --- gprename-2.6.6/bin/gprename.desktop 2011-12-01 02:43:43.000000000 +0000 +++ gprename-20140325/bin/gprename.desktop 2014-03-24 20:48:58.000000000 +0000 @@ -1,9 +1,9 @@ [Desktop Entry] -Version=2.6 +Version=1.0 Name=GPRename Comment=To rename files and directories in batch Exec=gprename -Icon=@INSTALLDIR@/share/pixmaps/gprename/gprename.png +Icon=gprename Terminal=false Type=Application -Categories=Utility;FileManager; +Categories=Utility; diff -Nru gprename-2.6.6/build/gprename gprename-20140325/build/gprename --- gprename-2.6.6/build/gprename 1970-01-01 00:00:00.000000000 +0000 +++ gprename-20140325/build/gprename 2014-03-25 22:47:23.000000000 +0000 @@ -0,0 +1,1532 @@ +#!/usr/bin/perl + +# GPRename is a complete batch renamer for files and directories. + +# GPRename Copyright (C) 2014 gprename-users@lists.sourceforge.net +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License or +# any later version. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# file COPYING that came with this software for details. + +# Home Page : http://gprename.sourceforge.net +# Wikipedia : http://en.wikipedia.org/wiki/GPRename +# Subversion Web Browsing : http://gprename.svn.sourceforge.net/viewvc/gprename +# Subversion Manual : http://svnbook.red-bean.com/ +# GTK2-Perl FAQ : http://live.gnome.org/GTK2-Perl/FrequentlyAskedQuestions +# GTK2-Perl Tutorials : http://gtk2-perl.sourceforge.net/doc +# GTK2-Perl POD : http://gtk2-perl.sourceforge.net/doc/pod/index.html +# Makefile tutorial : http://mrbook.org/tutorials/make/ +# GNOME Human Interface Guidelines : http://developer.gnome.org/projects/gup/hig/2.0/index.html +# Linux Filesystem Hierarchy : http://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/usr.html +# Tutorial on gettext : http://cpan.uwinnipeg.ca/htdocs/gettext/README.html +# Gnu gettext : http://www.gnu.org/software/gettext/ +# .desktop specification : http://www.freedesktop.org/wiki/Howto_desktop_files/ + +# To create a gprename.po template file : +# cd bin +# xgettext --from-code=UTF-8 -o gprename.po --no-wrap --language=Perl gprename + +# To start GPRename with another language : +# LANGUAGE=fr gprename + +# How-to make a timer (debug purpose) : +# use Time::HiRes qw(gettimeofday tv_interval); +# my $timer1=0; +# my $timer2=0; +# if ( $debug == 1 ) { print "\nentering preview\n"; $timer1 = [gettimeofday]; } +# if ( $debug == 1 ) { print "leaving preview\n"; $timer2 = [gettimeofday]; printf "time : %.3fs\n", tv_interval($timer1, $timer2);} + + +###################################################################### +# Initialisation # +###################################################################### + +use Gtk2 -init; +use File::Spec::Functions; # for the tree +use Cwd; # to get the current directory +use Encode qw(decode encode); # to handle accents, with the encode and decode function +use Fcntl ':flock'; # for the flock function in &read_settings +use strict; # require variables to be declared before using them and distrust barewords +use warnings; # print warning messages on the command line +use Glib qw/TRUE FALSE/; # to use the bareword TRUE and FALSE +use utf8; # Because this file is in UTF8 and because we're using hardcoded accent in Help/About +use Gtk2::Pango; # To use text markup in TextView +use POSIX; # for setlocale() +use Locale::gettext; # for l18n +use Gtk2::Gdk::Keysyms; # for keyboard shortcuts + +# set the locale +setlocale(LC_ALL, ''); +bindtextdomain( 'gprename', '/usr/local/share/locale'); +textdomain( 'gprename' ); + +# Change the font to courier new for the Tree and the SimpleList +Gtk2::Rc->parse_string(<<__); +style 'my_text' { font_name ='courier new' } +widget '*TreeView' style 'my_text' +__ + +# Declaration of global variables +my $setting_file = "$ENV{'HOME'}/.config/gprename/gprename"; +my $log_file = "$ENV{'HOME'}/.config/gprename/gprename_log"; +if ( ! -e "$ENV{'HOME'}/.config" ) { `mkdir "$ENV{'HOME'}/.config"`; } +if ( ! -e "$ENV{'HOME'}/.config/gprename" ) { `mkdir "$ENV{'HOME'}/.config/gprename"`; } +if ( ! -e $log_file ) { `touch $log_file`; } +our %langs; # Hash of all the different languages +my %settings; # Hash of all the different options that can be saved +my @undo_oldname=(); # Hold a list of all the names renamed so that it can be undo +my @undo_newname=(); +my $max_length_undo_old=0; # Hold the biggest length of the old names, the log needs it +my $max_length_undo_new=0; # Hold the biggest length of the new names, the log needs it +my $undo_path; # Hold the path that was just renamed +my $showpath=0; # For the option Show path +my $recursive=0; # For the option Show recursive +my $security=1; # For the option Disable security +my $filter=''; # For the option Filter +my $exist=0; # For security check, if a name already exist +my $status_bar_files=0; +my $status_bar_dirs=0; +my $status_bar_selected=0; +my $str_gprename_version='5'; + +# Hold a list of the Name and New Name column of files or directories +# These are filled when calling &preview +my @column_name=(); +my @column_new_name=(); + +# Load settings file "~/.gprename" +$settings{'trim_spaces'} = TRUE; +$settings{'auto_preview'} = 0; +$settings{'zero_autofill'} = TRUE; +$settings{'fullscreen'} = 0; +$settings{'width'} = 640; +$settings{'height'} = 480; +$settings{'security'} = 0; +$settings{'hpaned_width'} = 200; +$settings{'show_hidden_files'} = 0; +&read_settings; + + +###################################################################### +# Main window # +###################################################################### + +# Create a window +my $window = new Gtk2::Window( 'toplevel' ); +$window->set_position( 'none' ); +$window->set_title( 'GPRename' ); +$window->resize( $settings{'width'}, $settings{'height'} ); +$window->signal_connect( 'delete_event', \&quit ); +$window->show(); + +my $accel_group = new Gtk2::AccelGroup; +$window->add_accel_group( $accel_group ); + +# Set the window icon +my $icon = '/usr/share/icons/gprename.png'; +my $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file( $icon ); +$window->set_icon( $pixbuf ); + +# Create a vertical main pane +my $main_paned = new Gtk2::VPaned(); +$window->add( $main_paned ); + +# Create a vbox for menubar and pane +my $top_vbox = new Gtk2::VBox( FALSE, 0 ); +$main_paned->pack1( $top_vbox, TRUE, TRUE ); + + +###################################################################### +# Menubar # +###################################################################### + +# Create the menubar +my $menubar = new Gtk2::MenuBar(); +$top_vbox->pack_start( $menubar, FALSE, FALSE, 0 ); + +# Menu : File +my $file_mm = new Gtk2::MenuItem( decode('utf8',gettext('_File')) ); +$menubar->append( $file_mm ); +my $file_menu = new Gtk2::Menu(); +$file_mm->set_submenu( $file_menu ); + +# File - Quit +my $quit_mi = new Gtk2::MenuItem( decode('utf8',gettext('Quit')) ); +$file_menu->append($quit_mi); +$quit_mi->signal_connect( 'activate', \&quit ); +$quit_mi->add_accelerator( 'activate', $accel_group, $Gtk2::Gdk::Keysyms{Q}, ['control-mask'], ['visible'] ); + +# Menu : Options +my $options_mi = new Gtk2::MenuItem( decode('utf8',gettext('_Options')) ); +$menubar->append( $options_mi ); +my $options_menu = new Gtk2::Menu(); +$options_mi->set_submenu( $options_menu ); + +# Options - Automatically trim spaces at the beginning +my $trim_spaces_rmi = new Gtk2::CheckMenuItem( decode('utf8',gettext('Trim spaces')) ); +if ( $settings{'trim_spaces'} ) { $trim_spaces_rmi->set_active( TRUE ); } +$trim_spaces_rmi->signal_connect( 'activate', \&options_trim_spaces ); + +# Options - Zero auto-fill +my $zero_autofill_rmi = new Gtk2::CheckMenuItem( decode('utf8',gettext('Zero auto-fill')) ); +if ( $settings{'zero_autofill'} ) { $zero_autofill_rmi->set_active( TRUE ); } +$zero_autofill_rmi->signal_connect( 'activate', \&options_zero_autofill ); + +# Options - Automatic preview +my $auto_preview_rmi = new Gtk2::CheckMenuItem( decode('utf8',gettext('Automatic preview')) ); +if ( $settings{'auto_preview'} ) { $auto_preview_rmi->set_active( TRUE ); } +$auto_preview_rmi->signal_connect( 'activate', \&options_auto_preview ); + +# Options - Remember last directory +my $remember_last_directory_rmi = new Gtk2::CheckMenuItem( decode('utf8',gettext('Remember last directory')) ); +if ( $settings{'remember_last_directory'} ) { $remember_last_directory_rmi->set_active( TRUE ); } +$remember_last_directory_rmi->signal_connect( 'activate', \&options_remember_last_directory ); + +# Options - Show hidden files +my $show_hidden_files_rmi = new Gtk2::CheckMenuItem( decode('utf8',gettext('Show hidden files')) ); +if ( $settings{'show_hidden_files'} ) { $show_hidden_files_rmi->set_active( TRUE ); } +$show_hidden_files_rmi->signal_connect( 'activate', \&options_show_hidden_files ); + +# Options - Show Path +my $show_path_rmi = new Gtk2::CheckMenuItem( decode('utf8',gettext('Show path')) ); +$show_path_rmi->signal_connect( 'activate', \&options_show_path ); + +# Options - Recursive renaming +my $recursive_rmi = new Gtk2::CheckMenuItem( decode('utf8',gettext('Show contents of subdirectories')) ); +$recursive_rmi->signal_connect( 'activate', \&options_recursive ); + +# Options - Fullscreen +my $fullscreen_rmi = new Gtk2::CheckMenuItem( decode('utf8',gettext('Fullscreen')) ); +if ( $settings{'fullscreen'} ) { $fullscreen_rmi->set_active( TRUE ); $window->fullscreen; } +$fullscreen_rmi->signal_connect( 'activate', \&options_fullscreen ); + +# Options - Disable security check +my $security_rmi = new Gtk2::CheckMenuItem( decode('utf8',gettext('Disable security check')) ); +$security_rmi->signal_connect( 'activate', \&options_security ); + +# Options - Filter +my $filter_mi = new Gtk2::MenuItem( decode('utf8',gettext('Filter')) . '...' ); +$filter_mi->signal_connect( 'activate', \&options_filter ); + +# Options - View Log +my $view_log_mi = new Gtk2::MenuItem( decode('utf8',gettext('View log')) . '...' ); +$view_log_mi->signal_connect( 'activate', \&options_view_log ); + +$options_menu->append( $trim_spaces_rmi ); +$options_menu->append( $zero_autofill_rmi ); +$options_menu->append( $auto_preview_rmi ); +$options_menu->append( $remember_last_directory_rmi ); +#$options_menu->append( $recursive_rmi ); +$options_menu->append( $show_hidden_files_rmi ); +$options_menu->append( $show_path_rmi ); +$options_menu->append( $fullscreen_rmi ); +$options_menu->append( $security_rmi ); +$options_menu->append( Gtk2::SeparatorMenuItem->new() ); +$options_menu->append( $filter_mi ); +$options_menu->append( Gtk2::SeparatorMenuItem->new() ); +$options_menu->append( $view_log_mi ); + +# Menu : Help +my $help_mm = new Gtk2::MenuItem( decode('utf8',gettext('_Help')) ); +$menubar->append($help_mm); +my $help_menu = new Gtk2::Menu(); +$help_mm->set_submenu($help_menu); + +# Help - Contents +my $contents_mi = new Gtk2::MenuItem( decode('utf8',gettext('Contents')) ); +$help_menu->append($contents_mi); +$contents_mi->signal_connect( 'activate', \&help_contents ); + +# Help - About +my $about_mi = new Gtk2::MenuItem( decode('utf8',gettext('About')) ); +$help_menu->append($about_mi); +$about_mi->signal_connect( 'activate', \&help_about ); + + +###################################################################### +# Tree and files/directories list # +###################################################################### + +# Create the list of Files +my $sw_filelist = new Gtk2::ScrolledWindow( undef, undef ); +$sw_filelist->set_policy( 'automatic', 'automatic' ); +my $ls_files = Gtk2::ListStore->new( qw(Glib::String), qw(Glib::String) ); +my $tv_files = Gtk2::TreeView->new( $ls_files ); +$tv_files->set_rules_hint ( TRUE ); # property to draw rows in alternate colors +$tv_files->set_headers_visible ( TRUE ); +$tv_files->append_column ( Gtk2::TreeViewColumn->new_with_attributes( '', Gtk2::CellRendererText->new(), text => 0 ) ); +$tv_files->append_column ( Gtk2::TreeViewColumn->new_with_attributes( '', Gtk2::CellRendererText->new(), text => 1 ) ); +$tv_files->get_column(0)->set_resizable ( TRUE ); +$tv_files->get_column(1)->set_resizable ( TRUE ); +$tv_files->get_column(0)->set_title( decode('utf8',gettext('Name')) ); +$tv_files->get_column(1)->set_title( decode('utf8',gettext('New name')) ); +$tv_files->get_selection->signal_connect( 'changed', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } } ); +$tv_files->get_selection->set_mode( 'multiple' ); +$sw_filelist->add( $tv_files ); + +# Create the list of Directories +my $sw_dirlist = new Gtk2::ScrolledWindow( undef, undef ); +$sw_dirlist->set_policy( 'automatic', 'automatic' ); +my $ls_dirs = Gtk2::ListStore->new( qw(Glib::String), qw(Glib::String) ); +my $tv_dirs = Gtk2::TreeView->new( $ls_dirs ); +$tv_dirs->set_rules_hint( TRUE ); # property to draw rows in alternate colors +$tv_dirs->set_headers_visible( TRUE ); +$tv_dirs->append_column( Gtk2::TreeViewColumn->new_with_attributes( '', Gtk2::CellRendererText->new(), text => 0 ) ); +$tv_dirs->append_column( Gtk2::TreeViewColumn->new_with_attributes( '', Gtk2::CellRendererText->new(), text => 1 ) ); +$tv_dirs->get_column(0)->set_resizable( TRUE ); +$tv_dirs->get_column(1)->set_resizable( TRUE ); +$tv_dirs->get_column(0)->set_title( decode('utf8',gettext('Name')) ); +$tv_dirs->get_column(1)->set_title( decode('utf8',gettext('New name')) ); +$tv_dirs->get_selection->signal_connect( 'changed', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } } ); +$tv_dirs->get_selection->set_mode( 'multiple' ); +$sw_dirlist->add( $tv_dirs ); + +# Create the Notebook and put the Files and Directories list in it +my $file_dir_notebook = new Gtk2::Notebook(); +$file_dir_notebook->append_page( $sw_filelist, decode('utf8',gettext('Files')) ); +$file_dir_notebook->append_page( $sw_dirlist, decode('utf8',gettext('Directories')) ); + +$file_dir_notebook->set_current_page (0); +$file_dir_notebook->signal_connect_after( 'switch-page', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } } ); + +# Create the Tree +my $sw_tree = Gtk2::ScrolledWindow->new; +$sw_tree->set_policy( 'automatic', 'automatic' ); +my $ts_tree = Gtk2::TreeStore->new( qw(Glib::String) ); +my $tv_tree = Gtk2::TreeView->new( $ts_tree ); +my $iter = $ts_tree->append( undef ); +$ts_tree->set( $iter, 0 => File::Spec->rootdir() ); +$tv_tree->append_column( Gtk2::TreeViewColumn->new_with_attributes( '', Gtk2::CellRendererText->new(), text => 0 ) ); +$tv_tree->set_headers_visible( FALSE ); +$sw_tree->add_with_viewport( $tv_tree ); +$tv_tree->signal_connect( 'row_expanded', \&populate_tree ); +$tv_tree->signal_connect( 'cursor_changed', \&populate_listing ); + +# Add only one item in the tree, anything, and open it up, this will call the populate_tree function +$ts_tree->set( $ts_tree->append( $tv_tree->get_model->get_iter_first ), 0, 'anything' ); +$tv_tree->expand_to_path( $tv_tree->get_model->get_path( $tv_tree->get_model->get_iter_first ) ); + +# Create an HPaned and put the Tree and Notebook in it +my $hpaned = Gtk2::HPaned->new; +$top_vbox->pack_end( $hpaned, TRUE, TRUE, 2 ); +$hpaned->pack1( $sw_tree, TRUE, TRUE ); +$hpaned->pack2( $file_dir_notebook, FALSE, TRUE ); +$hpaned->set_position( $settings{'hpaned_width'} ); +$hpaned->child1_resize( 0 ); + +###################################################################### +# Create manipulation items # +###################################################################### + +# Create a vbox for menubar and pane +my $bottom_vbox = new Gtk2::VBox( FALSE, 2); +$main_paned->pack2( $bottom_vbox, FALSE, TRUE ); + +my $status_bar = new Gtk2::Label( '' ); +$status_bar->set_justify( 'left' ); +$bottom_vbox->pack_start( $status_bar, TRUE, TRUE, 0 ); + +my $table = new Gtk2::Table( 1, 2, FALSE ); +$bottom_vbox->pack_end( $table, FALSE, FALSE, 2); + +my $notebook = new Gtk2::Notebook(); +$notebook->set_current_page (0); +$table->attach_defaults( $notebook, 0, 1, 0, 1 ); +$notebook->signal_connect_after( 'switch-page', sub { if ( $settings{'auto_preview'} ) { &preview; } } ); + + +###################################################################### +# Case change # +###################################################################### + +my $case_hbox1 = new Gtk2::HBox( FALSE, 4 ); +my $case_hbox2 = new Gtk2::HBox( FALSE, 4 ); +my $case_vbox1 = new Gtk2::VBox( FALSE, 4 ); +my $case_vbox2 = new Gtk2::VBox( FALSE, 4 ); +$notebook->append_page( $case_hbox1, decode('utf8',gettext('Case Change')) ); + +my $case_all_up_radio = new Gtk2::RadioButton( undef, decode('utf8',gettext('ALL UPPERCASE')) ); +my $case_all_lo_radio = new Gtk2::RadioButton( $case_all_up_radio, decode('utf8',gettext('all lowercase')) ); +my $case_only_first_radio = new Gtk2::RadioButton( $case_all_up_radio, decode('utf8',gettext('Only the first letter')) ); +my $case_first_radio = new Gtk2::RadioButton( $case_all_up_radio, decode('utf8',gettext('Only The First Letter And After')) ); + +my $case_first_after_entry = Gtk2::Entry->new_with_max_length(254); +$case_first_after_entry->signal_connect_after( 'insert-text', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } return '', $case_first_after_entry->get_position+1;} ); +$case_first_after_entry->signal_connect_after( 'delete-text', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } return '', $case_first_after_entry->get_position+1;} ); +$case_first_after_entry->set_text(' _-\(['); +$case_first_after_entry->set_width_chars( 8 ); + +$case_all_up_radio ->signal_connect( 'clicked', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } } ); +$case_all_lo_radio ->signal_connect( 'clicked', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } } ); +$case_only_first_radio->signal_connect( 'clicked', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } } ); +$case_first_radio ->signal_connect( 'clicked', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } } ); + +$case_hbox1->pack_start( $case_vbox1, FALSE, TRUE, 4 ); +$case_hbox1->pack_start( $case_vbox2, FALSE, TRUE, 4 ); +$case_vbox1->pack_start( $case_all_up_radio, FALSE, TRUE, 4 ); +$case_vbox1->pack_start( $case_all_lo_radio, FALSE, TRUE, 4 ); +$case_vbox2->pack_start( $case_only_first_radio, FALSE, TRUE, 4 ); +$case_hbox2->pack_start( $case_first_radio, FALSE, TRUE, 0 ); +$case_hbox2->pack_start( $case_first_after_entry, FALSE, TRUE, 0 ); +$case_vbox2->pack_start( $case_hbox2, FALSE, TRUE, 4 ); + + +###################################################################### +# Insert / Delete # +###################################################################### + +my $insdel_vbox = new Gtk2::VBox( FALSE, 4 ); +my $insdel_hbox1 = new Gtk2::HBox( FALSE, 4 ); +my $insdel_hbox2 = new Gtk2::HBox( FALSE, 4 ); +$notebook->append_page( $insdel_vbox, decode('utf8',gettext('Insert / Delete')) ); + +# in hbox1 +my $insert_radio = new Gtk2::RadioButton( undef, decode('utf8',gettext('Insert')) ); +$insert_radio->signal_connect( 'clicked', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } } ); +my $insert_entry = Gtk2::Entry->new_with_max_length(254); +$insert_entry->signal_connect_after( 'insert-text', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } return '', $insert_entry->get_position+1;} ); +$insert_entry->signal_connect_after( 'delete-text', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } return '', $insert_entry->get_position+1;} ); +my $insert_at_label = new Gtk2::Label( decode('utf8',gettext('at position')) ); +my $insert_adj = new Gtk2::Adjustment( 0, -256.0, 256.0, 1.0, 5.0, 0.0 ); +$insert_adj->signal_connect( 'value_changed', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } } ); +my $insert_spin = new Gtk2::SpinButton( $insert_adj, 0, 0 ); +$insert_spin->set_numeric(TRUE); + +# in hbox2 +my $delete_radio = new Gtk2::RadioButton( $insert_radio, decode('utf8',gettext('Delete between')) ); +$delete_radio->signal_connect( 'clicked', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } } ); +my $delete_btw1_adj = new Gtk2::Adjustment( 0, -256.0, 256.0, 1.0, 5.0, 0.0 ); +$delete_btw1_adj->signal_connect( 'value_changed', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } } ); +my $delete_btw1_spin = new Gtk2::SpinButton( $delete_btw1_adj, 0, 0 ); +$delete_btw1_spin->set_numeric(TRUE); +my $delete_btw2_label = new Gtk2::Label( decode('utf8',gettext('and')) ); +my $delete_btw2_adj = new Gtk2::Adjustment( 1, -256.0, 256.0, 1.0, 5.0, 0.0 ); +$delete_btw2_adj->signal_connect( 'value_changed', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } } ); +my $delete_btw2_spin = new Gtk2::SpinButton( $delete_btw2_adj, 0, 0 ); +$delete_btw2_spin->set_numeric(TRUE); + +$insdel_vbox ->pack_start( $insdel_hbox1, FALSE, FALSE, 4 ); +$insdel_vbox ->pack_start( $insdel_hbox2, FALSE, FALSE, 4 ); +$insdel_hbox1->pack_start( $insert_radio, FALSE, FALSE, 4 ); +$insdel_hbox1->pack_start( $insert_entry, FALSE, FALSE, 4 ); +$insdel_hbox1->pack_start( $insert_at_label, FALSE, FALSE, 4 ); +$insdel_hbox1->pack_start( $insert_spin, FALSE, FALSE, 4 ); +$insdel_hbox2->pack_start( $delete_radio, FALSE, FALSE, 4 ); +$insdel_hbox2->pack_start( $delete_btw1_spin, FALSE, FALSE, 4 ); +$insdel_hbox2->pack_start( $delete_btw2_label, FALSE, FALSE, 4 ); +$insdel_hbox2->pack_start( $delete_btw2_spin, FALSE, FALSE, 4 ); + + +###################################################################### +# Replace / Remove # +###################################################################### + +my $reprem_vbox = new Gtk2::VBox( FALSE, 4 ); +my $reprem_hbox = new Gtk2::HBox( FALSE, 4 ); +$notebook->append_page( $reprem_vbox, decode('utf8',gettext('Replace / Remove')) ); + +my $replace_this_label = new Gtk2::Label( decode('utf8',gettext('Replace')) ); +my $replace_this_entry = Gtk2::Entry->new_with_max_length(99); +$replace_this_entry->signal_connect_after( 'insert-text', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } return '', $replace_this_entry->get_position+1;} ); +$replace_this_entry->signal_connect_after( 'delete-text', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } return '', $replace_this_entry->get_position+1;} ); +my $replace_with_label = new Gtk2::Label( decode('utf8',gettext('with')) ); +my $replace_with_entry = Gtk2::Entry->new_with_max_length(99); +$replace_with_entry->signal_connect_after( 'insert-text', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } return '', $replace_with_entry->get_position+1;} ); +$replace_with_entry->signal_connect_after( 'delete-text', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } return '', $replace_with_entry->get_position+1;} ); +my $replace_opt_case = new Gtk2::CheckButton( decode('utf8',gettext('Case sensitive')) ); +$replace_opt_case->signal_connect( 'clicked', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } } ); +my $replace_opt_regex = new Gtk2::CheckButton( decode('utf8',gettext('Regular expression')) ); +$replace_opt_regex->signal_connect( 'clicked', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } } ); + +$reprem_vbox->pack_start( $reprem_hbox, FALSE, FALSE, 4 ); +$reprem_hbox->pack_start( $replace_this_label, FALSE, FALSE, 4 ); +$reprem_hbox->pack_start( $replace_this_entry, FALSE, FALSE, 4 ); +$reprem_hbox->pack_start( $replace_with_label, FALSE, FALSE, 4 ); +$reprem_hbox->pack_start( $replace_with_entry, FALSE, FALSE, 4 ); +$reprem_vbox->pack_start( $replace_opt_case, FALSE, FALSE, 4 ); +$reprem_vbox->pack_start( $replace_opt_regex, FALSE, FALSE, 4 ); + + +###################################################################### +# Numerical # +###################################################################### + +my $numeric_vbox = new Gtk2::VBox( FALSE, 4 ); +my $numeric_hbox1 = new Gtk2::HBox( FALSE, 4 ); +my $numeric_hbox2 = new Gtk2::HBox( FALSE, 4 ); +my $numeric_hbox3 = new Gtk2::HBox( FALSE, 4 ); +$notebook->append_page( $numeric_vbox, decode('utf8',gettext('Numerical')) ); + +# in hbox1 +my $numeric_start_label = new Gtk2::Label( decode('utf8',gettext('Add numbers starting at')) ); +my $numeric_start_adj = new Gtk2::Adjustment( 1, 0.0, 999999.0, 1.0, 5.0, 0.0 ); +$numeric_start_adj->signal_connect( 'value_changed', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } } ); +my $numeric_start_spin = new Gtk2::SpinButton( $numeric_start_adj, 0, 0 ); +$numeric_start_spin->set_numeric(TRUE); +my $numeric_increment_label = new Gtk2::Label( decode('utf8',gettext('and increment by')) ); +my $numeric_increment_adj = new Gtk2::Adjustment( 1, 1.0, 9999.0, 1.0, 1.0, 0.0 ); +$numeric_increment_adj->signal_connect( 'value_changed', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } } ); +my $numeric_increment_spin = new Gtk2::SpinButton( $numeric_increment_adj, 0, 0 ); +$numeric_increment_spin->set_numeric(TRUE); + +# in hbox2 +my $numeric_prefix_label = new Gtk2::Label( decode('utf8',gettext('Insert before the numbers')) ); +my $numeric_prefix_entry = Gtk2::Entry->new_with_max_length(254); +$numeric_prefix_entry->signal_connect_after( 'insert-text', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } return '', $numeric_prefix_entry->get_position+1;} ); +$numeric_prefix_entry->signal_connect_after( 'delete-text', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } return '', $numeric_prefix_entry->get_position+1;} ); +$numeric_prefix_entry->set_width_chars (9); +my $numeric_suffix_label = new Gtk2::Label( decode('utf8',gettext('and after')) ); +my $numeric_suffix_entry = Gtk2::Entry->new_with_max_length(254); +$numeric_suffix_entry->signal_connect_after( 'insert-text', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } return '', $numeric_suffix_entry->get_position+1;} ); +$numeric_suffix_entry->signal_connect_after( 'delete-text', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } return '', $numeric_suffix_entry->get_position+1;} ); +$numeric_suffix_entry->set_width_chars (9); + +# in hbox3 +my $numeric_keep_filenames1 = new Gtk2::Label( decode('utf8',gettext('Keep existing names')) ); +my $numeric_keep_filenames2 = new Gtk2::RadioButton( undef, decode('utf8',gettext('Before the numbers')) ); +my $numeric_keep_filenames3 = new Gtk2::RadioButton( $numeric_keep_filenames2, decode('utf8',gettext('After the numbers')) ); +my $numeric_keep_filenames4 = new Gtk2::RadioButton( $numeric_keep_filenames2, decode('utf8',gettext('No')) ); +$numeric_keep_filenames4->set_active( TRUE ); + +$numeric_keep_filenames2->signal_connect( 'clicked', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } } ); +$numeric_keep_filenames3->signal_connect( 'clicked', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } } ); +$numeric_keep_filenames4->signal_connect( 'clicked', sub { if ( $settings{'auto_preview'} == TRUE ) { &preview; } } ); + +$numeric_vbox->pack_start( $numeric_hbox1, FALSE, FALSE, 4 ); +$numeric_vbox->pack_start( $numeric_hbox2, FALSE, FALSE, 4 ); +$numeric_vbox->pack_start( $numeric_hbox3, FALSE, FALSE, 4 ); +$numeric_hbox1->pack_start( $numeric_start_label, FALSE, FALSE, 4 ); +$numeric_hbox1->pack_start( $numeric_start_spin, FALSE, FALSE, 4 ); +$numeric_hbox1->pack_start( $numeric_increment_label, FALSE, FALSE, 4 ); +$numeric_hbox1->pack_start( $numeric_increment_spin, FALSE, FALSE, 4 ); +$numeric_hbox2->pack_start( $numeric_prefix_label, FALSE, FALSE, 4 ); +$numeric_hbox2->pack_start( $numeric_prefix_entry, FALSE, FALSE, 4 ); +$numeric_hbox2->pack_start( $numeric_suffix_label, FALSE, FALSE, 4 ); +$numeric_hbox2->pack_start( $numeric_suffix_entry, FALSE, FALSE, 4 ); +$numeric_hbox3->pack_start( $numeric_keep_filenames1, FALSE, FALSE, 4 ); +$numeric_hbox3->pack_start( $numeric_keep_filenames2, FALSE, FALSE, 4 ); +$numeric_hbox3->pack_start( $numeric_keep_filenames3, FALSE, FALSE, 4 ); +$numeric_hbox3->pack_start( $numeric_keep_filenames4, FALSE, FALSE, 4 ); + + +###################################################################### +# Buttons # +###################################################################### + +my $button_box = new Gtk2::VButtonBox(); +$button_box->set_layout_default( 'spread' ); +$table->attach_defaults( $button_box, 1, 2, 0, 1 ); + +my $preview_button = new Gtk2::Button( decode('utf8',gettext('_Preview')) ); +$button_box->add($preview_button); +$preview_button->set_sensitive( TRUE ); +if ( $settings{'auto_preview'} == TRUE ) { $preview_button->set_sensitive( FALSE ); } +$preview_button->signal_connect( 'clicked', \&preview ); + +my $apply_button = new Gtk2::Button( decode('utf8',gettext('_Rename')) ); +$button_box->add($apply_button); +$apply_button->set_sensitive( TRUE ); +if ( $settings{'auto_preview'} == FALSE ) { $apply_button->set_sensitive( FALSE ); } +$apply_button->signal_connect( 'clicked', \&rename_now ); + +my $undo_button = new Gtk2::Button( decode('utf8',gettext('_Undo')) ); +$button_box->add($undo_button); +$undo_button->set_sensitive( FALSE ); +$undo_button->signal_connect( 'clicked', \&undo ); + +my $refresh_button = new Gtk2::Button( decode('utf8',gettext('Refre_sh')) ); +$button_box->add($refresh_button); +$refresh_button->set_sensitive( TRUE ); +$refresh_button->signal_connect( 'clicked', \&refresh ); + +$window->show_all(); +&open_tree; # automatically open the tree at start for the user +Gtk2->main; +exit(0); + + +###################################################################### +# Functions # +###################################################################### + +sub populate_tree{ + my ( $tree_view, $iter, $tree_path ) = @_; + my $tree_model = $tree_view->get_model(); + + my $path = ''; # current path selected + my @path; # will store a listing of all files/directories of $path + my $iter_to_remove = $tree_model->iter_n_children( $iter ); # number of child to remove at the end + # set $path to be the full path name from the iter selected + my $iter_tmp = $iter; + while( $iter_tmp ) { + $path = $tree_model->get($iter_tmp) . '/' . $path; + $iter_tmp = $tree_model->iter_parent( $iter_tmp ); + } + $path =~ s/\/{2,}/\//g; # replace double slash to only one + $path = encode('utf8',$path); + + # fill @path with a list of files and directories + opendir( DIRHANDLE, $path ); + @path = readdir(DIRHANDLE); + closedir(DIRHANDLE); + @path = sort(@path); + + # Append all the new directories that just opened up from the tree + foreach my $i (@path) { + + # Append only if it's a directory, not a file, and it's not the directory '.' or '..' and that we have permissions to access the directory + if ( -d decode('utf8',"$path$i") and $i ne '.' and $i ne '..' and -x decode('utf8',"$path$i") ) { + + # Append only hidden files and directories if the option Show hidden files is checked + if ( substr($i,0,1) ne '.' or ( substr($i,0,1) eq '.' and $settings{'show_hidden_files'} == 1 ) ) { + + # fill @path_child with a listing of all files/directories of $i + my @path_child = ''; + opendir( DIRHANDLE, decode('utf8',"$path$i") ); + @path_child = readdir(DIRHANDLE); + closedir(DIRHANDLE); + @path_child = sort(@path_child); + + # add a new directory to the tree which is $i + my $iter_new = $ts_tree->append( $iter ); + $ts_tree->set( $iter_new, 0 => decode('utf8',$i) ); + + # we have to loop again to add new directories to the child of $i so that we can + # have a little arrow to open up $i since it contains other directories inside + foreach my $j (@path_child) { + if ( -d decode('utf8',"$path$i/$j") and $j ne '.' and $j ne '..' ) { + my $iter_child = $ts_tree->append( $iter_new ); + $ts_tree->set( $iter_child, 0 => decode('utf8',$j) ); + } + } + } + } + } + + # remove all the old directories since we just put new ones + foreach my $h ( 1...$iter_to_remove ) { + my $child = $ts_tree->iter_children( $iter ); + $ts_tree->remove( $child ); + } +} + +sub populate_listing { + my $tree_view = $tv_tree; + my $iter = $tree_view->get_selection->get_selected; + my $tree_model = $tree_view->get_model(); + my $path = ''; # current path selected + my @path; # will store a listing of all files/directories of $path + $status_bar_files=0; + $status_bar_dirs=0; + + # set $path to be the full path name from the iter selected + my $iter_tmp = $iter; + while( $iter_tmp ) { + $path = $tree_model->get($iter_tmp) . '/' . $path; + $iter_tmp = $tree_model->iter_parent( $iter_tmp ); + } + $path =~ s/\/{2,}/\//g; # replace double slash to only one + + # fill @path with a list of files and directory, make sure to use the + # opendir function and not the glob function for this because glob + # cannot handle directory with text inside brackets : "some[thing]", google + # for 'glob bug bracket' for more information on this behavior + opendir( DIRHANDLE, $path ); + @path = readdir(DIRHANDLE); + closedir(DIRHANDLE); + @path = sort(@path); + + # clear the ListStore before we put the new ones in + $ls_files->clear; + $ls_dirs->clear; + + # Append all the new files and directories names to each list if it's a + # file or a directory and it matches the filter and depending on the Show hidden files options + foreach my $t (@path) { + if ( -f $path . decode('utf8',$t) and index(lc($t), lc($filter)) != -1 ) { + if ( substr($t,0,1) ne '.' or ( substr($t,0,1) eq '.' and $settings{'show_hidden_files'} == 1 ) ) { + my $iter_new = $ls_files->append; + $status_bar_files+=1; + if ( $showpath == 0 ) { $ls_files->set_value( $iter_new, 0, decode('utf8',$t) ); } + else { $ls_files->set_value( $iter_new, 0, decode('utf8',"$path$t") ); } + } + } + elsif ( -d $path . decode('utf8',$t) and index(lc($t), lc($filter)) != -1 and $t ne '.' and $t ne '..' ) { + if ( substr($t,0,1) ne '.' or ( substr($t,0,1) eq '.' and $settings{'show_hidden_files'} == 1 ) ) { + my $iter_new = $ls_dirs->append; + $status_bar_dirs+=1; + if ( $showpath == 0 ) { $ls_dirs->set_value( $iter_new, 0, decode('utf8',$t) ); } + else { $ls_dirs->set_value( $iter_new, 0, decode('utf8',"$path$t") ); } + } + } + } + + # Turn off Automatic Preview if there's more than 10,000 files or directories + if ( $status_bar_files >= 10000 or $status_bar_dirs >= 10000 ) { + $auto_preview_rmi->set_active( FALSE ); + $settings{'auto_preview'} = 0; + $preview_button->set_sensitive(TRUE); + $apply_button->set_sensitive( FALSE ); + } + + if ( $settings{'auto_preview'} == TRUE ) { &preview }; + $tv_files->columns_autosize; + $tv_dirs->columns_autosize; + + &refresh_status_bar; +} + +sub refresh_status_bar { + $status_bar_selected=0; + my $temp_file = decode('utf8',gettext('_File')); + $temp_file =~ s/_//g; + + if ( $status_bar_files < 2 ) { $status_bar->set_label( $status_bar_files . ' ' . $temp_file ); } + else { $status_bar->set_label( $status_bar_files . ' ' . decode('utf8',gettext('Files')) ); } + + if ( $status_bar_dirs < 2 ) { $status_bar->set_label( $status_bar->get_label . ' | ' . $status_bar_dirs . ' ' . decode('utf8',gettext('Directory')) ); } + else { $status_bar->set_label( $status_bar->get_label . ' | ' . $status_bar_dirs . ' ' . decode('utf8',gettext('Directories')) ); } + + my $page_file_or_dir = $file_dir_notebook->get_current_page; + if ( $page_file_or_dir == 0 ) { $status_bar_selected = $tv_files->get_selection->count_selected_rows; } + if ( $page_file_or_dir == 1 ) { $status_bar_selected = $tv_dirs->get_selection->count_selected_rows; } + $status_bar->set_label( $status_bar->get_label . ' | ' . $status_bar_selected . ' ' . decode('utf8',gettext('Selected')) ); +} + +sub preview { + # change the cursor + my $cursor = Gtk2::Gdk::Cursor->new('watch'); + $window->window->set_cursor($cursor); + + # We need an Idle callback else the cursor will not display + Glib::Idle->add( sub { + + my $page = $notebook->get_current_page; + my $page_file_or_dir = $file_dir_notebook->get_current_page; + my $tree_view; # TreeView of files or directories + my $store; # ListStore of files or directories + if ( $page_file_or_dir == 0 ) { $tree_view = $tv_files; $store = $ls_files; } + elsif ( $page_file_or_dir == 1 ) { $tree_view = $tv_dirs ; $store = $ls_dirs ; } + @column_name =(); + @column_new_name=(); + my $selected_rows = $tree_view->get_selection->count_selected_rows; + + if ( defined $apply_button ) { $apply_button->set_sensitive( TRUE ); } + + # Fill @column_name + if ( defined $tree_view ) { $tree_view->get_model->foreach( sub + { + my ($model, $path, $iter, $tree_view) =@_; + # If there's no selection or there is and it's this iter, then add + # a string to @column_name, else set it empty with '' + if ( $selected_rows == 0 or $tree_view->get_selection->iter_is_selected( $iter ) ) { push(@column_name, $model->get($iter,0) ); } + else { push(@column_name, '' ); } + return FALSE; + }, $tree_view); } + + # Fill @column_new_name + if ( $page == 0 ) { &case; } + elsif ( $page == 1 ) { &insdel; } + elsif ( $page == 2 ) { &replace; } + elsif ( $page == 3 ) { &numeric; } + + # Append the new name in the column New Name + if ( defined $tree_view ) { $tree_view->get_model->foreach( sub { + my ($model, $path, $iter, $store) =@_; + $store->set( $iter, 1, $column_new_name[0] ); + push(@column_new_name, shift(@column_new_name)); + return FALSE; + }, $store); } + + &refresh_status_bar; + + $cursor = Gtk2::Gdk::Cursor->new('left-ptr'); + $window->window->set_cursor($cursor); + return FALSE; + }); # close Glib::Idle +} + +sub rename_now { + # change the cursor + my $cursor = Gtk2::Gdk::Cursor->new('watch'); + $window->window->set_cursor($cursor); + + # We need an Idle callback else the cursor will not display + Glib::Idle->add( sub { + + my $rename=0; + my $name_old=''; + my $name_new=''; + my $name_tmp=''; + my $path=''; + my $a=0; + my $a_undo=0; + $exist=0; + $max_length_undo_old=0; + $max_length_undo_new=0; + @undo_oldname=(); + @undo_newname=(); + + my @selected; + my $treeview; + my $page_file_or_dir = $file_dir_notebook->get_current_page; + if ( $page_file_or_dir == 0 ) { $treeview = $tv_files; } + if ( $page_file_or_dir == 1 ) { $treeview = $tv_dirs; } + @selected = $treeview->get_selection->get_selected_rows; + + # Set $path + $path = ''; + my $iter_tmp = $tv_tree->get_selection->get_selected; + while( $iter_tmp ) { + $path = $tv_tree->get_model->get($iter_tmp) . '/' . $path; + $iter_tmp = $tv_tree->get_model->iter_parent( $iter_tmp ); + } + + # replace double dash to only one + $path =~ s/\/{2,}/\//g; + + $undo_path = $path; + + while ( $a < @column_new_name ) { + if ( $column_new_name[$a] ne '' ) { + + # Set $name_old and $name_new without the path + if ( $showpath == 0 ) { $name_old = $column_name[$a]; } + else { $name_old = substr( $column_name[$a], rindex($column_name[$a],'/')+1, length($column_name[$a]) ); } + $name_new = $column_new_name[$a]; + + # Check if a file or a directory already exist with the name we need + if ( $security == 1 and $exist == 0 and -e $path . $name_new ) { + my $dialog = Gtk2::MessageDialog->new ($window, 'modal', 'info', 'ok', decode('utf8',gettext('Cannot rename because it already exist.')) . "\n\n" . decode('utf8',gettext('Name')) . " : $path$name_old" . "\n" . decode('utf8',gettext('New name')) . ": $path$name_new"); + $dialog->run; + $dialog->destroy; + $exist=1; + } + + # Check if a file or a directory is more than 253 characters long, else after appending _gp the filename will be too long + if ( (length($name_old) >= 253) || (length($name_new) >= 253) ) { + my $dialog = Gtk2::MessageDialog->new ($window, 'modal', 'info', 'ok', decode('utf8',gettext('Cannot rename because the filename is too long.')) . "\n\n" . decode('utf8',gettext('Name')) . " : $path$name_old" . "\n\n" . decode('utf8',gettext('New name')) . ": $path$name_new"); + $dialog->run; + $dialog->destroy; + $exist=1; + } + + # If the file or directory doesn't exist, then start renaming + if ( $exist == 0 ) { + + # If the setting Trim Spaces is checked, then trim it + if ( $settings{'trim_spaces'} == TRUE ) { + $name_new =~ s/^\s+//; # trim spaces at start + $name_new =~ s/\s+$//; # trim spaces at end + $name_new =~ s/\s{2,}/ /g; # replace more than 2 spaces to only 1 + } + + # Set $max_length for the log file + if ( $max_length_undo_old < length($name_old) ) { $max_length_undo_old = length($name_old); } + if ( $max_length_undo_new < length($name_new) ) { $max_length_undo_new = length($name_new); } + + $undo_oldname[$a_undo] = $name_old; + $undo_newname[$a_undo] = $name_new; + $a_undo++; + + # We have to rename the files/dirs 2 times with "_gp" because you can't + # rename the file "a" to "A" in one shot on a Windows filesystem + $name_old = "$path$name_old"; + $name_tmp = "$name_old" . "_gp"; + $name_new = "$path$name_new"; + rename( $name_old, $name_tmp ) || print $! . "\n"; + rename( $name_tmp, $name_new ); + + $rename=1; + } # end if $exist + + } # end if + $a++; + } # end while + + # if there was a rename with no error then print to the log file + if ( $rename == 1 and $exist == 0 ) { + open( OUTPUT, '>>', $log_file ) or die "Couldn't open $log_file for writing: $!\n"; + flock( OUTPUT, LOCK_EX ); + if ( $path ne '/' ) { print OUTPUT localtime() . " - " . substr($path, 0, length($path)-1) . "\n"; } + else { print OUTPUT localtime() . " - $path\n"; } + + my $x=0; + my $y=0; + while ( $x < @undo_newname ) { + print OUTPUT $undo_oldname[$x]; + $y=length( decode('utf8',$undo_oldname[$x]) ); + while ( $y < $max_length_undo_old ) { print OUTPUT " "; $y++; } + print OUTPUT " => $undo_newname[$x]\n"; + $x++; + } + + print OUTPUT "\n"; + flock( OUTPUT, LOCK_UN ); + close( OUTPUT ); + $undo_button->set_sensitive( TRUE ); + } + + # if there was a renaming and there was an error then call undo + if ( $rename == 1 and $exist == 1 ) { &undo; } + + @column_name=(); + @column_new_name=(); + + &populate_listing; + + $tv_files->columns_autosize; + $tv_dirs->columns_autosize; + + # if there was an error, keep the selection of the user + if ( $exist == 1 ) { foreach my $x (@selected) { $treeview->get_selection->select_path( $x ); } } + + &check_log_size; + + if ( $settings{'auto_preview'} == FALSE ) { $apply_button->set_sensitive( FALSE ); } + + $cursor = Gtk2::Gdk::Cursor->new('left-ptr'); + $window->window->set_cursor($cursor); + return FALSE; + }); # close Glib::Idle + +} + +sub case { + my @case_first_after = split( //, $case_first_after_entry->get_text); + my $new_name=''; + my $name_check=''; + my $a=0; + + while ( $a < @column_name ) { + if ( $column_name[$a] ne '' ) { + + # Trim the spaces and the path if the option Show path is selected + if ( $showpath == 0 ) { $new_name = $column_name[$a]; } + else { $new_name = substr( $column_name[$a] , rindex($column_name[$a],'/')+1, length($column_name[$a])) }; + $name_check = $new_name; + $new_name = &options_trim_spaces_and_return($new_name); + + # To UPPERCASE + if ( $case_all_up_radio->get_active ) { $new_name = "\U$new_name"; } + + # to lowercase + elsif ( $case_all_lo_radio->get_active ) { $new_name = "\L$new_name"; } + + # Only the first letter + # loop through each character, when it finds the first character that can + # be converted to uppercase, set it and exit the loop, this function can + # then convert "05 something" to "05 Something" + elsif ( $case_only_first_radio->get_active ) { + $new_name = "\L$new_name"; + my $exit=0; + my @tmp = split( //, $new_name ); + foreach my $x (@tmp) { + if ( $exit == 0 ) { + if ( $x =~ /\p{Ll}\p{M}*/ ) { $x = "\U$x"; $exit = 1; } + } + } + $new_name = join( "", @tmp ); + } + + # Each First Letter + # Loop two times for each string for each character, if it's equal then + # set the next character in uppercase + elsif ( $case_first_radio->get_active ) { + $new_name = "\L$new_name"; + my @temp1 = split( //, $new_name); # to loop + my @temp2 = split( //, $new_name); # to modify + foreach my $x (@case_first_after) { + my $y=0; + foreach my $z (@temp1) { + if ( $x eq $z and defined $temp1[$y+1] ) { $temp2[$y+1] = "\U$temp2[$y+1]"; } + $y++; + } + } + $temp2[0] = "\U$temp2[0]"; + $new_name = join( "", @temp2 ); + } + + } # end if + + $column_new_name[$a]=''; + if ( $name_check ne &options_trim_spaces_and_return($new_name) ) { $column_new_name[$a] = &options_trim_spaces_and_return($new_name); } + $new_name=''; + $a++; + } # end while +} + +sub insdel { + my $new_name=''; + my $name_check=''; + my $a=0; + + while ( $a < @column_name ) { + if ( $column_name[$a] ne '' ) { + + # Trim the spaces and the path if the option Show path is selected + if ( $showpath == 0 ) { $new_name = $column_name[$a]; } + else { $new_name = substr( $column_name[$a] , rindex($column_name[$a],'/')+1, length($column_name[$a])) }; + $name_check = $new_name; + $new_name = &options_trim_spaces_and_return($new_name); + + # Insert + if ( $insert_radio->get_active and $insert_entry->get_text ne '' ) { + my $insert_at = $insert_spin->get_value_as_int(); + if ( $insert_at > length($new_name) or $insert_at < (length($new_name)-(length($new_name)*2)) ) { $insert_at = length($new_name); } + my $tmp_string1 = substr( $new_name, 0, $insert_at ); + my $tmp_string2 = substr( $new_name, $insert_at, length($new_name) ); + $new_name = $tmp_string1 . $insert_entry->get_text . $tmp_string2; + } + + # Delete + elsif ( $delete_radio->get_active ) { + my $delete_to = $delete_btw2_spin->get_value_as_int(); + my $delete_from = $delete_btw1_spin->get_value_as_int(); + if ( $delete_to > length($new_name) or $delete_to < (length($new_name)-(length($new_name)*2)) ) { $delete_to = length($new_name); } + my $tmp_string1 = substr( $new_name, 0, $delete_from ); + my $tmp_string2 = substr( $new_name, $delete_to, length($new_name) ); + $new_name = $tmp_string1 . $tmp_string2; + } + + } # end if + + $column_new_name[$a]=''; + if ( $name_check ne &options_trim_spaces_and_return($new_name) ) { $column_new_name[$a] = &options_trim_spaces_and_return($new_name); } + $new_name=''; + $a++; + } # end while +} + +sub replace { + my $new_name=''; + my $name_check=''; + my $a=0; + my $replace_this = $replace_this_entry->get_text; + my $replace_with = $replace_with_entry->get_text; + + while ( $a < @column_name ) { + if ( $column_name[$a] ne '' and $replace_this ne '' ) { + + # Trim the spaces and the path if the option Show path is selected + if ( $showpath == 0 ) { $new_name = $column_name[$a]; } + else { $new_name = substr( $column_name[$a] , rindex($column_name[$a],'/')+1, length($column_name[$a])) }; + $name_check = $new_name; + $new_name = &options_trim_spaces_and_return($new_name); + + # Substitution with pattern metacharacters + if ( $replace_opt_regex->get_active ) { + if ( $replace_opt_case->get_mode ) { $new_name =~ s/$replace_this/$replace_with/g; } + else { $new_name =~ s/$replace_this/$replace_with/ig; } + } + + # Substitution without pattern metacharacters (hence the \Q) + else { + if ( $replace_opt_case->get_active ) { $new_name =~ s/\Q$replace_this/$replace_with/g; } + else { $new_name =~ s/\Q$replace_this/$replace_with/ig; } + } + + } # end if + + $column_new_name[$a]=''; + if ( $name_check ne &options_trim_spaces_and_return($new_name) ) { $column_new_name[$a] = &options_trim_spaces_and_return($new_name); } + $new_name=''; + $a++; + } # end while +} + +sub numeric { + my $numeric_start = $numeric_start_spin->get_value_as_int(); + my $numeric_increment = $numeric_increment_spin->get_value_as_int(); + my $numeric_prefix = $numeric_prefix_entry->get_text; + my $numeric_suffix = $numeric_suffix_entry->get_text; + my $name_before=''; + my $name_after=''; + my $new_name=''; + my $name_check=''; + my $a=0; + my $max_no=0; # Used for the zero-autofill + my $numeric_number=0; # Used for the zero-autofill + my $zero_autofill_no=$numeric_start; # Used for the zero-autofill + + # Calculate the number of items to rename and set $max_no + foreach my $x (@column_name) { if ( $x ne '' ) { $max_no++; } } + $max_no = ($max_no - 1) * $numeric_increment + $numeric_start; + $max_no = length($max_no); + + while ( $a < @column_name ) { + if ( $column_name[$a] ne '' ) { + + # Trim the spaces and the path if the option Show path is selected + if ( $showpath == 0 ) { $new_name = $column_name[$a]; } + else { $new_name = substr( $column_name[$a] , rindex($column_name[$a],'/')+1, length($column_name[$a])) }; + $name_check = $new_name; + $new_name = &options_trim_spaces_and_return($new_name); + + # Set the two name_before and name_after, doesn't matter if it's not use + # because their value is an empty string + if ( $numeric_keep_filenames2->get_active ) { $name_before = $new_name; } + if ( $numeric_keep_filenames3->get_active ) { $name_after = $new_name; } + + # If zero autofill is used, then fill $numeric_number with the right amount + # of '0' in it + $numeric_number = ''; + if ( $zero_autofill_rmi->get_active ) { + while ( (length($numeric_number) + length($zero_autofill_no)) < $max_no ) { + $numeric_number = '0' . $numeric_number; + } + } + + $new_name = $name_before . $numeric_prefix . $numeric_number . $zero_autofill_no . $numeric_suffix . $name_after; + + $zero_autofill_no = $zero_autofill_no + $numeric_increment; + } # end if + + $column_new_name[$a]=''; + if ( $name_check ne &options_trim_spaces_and_return($new_name) ) { $column_new_name[$a] = &options_trim_spaces_and_return($new_name); } + $new_name=''; + $a++; + } # end while +} + +sub refresh { + # Set $path + my $path = ''; + my $iter_tmp = $tv_tree->get_selection->get_selected; + while( $iter_tmp ) { + $path = $tv_tree->get_model->get($iter_tmp) . '/' . $path; + $iter_tmp = $tv_tree->get_model->iter_parent( $iter_tmp ); + } + $path =~ s/\/{2,}/\//g; # replace double slash to only one + $path =~ s/\/^//g; # remove last trailing slash + + # Clear everything + $ls_files->clear; + $ls_dirs->clear; + $ts_tree->clear; + + # Repopulate the tree with / and open it + $iter_tmp = $ts_tree->append( undef ); + $ts_tree->set( $iter_tmp, 0 => File::Spec->rootdir() ); + $ts_tree->set( $ts_tree->append( $tv_tree->get_model->get_iter_first ), 0, 'anything' ); + $tv_tree->expand_to_path( $tv_tree->get_model->get_path( $tv_tree->get_model->get_iter_first ) ); + + # Set some useful variables + my @paths = split( /\//, $path); + shift(@paths); # remove the first item which is empty + my $size = @paths; # need $size to get the last item of @paths + $path = ''; + my $iter = $tv_tree->get_model->get_iter_first; + $iter = $tv_tree->get_model->iter_nth_child ($iter, 0); # set $iter to point to the first directory in / + + # Re-open the tree where the user was + foreach my $x (@paths) { + $path = $path . '/' . $x; + + if ( -e $path ) { + while ( $x ne $tv_tree->get_model->get($iter) and $iter ) { $iter = $tv_tree->get_model->iter_next($iter); } + + if ( $iter ) { + $tv_tree->get_selection->select_iter( $iter ); + + # expand the path only if it's not the last item + if ( $x ne $paths[$size-1] ) { + $tv_tree->expand_to_path( $tv_tree->get_model->get_path( $iter ) ); + $iter = $tv_tree->get_model->iter_nth_child($iter, 0); + } + } + } + } + + # List the files/directories + &populate_listing; +} + +sub check_log_size { + if ( -s $log_file > 1000000 ) { + my $dialog = Gtk2::MessageDialog->new ($window, 'modal', 'info', 'ok', decode('utf8',gettext('The log file is over 1M, you should clear it from the Options menu.')) ); + $dialog->run; + $dialog->destroy; + } +} + +sub quit { + &save_settings; + exit(0); +} + +sub options_trim_spaces { + if ( $trim_spaces_rmi->get_active ) { $settings{'trim_spaces'} = TRUE; } + else { $settings{'trim_spaces'} = 0; } + if ( $settings{'auto_preview'} == TRUE ) { &preview }; +} + +sub options_trim_spaces_and_return { + my $i = $_[0]; + + if ( $settings{'trim_spaces'} == TRUE and $i ne '' ) { + $i =~ s/^\s+//; + $i =~ s/\s+$//; + $i =~ s/\s{2,}/ /g; + } + + return $i; +} + +sub options_zero_autofill { + if ( $zero_autofill_rmi->get_active ) { $settings{'zero_autofill'} = TRUE; } + else { $settings{'zero_autofill'} = 0; } + if ( $settings{'auto_preview'} == TRUE ) { &preview }; +} + +sub options_auto_preview { + if ( $auto_preview_rmi->get_active ) { + $settings{'auto_preview'} = TRUE; + $preview_button->set_sensitive(FALSE); + $apply_button->set_sensitive( TRUE ); + &preview; + } + else { + $settings{'auto_preview'} = 0; + $preview_button->set_sensitive(TRUE); + $apply_button->set_sensitive( FALSE ); + &populate_listing; + } +} + +sub options_remember_last_directory { + if ( $remember_last_directory_rmi->get_active ) { $settings{'remember_last_directory'} = 1; } + else { $settings{'remember_last_directory'} = 0; } +} + +#sub options_recursive { +# if ( $recursive_rmi->get_active ) { $recursive = TRUE; } +# else { $recursive = FALSE; } +# if ( $settings{'auto_preview'} == TRUE ) { &preview }; +#} + +sub options_show_hidden_files { + if ( $show_hidden_files_rmi->get_active ) { $settings{'show_hidden_files'} = 1; } + else { $settings{'show_hidden_files'} = 0; } + &refresh; +} + +sub options_show_path { + if ( $show_path_rmi->get_active ) { $showpath = 1; } + else { $showpath = 0; } + &populate_listing; + if ( $settings{'auto_preview'} == TRUE ) { &preview }; +} + +sub options_fullscreen { + if ( $fullscreen_rmi->get_active ) { $settings{'fullscreen'} = TRUE; $window->fullscreen; } + else { $settings{'fullscreen'} = 0; $window->unfullscreen; } +} + +sub options_security { + if ( $security_rmi->get_active ) { $settings{'security'} = 0; $security=0; } + else { $settings{'security'} = TRUE; $security=1; } +} + +sub options_filter { + my $dialog = Gtk2::Dialog->new ( decode('utf8',gettext('Filter')), $window, 'destroy-with-parent', 'gtk-ok' => 'reject'); + $dialog->set_default_response ('reject'); + $dialog->set_has_separator (TRUE); + my $label = new Gtk2::Label( decode('utf8',gettext('Only show files or directories that contains')) ); + + my $filter_entry = Gtk2::Entry->new_with_max_length(254); + $filter_entry->set_activates_default( TRUE ); + $filter_entry->signal_connect_after( 'insert-text', sub { $filter = encode('utf8',$filter_entry->get_text); &populate_listing; return '', $filter_entry->get_position+1;} ); + $filter_entry->signal_connect_after( 'delete-text', sub { $filter = encode('utf8',$filter_entry->get_text); &populate_listing; return '', $filter_entry->get_position+1;} ); + + $filter_entry->set_text( decode('utf8',$filter) ); + + $dialog->vbox->pack_start($label, TRUE, TRUE, TRUE); + $dialog->vbox->pack_start($filter_entry, TRUE, TRUE, TRUE); + + $label->show; + $filter_entry->show; + $dialog->show; + + $dialog->signal_connect(response => sub { if ( $_[1] =~ m/reject/ ) { $dialog->destroy; } } ); +} + +sub options_view_log { + my $dialog = Gtk2::Dialog->new ('', $window, 'destroy-with-parent', decode('utf8',gettext('Clear')) => 'accept', 'gtk-ok' => 'reject'); + $dialog->set_default_response ('reject'); + $dialog->set_has_separator (TRUE); + $dialog->set_default_size ($settings{'width'}, $settings{'height'}); + + my $log_sw = new Gtk2::ScrolledWindow( undef, undef ); + $log_sw->set_policy( 'automatic', 'automatic' ); + $log_sw->set_shadow_type ('in'); + + my $textview = Gtk2::TextView->new(); + $textview->set_editable( FALSE ); + $textview->set_cursor_visible( FALSE ) ; + $textview->set_wrap_mode ( 'none' ) ; + $textview->set_justification ( 'left' ) ; + my $buffer = $textview->get_buffer(); + my $content = ''; + if ( -e $log_file ) { $content = `cat $log_file`; } + $textview->get_buffer()->set_text( $content ); + if ( $content eq '' ) { $dialog->set_response_sensitive ('accept', FALSE) }; + my $tag = $textview->get_buffer()->create_tag ('', 'font', 'courier new'); + $textview->get_buffer()->apply_tag ($tag, $textview->get_buffer()->get_start_iter, $textview->get_buffer()->get_end_iter); + + $log_sw->add_with_viewport( $textview ); + $dialog->vbox->pack_start($log_sw, TRUE, TRUE, TRUE); + + $textview->show(); + $log_sw->show(); + $dialog->show; + + $dialog->signal_connect(response => sub { + if ( $_[1] =~ m/accept/ ) { + if ( -e $log_file ) { `rm -f $log_file`; `touch $log_file`; } + $textview->get_buffer()->set_text( '' ); + $dialog->set_response_sensitive ('accept', FALSE) + } + elsif ( $_[1] =~ m/reject/ ) { $dialog->destroy; } + }); +} + + +sub undo { + my $a=0; + @undo_newname = reverse(@undo_newname); + @undo_oldname = reverse(@undo_oldname); + + # We rename in reverse order to make sure we don't overwrite files/dirs + foreach my $x (@undo_newname) { + rename( $undo_path . $x, $undo_path . $x . '_gp' ); + rename( $undo_path . $x . '_gp', $undo_path . $undo_oldname[$a] ); + $a++; + } + + @undo_newname = reverse(@undo_newname); + @undo_oldname = reverse(@undo_oldname); + $a=0; + + # Then we print to the log file in sorted order + if ($exist == 0) { + open( OUTPUT, '>>', $log_file ) or die "Couldn't open $log_file for writing: $!\n"; + flock( OUTPUT, LOCK_EX ); + if ( $undo_path ne '/' ) { print OUTPUT localtime() . " - " . substr($undo_path, 0, length($undo_path)-1) . "\n"; } + else { print OUTPUT localtime() . " - $undo_path\n"; } + + $a=0; + foreach my $y (@undo_newname) { + print OUTPUT $y; + my $z=length( decode('utf8',$y) ); + while ( $z < $max_length_undo_new ) { print OUTPUT " "; $z++; } + print OUTPUT " => $undo_oldname[$a]\n"; + $a++; + } + + print OUTPUT "\n"; + flock( OUTPUT, LOCK_UN ); + close( OUTPUT ); + } + + $undo_button->set_sensitive(FALSE); + if ( defined $apply_button ) { $apply_button->set_sensitive( FALSE ); } + if ( $exist == 0 ) { &populate_listing; } +} + +sub read_settings { + if ( !-e $setting_file ) { return; } + open( INPUT, '<', $setting_file ) or die "Couldn't open $setting_file for reading: $!\n"; + flock( INPUT, LOCK_EX ); + while (my $line = ) { + chomp($line); + (my $key, my $value) = split(/=/, $line); + $settings{$key} = $value; + } + flock( INPUT, LOCK_UN ); + close( INPUT ); +} + +sub save_settings { + my $width_tmp; + my $height_tmp; + ($width_tmp, $height_tmp) = $window->get_size; + $settings{'width'} = $width_tmp; + $settings{'height'} = $height_tmp; + $settings{'hpaned_width'} = $hpaned->get_position; + + # set $path to be the full path name from the iter selected + my $tree_view = $tv_tree; + my $iter = $tree_view->get_selection->get_selected; + my $tree_model = $tree_view->get_model(); + my $path = ''; # current path selected + my $iter_tmp = $iter; + while( $iter_tmp ) { + $path = $tree_model->get($iter_tmp) . '/' . $path; + $iter_tmp = $tree_model->iter_parent( $iter_tmp ); + } + $path =~ s/\/{2,}/\//g; # replace double slash to only one + if ( $remember_last_directory_rmi->get_active ) { $settings{'remember_last_directory_path'} = encode('utf8',$path); } + else { $settings{'remember_last_directory_path'} = ''; } + + my $key; + open( OUTPUT, '>', $setting_file ) or die "Couldn't open $setting_file for writing: $!\n"; + flock( OUTPUT, LOCK_EX ); + foreach $key ( sort keys %settings ) { print OUTPUT $key, '=', $settings{$key}, "\n"; } + flock( OUTPUT, LOCK_UN ); + close( OUTPUT ); +} + +sub help_contents { + my $dialog = Gtk2::Dialog->new ( decode('utf8',gettext('Tips')), $window, 'destroy-with-parent', 'gtk-ok' => 'accept'); + $dialog->set_has_separator (TRUE); + $dialog->set_default_response ('accept'); + $dialog->set_default_size (470, 330); + + my $tips_sw = new Gtk2::ScrolledWindow( undef, undef ); + $tips_sw->set_policy( 'automatic', 'automatic' ); + $tips_sw->set_shadow_type ('in'); + + my $buffer = Gtk2::TextBuffer->new(); + $buffer->create_tag ("bold", weight => PANGO_WEIGHT_BOLD); + $buffer->create_tag ("indent", 'left-margin' => 20); + my $iter = $buffer->get_start_iter; + my $tmp_menu_options = decode('utf8',gettext('_Options')); + $tmp_menu_options =~ s/_//; + $buffer->insert_with_tags_by_name( $iter, $tmp_menu_options , "bold" ); + $buffer->insert_with_tags_by_name( $iter, "\n- " . decode('utf8',gettext('Trim spaces: Automatically trim double spaces to only one and remove spaces at the beginning or end of the names.')), "indent" ); + $buffer->insert_with_tags_by_name( $iter, "\n\n- " . decode('utf8',gettext('Zero auto-fill: For the Numerical section, 1 will be named 01 if you go up to 99 and 001 if you go up to 999 and so on.')), "indent" ); + $buffer->insert_with_tags_by_name( $iter, "\n\n- " . decode('utf8',gettext('Automatic preview: This option will be turned off automatically if there\'s more than 10,000 files or directories listed.')), "indent" ); + $buffer->insert_with_tags_by_name( $iter, "\n\n- " . decode('utf8',gettext('Disable security check: If used, this can delete files after renaming, only use this when you rename case on a VFAT (Windows) partition.')), "indent" ); + $buffer->insert_with_tags_by_name( $iter, "\n\n" . decode('utf8',gettext('Insert / Delete')), "bold" ); + $buffer->insert_with_tags_by_name( $iter, "\n- " . decode('utf8',gettext('To specify the end, use a negative number or a high number.')), "indent" ); + $buffer->insert_with_tags_by_name( $iter, "\n\n" . decode('utf8',gettext('Replace / Remove')), "bold" ); + $buffer->insert_with_tags_by_name( $iter, "\n- " . decode('utf8',gettext('Backreferences with Regular expression cannot be use as $1 is considered a Perl variable.')), "indent" ); + + my $textview = Gtk2::TextView->new_with_buffer( $buffer ); + $textview->set_editable( FALSE ); + $textview->set_cursor_visible( FALSE ) ; + $textview->set_wrap_mode ( 'word' ) ; + + $dialog->vbox->pack_start( $tips_sw, TRUE, TRUE, TRUE ); + $tips_sw->add_with_viewport( $textview ); + + $textview->show(); + $tips_sw->show(); + $dialog->show; + + $dialog->signal_connect( response => sub { + my( $self, $response ) = @_; + $self->destroy; + }); +} + +sub help_about { + my $dialog = Gtk2::Dialog->new( decode('utf8',gettext('About')), $window, 'destroy-with-parent', 'gtk-ok' => 'accept' ); + $dialog->set_default_response( 'accept' ); + $dialog->set_has_separator( TRUE ); + $dialog->set_default_size( 450, 260 ); + + my $about_sw = new Gtk2::ScrolledWindow( undef, undef ); + $about_sw->set_policy( 'automatic', 'automatic' ); + $about_sw->set_shadow_type ('in'); + + my $buffer = Gtk2::TextBuffer->new(); + $buffer->create_tag( 'bold', weight => PANGO_WEIGHT_BOLD ); + $buffer->create_tag( 'big', size => 15 * PANGO_SCALE ); + $buffer->create_tag( 'italic', style => 'italic' ); + my $iter = $buffer->get_start_iter; + my $icon = '/usr/local/share/pixmaps/gprename/gprename.png'; + my $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file( $icon ); + + $buffer->insert_pixbuf ($iter, $pixbuf); + $buffer->insert_with_tags_by_name( $iter, "\n GPRename " . $str_gprename_version, 'bold', 'big' ); + $buffer->insert_with_tags_by_name( $iter, "\n\nA complete batch renamer for files and directories." ); + $buffer->insert_with_tags_by_name( $iter, "\n\nMailing list", 'bold' ); + $buffer->insert_with_tags_by_name( $iter, " - gprename-users\@lists.sourceforge.net" ); + $buffer->insert_with_tags_by_name( $iter, "\nHome Page", 'bold' ); + $buffer->insert_with_tags_by_name( $iter, " - http://gprename.sourceforge.net" ); + $buffer->insert_with_tags_by_name( $iter, "\nWikipedia", 'bold' ); + $buffer->insert_with_tags_by_name( $iter, " - http://en.wikipedia.org/wiki/GPRename" ); + + my $textview = Gtk2::TextView->new_with_buffer($buffer); + $textview->set_editable( FALSE ); + $textview->set_cursor_visible( FALSE ) ; + $textview->set_wrap_mode ( 'word' ) ; + $textview->set_justification ( 'center' ) ; + + $dialog->vbox->pack_start($about_sw, TRUE, TRUE, TRUE); + $about_sw->add_with_viewport( $textview ); + + $textview->show(); + $about_sw->show(); + $dialog->show; + + $dialog->signal_connect (response => sub { + my ($self, $response) = @_; + $self->destroy; + }); +} + +sub open_tree { + # Set $path to be the directory to open gprename in + my $path; + if ( defined($ARGV[0]) ) { + if ( $ARGV[0] eq "/" ) { $path = $ARGV[0]; } + else { + if ( -e $ENV{PWD} . "/" . $ARGV[0] ) { $path = $ENV{PWD} . "/" . $ARGV[0]; } + else { $path = $ARGV[0]; } + } + } + elsif ( $settings{'remember_last_directory'} ) { $path = $settings{'remember_last_directory_path'}; } + else { $path = $ENV{PWD}; } + + $path =~ s/\s$//g; # remove the last space + $path =~ s/\/{2,}/\//g; # replace double slash to only one + $path =~ s/\/^//g; # remove last trailing slash + if ( -f $path ) { $path = `dirname "$path"`; } # remove the filename at the end of the path if there is one + $path =~ s/\n//g; # dirname adds a newline (i.e. \n), so remove it + + # Set some useful variables + my @paths = split( /\//, $path); + shift(@paths); # remove the first item which is empty + my $size = @paths; # need $size to get the last item of @paths + $path = ''; + my $iter = $tv_tree->get_model->get_iter_first; + $tv_tree->get_selection->select_iter( $iter ); # select the first iter which is '/' in case the use has the remember last directory option check and wants to remember / + $iter = $tv_tree->get_model->iter_nth_child ($iter, 0); # set $iter to point to the first directory in / + + # Open up the tree where the user wants to be + foreach my $x (@paths) { + $path = $path . '/' . $x; + if ( -e $path ) { + if ( !defined $iter ) { + print "Permission denied for this folder!" . "\n"; + exit; + } + + while ( defined $iter and decode('utf8',$x) ne $tv_tree->get_model->get($iter) ) { + $iter = $tv_tree->get_model->iter_next($iter); + } + if ( $iter ) { + $tv_tree->get_selection->select_iter( $iter ); + # expand the path only if it's not the last item + if ( $x ne $paths[$size-1] ) { + $tv_tree->expand_to_path( $tv_tree->get_model->get_path( $iter ) ); + $iter = $tv_tree->get_model->iter_nth_child($iter, 0); + } + } + } + else { + print "Path doesn't exist!" . "\n"; + exit; + } + } + + # List the files/directories + &populate_listing; +} diff -Nru gprename-2.6.6/build/gprename.desktop gprename-20140325/build/gprename.desktop --- gprename-2.6.6/build/gprename.desktop 1970-01-01 00:00:00.000000000 +0000 +++ gprename-20140325/build/gprename.desktop 2014-03-25 22:47:23.000000000 +0000 @@ -0,0 +1,9 @@ +[Desktop Entry] +Version=1.0 +Name=GPRename +Comment=To rename files and directories in batch +Exec=gprename +Icon=gprename +Terminal=false +Type=Application +Categories=Utility; Binary files /tmp/jKqIQ9ffod/gprename-2.6.6/build/locale/ca.mo and /tmp/3UHFnpDK9L/gprename-20140325/build/locale/ca.mo differ Binary files /tmp/jKqIQ9ffod/gprename-2.6.6/build/locale/de.mo and /tmp/3UHFnpDK9L/gprename-20140325/build/locale/de.mo differ Binary files /tmp/jKqIQ9ffod/gprename-2.6.6/build/locale/es.mo and /tmp/3UHFnpDK9L/gprename-20140325/build/locale/es.mo differ Binary files /tmp/jKqIQ9ffod/gprename-2.6.6/build/locale/et.mo and /tmp/3UHFnpDK9L/gprename-20140325/build/locale/et.mo differ Binary files /tmp/jKqIQ9ffod/gprename-2.6.6/build/locale/fr.mo and /tmp/3UHFnpDK9L/gprename-20140325/build/locale/fr.mo differ Binary files /tmp/jKqIQ9ffod/gprename-2.6.6/build/locale/id.mo and /tmp/3UHFnpDK9L/gprename-20140325/build/locale/id.mo differ Binary files /tmp/jKqIQ9ffod/gprename-2.6.6/build/locale/it.mo and /tmp/3UHFnpDK9L/gprename-20140325/build/locale/it.mo differ Binary files /tmp/jKqIQ9ffod/gprename-2.6.6/build/locale/nl.mo and /tmp/3UHFnpDK9L/gprename-20140325/build/locale/nl.mo differ Binary files /tmp/jKqIQ9ffod/gprename-2.6.6/build/locale/pl.mo and /tmp/3UHFnpDK9L/gprename-20140325/build/locale/pl.mo differ Binary files /tmp/jKqIQ9ffod/gprename-2.6.6/build/locale/pt_BR.mo and /tmp/3UHFnpDK9L/gprename-20140325/build/locale/pt_BR.mo differ Binary files /tmp/jKqIQ9ffod/gprename-2.6.6/build/locale/ru.mo and /tmp/3UHFnpDK9L/gprename-20140325/build/locale/ru.mo differ Binary files /tmp/jKqIQ9ffod/gprename-2.6.6/build/locale/sv.mo and /tmp/3UHFnpDK9L/gprename-20140325/build/locale/sv.mo differ Binary files /tmp/jKqIQ9ffod/gprename-2.6.6/build/locale/zh_CN.mo and /tmp/3UHFnpDK9L/gprename-20140325/build/locale/zh_CN.mo differ diff -Nru gprename-2.6.6/COPYING gprename-20140325/COPYING --- gprename-2.6.6/COPYING 2011-12-01 02:43:43.000000000 +0000 +++ gprename-20140325/COPYING 1970-01-01 00:00:00.000000000 +0000 @@ -1,621 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS diff -Nru gprename-2.6.6/COPYING.TXT gprename-20140325/COPYING.TXT --- gprename-2.6.6/COPYING.TXT 1970-01-01 00:00:00.000000000 +0000 +++ gprename-20140325/COPYING.TXT 2014-03-24 20:26:26.000000000 +0000 @@ -0,0 +1,621 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS diff -Nru gprename-2.6.6/debian/changelog gprename-20140325/debian/changelog --- gprename-2.6.6/debian/changelog 2015-05-08 06:45:19.000000000 +0000 +++ gprename-20140325/debian/changelog 2015-05-07 15:30:25.000000000 +0000 @@ -1,3 +1,22 @@ +gprename (20140325-1) unstable; urgency=low + + * New upstream release (Closes: #693118) + - Fixed directory with dot Bug (Closes: #781182) + * debian/control: + - Updated Standard-Version + - Added desktop-file-utils to Build-Dependencies + - Updated Build-Dependencies for debhelper + - Removed Build-Dependency on quilt + * debian/compat: + - Changed compat level to v9 + * debian/rules: + - Removed patch and unpatch targets as they are not needed anymore + * Switch to dpkg-source 3.0 (quilt) format + * Removed README.source + * Updated debian/copyright to copyright-format 1.0 + + -- Marvin Stark Tue, 05 May 2015 21:39:57 +0000 + gprename (2.6.6-1) unstable; urgency=low * New upstream release diff -Nru gprename-2.6.6/debian/compat gprename-20140325/debian/compat --- gprename-2.6.6/debian/compat 2015-05-08 06:45:19.000000000 +0000 +++ gprename-20140325/debian/compat 2015-03-19 13:59:10.000000000 +0000 @@ -1 +1 @@ -8 +9 diff -Nru gprename-2.6.6/debian/control gprename-20140325/debian/control --- gprename-2.6.6/debian/control 2015-05-08 06:45:19.000000000 +0000 +++ gprename-20140325/debian/control 2015-05-05 09:49:48.000000000 +0000 @@ -2,8 +2,8 @@ Section: utils Priority: optional Maintainer: Marvin Stark -Build-Depends: debhelper (>= 8.0.0), quilt -Standards-Version: 3.9.2 +Build-Depends: debhelper (>= 9.0.0), desktop-file-utils +Standards-Version: 3.9.6 Package: gprename Architecture: all diff -Nru gprename-2.6.6/debian/copyright gprename-20140325/debian/copyright --- gprename-2.6.6/debian/copyright 2015-05-08 06:45:19.000000000 +0000 +++ gprename-20140325/debian/copyright 2015-05-06 07:44:28.000000000 +0000 @@ -1,27 +1,64 @@ -This package was debianized by Marvin Stark on -Tue, 05 Apr 2007 16:40:15 +0200. - -It was downloaded from - -Copyright Holder: Copyright (C) 2008 gprename-users@lists.sourceforge.net - -Please remember that a mailinglist is not able to make any decisions -about the copyrighted material. - -License: - - This package is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 3 as - published by the Free Software Foundation; - - This package is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this package; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -On Debian systems, the complete text of the GNU General -Public License can be found in `/usr/share/common-licenses/GPL-3'. +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: GPRename +Upstream-Contact: http://sourceforge.net/p/gprename/bugs +Source: http://sourceforge.net/p/gprename/code/HEAD/tree/ + +Files: * +Copyright: Copyright (C) 2007-2014 gprename-users@lists.sourceforge.net +License: GPL-3+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the full text of the GNU General Public + License version 3 can be found in the file + `/usr/share/common-licenses/GPL-3'. + +Files: locale/sv.po +Copyright: Copyright (C) 2012 Free Software Foundation, Inc. +License: GPL-3+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the full text of the GNU General Public + License version 3 can be found in the file + `/usr/share/common-licenses/GPL-3'. + +Files: debian/* +Copyright: Copyright (C) 2007-2015 Marvin Stark +License: GPL-3+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the full text of the GNU General Public + License version 3 can be found in the file + `/usr/share/common-licenses/GPL-3'. diff -Nru gprename-2.6.6/debian/docs gprename-20140325/debian/docs --- gprename-2.6.6/debian/docs 2015-05-08 06:45:19.000000000 +0000 +++ gprename-20140325/debian/docs 2015-03-19 11:03:43.000000000 +0000 @@ -1 +1 @@ -README +README.TXT diff -Nru gprename-2.6.6/debian/patches/001-Makefile.diff gprename-20140325/debian/patches/001-Makefile.diff --- gprename-2.6.6/debian/patches/001-Makefile.diff 1970-01-01 00:00:00.000000000 +0000 +++ gprename-20140325/debian/patches/001-Makefile.diff 2015-05-05 09:58:01.000000000 +0000 @@ -0,0 +1,57 @@ +Description: Fix Makefile to install files into right directory +Author: Marvin Stark +Forwarded: No +--- a/Makefile ++++ b/Makefile +@@ -45,8 +45,9 @@ + # Create directories + install -d "$(DESTDIR)" + install -d "$(DESTDIR)/bin" +- install -d "/usr/share" +- install -d "/usr/share/icons" ++ install -d "$(DESTDIR)/share" ++ install -d "$(DESTDIR)/share/icons" ++ install -d "$(DESTDIR)/share/pixmaps/gprename" + install -d "$(DESTDIR)/share/applications" + install -d "$(DESTDIR)/share/man" + install -d "$(DESTDIR)/share/man/man1" +@@ -67,7 +68,8 @@ + # Copy all files in the filesystem + install -m 755 build/gprename "$(DESTDIR)/bin/" + install -m 644 gprename-nautilus-actions.xml "$(DESTDIR)/share/applications/" +- install -m 644 icon/gprename.png "/usr/share/icons/" ++ install -m 644 icon/gprename.png "$(DESTDIR)/share/icons/" ++ install -m 644 icon/gprename.png "$(DESTDIR)/share/pixmaps/gprename/" + install -m 644 man/gprename.1 "$(DESTDIR)/share/man/man1/" + install -m 644 build/locale/ca.mo "$(DESTDIR)/share/locale/ca/LC_MESSAGES/gprename.mo" + install -m 644 build/locale/de.mo "$(DESTDIR)/share/locale/de/LC_MESSAGES/gprename.mo" +@@ -82,13 +84,14 @@ + install -m 644 build/locale/ru.mo "$(DESTDIR)/share/locale/ru/LC_MESSAGES/gprename.mo" + install -m 644 build/locale/sv.mo "$(DESTDIR)/share/locale/sv/LC_MESSAGES/gprename.mo" + install -m 644 build/locale/zh_CN.mo "$(DESTDIR)/share/locale/zh_CN/LC_MESSAGES/gprename.mo" +- desktop-file-install bin/gprename.desktop +- update-desktop-database ++ # Debian delivers this over the package. ++ #desktop-file-install bin/gprename.desktop ++ #update-desktop-database + @echo "Installation completed." + + uninstall: clean + rm -f "$(DESTDIR)/bin/gprename" +- rm -f "/usr/share/applications/gprename.desktop" ++ rm -f "$(DESTDIR)/share/applications/gprename.desktop" + rm -f "$(DESTDIR)/share/applications/gprename-nautilus-actions.xml" + rm -f "$(DESTDIR)/share/man/man1/gprename.1" + rm -f "$(DESTDIR)/share/locale/ca/LC_MESSAGES/gprename.mo" +@@ -104,8 +107,9 @@ + rm -f "$(DESTDIR)/share/locale/ru/LC_MESSAGES/gprename.mo" + rm -f "$(DESTDIR)/share/locale/sv/LC_MESSAGES/gprename.mo" + rm -f "$(DESTDIR)/share/locale/zh_CN/LC_MESSAGES/gprename.mo" +- rm -fr "/usr/share/icons/gprename" +- update-desktop-database ++ # We don't need this for packaging ++ #rm -fr "/usr/share/icons/gprename" ++ #update-desktop-database + + clean: + rm -rf build diff -Nru gprename-2.6.6/debian/patches/002-gprename-path-corrections gprename-20140325/debian/patches/002-gprename-path-corrections --- gprename-2.6.6/debian/patches/002-gprename-path-corrections 1970-01-01 00:00:00.000000000 +0000 +++ gprename-20140325/debian/patches/002-gprename-path-corrections 2015-05-05 10:00:14.000000000 +0000 @@ -0,0 +1,32 @@ +Description: Fix icon location for gprename, upstream is working with fixed paths +Author: Marvin Stark +Forwarded: No +--- a/bin/gprename ++++ b/bin/gprename +@@ -61,7 +61,7 @@ + + # set the locale + setlocale(LC_ALL, ''); +-bindtextdomain( 'gprename', '/usr/local/share/locale'); ++bindtextdomain( 'gprename', '@INSTALLDIR@/share/locale'); + textdomain( 'gprename' ); + + # Change the font to courier new for the Tree and the SimpleList +@@ -127,7 +127,7 @@ + $window->add_accel_group( $accel_group ); + + # Set the window icon +-my $icon = '/usr/share/icons/gprename.png'; ++my $icon = '@INSTALLDIR@/share/icons/gprename.png'; + my $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file( $icon ); + $window->set_icon( $pixbuf ); + +@@ -1440,7 +1440,7 @@ + $buffer->create_tag( 'big', size => 15 * PANGO_SCALE ); + $buffer->create_tag( 'italic', style => 'italic' ); + my $iter = $buffer->get_start_iter; +- my $icon = '/usr/local/share/pixmaps/gprename/gprename.png'; ++ my $icon = '@INSTALLDIR@/share/pixmaps/gprename/gprename.png'; + my $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file( $icon ); + + $buffer->insert_pixbuf ($iter, $pixbuf); diff -Nru gprename-2.6.6/debian/patches/series gprename-20140325/debian/patches/series --- gprename-2.6.6/debian/patches/series 2015-05-08 06:45:19.000000000 +0000 +++ gprename-20140325/debian/patches/series 2015-03-19 14:13:00.000000000 +0000 @@ -1 +1,3 @@ # Empty. No patches needed at the moment. +001-Makefile.diff +002-gprename-path-corrections diff -Nru gprename-2.6.6/debian/README.source gprename-20140325/debian/README.source --- gprename-2.6.6/debian/README.source 2015-05-08 06:45:19.000000000 +0000 +++ gprename-20140325/debian/README.source 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -This package uses quilt to manage all modifications to the upstream -source. Changes are stored in the source package as diffs in -debian/patches and applied during the build. - -To configure quilt to use debian/patches instead of patches, you want -either to export QUILT_PATCHES=debian/patches in your environment -or use this snippet in your ~/.quiltrc: - - for where in ./ ../ ../../ ../../../ ../../../../ ../../../../../; do - if [ -e ${where}debian/rules -a -d ${where}debian/patches ]; then - export QUILT_PATCHES=debian/patches - fi - done - -To get the fully patched source after unpacking the source package, cd to -the root level of the source package and run: - - fakeroot debian/rules install - quilt push -a - -The last patch listed in debian/patches/series will become the current -patch. - -To add a new set of changes, first run quilt push -a, and then run: - - quilt new - -where is a descriptive name for the patch, used as the filename in -debian/patches. Then, for every file that will be modified by this patch, -run: - - quilt add - -before editing those files. You must tell quilt with quilt add what files -will be part of the patch before making changes or quilt will not work -properly. After editing the files, run: - - quilt refresh - -to save the results as a patch. - -Alternately, if you already have an external patch and you just want to -add it to the build system, run quilt push -a and then: - - quilt import -P /path/to/patch - quilt push -a - -(add -p 0 to quilt import if needed). as above is the filename to -use in debian/patches. The last quilt push -a will apply the patch to -make sure it works properly. - -To remove an existing patch from the list of patches that will be applied, -run: - - quilt delete - -You may need to run quilt pop -a to unapply patches first before running -this command. diff -Nru gprename-2.6.6/debian/rules gprename-20140325/debian/rules --- gprename-2.6.6/debian/rules 2015-05-08 06:45:19.000000000 +0000 +++ gprename-20140325/debian/rules 2015-05-06 07:20:19.000000000 +0000 @@ -1,9 +1,6 @@ #!/usr/bin/make -f -# Include quilt. -include /usr/share/quilt/quilt.make - -build: build-stamp patch +build: build-stamp build-arch: build build-indep: build @@ -11,7 +8,7 @@ dh_testdir touch build-stamp -clean: unpatch +clean: rm -f patches dh_testdir dh_testroot @@ -34,7 +31,10 @@ binary-indep: build install # Fix gprename.desktop file. - cp -f build/gprename.desktop debian/gprename/usr/share/applications/gprename.desktop + #cp -f build/gprename.desktop debian/gprename/usr/share/applications/gprename.desktop + # Add debian menu icon + install -d $(CURDIR)/debian/gprename/usr/share/pixmaps/gprename + cp $(CURDIR)/icon/gprename_debian_menu_icon.xpm $(CURDIR)/debian/gprename/usr/share/pixmaps/gprename/gprename_debian_menu_icon.xpm dh_testdir dh_testroot dh_installchangelogs @@ -48,7 +48,7 @@ dh_md5sums dh_builddeb -binary-arch: build install patch +binary-arch: build install binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install diff -Nru gprename-2.6.6/debian/source/format gprename-20140325/debian/source/format --- gprename-2.6.6/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ gprename-20140325/debian/source/format 2015-04-02 15:20:30.000000000 +0000 @@ -0,0 +1 @@ +3.0 (quilt) diff -Nru gprename-2.6.6/locale/ca.po gprename-20140325/locale/ca.po --- gprename-2.6.6/locale/ca.po 2011-12-01 02:43:43.000000000 +0000 +++ gprename-20140325/locale/ca.po 2014-03-24 20:26:25.000000000 +0000 @@ -1,11 +1,11 @@ # Catalan translation -# Copyright (C) 2007 GPRename +# Copyright (C) 2012 GPRename # This file is distributed under the same license as the GPRename package. -# gprename-users@lists.sourceforge.net, 2007 +# gprename-users@lists.sourceforge.net, 2012 msgid "" msgstr "" -"Project-Id-Version: GPRename 2.4\n" +"Project-Id-Version: GPRename 2.7\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff -Nru gprename-2.6.6/locale/de.po gprename-20140325/locale/de.po --- gprename-2.6.6/locale/de.po 2011-12-01 02:45:47.000000000 +0000 +++ gprename-20140325/locale/de.po 2014-03-24 20:26:25.000000000 +0000 @@ -1,11 +1,11 @@ # German translation -# Copyright (C) 2007 GPRename +# Copyright (C) 2012 GPRename # This file is distributed under the same license as the GPRename package. -# gprename-users@lists.sourceforge.net, 2007 +# gprename-users@lists.sourceforge.net, 2012 msgid "" msgstr "" -"Project-Id-Version: GPRename 2.4\n" +"Project-Id-Version: GPRename 2.7\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff -Nru gprename-2.6.6/locale/es.po gprename-20140325/locale/es.po --- gprename-2.6.6/locale/es.po 2011-12-01 02:43:43.000000000 +0000 +++ gprename-20140325/locale/es.po 2014-03-24 20:26:25.000000000 +0000 @@ -1,11 +1,11 @@ # Spanish translation -# Copyright (C) 2007 GPRename +# Copyright (C) 2012 GPRename # This file is distributed under the same license as the GPRename package. -# gprename-users@lists.sourceforge.net, 2007 +# gprename-users@lists.sourceforge.net, 2012 msgid "" msgstr "" -"Project-Id-Version: GPRename 2.4\n" +"Project-Id-Version: GPRename 2.7\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff -Nru gprename-2.6.6/locale/et.po gprename-20140325/locale/et.po --- gprename-2.6.6/locale/et.po 2011-12-01 02:43:43.000000000 +0000 +++ gprename-20140325/locale/et.po 2014-03-24 20:26:25.000000000 +0000 @@ -1,13 +1,13 @@ # Estonian translation -# Copyright (C) 2007 GPRename +# Copyright (C) 2012 GPRename # This file is distributed under the same license as the GPRename package. -# gprename-users@lists.sourceforge.net, 2007 -# mihkel , 2008. +# gprename-users@lists.sourceforge.net, 2012 +# mihkel , 2012. # # msgid "" msgstr "" -"Project-Id-Version: GPRename 2.6.2\n" +"Project-Id-Version: GPRename 2.7\n" "Report-Msgid-Bugs-To: turakas@gmail.com\n" "POT-Creation-Date: (null)\n" "PO-Revision-Date: 2008-09-03 12:15+0300\n" diff -Nru gprename-2.6.6/locale/fr.po gprename-20140325/locale/fr.po --- gprename-2.6.6/locale/fr.po 2011-12-01 02:43:43.000000000 +0000 +++ gprename-20140325/locale/fr.po 2014-03-24 20:26:25.000000000 +0000 @@ -1,11 +1,11 @@ # French translation -# Copyright (C) 2007 GPRename +# Copyright (C) 2012 GPRename # This file is distributed under the same license as the GPRename package. -# gprename-users@lists.sourceforge.net, 2007 +# gprename-users@lists.sourceforge.net, 2012 msgid "" msgstr "" -"Project-Id-Version: GPRename 2.6\n" +"Project-Id-Version: GPRename 2.7\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -80,7 +80,7 @@ msgstr "Sélectionné" msgid "Case Change" -msgstr "Casse" +msgstr "Case" msgid "ALL UPPERCASE" msgstr "TOUT EN MAJUSCULES" @@ -134,7 +134,7 @@ msgstr "et incrémente de" msgid "Insert before the numbers" -msgstr "Insèrer avant les nombres" +msgstr "Insérer avant les nombres" msgid "and after" msgstr "et après" @@ -166,6 +166,9 @@ msgid "Cannot rename because it already exist." msgstr "Impossible de renommer parce qu'il existe déjà." +msgid "Cannot rename because the filename is too long." +msgstr "Impossible de renommer parce que le nom du fichier est trop long." + msgid "The log file is over 1M, you should clear it from the Options menu." msgstr "Le journal est plus grand que 1M, vous devriez l'effacer à partir du menu Options." diff -Nru gprename-2.6.6/locale/id.po gprename-20140325/locale/id.po --- gprename-2.6.6/locale/id.po 2011-12-01 02:43:43.000000000 +0000 +++ gprename-20140325/locale/id.po 2014-03-24 20:26:25.000000000 +0000 @@ -1,11 +1,11 @@ # Indonesian translation -# Copyright (C) 2007 GPRename +# Copyright (C) 2012 GPRename # This file is distributed under the same license as the GPRename package. -# gprename-users@lists.sourceforge.net, 2007 +# gprename-users@lists.sourceforge.net, 2012 msgid "" msgstr "" -"Project-Id-Version: GPRename 2.4\n" +"Project-Id-Version: GPRename 2.7\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff -Nru gprename-2.6.6/locale/it.po gprename-20140325/locale/it.po --- gprename-2.6.6/locale/it.po 2011-12-01 02:43:43.000000000 +0000 +++ gprename-20140325/locale/it.po 2014-03-24 20:26:25.000000000 +0000 @@ -1,11 +1,11 @@ # Italian translation -# Copyright (C) 2007 GPRename +# Copyright (C) 2012 GPRename # This file is distributed under the same license as the GPRename package. -# gprename-users@lists.sourceforge.net, 2007 +# gprename-users@lists.sourceforge.net, 2012 msgid "" msgstr "" -"Project-Id-Version: GPRename 2.4\n" +"Project-Id-Version: GPRename 2.7\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff -Nru gprename-2.6.6/locale/nl.po gprename-20140325/locale/nl.po --- gprename-2.6.6/locale/nl.po 2011-12-01 02:43:43.000000000 +0000 +++ gprename-20140325/locale/nl.po 2014-03-24 20:26:25.000000000 +0000 @@ -1,11 +1,11 @@ # Dutch translation -# Copyright (C) 2007 GPRename +# Copyright (C) 2012 GPRename # This file is distributed under the same license as the GPRename package. -# gprename-users@lists.sourceforge.net, 2007 +# gprename-users@lists.sourceforge.net, 2012 msgid "" msgstr "" -"Project-Id-Version: GPRename 2.4\n" +"Project-Id-Version: GPRename 2.7\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff -Nru gprename-2.6.6/locale/pl.po gprename-20140325/locale/pl.po --- gprename-2.6.6/locale/pl.po 2011-12-01 02:43:43.000000000 +0000 +++ gprename-20140325/locale/pl.po 2014-03-24 20:26:25.000000000 +0000 @@ -1,11 +1,11 @@ # Polish translation -# Copyright (C) 2007 GPRename +# Copyright (C) 2012 GPRename # This file is distributed under the same license as the GPRename package. -# gprename-users@lists.sourceforge.net, 2007 +# gprename-users@lists.sourceforge.net, 2012 msgid "" msgstr "" -"Project-Id-Version: GPRename 2.4\n" +"Project-Id-Version: GPRename 2.7\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff -Nru gprename-2.6.6/locale/pt_BR.po gprename-20140325/locale/pt_BR.po --- gprename-2.6.6/locale/pt_BR.po 2011-12-01 02:43:43.000000000 +0000 +++ gprename-20140325/locale/pt_BR.po 2014-03-24 20:26:25.000000000 +0000 @@ -1,11 +1,11 @@ # Brazilian Portuguese translation -# Copyright (C) 2007 GPRename +# Copyright (C) 2012 GPRename # This file is distributed under the same license as the GPRename package. -# gprename-users@lists.sourceforge.net, 2007 +# gprename-users@lists.sourceforge.net, 2012 msgid "" msgstr "" -"Project-Id-Version: GPRename 2.4\n" +"Project-Id-Version: GPRename 2.7\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff -Nru gprename-2.6.6/locale/ru.po gprename-20140325/locale/ru.po --- gprename-2.6.6/locale/ru.po 2011-12-01 02:43:43.000000000 +0000 +++ gprename-20140325/locale/ru.po 2014-03-24 20:26:25.000000000 +0000 @@ -1,11 +1,11 @@ # Russian translation -# Copyright (C) 2007 GPRename +# Copyright (C) 2012 GPRename # This file is distributed under the same license as the GPRename package. -# gprename-users@lists.sourceforge.net, 2007 +# gprename-users@lists.sourceforge.net, 2012 msgid "" msgstr "" -"Project-Id-Version: GPRename 2.6\n" +"Project-Id-Version: GPRename 2.7\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff -Nru gprename-2.6.6/locale/sv.po gprename-20140325/locale/sv.po --- gprename-2.6.6/locale/sv.po 2011-12-01 02:43:43.000000000 +0000 +++ gprename-20140325/locale/sv.po 2014-03-24 20:26:25.000000000 +0000 @@ -1,11 +1,11 @@ # Swedish translation for GPRename -# Copyright (C) 2007 Free Software Foundation, Inc. +# Copyright (C) 2012 Free Software Foundation, Inc. # This file is distributed under the same license as the GPRename package. -# Daniel Nylander , 2007. +# Daniel Nylander , 2012. msgid "" msgstr "" -"Project-Id-Version: GPRename 2.4\n" +"Project-Id-Version: GPRename 2.7\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff -Nru gprename-2.6.6/locale/zh_CN.po gprename-20140325/locale/zh_CN.po --- gprename-2.6.6/locale/zh_CN.po 2011-12-01 02:44:02.000000000 +0000 +++ gprename-20140325/locale/zh_CN.po 2014-03-24 20:26:25.000000000 +0000 @@ -1,11 +1,11 @@ # Chinese (Simplified) translation -# Copyright (C) 2007 GPRename +# Copyright (C) 2012 GPRename # This file is distributed under the same license as the GPRename package. -# gprename-users@lists.sourceforge.net, 2007 +# gprename-users@lists.sourceforge.net, 2012 msgid "" msgstr "" -"Project-Id-Version: GPRename 2.4\n" +"Project-Id-Version: GPRename 2.7\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff -Nru gprename-2.6.6/Makefile gprename-20140325/Makefile --- gprename-2.6.6/Makefile 2011-12-01 02:43:43.000000000 +0000 +++ gprename-20140325/Makefile 2014-03-24 21:06:04.000000000 +0000 @@ -45,8 +45,8 @@ # Create directories install -d "$(DESTDIR)" install -d "$(DESTDIR)/bin" - install -d "$(DESTDIR)/share/pixmaps" - install -d "$(DESTDIR)/share/pixmaps/gprename" + install -d "/usr/share" + install -d "/usr/share/icons" install -d "$(DESTDIR)/share/applications" install -d "$(DESTDIR)/share/man" install -d "$(DESTDIR)/share/man/man1" @@ -65,30 +65,30 @@ install -d "$(DESTDIR)/share/locale/zh_CN/LC_MESSAGES" # Copy all files in the filesystem - install -m 755 build/gprename "$(DESTDIR)/bin/" - install -m 644 build/gprename.desktop "$(DESTDIR)/share/applications/" - install -m 644 gprename-nautilus-actions.xml "$(DESTDIR)/share/applications/" - install -m 644 icon/* "$(DESTDIR)/share/pixmaps/gprename" - install -m 644 man/gprename.1 "$(DESTDIR)/share/man/man1/" - install -m 644 build/locale/ca.mo "$(DESTDIR)/share/locale/ca/LC_MESSAGES/gprename.mo" - install -m 644 build/locale/de.mo "$(DESTDIR)/share/locale/de/LC_MESSAGES/gprename.mo" - install -m 644 build/locale/es.mo "$(DESTDIR)/share/locale/es/LC_MESSAGES/gprename.mo" - install -m 644 build/locale/et.mo "$(DESTDIR)/share/locale/et/LC_MESSAGES/gprename.mo" - install -m 644 build/locale/fr.mo "$(DESTDIR)/share/locale/fr/LC_MESSAGES/gprename.mo" - install -m 644 build/locale/id.mo "$(DESTDIR)/share/locale/id/LC_MESSAGES/gprename.mo" - install -m 644 build/locale/it.mo "$(DESTDIR)/share/locale/it/LC_MESSAGES/gprename.mo" - install -m 644 build/locale/nl.mo "$(DESTDIR)/share/locale/nl/LC_MESSAGES/gprename.mo" - install -m 644 build/locale/pl.mo "$(DESTDIR)/share/locale/pl/LC_MESSAGES/gprename.mo" - install -m 644 build/locale/pt_BR.mo "$(DESTDIR)/share/locale/pt_BR/LC_MESSAGES/gprename.mo" - install -m 644 build/locale/ru.mo "$(DESTDIR)/share/locale/ru/LC_MESSAGES/gprename.mo" - install -m 644 build/locale/sv.mo "$(DESTDIR)/share/locale/sv/LC_MESSAGES/gprename.mo" - install -m 644 build/locale/zh_CN.mo "$(DESTDIR)/share/locale/zh_CN/LC_MESSAGES/gprename.mo" - + install -m 755 build/gprename "$(DESTDIR)/bin/" + install -m 644 gprename-nautilus-actions.xml "$(DESTDIR)/share/applications/" + install -m 644 icon/gprename.png "/usr/share/icons/" + install -m 644 man/gprename.1 "$(DESTDIR)/share/man/man1/" + install -m 644 build/locale/ca.mo "$(DESTDIR)/share/locale/ca/LC_MESSAGES/gprename.mo" + install -m 644 build/locale/de.mo "$(DESTDIR)/share/locale/de/LC_MESSAGES/gprename.mo" + install -m 644 build/locale/es.mo "$(DESTDIR)/share/locale/es/LC_MESSAGES/gprename.mo" + install -m 644 build/locale/et.mo "$(DESTDIR)/share/locale/et/LC_MESSAGES/gprename.mo" + install -m 644 build/locale/fr.mo "$(DESTDIR)/share/locale/fr/LC_MESSAGES/gprename.mo" + install -m 644 build/locale/id.mo "$(DESTDIR)/share/locale/id/LC_MESSAGES/gprename.mo" + install -m 644 build/locale/it.mo "$(DESTDIR)/share/locale/it/LC_MESSAGES/gprename.mo" + install -m 644 build/locale/nl.mo "$(DESTDIR)/share/locale/nl/LC_MESSAGES/gprename.mo" + install -m 644 build/locale/pl.mo "$(DESTDIR)/share/locale/pl/LC_MESSAGES/gprename.mo" + install -m 644 build/locale/pt_BR.mo "$(DESTDIR)/share/locale/pt_BR/LC_MESSAGES/gprename.mo" + install -m 644 build/locale/ru.mo "$(DESTDIR)/share/locale/ru/LC_MESSAGES/gprename.mo" + install -m 644 build/locale/sv.mo "$(DESTDIR)/share/locale/sv/LC_MESSAGES/gprename.mo" + install -m 644 build/locale/zh_CN.mo "$(DESTDIR)/share/locale/zh_CN/LC_MESSAGES/gprename.mo" + desktop-file-install bin/gprename.desktop + update-desktop-database @echo "Installation completed." uninstall: clean rm -f "$(DESTDIR)/bin/gprename" - rm -f "$(DESTDIR)/share/applications/gprename.desktop" + rm -f "/usr/share/applications/gprename.desktop" rm -f "$(DESTDIR)/share/applications/gprename-nautilus-actions.xml" rm -f "$(DESTDIR)/share/man/man1/gprename.1" rm -f "$(DESTDIR)/share/locale/ca/LC_MESSAGES/gprename.mo" @@ -104,7 +104,8 @@ rm -f "$(DESTDIR)/share/locale/ru/LC_MESSAGES/gprename.mo" rm -f "$(DESTDIR)/share/locale/sv/LC_MESSAGES/gprename.mo" rm -f "$(DESTDIR)/share/locale/zh_CN/LC_MESSAGES/gprename.mo" - rm -fr "$(DESTDIR)/share/pixmaps/gprename" + rm -fr "/usr/share/icons/gprename" + update-desktop-database clean: rm -rf build diff -Nru gprename-2.6.6/README gprename-20140325/README --- gprename-2.6.6/README 2011-12-01 02:43:43.000000000 +0000 +++ gprename-20140325/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,294 +0,0 @@ - ___ ___ __ - / _ \ / _ \/__\ ___ ____ ____ ________ ___ - / /_\// /_)/ \/// _ \ _ \ / _ | _ _ \ / _ \ -/ /_\\/ ___/ _ \ __/ | | | (_| | | | | | | __/ -\____/\/ \/ \_/\___|_| |_|\__,_|_| |_| |_|\___| - - *********************************************** - -GPRename is a complete batch renamer for files and directories. - -Copyright (C) 2011 gprename-users@lists.sourceforge.net - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License or -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -file COPYING that came with this software for details. - -Mailing list - https://lists.sourceforge.net/lists/listinfo/gprename-users -Home Page - http://gprename.sourceforge.net -Wikipedia - http://en.wikipedia.org/wiki/GPRename - - -Requirements ---------------------------------------------------------------------------- - - perl: http://www.perl.org - - glib-perl: http://search.cpan.org/~tsch - - gtk2-perl: http://search.cpan.org/~tsch - - gnu-gettext: http://www.gnu.org/software/gettext/gettext.html - - perl-gettext: http://search.cpan.org/~pvandry - - libintl-perl: http://search.cpan.org/~guido - - nautilus-actions: http://www.grumz.net (optional) ---------------------------------------------------------------------------- - - -Installation ---------------------------------------------------------------------------- -GPRename is probably in your distribution's package manager, if it's not -follow these direction to install it : - -Download: http://sourceforge.net/project/showfiles.php?group_id=40094 - -After downloading GPRename, open up a terminal and type these commands: -tar xvjf gprename-X.X.X.tar.bz2 -cd gprename -sudo make install - -For Ubuntu or Debian, run this command in a terminal before compiling it: -sudo apt-get install build-essential libintl-perl gettext nautilus-actions - -Optional: If you're running Gnome and you're using Nautilus and you want -the contextual menu with the right-click button to show GPRename, then -install nautilus-actions, go into System/Preferences/Nautilus Actions -Configuration, click Tools, Import Assistant..., Forward, select -gprename-nautilus-actions.xml, Foward, Forward, Apply, Close, click the -Record icon to save the changes and, finally, you might have to close -Nautilus and open it up to be able to show the changes. If it doesn't you -can always call 'nautilus -q' to force it to restart. - -GPRename will now be installed and can be opened by calling 'gprename' -in a terminal or by selecting it in the Accessories menu in Gnome or with -the contextual menus in Nautilus if you've installed nautilus-actions. - -To uninstall: sudo make uninstall - -Installation from SVN: -Install the application Subversion, open up a terminal, type: -svn co https://gprename.svn.sourceforge.net/svnroot/gprename gprename -and follow the instructions above. ---------------------------------------------------------------------------- - - -Credits ---------------------------------------------------------------------------- - - Albino Riganello Translation: Italian (2.3) - - Bart'omiej Gródek Translation: Polish (1.24-2.6) - - Dominik Fretz Patch (<1.00) - - Duane Toler Bugs reports (<1.00) - - Johan Spee Logo, icon, bugs and features (2.1-2.2) - - Jose Oswaldo Translation: Brazilian Portuguese (2.1-2.5) - - Marcin Juszkiewicz Debian package (0.92) - - Martintxo Translation: Spanish (1.21-2.1) - - Marvin Stark Maintainer, Debian packager (2.2-2.5) - - nestor di Logo and icon (1.20-2.0) - - Petter Sundlöf Install script (0.92-1.3) - - Rudinei Weschenfelder Translation: Brazil (2.6.6) - - Salman Farisy Translation: Indonesian (2.4) - - Tristesse Author (0.90-1.24) - - Wayne E. Nail Bugs and features reports (2.0-2.5) - - Zurd Maintainer (1.0-2.6.6) ---------------------------------------------------------------------------- - - -Translation ---------------------------------------------------------------------------- -Download GPRename, extract it and go into the locale directory. -Copy the file fr.po and modify it to any language and send it on the -mailing list at gprename-users@lists.sourceforge.net - -Note that some strings have a underscore ( _ ), use it as a mnemonics, -which is a letter underlined and you can call it with ALT-letter in the -application and, of course, don't underline 2 times the same letter. ---------------------------------------------------------------------------- - - -To do ---------------------------------------------------------------------------- -Recursive options to re-implement - -Create an RPM of the latest version available. - -Implement a new column Date that can be sorted. -Implement a new column Filesize that can be sorted. - -Add a right-click option to rename just 1 file. - -Option : Insert numerical at a specific position - -Add a swap checkbox to swap text. -Example : "Artist - Song.mp3" -Swap to "Song - Artist.mp3" by using " - " as a swap text ---------------------------------------------------------------------------- - - -Changelog ---------------------------------------------------------------------------- -GPRename 2.6.6 2011-11-30 - Zurd -Added Translation : Brazil -Modified nautilus-action script - -GPRename 2.6.4 2010-06-21 - Zurd -Added Translation : Russian - -GPRename 2.6.3 2008-09-03 - Zurd -Added Translation : Estonian - -GPRename 2.6.2 - 2008-07-14 - Zurd -Fixed Bug with makefile where it couldn't be built if there was spaces in your path - -GPRename 2.6.1 2008-07-12 - Zurd -Added Translation: Swedish - -GPRename 2.6 2008-07-10 - Zurd -Added Translation: Chinese Simplified -Added The file gprename.schemas, to use for importing in Nautilus Actions -Fixed Bug where opening gprename with only a file in the parameter (i.e. gprename README) -Modified Translation: Polish -Modified GPRename files are now in ~/.config/gprename instead of ~/ -Modified Optimization of the function preview -Modified Automatic Preview: Will be turned off automatically if there's more than 10,000 files or directories - -GPRename 2.5 2007-09-29 - Zurd, Marvin Stark -Added Option: Show hidden files -Added Option: Remember last directory -Added Status bar -Added Translation: Catalan -Added Translation: Swedish -Modified Translation: German - -GPRename 2.4 2007-07-24 - Zurd, Marvin Stark -Added Calling GPRename with a partial path ('gprename local' in /usr) -Added Indonesian translation -Modified Makefile, added PREFIX, icon location is set correctly now -Modified Languages, automatically set by the system at opening (gettext) -Modified Change the license from GPL-2 to GPL-3 - -GPRename 2.3 2007-06-14 - Zurd, Marvin Stark -Added Manpage -Added New installation system -Added Debian 32x32 menu pixmap -Added Translation: Italian -Added Translation: Deutsch -Fixed Bug with first language selected and opening GPRename -Modified Translation: Brazilian Portuguese -Modified Translation: Dutch -Modified Translation: Polish - -GPRename 2.2 2007-04-10 - Zurd -Added Translation: Dutch -Added Change mouse cursor to a watch when waiting -Fixed Bug where accents characters couldn't be displayed -Fixed Bug that couldn't display files starting with a dash (-) - -GPRename 2.1 2007-03-13 - Zurd -Added Option: Show path -Added Option: Filter -Added In the tab Case: Only first letter -Added Refresh button -Added Automatically opening the tree at start -Added Translation: Brazilian Portuguese -Modified Better handling of language encodings from the language file -Modified ComboBox in Numerical to Radio Buttons - -GPRename 2.0 2007-01-15 - Zurd -Added Ability to see hidden files or directories -Added Size window preferences saved when the application quits -Added Option: Fullscreen -Added Option: Automatic preview -Added Option: View log -Added Option: Trim double, beginning and end spaces -Added Option: Disable security check (to rename case on a VFAT partition) -Added Automatic change of label when choosing a different language -Added Mnemonics on buttons and menus (Underscore letter: ALT-letter) -Added Automatic resize of column Name and New name -Added The file gprename.desktop to add an entry in the Application Menu -Modified Port from GTK-Perl to GTK2-Perl -Modified User interface -Modified gprename-uninstall.sh with file test operators -Modified Font: All text are now in Courier new -Removed Option: Recursive renaming (to do) -Removed Automatically opening the tree at start (to do) -Removed Chinese Translation again, missing too much new words - -GPRename 1.7 2006-04-26 - Zurd -Modified Install script for compatibility with Gentoo's ebuild - -GPRename 1.6 2006-02-27 - Zurd -Added Warning message box if a file already exist before renaming it -Fixed Bug #1095489 that would overwrite files - -GPRename 1.5 2006-02-24 - Zurd -Added Can now add text at the end with a checkbox -Modified Languages file, README, install script, website, tips - -GPRename 1.4 2006-02-22 - Zurd -Added uninstall.sh: to easily uninstall GPRename completely -Modified Languages files, they now all have a standard. Some string in it are labeled 'x', since I can't translate them. -Modified install.sh: Automatic install so the Gentoo's ebuild can be done more easily. - -GPRename 1.3 2006-01-27 - Zurd -Added Tooltip for the Insert radio button -Added Option to use the preview button or not -Added Option to automatically trim spaces at the beginning -Added Option to rename files recursively -Fixed Bug with directories with spaces not selected after opening GPRename -Modified About dialog -Modified The insert radio button is now the default - -GPRename 1.24 2004-06-23 - Tristesse -Added Translation: Polish - -GPRename 1.23 2004-03-18 - Tristesse -Fixed Language title so that it is translated in all language -Fixed Bug where 2 directories were selected at the opening - -GPRename 1.22 2004-03-16 - Zurd -Fixed A bug, now the starting directory will be deselected when another directory is selected -Modified Disabled the undo button when it can't be used -Modified Set default focus on the 'Close' button in a Dialog - -GPRename 1.21 2004-03-14 - Zurd -Added Translation: Spanish -Added Select the start directory in the tree - -GPRename 1.20 2004-03-13 - Tristesse -Added Window icon -Added Language selection menu -Added Translation: Chinese - -GPRename 1.11 2004-03-07 - Zurd -Added Some tooltips for a better understanding of some options -Modified Location of some widget, looks better now - -GPRename 1.10 2004-03-03 - Zurd -Modified All the widgets on the four tabs at the bottom, takes now less space and there is more space available for the tree and the file/directory list - -GPRename 1.00 2004-02-25 - Zurd -Added Renaming directory -Added Translation: French -Added Combo box "Do not keep existing filenames" in the numerical section -Added The GPRename logo in ASCII ;-) -Fixed A bug, now GPRename can better change case on a vfat partition -Fixed A bug, now GPRename can use a dot in the First Letter Case Change -Fixed A bug, now GPRename can open in 640x480 and a user can close the window -Modified Installation file, cleaned it and it is now asking for a language to use -Modified Opening directory, either the current directory or the first argument -Removed Size and Modified time shown in the list of files -Removed Chinese translation, too much new labels and I don't know chinese - -GPRename 0.92 2002-05-22 - Tristesse -Added The script install.sh -Fixed Bug with subdirectory -Modified Default directory now set to $HOME - -GPRename 0.91 2002-05-16 - Tristesse -Fixed A bug, now GPRename can handle spaces in directories - -GPRename 0.90 2001-11-30 - Tristesse -Initial release ---------------------------------------------------------------------------- diff -Nru gprename-2.6.6/README.TXT gprename-20140325/README.TXT --- gprename-2.6.6/README.TXT 1970-01-01 00:00:00.000000000 +0000 +++ gprename-20140325/README.TXT 2014-03-25 22:54:26.000000000 +0000 @@ -0,0 +1,315 @@ + ___ ___ __ + / _ \ / _ \/__\ ___ ____ ____ ________ ___ + / /_\// /_)/ \/// _ \ _ \ / _ | _ _ \ / _ \ +/ /_\\/ ___/ _ \ __/ | | | (_| | | | | | | __/ +\____/\/ \/ \_/\___|_| |_|\__,_|_| |_| |_|\___| + + *********************************************** + +GPRename is a complete batch renamer for files and directories. + +Copyright (C) 2014 gprename-users@lists.sourceforge.net + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License or +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +file COPYING that came with this software for details. + +Mailing list - https://lists.sourceforge.net/lists/listinfo/gprename-users +Home Page - http://gprename.sourceforge.net +Wikipedia - http://en.wikipedia.org/wiki/GPRename + + +Requirements +--------------------------------------------------------------------------- + - perl: http://www.perl.org + - glib-perl: http://search.cpan.org/~tsch + - gtk2-perl: http://search.cpan.org/~tsch + - gnu-gettext: http://www.gnu.org/software/gettext/gettext.html + - perl-gettext: http://search.cpan.org/~pvandry + - libintl-perl: http://search.cpan.org/~guido + - nautilus-actions: http://www.grumz.net (optional) +--------------------------------------------------------------------------- + + +Installation +--------------------------------------------------------------------------- +GPRename is probably in your distribution's package manager, if it's not +follow these direction to easily install it : + +Download: http://sourceforge.net/project/showfiles.php?group_id=40094 + +After downloading GPRename, open up a terminal and type these commands: +tar xvjf gprename-XXXXXXXX.tar.bz2 +cd gprename +sudo make install + +For Ubuntu or Debian, run this command in a terminal before you install it: +sudo apt-get install build-essential libintl-perl gettext nautilus-actions + +Optional: If you're running Gnome and you're using Nautilus and you want +the contextual menu with the right-click button to show GPRename, then +install nautilus-actions, go into System/Preferences/Nautilus Actions +Configuration, click Tools, Import Assistant..., Forward, select +gprename-nautilus-actions.xml, Foward, Forward, Apply, Close, click the +Record icon to save the changes and, finally, you might have to close +Nautilus and open it up to be able to show the changes. If it doesn't you +can always call 'nautilus -q' to force it to restart. + +GPRename will now be installed and can be opened by calling 'gprename' +in a terminal or by selecting it in the Accessories menu in Gnome or with +the contextual menus in Nautilus if you've installed nautilus-actions. + +To run GPRename in another language, you need to open the application +like so : LANGUAGE=fr gprename +The complete list of available languages is in the locale directory. + +To uninstall: sudo make uninstall + +Installation from SVN: +Install the application Subversion, open up a terminal, type: +svn co https://gprename.svn.sourceforge.net/svnroot/gprename gprename +and follow the instructions above. +--------------------------------------------------------------------------- + + +Credits +--------------------------------------------------------------------------- + - Albino Riganello Translation: Italian (2.3) + - Algimantas Margevičius Translation: Lithuanian (2.7) + - Bart'omiej Gródek Translation: Polish (1.24-2.6) + - Dominik Fretz Patch (<1.00) + - Duane Toler Bugs reports (<1.00) + - Johan Spee Logo, icon, bugs and features (2.1-2.2) + - Jose Oswaldo Translation: Brazilian Portuguese (2.1-2.5) + - Marcin Juszkiewicz Debian package (0.92) + - Martintxo Translation: Spanish (1.21-2.1) + - Marvin Stark Maintainer, Debian packager (2.2-2.5) + - nestor di Logo and icon (1.20-2.0) + - Petter Sundlöf Install script (0.92-1.3) + - Rudinei Weschenfelder Translation: Brazil (2.6.6) + - Salman Farisy Translation: Indonesian (2.4) + - Tristesse Author (0.90-1.24) + - Wayne E. Nail Bugs and features reports (2.0-2.5) + - Zurd Maintainer (1.0-20140325) +--------------------------------------------------------------------------- + + +Translation +--------------------------------------------------------------------------- +Download GPRename, extract it and go into the locale directory. +Copy the file gprename.po and modify it to any language and send it on the +mailing list at gprename-users@lists.sourceforge.net + +Note that some strings have a underscore ( _ ), use it as a mnemonics, +which is a letter underlined and you can call it with ALT-letter in the +application and, of course, don't underline 2 times the same letter. +--------------------------------------------------------------------------- + + +To do +--------------------------------------------------------------------------- +Recursive options to re-implement + +Create an RPM of the latest version available. + +Implement a new column Date that can be sorted. +Implement a new column Filesize that can be sorted. + +Add a right-click option to rename just 1 file. + +Option : Insert numerical at a specific position + +Add a swap checkbox to swap text. +Example : "Artist - Song.mp3" +Swap to "Song - Artist.mp3" by using " - " as a swap text +--------------------------------------------------------------------------- + + +Changelog +--------------------------------------------------------------------------- +GPRename 20140325 - Zurd +Modified icon file location in gprename.desktop +Added "Permission denied" and "Path doesn't exist" error message + +GPRename 5 2013-06-29 - Zurd +Modified Field 'Add numbers starting at' from a maximum of 9,999 to 999,999 + +GPRename 4 2013-05-03 - Zurd +Modified How GPRename rename long filename over 253 characters + +GPRename 3 2013-01-19 - Zurd +Modified Translation : French + +GPRename 2.7 2012-05-15 - Zurd +Added Translation : Lithuanian + +GPRename 2.6.6 2011-11-30 - Zurd +Added Translation : Brazil +Modified nautilus-action script + +GPRename 2.6.4 2010-06-21 - Zurd +Added Translation : Russian + +GPRename 2.6.3 2008-09-03 - Zurd +Added Translation : Estonian + +GPRename 2.6.2 - 2008-07-14 - Zurd +Fixed Bug with makefile where it couldn't be built if there was spaces in your path + +GPRename 2.6.1 2008-07-12 - Zurd +Added Translation: Swedish + +GPRename 2.6 2008-07-10 - Zurd +Added Translation: Chinese Simplified +Added The file gprename.schemas, to use for importing in Nautilus Actions +Fixed Bug where opening gprename with only a file in the parameter (i.e. gprename README) +Modified Translation: Polish +Modified GPRename files are now in ~/.config/gprename instead of ~/ +Modified Optimization of the function preview +Modified Automatic Preview: Will be turned off automatically if there's more than 10,000 files or directories + +GPRename 2.5 2007-09-29 - Zurd, Marvin Stark +Added Option: Show hidden files +Added Option: Remember last directory +Added Status bar +Added Translation: Catalan +Added Translation: Swedish +Modified Translation: German + +GPRename 2.4 2007-07-24 - Zurd, Marvin Stark +Added Calling GPRename with a partial path ('gprename local' in /usr) +Added Indonesian translation +Modified Makefile, added PREFIX, icon location is set correctly now +Modified Languages, automatically set by the system at opening (gettext) +Modified Change the license from GPL-2 to GPL-3 + +GPRename 2.3 2007-06-14 - Zurd, Marvin Stark +Added Manpage +Added New installation system +Added Debian 32x32 menu pixmap +Added Translation: Italian +Added Translation: Deutsch +Fixed Bug with first language selected and opening GPRename +Modified Translation: Brazilian Portuguese +Modified Translation: Dutch +Modified Translation: Polish + +GPRename 2.2 2007-04-10 - Zurd +Added Translation: Dutch +Added Change mouse cursor to a watch when waiting +Fixed Bug where accents characters couldn't be displayed +Fixed Bug that couldn't display files starting with a dash (-) + +GPRename 2.1 2007-03-13 - Zurd +Added Option: Show path +Added Option: Filter +Added In the tab Case: Only first letter +Added Refresh button +Added Automatically opening the tree at start +Added Translation: Brazilian Portuguese +Modified Better handling of language encodings from the language file +Modified ComboBox in Numerical to Radio Buttons + +GPRename 2.0 2007-01-15 - Zurd +Added Ability to see hidden files or directories +Added Size window preferences saved when the application quits +Added Option: Fullscreen +Added Option: Automatic preview +Added Option: View log +Added Option: Trim double, beginning and end spaces +Added Option: Disable security check (to rename case on a VFAT partition) +Added Automatic change of label when choosing a different language +Added Mnemonics on buttons and menus (Underscore letter: ALT-letter) +Added Automatic resize of column Name and New name +Added The file gprename.desktop to add an entry in the Application Menu +Modified Port from GTK-Perl to GTK2-Perl +Modified User interface +Modified gprename-uninstall.sh with file test operators +Modified Font: All text are now in Courier new +Removed Option: Recursive renaming (to do) +Removed Automatically opening the tree at start (to do) +Removed Chinese Translation again, missing too much new words + +GPRename 1.7 2006-04-26 - Zurd +Modified Install script for compatibility with Gentoo's ebuild + +GPRename 1.6 2006-02-27 - Zurd +Added Warning message box if a file already exist before renaming it +Fixed Bug #1095489 that would overwrite files + +GPRename 1.5 2006-02-24 - Zurd +Added Can now add text at the end with a checkbox +Modified Languages file, README, install script, website, tips + +GPRename 1.4 2006-02-22 - Zurd +Added uninstall.sh: to easily uninstall GPRename completely +Modified Languages files, they now all have a standard. Some string in it are labeled 'x', since I can't translate them. +Modified install.sh: Automatic install so the Gentoo's ebuild can be done more easily. + +GPRename 1.3 2006-01-27 - Zurd +Added Tooltip for the Insert radio button +Added Option to use the preview button or not +Added Option to automatically trim spaces at the beginning +Added Option to rename files recursively +Fixed Bug with directories with spaces not selected after opening GPRename +Modified About dialog +Modified The insert radio button is now the default + +GPRename 1.24 2004-06-23 - Tristesse +Added Translation: Polish + +GPRename 1.23 2004-03-18 - Tristesse +Fixed Language title so that it is translated in all language +Fixed Bug where 2 directories were selected at the opening + +GPRename 1.22 2004-03-16 - Zurd +Fixed A bug, now the starting directory will be deselected when another directory is selected +Modified Disabled the undo button when it can't be used +Modified Set default focus on the 'Close' button in a Dialog + +GPRename 1.21 2004-03-14 - Zurd +Added Translation: Spanish +Added Select the start directory in the tree + +GPRename 1.20 2004-03-13 - Tristesse +Added Window icon +Added Language selection menu +Added Translation: Chinese + +GPRename 1.11 2004-03-07 - Zurd +Added Some tooltips for a better understanding of some options +Modified Location of some widget, looks better now + +GPRename 1.10 2004-03-03 - Zurd +Modified All the widgets on the four tabs at the bottom, takes now less space and there is more space available for the tree and the file/directory list + +GPRename 1.00 2004-02-25 - Zurd +Added Renaming directory +Added Translation: French +Added Combo box "Do not keep existing filenames" in the numerical section +Added The GPRename logo in ASCII ;-) +Fixed A bug, now GPRename can better change case on a vfat partition +Fixed A bug, now GPRename can use a dot in the First Letter Case Change +Fixed A bug, now GPRename can open in 640x480 and a user can close the window +Modified Installation file, cleaned it and it is now asking for a language to use +Modified Opening directory, either the current directory or the first argument +Removed Size and Modified time shown in the list of files +Removed Chinese translation, too much new labels and I don't know chinese + +GPRename 0.92 2002-05-22 - Tristesse +Added The script install.sh +Fixed Bug with subdirectory +Modified Default directory now set to $HOME + +GPRename 0.91 2002-05-16 - Tristesse +Fixed A bug, now GPRename can handle spaces in directories + +GPRename 0.90 2001-11-30 - Tristesse +Initial release +---------------------------------------------------------------------------