summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-08-04 05:00:57 +0000
committerOlivier Blin <oblin@mandriva.org>2005-08-04 05:00:57 +0000
commit955dc2828451b68164b152a20bf2335b64b2e96a (patch)
tree6c036b83f738e3d3f4fd046c8e3941d67bf3347e
parent6cc940607cc0849f9cab7da1147c4176569af298 (diff)
downloaddrakx-955dc2828451b68164b152a20bf2335b64b2e96a.tar
drakx-955dc2828451b68164b152a20bf2335b64b2e96a.tar.gz
drakx-955dc2828451b68164b152a20bf2335b64b2e96a.tar.bz2
drakx-955dc2828451b68164b152a20bf2335b64b2e96a.tar.xz
drakx-955dc2828451b68164b152a20bf2335b64b2e96a.zip
simplify
-rwxr-xr-xperl-install/standalone/draksplash19
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() {