summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-08-14 13:02:05 +0000
committerThierry Vignaud <tv@mandriva.org>2008-08-14 13:02:05 +0000
commit171659fd0d36e5784221cd2a1237bc4dff308143 (patch)
tree820ea4e9c3c9b0dbf7c1f175155e36726ffe2087
parent1f486c5dbe9316a357526986d04392ecc5fac283 (diff)
downloadurpmi-171659fd0d36e5784221cd2a1237bc4dff308143.tar
urpmi-171659fd0d36e5784221cd2a1237bc4dff308143.tar.gz
urpmi-171659fd0d36e5784221cd2a1237bc4dff308143.tar.bz2
urpmi-171659fd0d36e5784221cd2a1237bc4dff308143.tar.xz
urpmi-171659fd0d36e5784221cd2a1237bc4dff308143.zip
(cancel_n_quit) notify callers when installation is canceled (#40358)
-rw-r--r--NEWS3
-rwxr-xr-xgurpmi6
-rw-r--r--gurpmi.pm7
3 files changed, 12 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index 91b739a4..a2441874 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+- gurpmi
+ o notify callers when installation is canceled (#40358)
+
Version 6.3 - 14 August 2008, Thierry Vignaud
- gurpmi
diff --git a/gurpmi b/gurpmi
index 48d783c5..6c056081 100755
--- a/gurpmi
+++ b/gurpmi
@@ -30,7 +30,7 @@ Gtk2->init;
$mainw = Gtk2::Window->new('toplevel');
$mainw->set_border_width(3);
$mainw->set_title(N("RPM installation"));
-$mainw->signal_connect(destroy => \&quit);
+$mainw->signal_connect(destroy => \&cancel_n_quit);
$mainw->set_position('center');
$mainw->set_modal(0);
$mainbox = Gtk2::VBox->new(0, 5);
@@ -45,7 +45,7 @@ foreach (@all_rpms) {
unless (-e $_) {
$mainbox->pack_start(new_label(N("Error: unable to find file %s, will cancel operation", $_)), 1, 1, 0);
my $abort_button = Gtk2::Button->new(but(N("_Ok")));
- $abort_button->signal_connect(clicked => sub { quit(); exit 1 });
+ $abort_button->signal_connect(clicked => sub { cancel_n_quit(); exit 1 });
add_button_box($mainbox, $abort_button);
$mainw->show_all;
Gtk2->main;
@@ -120,7 +120,7 @@ Proceed?", all_descriptions(@all_rpms))
$file_dialog->cancel_button->signal_connect(clicked => \&quit);
$file_dialog->show;
});
- $ccel_button->signal_connect(clicked => \&quit);
+ $ccel_button->signal_connect(clicked => \&cancel_n_quit);
add_button_box($mainbox, grep { defined $_ } $inst_button, $save_button, $ccel_button);
}
diff --git a/gurpmi.pm b/gurpmi.pm
index 64a5d023..f52ac553 100644
--- a/gurpmi.pm
+++ b/gurpmi.pm
@@ -31,7 +31,7 @@ URPM::bind_rpm_textdomain_codeset();
use Exporter;
our @ISA = qw(Exporter);
-our @EXPORT = qw(create_scrolled_window fatal but quit add_button_box new_label N);
+our @EXPORT = qw(create_scrolled_window fatal but cancel_n_quit quit add_button_box new_label N);
urpm::select::add_packages_to_priority_upgrade_list('gurpmi');
@@ -112,6 +112,11 @@ sub quit () {
}
}
+sub cancel_n_quit () {
+ Gtk2->main_quit;
+ exit(1);
+}
+
sub add_button_box {
my ($vbox, @buttons) = @_;
my $hbox = Gtk2::HButtonBox->new;