From 668926cfc0e72f1b950888eedd20362221fb8dbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor=20Duarte=20Martins?= Date: Mon, 26 Apr 2010 16:40:21 +0000 Subject: - Added auto_select and clean_cache options to conf file - Cleaned up readconf() - Readability fixes (variable names, indentation) --- rpmdrake | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) (limited to 'rpmdrake') diff --git a/rpmdrake b/rpmdrake index 706e64d2..8f235e49 100755 --- a/rpmdrake +++ b/rpmdrake @@ -529,8 +529,11 @@ sub run_treeview_dialog { my $status = gtknew('Label'); my $checkbox_show_autoselect; my %check_boxes; - my $auto_string = N("/_Options") . N("/_Select dependencies without asking"); - my $noclean_string = N("/_Options") . "/" . N("Clear download cache after successfull install"); + my $auto_select_string = + N("/_Options") . N("/_Select dependencies without asking"); + my $clean_cache_string = + N("/_Options") . "/" . + N("Clear download cache after successfull install"); my $updates_string = N("/_Options") . N("/_Compute updates on startup"); my $NVR_string = N("/_Options") . "/" . N("Search in _full package names"); my $regexp_search_string = N("/_Options") . "/" . N("Use _regular expressions in searches"); @@ -564,12 +567,21 @@ sub run_treeview_dialog { #[ N("/_View"), undef, undef, undef, '' ], if_(!$>, [ N("/_Options"), undef, undef, undef, '' ], - [ $auto_string, undef, sub { - $urpm->{options}{auto} = $::rpmdrake_options{auto} = $check_boxes{$auto_string}->get_active if $check_boxes{$auto_string}; - }, undef, '' ], - [ $noclean_string, undef, sub { - $::noclean = $check_boxes{$noclean_string}->get_active if $check_boxes{$noclean_string}; - }, undef, '' ], + [ $auto_select_string, undef, + sub { + my $box = $check_boxes{$auto_select_string}; + $auto_select->[0] = $box->get_active; + $::rpmdrake_options{auto} = $box->get_active; + $urpm->{options}{auto} = $box->get_active; + }, + undef, '' ], + [ $clean_cache_string, undef, + sub { + $clean_cache->[0] = + $check_boxes{$clean_cache_string}->get_active; + $::noclean = !$clean_cache->[0]; + }, + undef, '' ], [ N("/_Options") . N("/_Media Manager"), undef, sub { require Rpmdrake::edit_urpm_sources; Rpmdrake::edit_urpm_sources::run() && $reload_db_and_clear_all->(); @@ -636,13 +648,18 @@ sub run_treeview_dialog { %check_boxes = map { $_ => $factory->get_widget("
" . $get_path->($_)); - } ($auto_string, $noclean_string, $NVR_string, $updates_string, $regexp_search_string); + } ($auto_select_string, + $clean_cache_string, + $NVR_string, + $updates_string, + $regexp_search_string); + if (!$>) { $check_boxes{$regexp_search_string}->set_active($use_regexp->[0]); $check_boxes{$NVR_string}->set_active($NVR_searches->[0]); - $check_boxes{$auto_string}->set_active($::rpmdrake_options{auto}); + $check_boxes{$auto_select_string}->set_active($auto_select->[0]); $check_boxes{$updates_string}->set_active($compute_updates->[0]); - $check_boxes{$noclean_string}->set_active(!$::noclean); + $check_boxes{$clean_cache_string}->set_active($clean_cache->[0]); } $checkbox_show_autoselect = $factory->get_widget("
" . strip_first_underscore(N("/_Options"), N("/_Show automatically selected packages"))) -- cgit v1.2.1