diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-10-07 11:59:38 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-10-07 11:59:38 +0000 |
commit | 888a3fcc5262fc7f8b4659e1f4652d2a60181c44 (patch) | |
tree | c2d5ed2bcabde30a7ff5ba6294f348a6ce02d385 /perl-install | |
parent | a3c9c1621df4ba2b6440b710c70d856a95966968 (diff) | |
download | drakx-888a3fcc5262fc7f8b4659e1f4652d2a60181c44.tar drakx-888a3fcc5262fc7f8b4659e1f4652d2a60181c44.tar.gz drakx-888a3fcc5262fc7f8b4659e1f4652d2a60181c44.tar.bz2 drakx-888a3fcc5262fc7f8b4659e1f4652d2a60181c44.tar.xz drakx-888a3fcc5262fc7f8b4659e1f4652d2a60181c44.zip |
never crash if timezones cannot be listed (mga#6787)
(backported from trunk)
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/NEWS | 3 | ||||
-rwxr-xr-x | perl-install/standalone/drakclock | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS index 17e5b6022..9ffe39a9b 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,3 +1,6 @@ +- drakclock: + o do not crash if timezones cannot be listed (mga#6787) + Version 14.21.3 - 19 September 2012 - do not crash when trying to guess homedir before running another 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; |