From 9e9db899368826f8bedf7247b6d3549d7e0874fb Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 3 Oct 2008 14:42:43 +0000 Subject: (confirm_upgrade,is_there_a_new_distributions) enable to not check again for new distro --- NEWS | 1 + mdkapplet | 21 ++++++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index b2a13381..cb7f3cb8 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ o add an "upgrade system" in the menu when a new distro is available o ask for confirmation before performing distro upgrade + o enable to not check again for new distro o use blue icon when there's a new distro Version 2.48 - 2 October 2008 diff --git a/mdkapplet b/mdkapplet index 17d36ddd..04d00cdb 100755 --- a/mdkapplet +++ b/mdkapplet @@ -260,6 +260,8 @@ ugtk2::exit(0); sub is_there_a_new_distributions() { + return if $local_config{DO_NOT_ASK_FOR_DISTRO_UPGRADE} =~ /^TRUE$/i; + #- contact the following URL to retrieve the list of released distributions. my $type = lc($product_id->{type}); $type =~ s/\s//g; my $list = "http://api.mandriva.com/distributions/$type.$product_id->{arch}.list?product=$product_id->{product}"; @@ -352,11 +354,20 @@ sub restart_applet() { } sub confirm_upgrade() { - my $bool = ugtk2::ask_yesorno(N("A new stable distribution has been released"), - N("A new stable distribution has been released."), - N("Do you want to upgrade to the '\%s' distribution?", $new_distro_version), - ); - $bool; + my $w = ugtk2->new(N("A new stable distribution has been released")); + my $warn_me = text2bool($local_config{DO_NOT_ASK_FOR_DISTRO_UPGRADE}); + gtkadd($w->{window}, + gtknew('VBox', children_tight => [ + N("A new stable distribution has been released."), + N("Do you want to upgrade to the '\%s' distribution?", $new_distro_version), + gtknew('CheckButton', text => N("Do not ask me next time"), active_ref => \$warn_me), + create_okcancel($w, N("Yes"), N("No")), + ]), + ); + $w->{ok}->grab_focus; + my $res = $w->main; + setVar('DO_NOT_ASK_FOR_DISTRO_UPGRADE', bool2text($warn_me)); + $res; } sub upgrade() { -- cgit v1.2.1