summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Victor Duarte Martins <jvictor@mandriva.com>2010-06-11 13:51:48 +0000
committerJoão Victor Duarte Martins <jvictor@mandriva.com>2010-06-11 13:51:48 +0000
commitb4bcc80432d80805de5497ee26ff5254c43bc9cf (patch)
tree96cc07d2a433fa66e33af38c1e77ffb181b7bd03
parent070ebc890e7aace4c2e815f5b84e3c92762673ed (diff)
downloadmgaonline-b4bcc80432d80805de5497ee26ff5254c43bc9cf.tar
mgaonline-b4bcc80432d80805de5497ee26ff5254c43bc9cf.tar.gz
mgaonline-b4bcc80432d80805de5497ee26ff5254c43bc9cf.tar.bz2
mgaonline-b4bcc80432d80805de5497ee26ff5254c43bc9cf.tar.xz
mgaonline-b4bcc80432d80805de5497ee26ff5254c43bc9cf.zip
* mdkapplet-upgrade-helper: Create all success/fail dialogs before
upgrading, avoiding gtk upgrades to break mdkonline (#59025). * NEWS: Updated.
-rwxr-xr-xmdkapplet-upgrade-helper19
1 files changed, 9 insertions, 10 deletions
diff --git a/mdkapplet-upgrade-helper b/mdkapplet-upgrade-helper
index 57bb4020..a40a2885 100755
--- a/mdkapplet-upgrade-helper
+++ b/mdkapplet-upgrade-helper
@@ -90,6 +90,8 @@ sub run_gurpmi() {
my @initial_args = ('--replacefiles', '--clean');
push @initial_args, "--download-all=$download_dir" if $download_dir;
+ my $succeeded_win = create_upgrade_succeeded_window();
+ my $failed_win = create_upgrade_failed_window();
while ($refork_gurpmi) {
my $ok = fork_gurpmi(@initial_args);
@@ -104,9 +106,10 @@ sub run_gurpmi() {
if (!$refork_gurpmi) {
if (!$ok) {
- upgrade_failed();
+ $failed_win->main && upgrade();
} else {
- upgrade_distro_congratulations();
+ rm_rf(get_stale_upgrade_filename());
+ $succeeded_win->main && !$::testing && any::reboot();
}
}
}
@@ -120,7 +123,7 @@ my @common = (
width => $width - 50,
);
-sub upgrade_failed() {
+sub get_upgrade_failed_window() {
local $mygtk2::left_padding = 0;
my $w = ugtk2->new(N("Error"));
gtkadd($w->{window},
@@ -132,13 +135,10 @@ sub upgrade_failed() {
]),
);
$w->{ok}->grab_focus;
- my $answer = $w->main;
- upgrade() if $answer;
+ return $w;
}
-sub upgrade_distro_congratulations() {
- rm_rf(get_stale_upgrade_filename());
-
+sub get_upgrade_succeeded_window() {
local $mygtk2::left_padding = 0;
my $w = ugtk2->new(N("Congratulations"));
gtkadd($w->{window},
@@ -151,8 +151,7 @@ sub upgrade_distro_congratulations() {
]),
);
$w->{ok}->grab_focus;
- my $answer = $w->main;
- any::reboot() if $answer && !$::testing;
+ return $w;
}
# Returns: undef if failed to authenticate, [$email, $passwd] otherwise