Applications-BackupAndRestore
view release on metacpan or search on metacpan
lib/Gtk2/Ex/FileLocator/Helper.pm view on Meta::CPAN
sub string_shell_escape {
my $string = shift;
$string =~ s/([\#\'\&\|\s\<\>\{\}\(\)\?\*\!\[\]])/\\$1/sg;
$string =~ s/([`"])/?/sg;
return $string;
}
sub string_shell_unescape {
my $string = shift;
$string = CGI::unescape($string);
$string = Unicode::MapUTF8::from_utf8( { -string => $string, -charset => 'ISO-8859-1' } );
return $string;
}
sub string_shell_complete {
my $chunk = string_shell_escape(shift);
my @pattern = map { "$_/$chunk" } "/bin", split ":", $ENV{PATH};
chdir $ENV{HOME};
my $match = "";
lib/Gtk2/Ex/FileLocator/PathnameField.pm view on Meta::CPAN
my ($this) = @_;
printf "PF set_text %s\n", $this->get_filename;
my $filename = string_shell_unescape($this->get_filename);
$filename .= "/" if -d $filename;
$filename =~ s|/+|/|sgo;
$filename = Unicode::MapUTF8::from_utf8(
{ -string => $filename, -charset => 'ISO-8859-1' } );
$this->{filename} = $filename;
$this->get('entry')->set_text($filename);
$this->get('entry')->set_position( $this->{cursorPosition} );
# Gtk2->main_iteration while Gtk2->events_pending;
# $this->signal_emit( 'scroll_offset_changed',
# $this->get('entry')->get("scroll-offset") );
}
#sub on_move_cursor {
lib/Gtk2/Ex/FileLocator/RecycleButton.pm view on Meta::CPAN
if ( -d $filename ) {
$filename =~ s|\.{1,2}/*$||o; # remove ../ or ../ from end
$filename .= "/"; # add a / at the end
$filename =~ s|/+|/|sgo; # remove double //
}
my $image = Gtk2::Image->new;
image_set_file_icon( $image, $filename, $this->{iconsize} );
$filename = Unicode::MapUTF8::from_utf8(
{ -string => $filename, -charset => 'ISO-8859-1' } );
my @children = $this->{menu}->get_children;
return
if @children
and grep { $_->get_child->get_text eq $filename } @children;
$this->Debug($filename);
my $menuItem = Gtk2::ImageMenuItem->new($filename);
$menuItem->set_image($image);
$menuItem->signal_connect_after( 'activate' => \&on_menu_activated, $this );
( run in 0.260 second using v1.01-cache-2.11-cpan-4d50c553e7e )