diff options
author | Thierry Vignaud <tv@mandriva.org> | 2009-10-01 11:32:37 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2009-10-01 11:32:37 +0000 |
commit | 3c11932412535dbbcca0a8acf76ce1034e78693b (patch) | |
tree | 36d5cf6c50cf1bf51a2dc8486f630388ac800ad7 | |
parent | f0c6b087e508d61a8f6ae7ae9d434622966edaf1 (diff) | |
download | rpmdrake-3c11932412535dbbcca0a8acf76ce1034e78693b.tar rpmdrake-3c11932412535dbbcca0a8acf76ce1034e78693b.tar.gz rpmdrake-3c11932412535dbbcca0a8acf76ce1034e78693b.tar.bz2 rpmdrake-3c11932412535dbbcca0a8acf76ce1034e78693b.tar.xz rpmdrake-3c11932412535dbbcca0a8acf76ce1034e78693b.zip |
(real_quit) warn on exit if some packages are selected (#45404)
-rwxr-xr-x | MandrivaUpdate | 2 | ||||
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | Rpmdrake/gui.pm | 8 | ||||
-rwxr-xr-x | rpmdrake | 2 |
4 files changed, 11 insertions, 2 deletions
diff --git a/MandrivaUpdate b/MandrivaUpdate index 21678716..7c3d55e3 100755 --- a/MandrivaUpdate +++ b/MandrivaUpdate @@ -128,7 +128,7 @@ $::main_window = $w->{real_window}; sub quit() { ($mandrivaupdate_width->[0], $mandrivaupdate_height->[0]) = $::w->{real_window}->get_size; - Gtk2->main_quit; + real_quit(); } sub run_treeview_dialog { @@ -11,6 +11,7 @@ * enable to search in full or short package names (#46473) * fix searching for summary on startup (#49293) * rerun search after reloading package list (#49834) + o warn on exit if some packages are selected (#45404) Version 5.17 - 1 June 2009, Thierry Vignaud diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm index 9b63ddb8..05240dd1 100644 --- a/Rpmdrake/gui.pm +++ b/Rpmdrake/gui.pm @@ -65,6 +65,7 @@ our @EXPORT = qw( is_locale_available node_state pkgs_provider + real_quit reset_search set_node_state sort_callback @@ -803,6 +804,13 @@ sub is_there_selected_packages() { int(grep { $pkgs->{$_}{selected} } keys %$pkgs) } +sub real_quit() { + if (is_there_selected_packages()) { + interactive_msg(N("Some packages are selected."), N("Some packages are selected.") . "\n" . N("Do you really want to quit?"), yesno => 1) or return; + } + Gtk2->main_quit; +} + sub do_action__real { my ($options, $callback_action, $o_info) = @_; require urpm::sys; @@ -226,7 +226,7 @@ sub do_search($$$$$$$) { sub quit() { ($rpmdrake_width->[0], $rpmdrake_height->[0]) = $::w->{real_window}->get_size(); - Gtk2->main_quit; + real_quit(); } sub run_treeview_dialog { |