* 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
This commit is contained in:
Don Allingham 2003-12-17 05:23:16 +00:00
parent 494eea1bb8
commit 49512e683c
30 changed files with 173 additions and 156 deletions

View File

@ -1,3 +1,34 @@
2003-12-16 Don Allingham <dallingham@users.sourceforge.net>
* 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 <twaugh@redhat.com>
* src/plugins/Ancestors.py: Use write_note() when appropriate.

View File

@ -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)

View File

@ -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

View File

@ -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()

View File

@ -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)

View File

@ -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:

View File

@ -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:

View File

@ -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)

View File

@ -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]]

View File

@ -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()

View File

@ -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()

View File

@ -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:

View File

@ -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:

View File

@ -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)

View File

@ -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():

View File

@ -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()

View File

@ -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]]

View File

@ -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() != "":

View File

@ -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]

View File

@ -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)

View File

@ -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):

View File

@ -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)

View File

@ -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":

View File

@ -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()

View File

@ -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)

View File

@ -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)

View File

@ -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:

View File

@ -625,12 +625,12 @@ def roman(num):
#
#-------------------------------------------------------------------------
def bold_label(label):
text = label.get_text()
text = unicode(label.get_text())
label.set_text("<b>%s</b>" % text )
label.set_use_markup(1)
def unbold_label(label):
text = label.get_text()
text = unicode(label.get_text())
text = string.replace(text,'<b>','')
text = string.replace(text,'</b>','')
label.set_text(text)

View File

@ -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)

View File

@ -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))