From 23738ca23438f12066f74b6c81e5b921236548de Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Thu, 31 May 2001 13:38:24 +0000 Subject: [PATCH] Fixed paper/output settings, problems with images with spaces, understand FTW gedcom svn: r70 --- gramps/src/Config.py | 2 + gramps/src/EditPerson.py | 8 +- gramps/src/EditSource.py | 6 +- gramps/src/OpenOfficeDoc.py | 2 +- gramps/src/RelImage.py | 2 +- gramps/src/gramps.glade | 2 +- gramps/src/gramps_main.py | 2 +- gramps/src/plugins/HtmlReport.py | 3 +- gramps/src/plugins/ReadGedcom.py | 132 ++++++++++++++++++++----------- 9 files changed, 103 insertions(+), 56 deletions(-) diff --git a/gramps/src/Config.py b/gramps/src/Config.py index 232e640f7..1c1d646a5 100644 --- a/gramps/src/Config.py +++ b/gramps/src/Config.py @@ -288,6 +288,8 @@ def on_propertybox_apply(obj,page): global display_attr global attr_name global hide_altnames + global paper_preference + global output_preference if page != -1: return diff --git a/gramps/src/EditPerson.py b/gramps/src/EditPerson.py index c5f2072bd..d03716424 100644 --- a/gramps/src/EditPerson.py +++ b/gramps/src/EditPerson.py @@ -699,9 +699,15 @@ def on_add_attr_clicked(obj): edit_person_obj = obj.get_data(EDITPERSON) attr = Attribute() - attr.setType(edit_person_obj.attr_type.get_text()) + name = edit_person_obj.attr_type.get_text() + attr.setType(name) attr.setValue(edit_person_obj.attr_value.get_text()) + if name not in const.personalAttributes: + const.personalAttributes.append(name) + menu = edit_person_obj.get_widget("attribute") + menu.set_popdown_strings(const.personalAttributes) + edit_person_obj.person.addAttribute(attr) edit_person_obj.redraw_attr_list() utils.modified() diff --git a/gramps/src/EditSource.py b/gramps/src/EditSource.py index 4629c7237..a34446263 100644 --- a/gramps/src/EditSource.py +++ b/gramps/src/EditSource.py @@ -96,11 +96,11 @@ def on_source_apply_clicked(obj): utils.modified() if title != edit.source.getTitle(): - edit.source.setAuthor(title) + edit.source.setTitle(title) utils.modified() if pubinfo != edit.source.getPubInfo(): - edit.source.setAuthor(pubinfo) + edit.source.sePubInfo(pubinfo) utils.modified() if note != edit.source.getNote(): @@ -108,6 +108,6 @@ def on_source_apply_clicked(obj): utils.modified() utils.destroy_passed_object(edit.top) - edit.callback(1) + edit.callback(edit.source) diff --git a/gramps/src/OpenOfficeDoc.py b/gramps/src/OpenOfficeDoc.py index ef352ac98..a00147c66 100644 --- a/gramps/src/OpenOfficeDoc.py +++ b/gramps/src/OpenOfficeDoc.py @@ -425,7 +425,7 @@ class OpenOfficeDoc(TextDoc): base = os.path.basename(file) image_name = self.tempdir + os.sep + "Pictures" + os.sep + base if no_pil: - cmd = "%s -size %dx%d %s %s" % (const.convert,width,height,file,image_name) + cmd = "%s -size %dx%d '%s' '%s'" % (const.convert,width,height,file,image_name) os.system(cmd) else: im = PIL.Image.open(file) diff --git a/gramps/src/RelImage.py b/gramps/src/RelImage.py index 0a429e3e9..be80921eb 100644 --- a/gramps/src/RelImage.py +++ b/gramps/src/RelImage.py @@ -61,7 +61,7 @@ def import_photo(filename,path,prefix): shutil.copy(filename,name) else: if no_pil: - cmd = "%s %s %s" % (const.convert,filename,name) + cmd = "%s '%s' '%s'" % (const.convert,filename,name) os.system(cmd) else: PIL.Image.open(filename).save(name) diff --git a/gramps/src/gramps.glade b/gramps/src/gramps.glade index 49e2539ed..cb6413ff6 100644 --- a/gramps/src/gramps.glade +++ b/gramps/src/gramps.glade @@ -3719,7 +3719,7 @@ Other GtkText source_note True - False + True diff --git a/gramps/src/gramps_main.py b/gramps/src/gramps_main.py index 5c463ac13..3784591c8 100755 --- a/gramps/src/gramps_main.py +++ b/gramps/src/gramps_main.py @@ -702,7 +702,7 @@ def on_edit_source_clicked(obj): # #------------------------------------------------------------------------- def new_source_after_edit(source): - database.addSource(source.source) + database.addSource(source) update_display(1) #------------------------------------------------------------------------- diff --git a/gramps/src/plugins/HtmlReport.py b/gramps/src/plugins/HtmlReport.py index 77bf2b974..d0bac3eed 100644 --- a/gramps/src/plugins/HtmlReport.py +++ b/gramps/src/plugins/HtmlReport.py @@ -419,8 +419,7 @@ def dump_person(person,prefix,templateTop,templateBottom,targetDir): width = int( (float(image.rgb_width) * 200.0) / float(image.rgb_height)) base = os.path.basename(file) image_name = targetDir + os.sep + base - cmd = const.convert + " -size " + str(width) + "x200 "\ - + file + " " + image_name + cmd = "%s -size %dx200 '%s' '%s'" % (const.convert,width,file,image_name) os.system(cmd) html.write('