aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-08-27 15:38:23 +0000
committerThierry Vignaud <tv@mandriva.org>2007-08-27 15:38:23 +0000
commit0d00757fce246fde41a9860bae4304275fc5fe14 (patch)
tree808e5c7ee57b0fb6ecacb5c016fd6d25146a2600
parent976cc30501e6b1b7d1e88e9b5b65420eb97f6458 (diff)
downloadrpmdrake-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-xrpmdrake28
1 files changed, 12 insertions, 16 deletions
diff --git a/rpmdrake b/rpmdrake
index 14c6a54b..2213e33f 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -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_(!$>,