From 49512e683c231701c83b5fdf0c32799bd0f4f3ca Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Wed, 17 Dec 2003 05:23:16 +0000 Subject: [PATCH] * src/PlaceView.py: Make sure to add new place after edit * src/AddMedia.py: unicode conversion from gtk.Entry * src/AddSpouse.py: unicode conversion from gtk.Entry * src/AddrEdit.py: unicode conversion from gtk.Entry * src/AttrEdit.py: unicode conversion from gtk.Entry * src/AutoComp.py: unicode conversion from gtk.Entry * src/ChooseParents.py: unicode conversion from gtk.Entry * src/DateEdit.py: unicode conversion from gtk.Entry * src/EditPerson.py: unicode conversion from gtk.Entry * src/EditPlace.py: unicode conversion from gtk.Entry * src/EditSource.py: unicode conversion from gtk.Entry * src/EventEdit.py: unicode conversion from gtk.Entry * src/Find.py: unicode conversion from gtk.Entry * src/GrampsCfg.py: unicode conversion from gtk.Entry * src/ImageSelect.py: unicode conversion from gtk.Entry * src/LocEdit.py: unicode conversion from gtk.Entry * src/Marriage.py: unicode conversion from gtk.Entry * src/MergeData.py: unicode conversion from gtk.Entry * src/NameEdit.py: unicode conversion from gtk.Entry * src/PeopleView.py: unicode conversion from gtk.Entry * src/Report.py: unicode conversion from gtk.Entry * src/SelectChild.py: unicode conversion from gtk.Entry * src/Sources.py: unicode conversion from gtk.Entry * src/StartupDialog.py: unicode conversion from gtk.Entry * src/StyleEditor.py: unicode conversion from gtk.Entry * src/UrlEdit.py: unicode conversion from gtk.Entry * src/Utils.py: unicode conversion from gtk.Entry * src/VersionControl.py: unicode conversion from gtk.Entry * src/Witness.py: unicode conversion from gtk.Entry svn: r2534 --- ChangeLog | 31 ++++++++++++++++++ src/AddMedia.py | 6 ++-- src/AddSpouse.py | 6 ++-- src/AddrEdit.py | 14 ++++---- src/AttrEdit.py | 4 +-- src/AutoComp.py | 4 +-- src/ChooseParents.py | 12 +++---- src/DateEdit.py | 2 +- src/EditPerson.py | 76 +++++++++++++++++++------------------------ src/EditPlace.py | 2 +- src/EditSource.py | 8 ++--- src/EventEdit.py | 12 +++---- src/Find.py | 4 +-- src/GrampsCfg.py | 38 +++++++++++----------- src/ImageSelect.py | 8 ++--- src/LocEdit.py | 14 ++++---- src/Marriage.py | 24 +++++++------- src/MergeData.py | 2 +- src/NameEdit.py | 10 +++--- src/PeopleView.py | 2 +- src/PlaceView.py | 2 +- src/Report.py | 8 ++--- src/SelectChild.py | 8 ++--- src/Sources.py | 2 +- src/StartupDialog.py | 16 ++++----- src/StyleEditor.py | 2 +- src/UrlEdit.py | 4 +-- src/Utils.py | 4 +-- src/VersionControl.py | 2 +- src/Witness.py | 2 +- 30 files changed, 173 insertions(+), 156 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8f9dc2835..bd59dc03b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,34 @@ +2003-12-16 Don Allingham + * src/PlaceView.py: Make sure to add new place after edit + * src/AddMedia.py: unicode conversion from gtk.Entry + * src/AddSpouse.py: unicode conversion from gtk.Entry + * src/AddrEdit.py: unicode conversion from gtk.Entry + * src/AttrEdit.py: unicode conversion from gtk.Entry + * src/AutoComp.py: unicode conversion from gtk.Entry + * src/ChooseParents.py: unicode conversion from gtk.Entry + * src/DateEdit.py: unicode conversion from gtk.Entry + * src/EditPerson.py: unicode conversion from gtk.Entry + * src/EditPlace.py: unicode conversion from gtk.Entry + * src/EditSource.py: unicode conversion from gtk.Entry + * src/EventEdit.py: unicode conversion from gtk.Entry + * src/Find.py: unicode conversion from gtk.Entry + * src/GrampsCfg.py: unicode conversion from gtk.Entry + * src/ImageSelect.py: unicode conversion from gtk.Entry + * src/LocEdit.py: unicode conversion from gtk.Entry + * src/Marriage.py: unicode conversion from gtk.Entry + * src/MergeData.py: unicode conversion from gtk.Entry + * src/NameEdit.py: unicode conversion from gtk.Entry + * src/PeopleView.py: unicode conversion from gtk.Entry + * src/Report.py: unicode conversion from gtk.Entry + * src/SelectChild.py: unicode conversion from gtk.Entry + * src/Sources.py: unicode conversion from gtk.Entry + * src/StartupDialog.py: unicode conversion from gtk.Entry + * src/StyleEditor.py: unicode conversion from gtk.Entry + * src/UrlEdit.py: unicode conversion from gtk.Entry + * src/Utils.py: unicode conversion from gtk.Entry + * src/VersionControl.py: unicode conversion from gtk.Entry + * src/Witness.py: unicode conversion from gtk.Entry + 2003-12-16 Tim Waugh * src/plugins/Ancestors.py: Use write_note() when appropriate. diff --git a/src/AddMedia.py b/src/AddMedia.py index 2e34c8e1a..8efddf3d2 100644 --- a/src/AddMedia.py +++ b/src/AddMedia.py @@ -105,7 +105,7 @@ class AddMediaObject: A new media object is created, and added to the database. """ filename = self.glade.get_widget("photosel").get_full_path(0) - description = self.description.get_text() + description = unicode(self.description.get_text()) external = self.glade.get_widget("private") if os.path.exists(filename) == 0: @@ -142,10 +142,10 @@ class AddMediaObject: see if the file exists. If it does, the imgae is loaded into the preview window. """ - filename = self.file_text.get_text() + filename = unicode(self.file_text.get_text()) basename = os.path.basename(filename) (root,ext) = os.path.splitext(basename) - old_title = self.description.get_text() + old_title = unicode(self.description.get_text()) if old_title == '' or old_title == self.temp_name: self.description.set_text(root) diff --git a/src/AddSpouse.py b/src/AddSpouse.py index 5feadb4d6..8ab8504a9 100644 --- a/src/AddSpouse.py +++ b/src/AddSpouse.py @@ -139,7 +139,7 @@ class AddSpouse: """ import EditPerson - relation = const.save_frel(self.relation_type.get_text()) + relation = const.save_frel(unicode(self.relation_type.get_text())) if relation == "Partners": if self.person.getGender() == RelLib.Person.male: gen = RelLib.Person.male @@ -202,7 +202,7 @@ class AddSpouse: self.active_family.setFather(spouse) self.active_family.setMother(self.person) - self.active_family.setRelationship(const.save_frel(self.relation_type.get_text())) + self.active_family.setRelationship(const.save_frel(unicode(self.relation_type.get_text()))) Utils.destroy_passed_object(obj) self.update(self.active_family) @@ -215,7 +215,7 @@ class AddSpouse: the potential spouse list. """ - text = self.relation_type.get_text() + text = unicode(self.relation_type.get_text()) self.relation_def.set_text(const.relationship_def(text)) # determine the gender of the people to be loaded into diff --git a/src/AddrEdit.py b/src/AddrEdit.py index cfd7f39b5..f303b6eec 100644 --- a/src/AddrEdit.py +++ b/src/AddrEdit.py @@ -147,13 +147,13 @@ class AddressEditor: Called when the OK button is pressed. Gets data from the form and updates the Address data structure. """ - date = self.addr_start.get_text() - street = self.street.get_text() - city = self.city.get_text() - state = self.state.get_text() - country = self.country.get_text() - phone = self.phone.get_text() - postal = self.postal.get_text() + date = unicode(self.addr_start.get_text()) + street = unicode(self.street.get_text()) + city = unicode(self.city.get_text()) + state = unicode(self.state.get_text()) + country = unicode(self.country.get_text()) + phone = unicode(self.phone.get_text()) + postal = unicode(self.postal.get_text()) b = self.note_field.get_buffer() note = b.get_text(b.get_start_iter(),b.get_end_iter(),gtk.FALSE) format = self.preform.get_active() diff --git a/src/AttrEdit.py b/src/AttrEdit.py index 82993b7cd..ed8dc7c85 100644 --- a/src/AttrEdit.py +++ b/src/AttrEdit.py @@ -152,8 +152,8 @@ class AttributeEditor: Called when the OK button is pressed. Gets data from the form and updates the Attribute data structure. """ - type = self.type_field.get_text() - value = self.value_field.get_text() + type = unicode(self.type_field.get_text()) + value = unicode(self.value_field.get_text()) buf = self.note_field.get_buffer() note = buf.get_text(buf.get_start_iter(),buf.get_end_iter(),gtk.FALSE) diff --git a/src/AutoComp.py b/src/AutoComp.py index 033dc88ba..88cf5e22c 100644 --- a/src/AutoComp.py +++ b/src/AutoComp.py @@ -155,7 +155,7 @@ class AutoCombo(AutoCompBase): """Callback task called on the button release""" self.inb = 0 - text = self.entry.entry.get_text() + text = unicode(self.entry.entry.get_text()) if self.nl == string.lower(text): gtk.Editable.set_position(self.entry.entry,self.l) gtk.Editable.select_region(self.entry.entry,self.l,-1) @@ -168,7 +168,7 @@ class AutoCombo(AutoCompBase): if self.vals and len(self.vals) < 250: if self.vals[0] == "": - self.entry.set_popdown_strings([self.entry.entry.get_text()]) + self.entry.set_popdown_strings([unicode(self.entry.entry.get_text())]) else: self.entry.set_popdown_strings(self.vals) else: diff --git a/src/ChooseParents.py b/src/ChooseParents.py index bbb50fc64..eb2f22532 100644 --- a/src/ChooseParents.py +++ b/src/ChooseParents.py @@ -304,7 +304,7 @@ class ChooseParents: def parent_relation_changed(self,obj): """Called everytime the parent relationship information is changegd""" self.old_type = self.type - self.type = const.save_frel(obj.get_text()) + self.type = const.save_frel(unicode(obj.get_text())) if self.old_type == "Partners" or self.type == "Partners": self.redrawf() self.redrawm() @@ -384,12 +384,12 @@ class ChooseParents: of the main perosn. """ try: - mother_rel = const.childRelations[self.mother_rel.get_text()] + mother_rel = const.childRelations[unicode(self.mother_rel.get_text())] except KeyError: mother_rel = const.childRelations["Birth"] try: - father_rel = const.childRelations[self.father_rel.get_text()] + father_rel = const.childRelations[unicode(self.father_rel.get_text())] except KeyError: father_rel = const.childRelations["Birth"] @@ -437,7 +437,7 @@ class ChooseParents: self.db.addPersonNoMap(person,id) self.db.buildPersonDisplay(id) - self.type = const.save_frel(self.prel.get_text()) + self.type = const.save_frel(unicode(self.prel.get_text())) dinfo = self.db.getPersonDisplay(id) rdata = [dinfo[0],dinfo[1],dinfo[3],dinfo[5],dinfo[6]] @@ -580,8 +580,8 @@ class ModifyParents: Called with the OK button nis pressed. Saves the selected people as parents of the main perosn. """ - mother_rel = const.childRelations[self.mother_rel.get_text()] - father_rel = const.childRelations[self.father_rel.get_text()] + mother_rel = const.childRelations[unicode(self.mother_rel.get_text())] + father_rel = const.childRelations[unicode(self.father_rel.get_text())] mod = 0 if mother_rel != self.orig_mrel or father_rel != self.orig_frel: diff --git a/src/DateEdit.py b/src/DateEdit.py index 6abfc3d0d..4f5358170 100644 --- a/src/DateEdit.py +++ b/src/DateEdit.py @@ -75,7 +75,7 @@ class DateEdit: """Called with the text box loses focus. If the string contains a valid date, sets the appropriate pixmap""" - text = self.text_obj.get_text() + text = unicode(self.text_obj.get_text()) self.checkval.set(text) if not self.checkval.isValid(): self.pixmap_obj.set_from_pixbuf(DateEdit.bad) diff --git a/src/EditPerson.py b/src/EditPerson.py index dc8981199..8fc634b13 100644 --- a/src/EditPerson.py +++ b/src/EditPerson.py @@ -521,7 +521,7 @@ class EditPerson: if not self.should_guess_gender: return - gender = self.db.genderStats.guess_gender (entry.get_text ()) + gender = self.db.genderStats.guess_gender(unicode(entry.get_text ())) if gender == RelLib.Person.unknown: self.is_unknown.set_active (1) elif gender == RelLib.Person.male: @@ -821,13 +821,9 @@ class EditPerson: # Remember old combo list input - bplace_text = self.bplace.get_text() - if type(bplace_text) == type(u''): - bplace_text = unicode(bplace_text) + bplace_text = unicode(self.bplace.get_text()) - dplace_text = self.dplace.get_text() - if type(dplace_text) == type(u''): - dplace_text = unicode(dplace_text) + dplace_text = unicode(self.dplace.get_text()) prev_btext = Utils.strip_id(bplace_text) prev_dtext = Utils.strip_id(dplace_text) @@ -896,10 +892,8 @@ class EditPerson: self.update_birth = 1 pname = self.person.getPrimaryName().getName() event = self.birth - event.setDate(self.bdate.get_text()) - def_placename = self.bplace.get_text() - if type(def_placename) == type(u''): - def_placename = unicode(def_placename) + event.setDate(unicode(self.bdate.get_text())) + def_placename = unicode(self.bplace.get_text()) p = self.get_place(self.bplace) if p: @@ -916,10 +910,8 @@ class EditPerson: self.update_death = 1 pname = self.person.getPrimaryName().getName() event = self.death - event.setDate(self.ddate.get_text()) - def_placename = self.dplace.get_text() - if type(def_placename) == type(u''): - def_placename = unicode(def_placename) + event.setDate(unicode(self.ddate.get_text())) + def_placename = unicode(self.dplace.get_text()) p = self.get_place(self.dplace) if p: @@ -1009,22 +1001,22 @@ class EditPerson: original record""" surname = unicode(self.surname_field.get_text()) - self.birth.setDate(self.bdate.get_text()) - self.death.setDate(self.ddate.get_text()) + self.birth.setDate(unicode(self.bdate.get_text())) + self.death.setDate(unicode(self.ddate.get_text())) - ntype = self.ntype_field.entry.get_text() - suffix = self.suffix.get_text() - prefix = self.prefix.get_text() - given = self.given.get_text() - nick = self.nick.get_text() - title = self.title.get_text() + ntype = unicode(self.ntype_field.entry.get_text()) + suffix = unicode(self.suffix.get_text()) + prefix = unicode(self.prefix.get_text()) + given = unicode(self.given.get_text()) + nick = unicode(self.nick.get_text()) + title = unicode(self.title.get_text()) male = self.is_male.get_active() female = self.is_female.get_active() unknown = self.is_unknown.get_active() text = self.notes_buffer.get_text(self.notes_buffer.get_start_iter(), self.notes_buffer.get_end_iter(),gtk.FALSE) format = self.preform.get_active() - idval = self.gid.get_text() + idval = unicode(self.gid.get_text()) changed = 0 name = self.person.getPrimaryName() @@ -1100,24 +1092,24 @@ class EditPerson: return changed def check_lds(self): - self.lds_baptism.setDate(self.ldsbap_date.get_text()) - temple = self.ldsbap_temple.entry.get_text() + self.lds_baptism.setDate(unicode(self.ldsbap_date.get_text())) + temple = unicode(self.ldsbap_temple.entry.get_text()) if const.lds_temple_codes.has_key(temple): self.lds_baptism.setTemple(const.lds_temple_codes[temple]) else: self.lds_baptism.setTemple("") self.lds_baptism.setPlace(self.get_place(self.ldsbapplace,1)) - self.lds_endowment.setDate(self.ldsend_date.get_text()) - temple = self.ldsend_temple.entry.get_text() + self.lds_endowment.setDate(unicode(self.ldsend_date.get_text())) + temple = unicode(self.ldsend_temple.entry.get_text()) if const.lds_temple_codes.has_key(temple): self.lds_endowment.setTemple(const.lds_temple_codes[temple]) else: self.lds_endowment.setTemple("") self.lds_endowment.setPlace(self.get_place(self.ldsendowplace,1)) - self.lds_sealing.setDate(self.ldsseal_date.get_text()) - temple = self.ldsseal_temple.entry.get_text() + self.lds_sealing.setDate(unicode(self.ldsseal_date.get_text())) + temple = unicode(self.ldsseal_temple.entry.get_text()) if const.lds_temple_codes.has_key(temple): self.lds_sealing.setTemple(const.lds_temple_codes[temple]) else: @@ -1360,18 +1352,18 @@ class EditPerson: Utils.modified() def on_apply_person_clicked(self,obj): - surname = self.surname_field.get_text() - suffix = self.suffix.get_text() - prefix = self.prefix.get_text() - ntype = self.ntype_field.entry.get_text() - given = self.given.get_text() - nick = self.nick.get_text() - title = self.title.get_text() - idval = self.gid.get_text() + surname = unicode(self.surname_field.get_text()) + suffix = unicode(self.suffix.get_text()) + prefix = unicode(self.prefix.get_text()) + ntype = unicode(self.ntype_field.entry.get_text()) + given = unicode(self.given.get_text()) + nick = unicode(self.nick.get_text()) + title = unicode(self.title.get_text()) + idval = unicode(self.gid.get_text()) name = self.pname - self.birth.setDate(self.bdate.get_text()) + self.birth.setDate(unicode(self.bdate.get_text())) self.birth.setPlace(self.get_place(self.bplace,1)) if idval != self.person.getId(): @@ -1444,7 +1436,7 @@ class EditPerson: new_order = reorder_child_list(self.person,family.getChildList()) family.setChildList(new_order) - self.death.setDate(self.ddate.get_text()) + self.death.setDate(unicode(self.ddate.get_text())) self.death.setPlace(self.get_place(self.dplace,1)) if not self.person.getDeath().are_equal(self.death): @@ -1544,9 +1536,7 @@ class EditPerson: self.window.destroy() def get_place(self,field,makenew=0): - text = string.strip(field.get_text()) - if type(text) != type(u' '): - text = unicode(text) + text = unicode(string.strip(field.get_text())) if text: if self.pdmap.has_key(text): return self.db.getPlaceMap()[self.pdmap[text]] diff --git a/src/EditPlace.py b/src/EditPlace.py index 9ff4e4218..e3e0d2979 100644 --- a/src/EditPlace.py +++ b/src/EditPlace.py @@ -282,7 +282,7 @@ class EditPlace: gnome.url.show(text) def set(self,field,getf,setf): - text = field.get_text() + text = unicode(field.get_text()) if text != getf(): setf(text) Utils.modified() diff --git a/src/EditSource.py b/src/EditSource.py index c4fd2fd17..26f69bcb2 100644 --- a/src/EditSource.py +++ b/src/EditSource.py @@ -234,10 +234,10 @@ class EditSource: def on_source_apply_clicked(self): - title = self.title.get_text() - author = self.author.get_text() - pubinfo = self.pubinfo.get_text() - abbrev = self.abbrev.get_text() + title = unicode(self.title.get_text()) + author = unicode(self.author.get_text()) + pubinfo = unicode(self.pubinfo.get_text()) + abbrev = unicode(self.abbrev.get_text()) note = self.notes_buffer.get_text(self.notes_buffer.get_start_iter(), self.notes_buffer.get_end_iter(),gtk.FALSE) format = self.preform.get_active() diff --git a/src/EventEdit.py b/src/EventEdit.py index 91d7f22c5..3dfa711f2 100644 --- a/src/EventEdit.py +++ b/src/EventEdit.py @@ -212,13 +212,13 @@ class EventEditor: def on_menu_changed(self,obj): cobj = obj.get_data("d") - self.date.set(self.date_field.get_text()) + self.date.set(unicode(self.date_field.get_text())) self.date.set_calendar(cobj) self.date_field.set_text(self.date.getDate()) self.date_check.set_calendar(cobj()) def get_place(self,field,makenew=0): - text = strip(field.get_text()) + text = unicode(strip(field.get_text())) if text: if self.pmap.has_key(text): return self.parent.db.getPlaceMap()[self.pmap[text]] @@ -237,15 +237,15 @@ class EventEditor: def on_event_edit_ok_clicked(self): - ename = self.name_field.get_text() - self.date.set(self.date_field.get_text()) - ecause = self.cause_field.get_text() + ename = unicode(self.name_field.get_text()) + self.date.set(unicode(self.date_field.get_text())) + ecause = unicode(self.cause_field.get_text()) eplace_obj = self.get_place(self.place_field,1) buf = self.note_field.get_buffer() enote = buf.get_text(buf.get_start_iter(),buf.get_end_iter(),gtk.FALSE) eformat = self.preform.get_active() - edesc = self.descr_field.get_text() + edesc = unicode(self.descr_field.get_text()) epriv = self.priv.get_active() if not ename in self.elist: diff --git a/src/Find.py b/src/Find.py index 291ef5467..43ed62416 100644 --- a/src/Find.py +++ b/src/Find.py @@ -85,9 +85,7 @@ class FindBase: return id def advance(self,func): - text = self.entry.get_text() - if type(text) != self.t: - text = unicode(text.upper()) + text = unicode(self.entry.get_text().upper()) orow = self.index func() while self.index != orow: diff --git a/src/GrampsCfg.py b/src/GrampsCfg.py index e480a0021..20e54f301 100644 --- a/src/GrampsCfg.py +++ b/src/GrampsCfg.py @@ -442,7 +442,7 @@ class ConfigEntry(ConfigWidget): return [l,self.w] def set(self): - val = self.w.get_text() + val = unicode(self.w.get_text()) set_string(self.tag,val) class ConfigInt(ConfigWidget): @@ -883,21 +883,21 @@ class GrampsPreferences: defaultview = not self.top.get_widget("pvbutton").get_active() familyview = not self.top.get_widget("familyview1").get_active() - iprefix = self.top.get_widget("iprefix").get_text() + iprefix = unicode(self.top.get_widget("iprefix").get_text()) if iprefix == "": - iprefix = "I" - sprefix = self.top.get_widget("sprefix").get_text() + iprefix = "I%04d" + sprefix = unicode(self.top.get_widget("sprefix").get_text()) if sprefix == "": - sprefix = "S" - oprefix = self.top.get_widget("oprefix").get_text() + sprefix = "S%04d" + oprefix = unicode(self.top.get_widget("oprefix").get_text()) if oprefix == "": - oprefix = "O" - fprefix = self.top.get_widget("fprefix").get_text() + oprefix = "O%04d" + fprefix = unicode(self.top.get_widget("fprefix").get_text()) if fprefix == "": - fprefix = "F" - pprefix = self.top.get_widget("pprefix").get_text() + fprefix = "F%04d" + pprefix = unicode(self.top.get_widget("pprefix").get_text()) if pprefix == "": - pprefix = "P" + pprefix = "P%04d" dbdir_temp = self.top.get_widget("dbdir").get_full_path(1) if dbdir_temp != None and os.path.isdir(dbdir_temp): @@ -977,14 +977,14 @@ class GrampsPreferences: lastnamegen = format_menu.get_active().get_data(DATA) set_int("/apps/gramps/surname-guessing",lastnamegen) - name = self.top.get_widget("resname").get_text() - addr = self.top.get_widget("resaddr").get_text() - city = self.top.get_widget("rescity").get_text() - state = self.top.get_widget("resstate").get_text() - country = self.top.get_widget("rescountry").get_text() - postal = self.top.get_widget("respostal").get_text() - phone = self.top.get_widget("resphone").get_text() - email = self.top.get_widget("resemail").get_text() + name = unicode(self.top.get_widget("resname").get_text()) + addr = unicode(self.top.get_widget("resaddr").get_text()) + city = unicode(self.top.get_widget("rescity").get_text()) + state = unicode(self.top.get_widget("resstate").get_text()) + country = unicode(self.top.get_widget("rescountry").get_text()) + postal = unicode(self.top.get_widget("respostal").get_text()) + phone = unicode(self.top.get_widget("resphone").get_text()) + email = unicode(self.top.get_widget("resemail").get_text()) set_string("/apps/gramps/researcher-name",name) set_string("/apps/gramps/researcher-addr",addr) diff --git a/src/ImageSelect.py b/src/ImageSelect.py index f4cae9d95..cdbe6113b 100644 --- a/src/ImageSelect.py +++ b/src/ImageSelect.py @@ -135,11 +135,11 @@ class ImageSelect: def on_name_changed(self, obj): """The filename has changed. Verify it and load the picture.""" - filename = self.fname.get_text() + filename = unicode(self.fname.get_text()) basename = os.path.basename(filename) (root,ext) = os.path.splitext(basename) - old_title = self.description.get_text() + old_title = unicode(self.description.get_text()) if old_title == "" or old_title == self.temp_name: self.description.set_text(root) @@ -161,7 +161,7 @@ class ImageSelect: filename = self.photosel.get_full_path(0) _last_path = os.path.dirname(filename) - description = self.description.get_text() + description = unicode(self.description.get_text()) if os.path.exists(filename) == 0: msgstr = _("Cannot import %s") @@ -985,7 +985,7 @@ class GlobalMediaProperties: def on_apply_clicked(self, obj): t = self.notes.get_buffer() text = t.get_text(t.get_start_iter(),t.get_end_iter(),gtk.FALSE) - desc = self.descr_window.get_text() + desc = unicode(self.descr_window.get_text()) note = self.object.getNote() format = self.preform.get_active() if text != note or desc != self.object.getDescription(): diff --git a/src/LocEdit.py b/src/LocEdit.py index 0a40c304b..13021d398 100644 --- a/src/LocEdit.py +++ b/src/LocEdit.py @@ -92,13 +92,13 @@ class LocationEditor: def on_location_edit_ok_clicked(self): self.location = self.location - city = self.city.get_text() - county = self.county.get_text() - country = self.country.get_text() - state = self.state.get_text() - phone = self.phone.get_text() - postal = self.postal.get_text() - parish = self.parish.get_text() + city = unicode(self.city.get_text()) + county = unicode(self.county.get_text()) + country = unicode(self.country.get_text()) + state = unicode(self.state.get_text()) + phone = unicode(self.phone.get_text()) + postal = unicode(self.postal.get_text()) + parish = unicode(self.parish.get_text()) if self.location == None: self.location = RelLib.Location() diff --git a/src/Marriage.py b/src/Marriage.py index c10790ae2..64d283dc8 100644 --- a/src/Marriage.py +++ b/src/Marriage.py @@ -423,7 +423,7 @@ class Marriage: def did_data_change(self): changed = 0 - relation = self.type_field.entry.get_text() + relation = unicode(self.type_field.entry.get_text()) if const.save_frel(relation) != self.family.getRelationship(): changed = 1 @@ -442,12 +442,12 @@ class Marriage: if self.lists_changed: changed = 1 - idval = self.gid.get_text() + idval = unicode(self.gid.get_text()) if self.family.getId() != idval: changed = 1 - date = self.lds_date.get_text() - temple = self.lds_temple.entry.get_text() + date = unicode(self.lds_date.get_text()) + temple = unicode(self.lds_temple.entry.get_text()) if const.lds_temple_codes.has_key(temple): temple = const.lds_temple_codes[temple] else: @@ -493,7 +493,7 @@ class Marriage: self.save() def save(self): - idval = self.gid.get_text() + idval = unicode(self.gid.get_text()) family = self.family if idval != family.getId(): m = self.db.getFamilyMap() @@ -508,7 +508,7 @@ class Marriage: _('The GRAMPS ID that you chose for this ' 'relationship is already being used.')) - relation = self.type_field.entry.get_text() + relation = unicode(self.type_field.entry.get_text()) father = self.family.getFather() mother = self.family.getMother() if father and mother: @@ -541,8 +541,8 @@ class Marriage: self.family.setComplete(self.complete.get_active()) Utils.modified() - date = self.lds_date.get_text() - temple = self.lds_temple.entry.get_text() + date = unicode(self.lds_date.get_text()) + temple = unicode(self.lds_temple.entry.get_text()) if const.lds_temple_codes.has_key(temple): temple = const.lds_temple_codes[temple] else: @@ -706,8 +706,8 @@ class Marriage: else: Utils.unbold_label(self.notes_label) - date = self.lds_date.get_text() - temple = self.lds_temple.entry.get_text() + date = unicode(self.lds_date.get_text()) + temple = unicode(self.lds_temple.entry.get_text()) if const.lds_temple_codes.has_key(temple): temple = const.lds_temple_codes[temple] else: @@ -721,9 +721,7 @@ class Marriage: def get_place(self,makenew=0): field = self.lds_place.entry - text = string.strip(field.get_text()) - if type(text) != type(u' '): - text = unicode(text) + text = unicode(string.strip(field.get_text())) if text: if self.pmap.has_key(text): return self.db.getPlaceMap()[self.pmap[text]] diff --git a/src/MergeData.py b/src/MergeData.py index 8076e4def..cdaf16362 100644 --- a/src/MergeData.py +++ b/src/MergeData.py @@ -844,7 +844,7 @@ class MergePlaces: if t2active: self.p1.set_title(self.p2.get_title()) elif self.glade.get_widget("title3").get_active(): - self.p1.set_title(self.t3.get_text()) + self.p1.set_title(unicode(self.t3.get_text())) # Set longitude if self.p1.get_longitude() == "" and self.p2.get_longitude() != "": diff --git a/src/NameEdit.py b/src/NameEdit.py index 9262d80ad..d06c148d5 100644 --- a/src/NameEdit.py +++ b/src/NameEdit.py @@ -132,16 +132,16 @@ class NameEditor: self.val = self.window.run() def on_name_edit_ok_clicked(self): - first = self.given_field.get_text() - last = self.surname_field.get_text() - title = self.title_field.get_text() - suffix = self.suffix_field.get_text() + first = unicode(self.given_field.get_text()) + last = unicode(self.surname_field.get_text()) + title = unicode(self.title_field.get_text()) + suffix = unicode(self.suffix_field.get_text()) note = self.note_buffer.get_text(self.note_buffer.get_start_iter(), self.note_buffer.get_end_iter(),gtk.FALSE) format = self.preform.get_active() priv = self.priv.get_active() - type = self.type_field.entry.get_text() + type = unicode(self.type_field.entry.get_text()) if const.NameTypesMap.has_key(type): type = const.NameTypesMap[type] diff --git a/src/PeopleView.py b/src/PeopleView.py index 9c25ce7a5..27b0a30a9 100644 --- a/src/PeopleView.py +++ b/src/PeopleView.py @@ -178,7 +178,7 @@ class PeopleView: def apply_filter_clicked(self): invert_filter = self.parent.filter_inv.get_active() - qualifer = self.parent.filter_text.get_text() + qualifer = unicode(self.parent.filter_text.get_text()) mi = self.parent.filter_list.get_menu().get_active() class_init = mi.get_data("function") self.DataFilter = class_init(qualifer) diff --git a/src/PlaceView.py b/src/PlaceView.py index 9d90bf340..187b8700f 100644 --- a/src/PlaceView.py +++ b/src/PlaceView.py @@ -192,7 +192,7 @@ class PlaceView: menu.popup(None,None,None,event.button,event.time) def new_place_after_edit(self,place): - #self.db.addPlace(place) + self.db.addPlace(place) self.update(0) def update_display(self,place): diff --git a/src/Report.py b/src/Report.py index 45bc0f55e..8af9eb206 100644 --- a/src/Report.py +++ b/src/Report.py @@ -1085,7 +1085,7 @@ class ReportDialog(BareReportDialog): def html_file_enable(self,obj): - text = obj.get_text() + text = unicode(obj.get_text()) if _template_map.has_key(text): if _template_map[text]: self.html_fileentry.set_sensitive(0) @@ -1195,8 +1195,8 @@ class ReportDialog(BareReportDialog): if self.paper.get_height() <= 0 or self.paper.get_width() <= 0: try: - h = float(self.pheight.get_text()) - w = float(self.pwidth.get_text()) + h = float(unicode(self.pheight.get_text())) + w = float(unicode(self.pwidth.get_text())) if h <= 1.0 or w <= 1.0: self.paper.set_height(29.7) @@ -1223,7 +1223,7 @@ class ReportDialog(BareReportDialog): displayed on the screen. The subclass will know whether this entry was enabled. This is for simplicity of programming.""" - text = self.template_combo.entry.get_text() + text = unicode(self.template_combo.entry.get_text()) if _template_map.has_key(text): if text == _user_template: self.template_name = self.html_fileentry.get_full_path(0) diff --git a/src/SelectChild.py b/src/SelectChild.py index 4aae616f4..038f99101 100644 --- a/src/SelectChild.py +++ b/src/SelectChild.py @@ -222,13 +222,13 @@ class SelectChild: self.family.addChild(select_child) - mrel = const.childRelations[self.mrel.get_text()] + mrel = const.childRelations[unicode(self.mrel.get_text())] mother = self.family.getMother() if mother and mother.getGender() != RelLib.Person.female: if mrel == "Birth": mrel = "Unknown" - frel = const.childRelations[self.frel.get_text()] + frel = const.childRelations[unicode(self.frel.get_text())] father = self.family.getFather() if father and father.getGender() !=RelLib. Person.male: if frel == "Birth": @@ -352,13 +352,13 @@ class EditRel: self.top.destroy() def on_ok_clicked(self,obj): - mrel = const.childRelations[self.mentry.get_text()] + mrel = const.childRelations[unicode(self.mentry.get_text())] mother = self.family.getMother() if mother and mother.getGender() != RelLib.Person.female: if mrel == "Birth": mrel = "Unknown" - frel = const.childRelations[self.fentry.get_text()] + frel = const.childRelations[unicode(self.fentry.get_text())] father = self.family.getFather() if father and father.getGender() !=RelLib. Person.male: if frel == "Birth": diff --git a/src/Sources.py b/src/Sources.py index a7c90788b..9090702e6 100644 --- a/src/Sources.py +++ b/src/Sources.py @@ -355,7 +355,7 @@ class SourceEditor: if self.active_source != self.source_ref.getBase(): self.source_ref.setBase(self.active_source) - date = self.get_widget("sdate").get_text() + date = unicode(self.get_widget("sdate").get_text()) conf = self.get_widget("conf").get_menu().get_active().get_data('a') buffer = self.get_widget("scomment").get_buffer() diff --git a/src/StartupDialog.py b/src/StartupDialog.py index 5fb5e80f0..a2aec045e 100644 --- a/src/StartupDialog.py +++ b/src/StartupDialog.py @@ -114,14 +114,14 @@ class StartupDialog: return val def complete(self,obj,obj2): - self.client.set_string('/apps/gramps/researcher-name',self.name.get_text()) - self.client.set_string('/apps/gramps/researcher-addr',self.addr.get_text()) - self.client.set_string('/apps/gramps/researcher-city',self.city.get_text()) - self.client.set_string('/apps/gramps/researcher-state',self.state.get_text()) - self.client.set_string('/apps/gramps/researcher-postal',self.postal.get_text()) - self.client.set_string('/apps/gramps/researcher-country',self.country.get_text()) - self.client.set_string('/apps/gramps/researcher-phone',self.phone.get_text()) - self.client.set_string('/apps/gramps/researcher-email',self.email.get_text()) + self.client.set_string('/apps/gramps/researcher-name',unicode(self.name.get_text())) + self.client.set_string('/apps/gramps/researcher-addr',unicode(self.addr.get_text())) + self.client.set_string('/apps/gramps/researcher-city',unicode(self.city.get_text())) + self.client.set_string('/apps/gramps/researcher-state',unicode(self.state.get_text())) + self.client.set_string('/apps/gramps/researcher-postal',unicode(self.postal.get_text())) + self.client.set_string('/apps/gramps/researcher-country',unicode(self.country.get_text())) + self.client.set_string('/apps/gramps/researcher-phone',unicode(self.phone.get_text())) + self.client.set_string('/apps/gramps/researcher-email',unicode(self.email.get_text())) if self.date1.get_active(): self.client.set_int("/apps/gramps/dateEntry",0) diff --git a/src/StyleEditor.py b/src/StyleEditor.py index 868d88e20..d42647da1 100644 --- a/src/StyleEditor.py +++ b/src/StyleEditor.py @@ -284,7 +284,7 @@ class StyleEditor: the changes. """ p = self.current_p - name = self.top.get_widget("style_name").get_text() + name = unicode(self.top.get_widget("style_name").get_text()) self.save_paragraph(p) self.style.set_name(name) diff --git a/src/UrlEdit.py b/src/UrlEdit.py index 9ebe721fe..d41f903c4 100644 --- a/src/UrlEdit.py +++ b/src/UrlEdit.py @@ -86,8 +86,8 @@ class UrlEditor: self.val = self.window.run() def on_url_edit_ok_clicked(self): - des = self.des.get_text() - addr = self.addr.get_text() + des = unicode(self.des.get_text()) + addr = unicode(self.addr.get_text()) priv = self.priv.get_active() if self.url == None: diff --git a/src/Utils.py b/src/Utils.py index b2a1d5e7f..e19d3a18e 100644 --- a/src/Utils.py +++ b/src/Utils.py @@ -625,12 +625,12 @@ def roman(num): # #------------------------------------------------------------------------- def bold_label(label): - text = label.get_text() + text = unicode(label.get_text()) label.set_text("%s" % text ) label.set_use_markup(1) def unbold_label(label): - text = label.get_text() + text = unicode(label.get_text()) text = string.replace(text,'','') text = string.replace(text,'','') label.set_text(text) diff --git a/src/VersionControl.py b/src/VersionControl.py index 734109d93..46af26878 100644 --- a/src/VersionControl.py +++ b/src/VersionControl.py @@ -87,7 +87,7 @@ class RevisionComment: self.win.show() def on_savecomment_clicked(self,obj): - comment = self.text.get_text() + comment = unicode(self.text.get_text()) Utils.destroy_passed_object(self.win) self.save(self.filename,comment) diff --git a/src/Witness.py b/src/Witness.py index aa157090a..233fb3892 100644 --- a/src/Witness.py +++ b/src/Witness.py @@ -187,7 +187,7 @@ class WitnessEditor: if self.in_db.get_active(): self.ref.set_value(self.idval) else: - self.ref.set_value(self.name.get_text()) + self.ref.set_value(unicode(self.name.get_text())) c = self.comment.get_buffer() self.ref.set_comment(c.get_text(c.get_start_iter(),c.get_end_iter(),gtk.FALSE))