diff options
-rwxr-xr-x | perl-install/standalone/drakfont | 17 |
1 files 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 ]); + } } } |