diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index dec4ac284..d4c80d5f7 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,7 @@ +2006-10-11 Martin Hawlisch + * src/plugins/IndivComplete.py (write_person): Catch missing image + files. + 2006-10-11 Alex Roitman * src/GrampsDisplay.py (help): Rename gramps-manual to gramps. diff --git a/gramps2/src/plugins/IndivComplete.py b/gramps2/src/plugins/IndivComplete.py index 1ce3db1b7..1b5ee8b4b 100644 --- a/gramps2/src/plugins/IndivComplete.py +++ b/gramps2/src/plugins/IndivComplete.py @@ -50,6 +50,7 @@ from PluginUtils import register_report from ReportBase import Report, ReportUtils, ReportOptions, \ CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI from NameDisplay import displayer as _nd +from QuestionDialog import WarningDialog #------------------------------------------------------------------------ # @@ -428,10 +429,14 @@ class IndivCompleteReport(Report): object = self.database.get_object_from_handle(object_handle) mime_type = object.get_mime_type() if mime_type and mime_type.startswith("image"): - file = object.get_path() - self.doc.start_paragraph("IDS-Normal") - self.doc.add_media_object(file,"row",4.0,4.0) - self.doc.end_paragraph() + filename = object.get_path() + if os.path.exists(filename): + self.doc.start_paragraph("IDS-Normal") + self.doc.add_media_object(filename,"row",4.0,4.0) + self.doc.end_paragraph() + else: + WarningDialog(_("Could not add photo to page"), + "%s: %s" % (filename, _('File does not exist'))) self.doc.start_table("one","IDS-IndTable")