Merge pull request #274 from SNoiraud/9378

9378: Quick Backup: remember Media (include/exclude) setting
This commit is contained in:
Sam Manzi 2016-11-25 17:31:09 +11:00 committed by GitHub
commit d8077a8169
2 changed files with 7 additions and 0 deletions

View File

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

View File

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