From 9bd3d6915ddac3a64ae7b067bbaf409f0a65678d Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Sun, 20 Feb 2005 10:37:59 +0000 Subject: allow to select multiple files --- perl-install/standalone/drakfont | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'perl-install') diff --git a/perl-install/standalone/drakfont b/perl-install/standalone/drakfont index 11d46aa3c..ad0fe0488 100755 --- a/perl-install/standalone/drakfont +++ b/perl-install/standalone/drakfont @@ -586,6 +586,7 @@ sub font_choice() { my $file_dialog; $select_font_msg = N("Select the font file or directory and click on 'Add'"); $file_dialog = Gtk2::FileSelection->new(N("File Selection")); + $file_dialog->set_select_multiple(1); $file_dialog->signal_connect(delete_event => sub { $file_dialog->response('close') }); $file_dialog->ok_button->signal_connect(clicked => \&file_ok_sel, $file_dialog); $file_dialog->ok_button->set_label(N("Add")); @@ -598,12 +599,12 @@ sub font_choice() { sub file_ok_sel { my ($_w, $file_selection) = @_; - my $file_name = $file_selection->get_filename; - if ($file_name =~ /\Q$select_font_msg/) { + if ($file_selection->get_filename =~ /\Q$select_font_msg/) { create_dialog(N("Error"), N("You've not selected any font")); } else { print "-- @install\n"; - if (!member($file_name, @install)) { + my @files = $file_selection->get_selections; + foreach my $file_name (difference2(\@files, \@install)) { push @install, $file_name; $model->append_set(undef, [ 0 => $file_name ]); } -- cgit v1.2.1