diff options
-rwxr-xr-x | mdkapplet | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -357,8 +357,6 @@ sub confirm_upgrade() { local $mygtk2::left_padding = 0; my $w = ugtk2->new(N("New version of Mandriva Linux distribution"), width => $width + 20); my $warn_me = text2bool($local_config{DO_NOT_ASK_FOR_DISTRO_UPGRADE}); - my $link; - { # use wizard button order (for both 2008.1 & 2009.0): local $::isWizard = 1; @@ -369,7 +367,7 @@ sub confirm_upgrade() { get_banner(), gtknew('Label_Left', text => N("A new version of Mandriva Linux distribution has been released."), @common), gtknew('HButtonBox', layout => 'start', children_tight => [ - $link = Gtk2::LinkButton->new($new_distro->{url}, N("More info about this new version")), + new_link_button($new_distro->{url}, N("More info about this new version")), ]), gtknew('Label_Left', text => N("Do you want to upgrade to the '\%s' distribution?", $new_distro->{name} || $new_distro->{version}), @common), @@ -378,11 +376,6 @@ sub confirm_upgrade() { ]), ); } - - $link->set_uri_hook(sub { - my (undef, $url) = @_; - run_program::raw({ detach => 1, setuid => get_parent_uid() }, 'www-browser', $url); - }); $w->{ok}->grab_focus; my $res = $w->main; @@ -391,6 +384,16 @@ sub confirm_upgrade() { $res ? really_confirm_upgrade() : 0; } +sub new_link_button { + my ($url, $text) = @_; + my $link = Gtk2::LinkButton->new($url, $text); + $link->set_uri_hook(sub { + my (undef, $url) = @_; + run_program::raw({ detach => 1, setuid => get_parent_uid() }, 'www-browser', $url); + }); + $link; +} + sub really_confirm_upgrade() { local $mygtk2::left_padding = 0; my $w = ugtk2->new(N("New version of Mandriva Linux distribution"), width => $width + 20); |