diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2004-07-29 10:57:49 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2004-07-29 10:57:49 +0000 |
commit | 207ec36649fe5d46adb02833ffba703da5b86df9 (patch) | |
tree | 8005684602d12c18a4e86837c17777298fc60f58 /perl-install/standalone | |
parent | af58c9e7835dee9421ca8e37713846049fa0b4e2 (diff) | |
download | drakx-backup-do-not-use-207ec36649fe5d46adb02833ffba703da5b86df9.tar drakx-backup-do-not-use-207ec36649fe5d46adb02833ffba703da5b86df9.tar.gz drakx-backup-do-not-use-207ec36649fe5d46adb02833ffba703da5b86df9.tar.bz2 drakx-backup-do-not-use-207ec36649fe5d46adb02833ffba703da5b86df9.tar.xz drakx-backup-do-not-use-207ec36649fe5d46adb02833ffba703da5b86df9.zip |
(show_prev) do not crash when the image format is unknown
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-x | perl-install/standalone/draksplash | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/perl-install/standalone/draksplash b/perl-install/standalone/draksplash index a9e990c5f..f6bada3d8 100755 --- a/perl-install/standalone/draksplash +++ b/perl-install/standalone/draksplash @@ -4,7 +4,7 @@ use strict; use lib qw(/usr/lib/libDrakX); use standalone; use common; -use ugtk2 qw(:helpers :wrappers :create); +use ugtk2 qw(:create :dialogs :helpers :wrappers); use interactive; #- convenience variables for true and false @@ -513,7 +513,16 @@ sub show_prev { $prev_window->set_title( #-PO: First %s is theme name, second %s (in parenthesis) is resolution N("%s BootSplash (%s) preview", $theme{name}, $theme{res}{res})); - $prev_pic = gtkcreate_pixbuf($img_file); + eval { $prev_pic = gtkcreate_pixbuf($img_file) }; + if (my $err = $@) { + err_dialog(N("Error"), + #-PO: Do not alter the <span ..> and </span> tags + N("The image \"%s\" cannot be load due to the following issue:\n\n<span foreground=\"Red\">%s</span>", $img_file, $err), + { use_markup => 1 } + ); + return; + } + $prev_pic->scale_simple($theme{res}{w}, $theme{res}{h}, 'hyper'); $prev_canvas && $prev_canvas->isa('Gtk2::Widget') or $prev_canvas = Gtk2::DrawingArea->new and $prev_window->add($prev_canvas); |