summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormisc <misc@99302b65-d5f7-0310-b3dd-f8cd6f4e3d94>2010-08-16 23:11:51 +0000
committermisc <misc@99302b65-d5f7-0310-b3dd-f8cd6f4e3d94>2010-08-16 23:11:51 +0000
commit970cc811b07477f9c013b7b8412c8b1349dba5fa (patch)
tree20ed559f6dd5dd48653f4e399e9ed1cbcf1b0cb0
parent93e5aa00573b8025657da56c8da4fb683d4a018e (diff)
downloaddraksnapshot-970cc811b07477f9c013b7b8412c8b1349dba5fa.tar
draksnapshot-970cc811b07477f9c013b7b8412c8b1349dba5fa.tar.gz
draksnapshot-970cc811b07477f9c013b7b8412c8b1349dba5fa.tar.bz2
draksnapshot-970cc811b07477f9c013b7b8412c8b1349dba5fa.tar.xz
draksnapshot-970cc811b07477f9c013b7b8412c8b1349dba5fa.zip
- 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
-rwxr-xr-xdraksnapshot-config17
1 files 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);