* src/gramps_main.py (read_file): Remove set_resizable() calls.

* src/ReadGedcom.py (parse_person_object,parse_family_object):
Always add media references/objects, even if the files are not found
(keep the warnings); set the note for the media references.


svn: r4647
This commit is contained in:
Alex Roitman 2005-05-20 21:27:03 +00:00
parent 779a231259
commit ec654be45e
3 changed files with 34 additions and 30 deletions

View File

@ -16,6 +16,10 @@
referred MediaObject.
* src/MediaView.py (on_drag_drop): Remove drag_get_data() call
as it was calling extraneous 'drag-data-received' signal.
* src/gramps_main.py (read_file): Remove set_resizable() calls.
* src/ReadGedcom.py (parse_person_object,parse_family_object):
Always add media references/objects, even if the files are not found
(keep the warnings); set the note for the media references.
2005-05-19 Don Allingham <don@gramps-project.org>
* src/DisplayModels.py: remove place column

View File

@ -1190,21 +1190,22 @@ class GedcomParser:
self.warn(_("\tThe following paths were tried:\n\t\t"))
self.warn("\n\t\t".join(path))
self.warn('\n')
path = filename.replace('\\','/')
photo_handle = self.media_map.get(path)
if photo_handle == None:
photo = RelLib.MediaObject()
photo.set_path(path)
photo.set_description(title)
photo.set_mime_type(GrampsMime.get_type(os.path.abspath(path)))
self.db.add_object(photo, self.trans)
self.media_map[path] = photo.get_handle()
else:
photo_handle = self.media_map.get(path)
if photo_handle == None:
photo = RelLib.MediaObject()
photo.set_path(path)
photo.set_description(title)
photo.set_mime_type(GrampsMime.get_type(os.path.abspath(path)))
self.db.add_object(photo, self.trans)
self.media_map[path] = photo.get_handle()
else:
photo = self.db.get_object_from_handle(photo_handle)
oref = RelLib.MediaRef()
oref.set_reference_handle(photo.get_handle())
self.person.add_media_reference(oref)
self.db.commit_person(self.person, self.trans)
photo = self.db.get_object_from_handle(photo_handle)
oref = RelLib.MediaRef()
oref.set_reference_handle(photo.get_handle())
oref.set_note(note)
self.person.add_media_reference(oref)
self.db.commit_person(self.person, self.trans)
def parse_family_object(self,level):
form = ""
@ -1234,21 +1235,22 @@ class GedcomParser:
self.warn(_("\tThe following paths were tried:\n\t\t"))
self.warn("\n\t\t".join(path))
self.warn('\n')
path = filename.replace('\\','/')
photo_handle = self.media_map.get(path)
if photo_handle == None:
photo = RelLib.MediaObject()
photo.set_path(path)
photo.set_description(title)
photo.set_mime_type(GrampsMime.get_type(os.path.abspath(path)))
self.db.add_object(photo, self.trans)
self.media_map[path] = photo.get_handle()
else:
photo_handle = self.media_map.get(path)
if photo_handle == None:
photo = RelLib.MediaObject()
photo.set_path(path)
photo.set_description(title)
photo.set_mime_type(GrampsMime.get_type(os.path.abspath(path)))
self.db.add_object(photo, self.trans)
self.media_map[path] = photo.get_handle()
else:
photo = self.db.get_object_from_handle(photo_handle)
oref = RelLib.MediaRef()
oref.set_reference_handle(photo.get_handle())
self.family.add_media_reference(oref)
self.db.commit_family(self.family, self.trans)
photo = self.db.get_object_from_handle(photo_handle)
oref = RelLib.MediaRef()
oref.set_reference_handle(photo.get_handle())
oref.set_note(note)
self.family.add_media_reference(oref)
self.db.commit_family(self.family, self.trans)
def parse_residence(self,address,level):
note = ""

View File

@ -1257,7 +1257,6 @@ class Gramps(GrampsDBCallback.GrampsDBCallback):
self.progress.set_fraction(0)
def read_file(self,filename,callback=None):
self.topWindow.set_resizable(False)
mode = "w"
filename = os.path.normpath(os.path.abspath(filename))
@ -1300,7 +1299,6 @@ class Gramps(GrampsDBCallback.GrampsDBCallback):
_('%s could not be opened.' % filename) + '\n' + msg[1])
return 0
self.topWindow.set_resizable(True)
# Undo/Redo always start with standard labels and insensitive state
self.undo_callback(None)
self.redo_callback(None)