db updates
svn: r2934
This commit is contained in:
parent
8af8f42239
commit
1a1c30d8d3
@ -899,8 +899,9 @@ class FamilyView:
|
||||
|
||||
def find_marriage(self,family):
|
||||
for event_id in family.get_event_list():
|
||||
if event_id:
|
||||
event = self.parent.db.find_event_from_id(event_id)
|
||||
if event and event.get_name() == "Marriage":
|
||||
if event.get_name() == "Marriage":
|
||||
return event
|
||||
return None
|
||||
|
||||
|
@ -144,29 +144,30 @@ def importData(database, filename, callback,cl=0):
|
||||
#-------------------------------------------------------------------------
|
||||
def remove_clicked():
|
||||
# File is lost => remove all references and the object itself
|
||||
mobj = ObjectMap[NewMediaID]
|
||||
for p in database.get_family_id_map().values():
|
||||
mobj = database.find_object_from_id(NewMediaID)
|
||||
for fid in database.get_family_keys():
|
||||
p = database.find_family_from_id(fid)
|
||||
nl = p.get_media_list()
|
||||
for o in nl:
|
||||
if o.get_reference() == mobj:
|
||||
nl.remove(o)
|
||||
p.set_media_list(nl)
|
||||
for key in database.get_person_keys():
|
||||
p = database.get_person(key)
|
||||
p = database.find_person_from_id(key)
|
||||
nl = p.get_media_list()
|
||||
for o in nl:
|
||||
if o.get_reference() == mobj:
|
||||
if o.get_reference_id() == mobj.get_id():
|
||||
nl.remove(o)
|
||||
p.set_media_list(nl)
|
||||
for key in database.get_source_keys():
|
||||
p = database.get_source(key)
|
||||
p = database.find_source_from_id(key)
|
||||
nl = p.get_media_list()
|
||||
for o in nl:
|
||||
if o.get_reference() == mobj:
|
||||
if o.get_reference_id() == mobj.get_id():
|
||||
nl.remove(o)
|
||||
p.set_media_list(nl)
|
||||
for key in database.get_place_id_keys():
|
||||
p = database.get_place_id(key)
|
||||
p = database.find_place_from_id(key)
|
||||
nl = p.get_media_list()
|
||||
for o in nl:
|
||||
if o.get_reference() == mobj:
|
||||
@ -201,8 +202,6 @@ def importData(database, filename, callback,cl=0):
|
||||
fs_top.run()
|
||||
fs_top.destroy()
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
# # Rename media files if they were conflicting with existing ones
|
||||
# newpath = database.get_save_path()
|
||||
# for old_media_id in parser.media_file_map.keys():
|
||||
|
@ -1961,6 +1961,7 @@ class Family(SourceNote):
|
||||
|
||||
def add_event_id(self,event_id):
|
||||
"""adds an Event to the event list"""
|
||||
assert(event_id != None)
|
||||
self.event_list.append(event_id)
|
||||
|
||||
def get_event_list(self) :
|
||||
@ -2901,12 +2902,12 @@ class GrampsDB:
|
||||
|
||||
if map.has_key(str(idVal)):
|
||||
place = Place()
|
||||
data = self.place_map[map[str(idVal)]]
|
||||
data = self.place_map[str(map[idVal])]
|
||||
place.unserialize(data)
|
||||
else:
|
||||
place = Place()
|
||||
if self.place_map.has_key(str(idVal)):
|
||||
map[str(idVal)] = self.add_place(place)
|
||||
map[idVal] = self.add_place(place)
|
||||
else:
|
||||
place.set_id(str(idVal))
|
||||
map[str(idVal)] = self.add_place_as(place)
|
||||
@ -3108,7 +3109,7 @@ class GrampsDB:
|
||||
family = self.new_family()
|
||||
else:
|
||||
family = self.new_family_no_map(str(idVal))
|
||||
map[str(idVal)] = family.get_id()
|
||||
map[idVal] = family.get_id()
|
||||
return family
|
||||
|
||||
def find_source_no_conflicts(self,idVal,map):
|
||||
|
@ -51,7 +51,7 @@
|
||||
<accelerator key="N" modifiers="GDK_CONTROL_MASK" signal="activate"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1765">
|
||||
<widget class="GtkImage" id="image1783">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-new</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -73,7 +73,7 @@
|
||||
<accelerator key="O" modifiers="GDK_CONTROL_MASK" signal="activate"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1766">
|
||||
<widget class="GtkImage" id="image1784">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-open</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -107,7 +107,7 @@
|
||||
<property name="use_underline">True</property>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1767">
|
||||
<widget class="GtkImage" id="image1785">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-convert</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -120,27 +120,6 @@
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="revert">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Revert</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_revert_activate"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1768">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-revert-to-saved</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="reload_plugins">
|
||||
<property name="visible">True</property>
|
||||
@ -149,7 +128,7 @@
|
||||
<signal name="activate" handler="on_reload_plugins_activate"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1769">
|
||||
<widget class="GtkImage" id="image1786">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-refresh</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -177,7 +156,7 @@
|
||||
<accelerator key="Q" modifiers="GDK_CONTROL_MASK" signal="activate"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1770">
|
||||
<widget class="GtkImage" id="image1787">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-quit</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -213,7 +192,7 @@
|
||||
<accelerator key="Insert" modifiers="GDK_CONTROL_MASK" signal="activate"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1771">
|
||||
<widget class="GtkImage" id="image1788">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-add</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -236,7 +215,7 @@
|
||||
<accelerator key="Delete" modifiers="GDK_CONTROL_MASK" signal="activate"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1772">
|
||||
<widget class="GtkImage" id="image1789">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-remove</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -274,7 +253,7 @@
|
||||
<accelerator key="F" modifiers="GDK_CONTROL_MASK" signal="activate"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1773">
|
||||
<widget class="GtkImage" id="image1790">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-find</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -296,7 +275,7 @@
|
||||
<accelerator key="M" modifiers="GDK_CONTROL_MASK" signal="activate"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1774">
|
||||
<widget class="GtkImage" id="image1791">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-convert</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -323,7 +302,7 @@
|
||||
<signal name="activate" handler="on_preferences1_activate"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1775">
|
||||
<widget class="GtkImage" id="image1792">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-preferences</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -344,7 +323,7 @@
|
||||
<signal name="activate" handler="on_default_person_activate" last_modification_time="Sat, 16 Aug 2003 01:58:26 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1776">
|
||||
<widget class="GtkImage" id="image1793">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-home</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -430,7 +409,7 @@
|
||||
<accelerator key="D" modifiers="GDK_CONTROL_MASK" signal="activate"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1777">
|
||||
<widget class="GtkImage" id="image1794">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-index</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -452,7 +431,7 @@
|
||||
<accelerator key="B" modifiers="GDK_CONTROL_MASK" signal="activate"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1778">
|
||||
<widget class="GtkImage" id="image1795">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gnome-stock-book-open</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -525,7 +504,7 @@
|
||||
<accelerator key="F1" modifiers="0" signal="activate"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1779">
|
||||
<widget class="GtkImage" id="image1796">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-help</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -546,7 +525,7 @@
|
||||
<signal name="activate" handler="on_faq_activate" last_modification_time="Wed, 26 Nov 2003 17:59:23 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1780">
|
||||
<widget class="GtkImage" id="image1797">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gnome-stock-book-open</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -573,7 +552,7 @@
|
||||
<signal name="activate" handler="on_gramps_home_page_activate"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1781">
|
||||
<widget class="GtkImage" id="image1798">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-jump-to</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -594,7 +573,7 @@
|
||||
<signal name="activate" handler="on_gramps_mailing_lists_activate"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1782">
|
||||
<widget class="GtkImage" id="image1799">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gnome-stock-mail</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -648,7 +627,7 @@
|
||||
<signal name="activate" handler="on_about_activate" last_modification_time="Tue, 01 Apr 2003 03:44:24 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1783">
|
||||
<widget class="GtkImage" id="image1800">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gnome-stock-about</property>
|
||||
<property name="icon_size">1</property>
|
||||
|
@ -667,9 +667,10 @@ class GedcomParser:
|
||||
event.set_name(matches[1])
|
||||
if event.get_name() == "Marriage":
|
||||
self.family.set_relationship("Married")
|
||||
self.db.add_event(event)
|
||||
self.family.add_event_id(event.get_id())
|
||||
self.parse_family_event(event,2)
|
||||
self.db.add_event(event)
|
||||
self.db.commit_event(event)
|
||||
|
||||
def parse_note_base(self,matches,obj,level,old_note,task):
|
||||
note = old_note
|
||||
|
@ -90,7 +90,7 @@ class ReadNative:
|
||||
DisplayTrace.DisplayTrace()
|
||||
|
||||
self.window.destroy()
|
||||
self.callback(1)
|
||||
self.callback()
|
||||
|
||||
def progress(self,val):
|
||||
self.progress_bar.set_fraction(val)
|
||||
|
Loading…
Reference in New Issue
Block a user