From 23bfed5220ef942e8a3103f2fc4eb8bf0e2d0be8 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 21 Mar 2007 14:16:28 +0000 Subject: (perform_installation) simplify and make sure we restore the main window sensivity in case of an exception --- Rpmdrake/pkg.pm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index 1facc7f6..e5b7d2c7 100755 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -462,6 +462,8 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-( my $w = $::main_window; $w->set_sensitive(0); + my $_restore_sensitive = before_leaving { warn" RESTORE\n";$w->set_sensitive(1) }; + my $_flush_guard = Gtk2::GUI_Update_Guard->new; my $group; @@ -513,7 +515,6 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-( : $to_install), scroll => 1, yesno => 1) or do { - $w->set_sensitive(1); return 1; }; @@ -733,7 +734,6 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-( join("\n\n", @errors, @error_msgs)), if_(@errors + @error_msgs > 1, scroll => 1), ); - $w->set_sensitive(1); return !$something_installed; } @@ -780,7 +780,6 @@ you may now inspect some in order to take actions:"), N("Unrecoverable error: no package found for installation, sorry.")); } - $w->set_sensitive(1); statusbar_msg_remove($statusbar_msg_id); #- XXX maybe remove this return !($something_installed || scalar(@to_remove)); @@ -790,7 +789,6 @@ you may now inspect some in order to take actions:"), N("There was a problem during the installation:\n\n%s", $fatal_msg)); return_with_error: Rpmdrake::gurpm::end(); - $w->set_sensitive(1); return !$something_installed; } -- cgit v1.2.1