Applications-BackupAndRestore

 view release on metacpan or  search on metacpan

lib/Gtk2/Ex/FileLocator/FileChooser.pm  view on Meta::CPAN

sub on_delete_event {
   my ( $widget, $event, $this ) = @_;
   $widget->hide;
   return 1;
}

sub get_current_folder {
   my ($this) = @_;
   $this->get('chooser')->get_current_folder;
}

sub set_current_folder {
   my ( $this, $folder ) = @_;
   $this->get('chooser')->set_current_folder( $folder || "" );
}

sub get_filename {
   my ($this) = @_;
   my $uri = $this->get('chooser')->get_uri || "";
   $uri =~ s|^.+?\://||o if $uri;
   return $uri;
}

sub set_filename {
   my ( $this, $filename ) = @_;

   return unless $filename;
   return if ( $this->get('chooser')->get_filename || "" ) eq $filename;

   #$this->Debug($filename);
   $this->get('chooser')->set_filename( $this->{path} );

   return;
}

sub get_uri {
   my ($this) = @_;
   $this->get('chooser')->get_uri;
}

sub set_uri {
   my ( $this, $uri ) = @_;

   return unless $uri;
   return if ( $this->get('chooser')->get_uri || "" ) eq $uri;

   $this->Debug($this, $uri);
   $this->get('chooser')->set_uri($uri);

   return;
}

sub Debug {
   my ( $this, @values ) = @_;
   return unless $DEBUG;
   printf "# %s %s\n", &caller_subroutine, @values
     ? join " ", map { defined $_ ? $_ : "" } @values
     : "";
}

sub caller_subroutine { ( caller(2) )[3] || "" }
1;
__END__



( run in 1.034 second using v1.01-cache-2.11-cpan-75ffa21a3d4 )