diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-09-21 16:15:52 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-09-21 16:15:52 +0000 |
commit | 2885bab77f429c996e3ee600d4437f762e29481f (patch) | |
tree | 3714ed79b80e329afe7ae33dbd8830d4862b4ae5 /perl-install/standalone | |
parent | 81871ae58a64cb7a41a62d03d1a5fb5abcdb9747 (diff) | |
download | drakx-2885bab77f429c996e3ee600d4437f762e29481f.tar drakx-2885bab77f429c996e3ee600d4437f762e29481f.tar.gz drakx-2885bab77f429c996e3ee600d4437f762e29481f.tar.bz2 drakx-2885bab77f429c996e3ee600d4437f762e29481f.tar.xz drakx-2885bab77f429c996e3ee600d4437f762e29481f.zip |
never crash if timezones cannot be listed (mga#6787)
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-x | perl-install/standalone/drakclock | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/perl-install/standalone/drakclock b/perl-install/standalone/drakclock index 482548d38..0ca3c5b51 100755 --- a/perl-install/standalone/drakclock +++ b/perl-install/standalone/drakclock @@ -39,14 +39,20 @@ my $timezone = timezone::read(); my $label_timezone = gtknew('Label', text => $timezone->{timezone} || N("not defined")); my $button_time = gtknew('Button', text => N("Change Time Zone")); +my @timezones = eval { timezone::getTimeZones() }; +my $err = $@; $button_time->signal_connect(clicked => sub { local $::isEmbedded = 0; # to prevent sub window embedding - if ($timezone->{timezone} = $in->ask_from_treelist(N("Timezone - DrakClock"), N("Which is your timezone?"), '/', [ timezone::getTimeZones() ], $timezone->{timezone})) { + if ($timezone->{timezone} = $in->ask_from_treelist(N("Timezone - DrakClock"), N("Which is your timezone?"), '/', \@timezones, $timezone->{timezone})) { $timezone->{UTC} = $in->ask_yesorno(N("GMT - DrakClock"), N("Is your hardware clock set to GMT?"), $timezone->{UTC}); timezone::write($timezone); } $label_timezone->set_text($timezone->{timezone}); }); +if (!@timezones) { + warn "Failed to retrieve timezone list: $err\n"; + $button_time->set_sensitive(0); +} my $drawing_area; |