* src/GrampsBSDDB.py: broke out support for database class to

make it easier to support multiple backends in the future
* src/RelLib.py: broke out support for database class to
make it easier to support multiple backends in the future
* src/AddSpouse.py: better support for gay unions
* src/ChooseParents.py: better support for gay unions
* src/FamilyView.py: better support for gay unions
* src/Marriage.py: better support for gay unions
* src/ReadXML.py: better support for gay unions
* src/gramps.glade: better support for gay unions
* src/gramps_main.py: better support for gay unions
* src/Check.py: better support for gay unions
* src/ReadGedcom.py: better support for gay unions


svn: r3302
This commit is contained in:
Don Allingham 2004-07-30 18:56:49 +00:00
parent e74691df11
commit 74917677ad
12 changed files with 1374 additions and 1464 deletions

View File

@ -1,3 +1,18 @@
2004-07-30 Don Allingham <dallingham@users.sourceforge.net>
* src/GrampsBSDDB.py: broke out support for database class to
make it easier to support multiple backends in the future
* src/RelLib.py: broke out support for database class to
make it easier to support multiple backends in the future
* src/AddSpouse.py: better support for gay unions
* src/ChooseParents.py: better support for gay unions
* src/FamilyView.py: better support for gay unions
* src/Marriage.py: better support for gay unions
* src/ReadXML.py: better support for gay unions
* src/gramps.glade: better support for gay unions
* src/gramps_main.py: better support for gay unions
* src/Check.py: better support for gay unions
* src/ReadGedcom.py: better support for gay unions
2004-07-28 Alex Roitman <shura@alex.neuro.umn.edu>
* src/data/Makefile.am: Uninstall everything that we install.
* src/GrampsCfg.py: Remove unneeded id_edit widget.

View File

@ -143,7 +143,7 @@ class AddSpouse:
"destroy_passed_object" : Utils.destroy_passed_object
})
self.relation_type.set_text(_("Married"))
self.relation_type.set_text(const.family_relations[const.FREL_MARRIED][0])
self.update_data()
def add_columns(self,tree):
@ -342,9 +342,8 @@ class AddSpouse:
return 1
def set_gender(self):
text = unicode(self.relation_type.get_text())
self.relation_def.set_text(const.relationship_def(text))
if text == _("Partners"):
family_type = const.family_relations[value][0]
if text == const.FAMILY_CIVIL_UNION:
if self.gender == RelLib.Person.male:
self.sgender = RelLib.Person.female
else:

View File

