From f428a9ecda87cfcbb1877e08b25448b4577159b9 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 15 May 2003 14:42:31 +0000 Subject: fix #1352 : do not add buggy font directories --- perl-install/standalone/drakfont | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/perl-install/standalone/drakfont b/perl-install/standalone/drakfont index ac6255503..8790a9884 100755 --- a/perl-install/standalone/drakfont +++ b/perl-install/standalone/drakfont @@ -709,24 +709,31 @@ sub appli_choice() { $font_box->show_all(); } +my $select_font_msg; + sub font_choice() { my $file_dialog; + $select_font_msg = N("Select the font file or directory and click on 'Add'"); $file_dialog = gtksignal_connect(new Gtk2::FileSelection(N("File Selection")), destroy => sub { $file_dialog->destroy() }); $file_dialog->ok_button->signal_connect(clicked => \&file_ok_sel, $file_dialog); $file_dialog->ok_button->set_label(N("Add")); $file_dialog->cancel_button->signal_connect(clicked => sub { $file_dialog->destroy() }); $file_dialog->cancel_button->set_label(N("Close")); - $file_dialog->set_filename(N("Select the font file or directory and click on 'Add'")); + $file_dialog->set_filename($select_font_msg); $file_dialog->show(); } sub file_ok_sel { my ($_widget, $file_selection) = @_; my $file_name = $file_selection->get_filename(); - print "-- @install\n"; - if (!member($file_name, @install)) { - push @install, $file_name; - $model->append_set(undef, [ 0 => $file_name ]); + if ($file_name =~ /$select_font_msg/) { + create_dialog(N("You've not selected any font")); + } else { + print "-- @install\n"; + if (!member($file_name, @install)) { + push @install, $file_name; + $model->append_set(undef, [ 0 => $file_name ]); + } } } -- cgit v1.2.1