9378: Quick Backup: remember Media (include/exclude) setting

This commit is contained in:
SNoiraud 2016-11-16 12:32:01 +01:00
parent 4a49287292
commit 6675cce1f2
2 changed files with 7 additions and 0 deletions

View File

@ -317,6 +317,7 @@ register('paths.quick-backup-directory', USER_HOME)
register('paths.quick-backup-filename',
"%(filename)s_%(year)d-%(month)02d-%(day)02d.%(extension)s")
register('preferences.quick-backup-include-mode', False)
register('preferences.date-format', 0)
register('preferences.calendar-format-report', 0)
register('preferences.cprefix', 'C%04d')

View File

@ -1352,6 +1352,11 @@ class ViewManager(CLIManager):
_("Exclude"))
include.connect("toggled", lambda widget: self.media_toggle(widget,
file_entry))
include_mode = config.get('preferences.quick-backup-include-mode')
if include_mode:
include.set_active(True)
else:
exclude.set_active(True)
hbox.pack_start(include, False, True, 0)
hbox.pack_end(exclude, False, True, 0)
vbox.pack_start(hbox, False, True, 0)
@ -1426,6 +1431,7 @@ class ViewManager(CLIManager):
Toggles media include values in the quick backup dialog.
"""
include = widget.get_active()
config.set('preferences.quick-backup-include-mode', include)
extension = "gpkg" if include else "gramps"
filename = file_entry.get_text()
if "." in filename: