From 37ed4e58cad488b0fcc02c7bd81d8901a608a4d7 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Mon, 2 Jan 2012 15:12:18 +0000 Subject: [PATCH] 5476: Allow user to set a default relationship type svn: r18687 --- src/config.py | 1 + src/gen/lib/familyreltype.py | 3 ++- src/gui/configure.py | 13 +++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/config.py b/src/config.py index 9e45c6005..0c098ffa6 100644 --- a/src/config.py +++ b/src/config.py @@ -299,6 +299,7 @@ register('preferences.use-last-view', True) register('preferences.last-view', '') register('preferences.last-views', []) register('preferences.use-bsddb3', False) +register('preferences.family-relation-type', 3) # UNKNOWN register('researcher.researcher-addr', '') register('researcher.researcher-locality', '') diff --git a/src/gen/lib/familyreltype.py b/src/gen/lib/familyreltype.py index 91c69bfbc..6b7cab3b5 100644 --- a/src/gen/lib/familyreltype.py +++ b/src/gen/lib/familyreltype.py @@ -35,6 +35,7 @@ from gen.ggettext import gettext as _ # #------------------------------------------------------------------------- from gen.lib.grampstype import GrampsType +import config class FamilyRelType(GrampsType): @@ -57,5 +58,5 @@ class FamilyRelType(GrampsType): def __init__(self, value=None): if value is None: - value = self.UNKNOWN + value = config.get("preferences.family-relation-type") GrampsType.__init__(self, value) diff --git a/src/gui/configure.py b/src/gui/configure.py index f7b532cd0..64d15b300 100644 --- a/src/gui/configure.py +++ b/src/gui/configure.py @@ -900,6 +900,19 @@ class GrampsPreferences(ConfigureDialog): table.attach(obox, 1, 3, row, row+1, yoptions=0) row += 1 + # Default Family Relationship + obox = gtk.combo_box_new_text() + formats = gen.lib.FamilyRelType().get_standard_names() + map(obox.append_text, formats) + obox.set_active(config.get('preferences.family-relation-type')) + obox.connect('changed', + lambda obj: config.set('preferences.family-relation-type', + obj.get_active())) + lwidget = BasicLabel("%s: " % _('Default family relationship')) + table.attach(lwidget, 0, 1, row, row+1, yoptions=0) + table.attach(obox, 1, 3, row, row+1, yoptions=0) + row += 1 + #height multiple surname table self.add_pos_int_entry(table, _('Height multiple surname box (pixels)'),