From 970cc811b07477f9c013b7b8412c8b1349dba5fa Mon Sep 17 00:00:00 2001 From: misc Date: Mon, 16 Aug 2010 23:11:51 +0000 Subject: - force default config if it doesn't exist ( #58534 ) git-svn-id: http://svn.mandriva.com/svn/soft/draksnapshot/trunk@270570 99302b65-d5f7-0310-b3dd-f8cd6f4e3d94 --- draksnapshot-config | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/draksnapshot-config b/draksnapshot-config index c389bcf..bd98c64 100755 --- a/draksnapshot-config +++ b/draksnapshot-config @@ -45,6 +45,11 @@ ugtk2::add_icon_path("/usr/share/draksnapshot/pixmaps/"); my $product_id = common::parse_LDAP_namespace_structure(cat_("$root/etc/product.id")); my @ordered_intervals = qw(hourly daily weekly monthly); +my %default_values = ( + "hourly" => 6, + "daily" => 7, + "weekly" => 4, +); my ($backup_list, $exclude_list) = map { my $key = $_; @@ -66,7 +71,7 @@ my %default_intervals = ( ); # initialize commented out fields: -$default_intervals{$_} ||= undef foreach @ordered_intervals; +$default_intervals{$_} ||= $default_values{$_} foreach @ordered_intervals; ######### GUI @@ -285,12 +290,10 @@ sub add { } sub save() { - # $entries are currently not added to window so $val will always be 0 - # As there is no way currently to change interval, the best is to not rewrite them (#58534) -# save_keyword('interval', map { -# my $val = $entries{$_}->get_text; -# if_($val, join("\t", 'interval', $_, $val)); -# } @ordered_intervals); + save_keyword('interval', map { + my $val = $default_intervals{$_}; + if_($val, join("\t", 'interval', $_, $val)); + } @ordered_intervals); if (!$button->get('sensitive')) { # Mandriva defaults @{$backup_list->{data}} = '/'; #qw(/bin /boot /etc /home /lib /lib64 /opt); -- cgit v1.2.1