@ -125,8 +125,7 @@ class ChooseParents:
self.mother_rel = self.glade.get_widget("mrel")
self.father_rel = self.glade.get_widget("frel")
self.fcombo = self.glade.get_widget("prel_combo")
self.prel = self.glade.get_widget("prel")
self.prel = self.glade.get_widget("prel_combo")
self.title = self.glade.get_widget("chooseTitle")
self.mother_list = self.glade.get_widget("mother_list")
self.flabel = self.glade.get_widget("flabel")
@ -134,8 +133,6 @@ class ChooseParents:
self.showallf = self.glade.get_widget('showallf')
self.showallm = self.glade.get_widget('showallm')
self.fcombo.set_popdown_strings(const.familyRelations)
self.build_father_list()
self.build_mother_list()
@ -151,9 +148,9 @@ class ChooseParents:
if self.family:
self.type = self.family.get_relationship()
else:
self.type = "Married"
self.type = const.FAMILY_MARRIED
self.prel.set_text(_(self.type))
self.prel.set_active(self.type)
self.redrawm()
self.glade.signal_autoconnect({
@ -330,7 +327,7 @@ class ChooseParents:
self.father_list.set_model(self.father_model)
self.father_model.refilter()
if self.type == "Partners":
if self.type == const.FAMILY_CIVIL_UNION:
self.flabel.set_label("<b>%s</b>" % _("Par_ent"))
else:
self.flabel.set_label("<b>%s</b>" % _("Fath_er"))
@ -353,16 +350,16 @@ class ChooseParents:
self.mother_list.set_model(self.mother_model)
self.mother_model.refilter()
if self.type == "Partners":
if self.type == const.FAMILY_CIVIL_UNION:
self.mlabel.set_label("<b>%s</b>" % _("Pa_rent"))
else:
self.mlabel.set_label("<b>%s</b>" % _("Mothe_r"))
def parent_relation_changed(self,obj):
"""Called everytime the parent relationship information is changegd"""
"""Called everytime the parent relationship information is changed"""
self.old_type = self.type
self.type = const.save_frel(unicode(obj.get_text()))
if self.old_type == "Partners" or self.type == "Partners":
self.type = self.prel.get_active()
if self.old_type == const.FAMILY_CIVIL_UNION or self.type == const.FAMILY_CIVIL_UNION:
self.redrawf()
self.redrawm()
@ -580,9 +577,9 @@ class ChooseParents:
else:
self.db.add_person_no_map(person,id,trans)
self.type = const.save_frel(unicode(self.prel.get_text()))
self.type = self.prel.get_active()
if self.type == "Partners":
if self.type == const.FAMILY_CIVIL_UNION:
self.parent_relation_changed(self.prel)
elif person.get_gender() == RelLib.Person.male:
self.redrawf()
@ -690,9 +687,9 @@ class ModifyParents:
self.title.set_use_markup(gtk.TRUE)
if self.family.get_relationship() == "Partners":
self.mlabel.set_label('<b>%s</b>' % _("Parent"))
self.flabel.set_label('<b>%s</b>' % _("Parent"))
if self.family.get_relationship() == const.FAMILY_CIVIL_UNION:
self.mlabel.set_label("<b>%s</b>" % _("Pa_rent"))
self.flabel.set_label("<b>%s</b>" % _("Par_ent"))
else:
self.mlabel.set_label('<b>%s</b>' % _("Mother"))
self.flabel.set_label('<b>%s</b>' % _("Father"))

View File

@ -925,7 +925,7 @@ class FamilyView:
mdate = ""
v = "%s [%s]\n\t%s%s" % (GrampsCfg.get_nameof()(sp),
sp.get_gramps_id(),
const.display_frel(fm.get_relationship()),
const.family_relations[fm.get_relationship()][0],
mdate)
self.spouse_model.set(iter,0,v)
else:

1280
src/GrampsBSDDB.py Normal file

File diff suppressed because it is too large Load Diff

View File

@ -31,6 +31,7 @@ import string
import gtk
import gtk.glade
import gnome
import gobject
#-------------------------------------------------------------------------
#
@ -198,9 +199,8 @@ class Marriage:
self.on_attr_list_select_row,
self.on_update_attr_clicked)
self.type_field.set_popdown_strings(const.familyRelations)
frel = const.display_frel(family.get_relationship())
self.type_field.entry.set_text(frel)
frel = family.get_relationship()
self.type_field.set_active(frel)
self.gid.set_text(family.get_handle())
self.gid.set_editable(1)
@ -488,8 +488,7 @@ class Marriage:
def did_data_change(self):
changed = 0
relation = unicode(self.type_field.entry.get_text())
if const.save_frel(relation) != self.family.get_relationship():
if self.type_field.get_active() != self.family.get_relationship():
changed = 1
if self.complete.get_active() != self.family.get_complete():
@ -539,7 +538,6 @@ class Marriage:
self.close(0)
def on_cancel_edit(self,obj):
if self.did_data_change():
global quit
self.quit = obj
@ -570,22 +568,12 @@ class Marriage:
_('The GRAMPS ID that you chose for this '
'relationship is already being used.'))
relation = unicode(self.type_field.entry.get_text())
relation = self.type_field.get_active()
father = self.family.get_father_handle()
mother = self.family.get_mother_handle()
if father and mother:
if const.save_frel(relation) != self.family.get_relationship():
if father.get_gender() == mother.get_gender():
self.family.set_relationship("Partners")
else:
val = const.save_frel(relation)
if val == "Partners":
val = "Unknown"
if father.get_gender() == RelLib.Person.female or \
mother.get_gender() == RelLib.Person.male:
self.family.set_father_handle(mother)
self.family.set_mother_handle(father)
self.family.set_relationship(val)
if relation != self.family.get_relationship():
self.family.set_relationship(relation)
text = unicode(self.notes_buffer.get_text(self.notes_buffer.get_start_iter(),
self.notes_buffer.get_end_iter(),gtk.FALSE))
@ -632,9 +620,9 @@ class Marriage:
self.family.set_source_reference_list(self.srcreflist)
self.update_lists()
self.update_fv(self.family)
self.db.commit_family(self.family,trans)
self.db.add_transaction(trans,_("Edit Marriage"))
self.update_fv(self.family)
self.close(1)

View File

@ -56,6 +56,11 @@ try:
except:
gzip_ok = 0
_FAMILY_TRANS = {
'Married' : 0, 'Unmarried' : 1, 'Partners' : 1,
'Civil Union' : 2, 'Unknown' : 3, 'Other' : 4
}
#-------------------------------------------------------------------------
#
# Importing data into the currently open database.
@ -425,7 +430,7 @@ class GrampsParser:
if self.idswap.get(id):
return self.idswap[id]
else:
if self.db.idtrans.get(str(id)):
if self.db.id_trans.get(str(id)):
self.idswap[id] = self.db.find_next_gramps_id()
else:
self.idswap[id] = id
@ -636,7 +641,7 @@ class GrampsParser:
self.family = self.db.find_family_no_conflicts(attrs["id"],
self.fmap,self.trans)
if attrs.has_key("type"):
self.family.set_relationship(const.save_frel(attrs["type"]))
self.family.set_relationship(_FAMILY_TRANS.get(attrs["type"],const.FAMILY_UNKNOWN))
if attrs.has_key("complete"):
self.family.set_complete(int(attrs['complete']))
else:

