summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-10-21 16:01:13 +0000
committerThierry Vignaud <tv@mandriva.org>2008-10-21 16:01:13 +0000
commit93bdb25caa8b9c968ee8f0759553b765823e44b2 (patch)
tree84ba8144394643dbf340452f183095468e9409f2
parent001c3406af000298207b4cc1d4bb9f14d063f48d (diff)
downloadmgaonline-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
-rw-r--r--NEWS6
-rwxr-xr-xmdkapplet32
2 files changed, 37 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 7336a6de..0e5f4dd6 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,10 @@
- mdkapplet
+ o confirmation dialog for system upgrade:
+ * 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
o new distro notification bubble:
* change button from "Upgrade the system" to "More Information"
* set urgency as 'low'
diff --git a/mdkapplet b/mdkapplet
index e9a88e34..4556fa71 100755
--- a/mdkapplet
+++ b/mdkapplet
@@ -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() {