From 770daeb5d2b473d50d67b4e9423c2e914aed718b Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 15 Feb 2005 16:36:47 +0000 Subject: create ->ask_filename and ->ask_directory to replace ->ask_file --- perl-install/interactive/gtk.pm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'perl-install/interactive/gtk.pm') diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm index c55a5f41c..d29c2df9b 100644 --- a/perl-install/interactive/gtk.pm +++ b/perl-install/interactive/gtk.pm @@ -24,11 +24,17 @@ sub leave_console { my ($o) = @_; common::setVirtual(delete $o->{suspended}) } sub exit { ugtk2::exit(@_) } sub ask_fileW { - my ($_o, $title, $dir) = @_; - my $w = ugtk2->new($title); - $dir .= '/' if $dir !~ m|/$|; - ugtk2::_ask_file($w, $title, $dir); - $w->main; + my ($in, $common) = @_; + + my $w = ugtk2::create_file_selector(%$common); + + my $file; + $w->main(sub { + $file = $w->{chooser}->get_filename; + my $err = ugtk2::file_selected_check($common->{save}, $common->{want_a_dir}, $file); + $err and $in->ask_warn('', $err); + !$err; + }) && $file; } sub create_boxradio { -- cgit v1.2.1