File diff suppressed because it is too large Load Diff

View File

@ -3980,10 +3980,6 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">prel</property>
<accessibility>
<atkrelation target="prel_combo" type="label-for"/>
</accessibility>
</widget>
<packing>
<property name="left_attach">1</property>
@ -4232,68 +4228,6 @@
</packing>
</child>
<child>
<widget class="GtkCombo" id="prel_combo">
<property name="visible">True</property>
<property name="value_in_list">True</property>
<property name="allow_empty">True</property>
<property name="case_sensitive">False</property>
<property name="enable_arrow_keys">True</property>
<property name="enable_arrows_always">False</property>
<child internal-child="entry">
<widget class="GtkEntry" id="prel">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">False</property>
<signal name="changed" handler="on_prel_changed"/>
</widget>
</child>
<child internal-child="list">
<widget class="GtkList" id="convertwidget51">
<property name="visible">True</property>
<property name="selection_mode">GTK_SELECTION_BROWSE</property>
<child>
<widget class="GtkListItem" id="convertwidget52">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="convertwidget53">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">9</property>
<property name="bottom_attach">10</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkCombo" id="mrel_combo">
<property name="visible">True</property>
@ -4679,6 +4613,26 @@
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkComboBox" id="prel_combo">
<property name="visible">True</property>
<property name="items" translatable="yes">Married
Unmarried
Civil Union
Uknown
Other</property>
<signal name="changed" handler="on_prel_changed" last_modification_time="Fri, 30 Jul 2004 15:32:53 GMT"/>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">9</property>
<property name="bottom_attach">10</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
@ -13120,10 +13074,6 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">combo-entry1</property>
<accessibility>
<atkrelation target="marriage_type" type="label-for"/>
</accessibility>
</widget>
<packing>
<property name="left_attach">0</property>
@ -13207,64 +13157,17 @@
</child>
<child>
<widget class="GtkCombo" id="marriage_type">
<widget class="GtkComboBox" id="marriage_type">
<property name="visible">True</property>
<property name="value_in_list">False</property>
<property name="allow_empty">True</property>
<property name="case_sensitive">False</property>
<property name="enable_arrow_keys">True</property>
<property name="enable_arrows_always">False</property>
<child internal-child="entry">
<widget class="GtkEntry" id="combo-entry1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">False</property>
</widget>
</child>
<child internal-child="list">
<widget class="GtkList" id="convertwidget1">
<property name="visible">True</property>
<property name="selection_mode">GTK_SELECTION_BROWSE</property>
<child>
<widget class="GtkListItem" id="convertwidget2">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="convertwidget3">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
</widget>
</child>
<property name="items" translatable="yes">Married</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="y_options"></property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
</child>
</widget>

View File

@ -52,6 +52,7 @@ import gtk.gdk
#
#-------------------------------------------------------------------------
import RelLib
import GrampsBSDDB
import PedView
import MediaView
import PlaceView
@ -128,7 +129,7 @@ class Gramps:
self.mhistory = []
self.hindex = -1
self.db = RelLib.GrampsDB()
self.db = GrampsBSDDB.GrampsBSDDB()
self.db.set_iprefix(GrampsCfg.get_iprefix())
self.db.set_oprefix(GrampsCfg.get_oprefix())
self.db.set_fprefix(GrampsCfg.get_fprefix())

View File

@ -271,9 +271,9 @@ class CheckIntegrity:
else:
fgender = father.get_gender()
mgender = mother.get_gender()
if type != "Partners":
if type != const.FAMILY_CIVIL_UNION:
if fgender == mgender and fgender != RelLib.Person.unknown:
family.set_relationship("Partners")
family.set_relationship(const.FAMILY_CIVIL_UNION)
self.fam_rel.append(family_handle)
self.db.commit_family(family,self.trans)
elif fgender == RelLib.Person.female or mgender == RelLib.Person.male:
@ -282,7 +282,7 @@ class CheckIntegrity:
self.fam_rel.append(family_handle)
self.db.commit_family(family,self.trans)
elif fgender != mgender:
family.set_relationship("Unknown")
family.set_relationship(const.FAMILY_UNKNOWN)
self.fam_rel.append(family_handle)
if fgender == RelLib.Person.female or mgender == RelLib.Person.male:
family.set_father_handle(mother_handle)

View File

@ -678,7 +678,7 @@ class GedcomParser:
except:
event.set_name(matches[1])
if event.get_name() == "Marriage":
self.family.set_relationship("Married")
self.family.set_relationship(const.FAMILY_MARRIED)
self.db.add_event(event,self.trans)
self.family.add_event_handle(event.get_handle())
self.parse_family_event(event,2)