summaryrefslogtreecommitdiffstats
path: root/mdkapplet
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-11-19 13:53:08 +0000
committerThierry Vignaud <tv@mandriva.org>2008-11-19 13:53:08 +0000
commit984581fb9c165ea6f05c2602490c290fa52d0722 (patch)
tree5177360f797eea20624dbc2a1762b90134bfbb74 /mdkapplet
parente4c73bb51ac482a9cfe89b1eb29cc78c51db85e9 (diff)
downloadmgaonline-984581fb9c165ea6f05c2602490c290fa52d0722.tar
mgaonline-984581fb9c165ea6f05c2602490c290fa52d0722.tar.gz
mgaonline-984581fb9c165ea6f05c2602490c290fa52d0722.tar.bz2
mgaonline-984581fb9c165ea6f05c2602490c290fa52d0722.tar.xz
mgaonline-984581fb9c165ea6f05c2602490c290fa52d0722.zip
(new_link_button) extract code creating link (needed for next commits)
(to be moved in mygtk2)
Diffstat (limited to 'mdkapplet')
-rwxr-xr-xmdkapplet19
1 files changed, 11 insertions, 8 deletions
diff --git a/mdkapplet b/mdkapplet
index f938e2a8..d1d6b6a7 100755
--- a/mdkapplet
+++ b/mdkapplet
@@ -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);