summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2005-04-20 14:50:03 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2005-04-20 14:50:03 +0000
commit0b93b8f4544d1a8698c3ec1c2b1d416bad91a0eb (patch)
treeb86282f3aa8fdc64f2223957f6b65b1a05595a46
parent119a212b839ae94a7c0a67e0372776569ee57bbd (diff)
downloaddrakx-backup-do-not-use-0b93b8f4544d1a8698c3ec1c2b1d416bad91a0eb.tar
drakx-backup-do-not-use-0b93b8f4544d1a8698c3ec1c2b1d416bad91a0eb.tar.gz
drakx-backup-do-not-use-0b93b8f4544d1a8698c3ec1c2b1d416bad91a0eb.tar.bz2
drakx-backup-do-not-use-0b93b8f4544d1a8698c3ec1c2b1d416bad91a0eb.tar.xz
drakx-backup-do-not-use-0b93b8f4544d1a8698c3ec1c2b1d416bad91a0eb.zip
(font_choice) filter file list so that only fonts are displayed
-rwxr-xr-xperl-install/standalone/drakfont10
1 files changed, 9 insertions, 1 deletions
diff --git a/perl-install/standalone/drakfont b/perl-install/standalone/drakfont
index 3422d73ca..da9653de9 100755
--- a/perl-install/standalone/drakfont
+++ b/perl-install/standalone/drakfont
@@ -225,9 +225,11 @@ sub search_windows_font() {
1;
}
+my @font_extensions = qw(ttf pfa pfb pcf pcf.gz pfm gsf);
+
sub is_a_font($) {
my ($file) = @_;
- any { $file =~ /\Q.$_\E$/i } qw(ttf pfa pfb pcf pcf.gz pfm gsf);
+ any { $file =~ /\Q.$_\E$/i } @font_extensions;
}
# Optimisation de cette etape indispensable
@@ -588,6 +590,12 @@ sub font_choice() {
$file_dialog = Gtk2::FileChooserDialog->new(N("File Selection"), $window1->{real_window}, 'open', N("Cancel") => 'cancel', N("Ok") => 'ok'); # 'select_folder'
$file_dialog->set_select_multiple(1);
+ my $filter = Gtk2::FileFilter->new;
+ $filter->set_name(N("Fonts"));
+ $filter->add_pattern("*.$_") foreach @font_extensions;
+ $file_dialog->add_filter($filter);
+ $file_dialog->set_filter($filter);
+
$file_dialog->show;
while (my $answer = $file_dialog->run) {
if (member($answer, qw(cancel delete-event))) {