diff options
author | Olivier Blin <oblin@mandriva.org> | 2005-08-04 05:00:57 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2005-08-04 05:00:57 +0000 |
commit | 955dc2828451b68164b152a20bf2335b64b2e96a (patch) | |
tree | 6c036b83f738e3d3f4fd046c8e3941d67bf3347e /perl-install/standalone/draksplash | |
parent | 6cc940607cc0849f9cab7da1147c4176569af298 (diff) | |
download | drakx-backup-do-not-use-955dc2828451b68164b152a20bf2335b64b2e96a.tar drakx-backup-do-not-use-955dc2828451b68164b152a20bf2335b64b2e96a.tar.gz drakx-backup-do-not-use-955dc2828451b68164b152a20bf2335b64b2e96a.tar.bz2 drakx-backup-do-not-use-955dc2828451b68164b152a20bf2335b64b2e96a.tar.xz drakx-backup-do-not-use-955dc2828451b68164b152a20bf2335b64b2e96a.zip |
simplify
Diffstat (limited to 'perl-install/standalone/draksplash')
-rwxr-xr-x | perl-install/standalone/draksplash | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/perl-install/standalone/draksplash b/perl-install/standalone/draksplash index 71228c7a7..5f3f4980c 100755 --- a/perl-install/standalone/draksplash +++ b/perl-install/standalone/draksplash @@ -162,24 +162,21 @@ sub load_image { $image_pixbuf[$mode] = $image_pixbuf[$mode]->scale_simple($theme{res_w}, $theme{res_h}, 'hyper'); $image_pixbuf[1-$mode] or $image_pixbuf[1-$mode] = $image_pixbuf[$mode]; $image_area->queue_draw; + 1; } sub choose_image { - my ($name) = @_; + my ($type) = @_; my $file_dialog = Gtk2::FileChooserDialog->new(N("choose image"), $window->{real_window}, 'open', N("Cancel") => 'cancel', N("Ok") => 'ok'); - $file_dialog->set_filename($theme{$name} || '~/'); + $file_dialog->set_filename($theme{$type} || '~/'); $file_dialog->show; - while (my $answer = $file_dialog->run) { - if (member($answer, qw(cancel delete-event))) { - $file_dialog->destroy; - return; - } elsif ($answer eq 'ok') { - load_image(my $img = $file_dialog->get_filename); - $theme{conf}{$name} = $img; - $file_dialog->destroy; - return; + while ($file_dialog->run eq 'ok') { + if (load_image(my $img = $file_dialog->get_filename)) { + $theme{conf}{$type} = $img; + last; } } + $file_dialog->destroy; } sub choose_color() { |