5476: Allow user to set a default relationship type

svn: r18687
This commit is contained in:
Doug Blank 2012-01-02 15:12:18 +00:00
parent 020f99098f
commit 37ed4e58ca
3 changed files with 16 additions and 1 deletions

View File

@ -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', '')

View File

@ -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)

View File

@ -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)'),