diff --git a/gramps/src/EditPerson.py b/gramps/src/EditPerson.py
index b27c66aed..006a0d7b5 100644
--- a/gramps/src/EditPerson.py
+++ b/gramps/src/EditPerson.py
@@ -257,20 +257,13 @@ class EditPerson:
if GrampsCfg.uselds or self.lds_baptism or self.lds_endowment or self.lds_sealing:
self.get_widget("lds_tab").show()
self.get_widget("lds_page").show()
-
- # initial values
- self.get_widget("activepersonTitle").set_text(GrampsCfg.nameof(person))
- self.suffix.set_text(self.pname.getSuffix())
- self.surname_field.set_text(self.pname.getSurname())
- self.given.set_text(self.pname.getFirstName())
+ self.write_primary_name()
types = const.NameTypesMap.keys()
types.sort()
self.ntype_field.set_popdown_strings(types)
self.autotype = AutoComp.AutoEntry(self.ntype_field.entry,types)
- self.ntype_field.entry.set_text(_(self.pname.getType()))
- t = self.pname.getType()
if person.getGender() == Person.male:
self.is_male.set_active(1)
@@ -280,7 +273,6 @@ class EditPerson:
self.is_unknown.set_active(1)
self.nick.set_text(person.getNickName())
- self.title.set_text(self.pname.getTitle())
self.update_birth_death()
self.load_person_image()
@@ -1011,6 +1003,14 @@ class EditPerson:
def aka_double_click(self,obj,event):
if event.button == 1 and event.type == _2BUTTON_PRESS:
self.on_aka_update_clicked(obj)
+ elif event.button == 3:
+ menu = gtk.GtkMenu()
+ item = gtk.GtkTearoffMenuItem()
+ item.show()
+ menu.append(item)
+ Utils.add_menuitem(menu,_("Make the selected name the preferred name"),
+ None,self.change_name)
+ menu.popup(None,None,None,0,0)
def on_aka_update_clicked(self,obj):
import NameEdit
@@ -1342,6 +1342,28 @@ class EditPerson:
self.lds_not_loaded = 0
self.draw_lds()
+ def change_name(self,obj):
+ if len(self.name_list.selection) == 1:
+ old = self.pname
+ row = self.name_list.selection[0]
+ new = self.name_list.get_row_data(row)
+ self.nlist.remove(new)
+ self.nlist.append(old)
+ self.redraw_name_list()
+ self.pname = Name(new)
+ self.write_primary_name()
+
+ def write_primary_name(self):
+ # initial values
+ self.get_widget("activepersonTitle").set_text(GrampsCfg.nameof(self.person))
+ self.suffix.set_text(self.pname.getSuffix())
+
+ self.surname_field.set_text(self.pname.getSurname())
+ self.given.set_text(self.pname.getFirstName())
+
+ self.ntype_field.entry.set_text(_(self.pname.getType()))
+ self.title.set_text(self.pname.getTitle())
+
def update_ord(func,ord,date,temple,stat,place):
if not ord:
if (date or temple or place):
diff --git a/gramps/src/NameEdit.py b/gramps/src/NameEdit.py
index 0e8725e10..ffc47a24d 100644
--- a/gramps/src/NameEdit.py
+++ b/gramps/src/NameEdit.py
@@ -154,7 +154,7 @@ class NameEditor:
if self.name.getPrivacy() != priv:
self.name.setPrivacy(priv)
self.parent.lists_changed = 1
-
+
def src_changed(parent):
parent.lists_changed = 1
diff --git a/gramps/src/Report.py b/gramps/src/Report.py
index 3fc49e3c6..73d94195d 100644
--- a/gramps/src/Report.py
+++ b/gramps/src/Report.py
@@ -832,7 +832,10 @@ class ReportDialog:
self.make_document()
# Create the report object and product the report.
- self.make_report()
+ try:
+ self.make_report()
+ except (IOError,OSError),msg:
+ GnomeErrorDialog(str(msg))
# Clean up the dialog object
self.window.destroy()
diff --git a/gramps/src/docgen/KwordDoc.py b/gramps/src/docgen/KwordDoc.py
index 9989d7d28..883cc69df 100644
--- a/gramps/src/docgen/KwordDoc.py
+++ b/gramps/src/docgen/KwordDoc.py
@@ -20,6 +20,8 @@
from TextDoc import *
from latin_utf8 import latin_to_utf8
+
+import Utils
import time
import StringIO
import os
@@ -33,17 +35,17 @@ _ = intl.gettext
def points(val):
inch = float(val)/2.54
return (int(inch*72))
-
+
#------------------------------------------------------------------------
#
-#
+#
#
#------------------------------------------------------------------------
class KwordDoc(TextDoc):
def open(self,filename):
self.photo_list = []
-
+
if filename[-4:] != ".kwd":
self.filename = filename + ".kwd"
else:
@@ -130,8 +132,18 @@ class KwordDoc(TextDoc):
self.f.write('bottom="%d" ' % points(self.height-self.bmargin))
self.f.write('runaround="1" />\n')
+ self.cell_row= 0
+ self.cell_col= 0
+ self.frameset_flg= 1
+ self.table_no= 0
+ self.cell_style= ""
+ self.cell_span= 1
+
def close(self):
- self.f.write('\n')
+ if self.frameset_flg == 1:
+ self.f.write('\n')
+ self.frameset_flg= 0
+
for p in self.photo_list:
self.f.write('