16
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22
25
class RemoveWidget(urwid.WidgetWrap):
24
27
def __init__( self, config ):
25
28
self._config = config
27
30
old_enabled, self._remove_old_value, self._remove_old_unit = config.get_remove_old_snapshots()
28
self._remove_old_enabled = urwid.CheckBox( 'Older than:', old_enabled, on_state_change=self.flip_old_enabled )
31
self._remove_old_enabled = urwid.CheckBox( _('Older than:'), old_enabled, on_state_change=self.flip_old_enabled )
29
32
remove_old_value_box = urwid.IntEdit( '', self._remove_old_value )
30
33
urwid.connect_signal( remove_old_value_box, 'change', self.remove_old_value_changed )
44
47
space_enabled, self._free_space_value, self._free_space_unit = config.get_min_free_space()
45
self._free_space_enabled = urwid.CheckBox( 'If free space is less than:', space_enabled, on_state_change=self.flip_free_space_enabled )
48
self._free_space_enabled = urwid.CheckBox( _('If free space is less than:'), space_enabled, on_state_change=self.flip_free_space_enabled )
46
49
free_space_value_box = urwid.IntEdit( '', self._free_space_value )
47
50
urwid.connect_signal( free_space_value_box, 'change', self.free_space_value_changed )
48
51
free_space_units = []
66
urwid.CheckBox( 'Smart remove', config.get_smart_remove(), on_state_change=self.flip_smart_remove ),
67
urwid.Padding( urwid.Text( '- keep all snapshots from today and yesterday' ), left=4 ),
68
urwid.Padding( urwid.Text( '- keep one snapshot for the last week and one for two weeks ago' ), left=4 ),
69
urwid.Padding( urwid.Text( '- keep one snapshot per month for all previous months of this year and all months of the last year' ), left=4 ),
70
urwid.Padding( urwid.Text( '- keep one snapshot per year for all other years' ), left=4 ),
69
urwid.CheckBox( _('Smart remove'), config.get_smart_remove(), on_state_change=self.flip_smart_remove ),
70
urwid.Padding( urwid.Text( _('- keep all snapshots from today and yesterday') ), left=4 ),
71
urwid.Padding( urwid.Text( _('- keep one snapshot for the last week and one for two weeks ago') ), left=4 ),
72
urwid.Padding( urwid.Text( _('- keep one snapshot per month for all previous months of this year and all months of the last year') ), left=4 ),
73
urwid.Padding( urwid.Text( _('- keep one snapshot per year for all other years') ), left=4 ),
72
urwid.CheckBox( 'Don\'t remove named snapshots', config.get_dont_remove_named_snapshots(), on_state_change=self.flip_remove_named )
75
urwid.CheckBox( _("Don't remove named snapshots"), config.get_dont_remove_named_snapshots(), on_state_change=self.flip_remove_named )
74
77
display_widget = urwid.Pile( pile_list )
75
78
urwid.WidgetWrap.__init__( self, display_widget )