diff options
author | Thierry Vignaud <tv@mandriva.org> | 2008-10-21 16:01:13 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2008-10-21 16:01:13 +0000 |
commit | 93bdb25caa8b9c968ee8f0759553b765823e44b2 (patch) | |
tree | 84ba8144394643dbf340452f183095468e9409f2 /mdkapplet | |
parent | 001c3406af000298207b4cc1d4bb9f14d063f48d (diff) | |
download | mgaonline-93bdb25caa8b9c968ee8f0759553b765823e44b2.tar mgaonline-93bdb25caa8b9c968ee8f0759553b765823e44b2.tar.gz mgaonline-93bdb25caa8b9c968ee8f0759553b765823e44b2.tar.bz2 mgaonline-93bdb25caa8b9c968ee8f0759553b765823e44b2.tar.xz mgaonline-93bdb25caa8b9c968ee8f0759553b765823e44b2.zip |
(really_confirm_upgrade) introduce it in order to:
- advise that it may take a couple hours
- advise the need for high BW network
- advise to close other applications
- advise to use AC & wired network when using a laptop
- display estimated size of downloads
Diffstat (limited to 'mdkapplet')
-rwxr-xr-x | mdkapplet | 32 |
1 files changed, 31 insertions, 1 deletions
@@ -373,7 +373,37 @@ sub confirm_upgrade() { my $res = $w->main; setVar('DO_NOT_ASK_FOR_DISTRO_UPGRADE', bool2text($warn_me)); $local_config{DO_NOT_ASK_FOR_DISTRO_UPGRADE} = bool2text($warn_me); - $res; + $res ? really_confirm_upgrade() : 0; +} + +sub really_confirm_upgrade() { + local $mygtk2::left_padding = 0; + my $w = ugtk2->new(N("New version of Mandriva Linux distribution")); + + # estimated package size: + my $c; + foreach (run_program::get_stdout('rpm', '-qa', '--qf', '%{Archivesize}\n')) { + $c += $_; + } + $c = formatXiB($c); + + gtkadd($w->{window}, + gtknew('VBox', children_tight => [ + get_banner(), + gtknew('Label_Left', text => N("This upgrade requires high bandwidth network connection (cable, xDSL, ...) and may take several hours to complete."), + @common), + gtknew('Label_Left', text => N("Estimated download data will be %s", $c), @common), + gtknew('Label_Left', text => N("You should close all other running applications before continuing.") . + (1 || detect_devices::isLaptop() ? + ' ' . + N("You should put your laptop on AC and favor ethernet connection over wifi, if available.") + : ''), + @common), + create_okcancel($w, N("Yes"), N("No")), + ]), + ); + $w->{ok}->grab_focus; + return $w->main; } sub upgrade() { |