summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2005-02-25 13:31:42 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2005-02-25 13:31:42 +0000
commit9da35c2fa63624414b646f8fd5b2c6629490eada (patch)
tree830c566f0a6da1e42dca504e009ca79a07399dd8
parent4649e7e046e9899c0175003a4e89812e85b0ab01 (diff)
downloaddrakx-backup-do-not-use-9da35c2fa63624414b646f8fd5b2c6629490eada.tar
drakx-backup-do-not-use-9da35c2fa63624414b646f8fd5b2c6629490eada.tar.gz
drakx-backup-do-not-use-9da35c2fa63624414b646f8fd5b2c6629490eada.tar.bz2
drakx-backup-do-not-use-9da35c2fa63624414b646f8fd5b2c6629490eada.tar.xz
drakx-backup-do-not-use-9da35c2fa63624414b646f8fd5b2c6629490eada.zip
(backend_mod) fix uninstalling fonts (#9324)
-rwxr-xr-xperl-install/standalone/drakfont37
1 files changed, 26 insertions, 11 deletions
diff --git a/perl-install/standalone/drakfont b/perl-install/standalone/drakfont
index 57df30e9f..92252201d 100755
--- a/perl-install/standalone/drakfont
+++ b/perl-install/standalone/drakfont
@@ -226,9 +226,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
@@ -457,7 +459,7 @@ sub backend_mod() {
print "\nUninstall Specifics Fonts.........\n";
search_installed_fonts_full_path();
if ($interactive) { search_dir_font_uninstall_gi() }
- else { search_dir_font_uninstall() foreach @uninstall }
+ else { search_dir_font_uninstall($_) foreach @uninstall }
remove_fonts();
print "\nThe End............................\n";
}
@@ -586,15 +588,28 @@ 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 = Gtk2::FileSelection->new(N("File Selection"));
- $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"));
- $file_dialog->cancel_button->signal_connect(clicked => sub { $file_dialog->response('cancel') });
- $file_dialog->cancel_button->set_label(N("Close"));
+ $file_dialog = Gtk2::FileChooserDialog->new(N("File Selection"), $window1->{window}, 'open', 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->ok_button->signal_connect(clicked => \&file_ok_sel, $file_dialog);
+# $file_dialog->cancel_button->signal_connect(clicked => sub { $file_dialog->destroy });
$file_dialog->show;
- $file_dialog->run;
- $file_dialog->destroy;
+ while (my $answer = $file_dialog->run) {
+ print "ANSWER IS «$answer»\n";
+ if (member($answer, qw(cancel delete-event))) {
+ $file_dialog->destroy;
+ return;
+ } elsif ($answer eq 'ok') {
+ #file_ok_sel();
+ my @names = $file_dialog->get_filenames();
+ }
+ }
}
sub file_ok_sel {
@@ -609,7 +624,7 @@ sub file_ok_sel {
$model->append_set(undef, [ 0 => $file_name ]);
}
}
- $file_selection->response('ok')
+ Gtk2->main;
}
sub list_remove() { #- TODO : multi-selection