diff options
author | Thierry Vignaud <tv@mandriva.org> | 2007-08-27 15:38:23 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2007-08-27 15:38:23 +0000 |
commit | 0d00757fce246fde41a9860bae4304275fc5fe14 (patch) | |
tree | 808e5c7ee57b0fb6ecacb5c016fd6d25146a2600 | |
parent | 976cc30501e6b1b7d1e88e9b5b65420eb97f6458 (diff) | |
download | rpmdrake-0d00757fce246fde41a9860bae4304275fc5fe14.tar rpmdrake-0d00757fce246fde41a9860bae4304275fc5fe14.tar.gz rpmdrake-0d00757fce246fde41a9860bae4304275fc5fe14.tar.bz2 rpmdrake-0d00757fce246fde41a9860bae4304275fc5fe14.tar.xz rpmdrake-0d00757fce246fde41a9860bae4304275fc5fe14.zip |
(reload_db_and_clear_all) factorize some code for rereading URPM DB
and updating the packages tree & be consistant regarding slow_func() usage
-rwxr-xr-x | rpmdrake | 28 |
1 files changed, 12 insertions, 16 deletions
@@ -328,6 +328,16 @@ sub run_treeview_dialog { ) ); + my $reload_db_and_clear_all = sub { + slow_func($::main_window->window, sub { + $force_rebuild = 1; + pkgs_provider({ skip_updating_mu => 1 }, $options->{tree_mode}); + reset_search(); + $size_selected = 0; + $options->{rebuild_tree}->(); + }); + }; + my $status = gtknew('Label'); my $checkbox_show_autoselect; my %check_boxes; @@ -339,13 +349,7 @@ sub run_treeview_dialog { ! $>, [ N("/_File") . N("/_Update media"), undef, sub { update_sources_interactive($urpm, transient => $w->{real_window}) - and do { - $force_rebuild = 1; - pkgs_provider({ skip_updating_mu => 1 }, $options->{tree_mode}); - reset_search(); - $size_selected = 0; - $options->{rebuild_tree}->(); - }; + and $reload_db_and_clear_all->(); }, undef, '<Item>' ] ), [ N("/_File") . N("/_Reset the selection"), undef, sub { @@ -361,15 +365,7 @@ sub run_treeview_dialog { $force_displaying_group = 1; $tree->get_selection->signal_emit('changed'); }, undef, '<Item>' ], - [ N("/_File") . N("/Reload the _packages list"), undef, sub { - slow_func($::main_window->window, sub { - $force_rebuild = 1; - pkgs_provider({ skip_updating_mu => 1 }, $options->{tree_mode}); - }); - reset_search(); - $size_selected = 0; - $options->{rebuild_tree}->(); - }, undef, '<Item>' ], + [ N("/_File") . N("/Reload the _packages list"), undef, $reload_db_and_clear_all, undef, '<Item>' ], [ N("/_File") . N("/_Quit"), N("<control>Q"), sub { Gtk2->main_quit }, undef, '<Item>', ], #[ N("/_View"), undef, undef, undef, '<Branch>' ], if_(!$>, |