From d192e735062799a2fb332303fe700676d45f22e8 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 8 Jan 2019 13:53:14 -0800 Subject: [PATCH] snapshot: Update descriptions and UI options - Mention that btrfs filesystems are only supported 'currently'. - Clarify 'Free Space'. Explain how it actually works. - Show '%' after the number in free space drop down. Also add 70%. - Maintain the earlier order of showing timeline snapshots first and then software snapshots. This is order of importance. Signed-off-by: Sunil Mohan Adapa --- plinth/modules/snapshot/__init__.py | 2 +- plinth/modules/snapshot/forms.py | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/plinth/modules/snapshot/__init__.py b/plinth/modules/snapshot/__init__.py index f9b3c21f2..fc7187073 100644 --- a/plinth/modules/snapshot/__init__.py +++ b/plinth/modules/snapshot/__init__.py @@ -42,7 +42,7 @@ description = [ _('Snapshots are taken periodically (called timeline snapshots) and also ' 'before and after a software installation. Older snapshots will be ' 'automatically cleaned up according to the settings below.'), - _('Snapshots work on btrfs file systems only and on the root ' + _('Snapshots currently work on btrfs file systems only and on the root ' 'partition only. Snapshots are not a replacement for ' 'backups since ' 'they can only be stored on the same partition. ') diff --git a/plinth/modules/snapshot/forms.py b/plinth/modules/snapshot/forms.py index 279e7c2cb..277096ecf 100644 --- a/plinth/modules/snapshot/forms.py +++ b/plinth/modules/snapshot/forms.py @@ -24,15 +24,12 @@ from django.utils.translation import ugettext_lazy as _ class SnapshotForm(forms.Form): free_space = forms.ChoiceField( - label=_('Free Space'), + label=_('Free Disk Space to Maintain'), help_text=_('Maintain this percentage of free space on the disk. ' - 'The default value is 30%.'), - choices=[(i / 100, i) for i in range(10, 70, 10)]) - - enable_software_snapshots = forms.ChoiceField( - label=_('Software Installation Snapshots'), help_text=_( - 'Enable or disable snapshots before and after software ' - 'installation'), choices=[('yes', 'Enabled'), ('no', 'Disabled')]) + 'If free space falls below this value, older snapshots ' + 'are removed until this much free space is regained. The ' + 'default value is 30%.'), + choices=[(i / 100, '{}%'.format(i)) for i in range(10, 80, 10)]) enable_timeline_snapshots = forms.ChoiceField( label=_('Timeline Snapshots'), @@ -40,6 +37,11 @@ class SnapshotForm(forms.Form): '(hourly, daily, monthly and yearly).'), choices=[('yes', 'Enabled'), ('no', 'Disabled')]) + enable_software_snapshots = forms.ChoiceField( + label=_('Software Installation Snapshots'), help_text=_( + 'Enable or disable snapshots before and after software ' + 'installation'), choices=[('yes', 'Enabled'), ('no', 'Disabled')]) + hourly_limit = forms.IntegerField( label=_('Hourly Snapshots Limit'), min_value=0, help_text=_('Keep a maximum of this many hourly snapshots.'))