diff --git a/gramps2/src/AddSpouse.py b/gramps2/src/AddSpouse.py
index a4c086166..7e588ea1c 100644
--- a/gramps2/src/AddSpouse.py
+++ b/gramps2/src/AddSpouse.py
@@ -218,7 +218,7 @@ class AddSpouse:
sgender = const.male
else:
sgender = const.female
-
+
self.entries = []
self.slist.clear()
self.slist.new_model()
@@ -260,9 +260,7 @@ class AddSpouse:
# 100 years from spouse deathdate
if abs(pdday.getYear() - dday.getYear()) > 100:
continue
-
self.slist.add([data[0],data[1],data[3],data[5],data[6]],key,person==key)
-
self.slist.connect_model()
def on_show_toggled(self,obj):
diff --git a/gramps2/src/AddrEdit.py b/gramps2/src/AddrEdit.py
index 5f9e328d5..cddb690ba 100644
--- a/gramps2/src/AddrEdit.py
+++ b/gramps2/src/AddrEdit.py
@@ -76,7 +76,11 @@ class AddressEditor:
self.addr = addr
name = parent.person.getPrimaryName().getName()
- text = _("Address Editor for %s") % name
+ print "'%s'" % name
+ if name == ", ":
+ text = _("Address Editor")
+ else:
+ text = _("Address Editor for %s") % name
title_label = self.top.get_widget("title")
diff --git a/gramps2/src/AttrEdit.py b/gramps2/src/AttrEdit.py
index 8928f4650..fae1eedf5 100644
--- a/gramps2/src/AttrEdit.py
+++ b/gramps2/src/AttrEdit.py
@@ -88,7 +88,10 @@ class AttributeEditor:
self.top.get_widget('edit_src'),
self.top.get_widget('del_src'))
- title = _("Attribute Editor for %s") % title
+ if title == ", ":
+ title = _("Attribute Editor")
+ else:
+ title = _("Attribute Editor for %s") % title
l = self.top.get_widget("title")
Utils.set_titles(self.window,l,title,_('Attribute Editor'))
diff --git a/gramps2/src/DrawDoc.py b/gramps2/src/DrawDoc.py
index 83cb6ecfa..7282f73c3 100644
--- a/gramps2/src/DrawDoc.py
+++ b/gramps2/src/DrawDoc.py
@@ -182,6 +182,9 @@ class DrawDoc:
def draw_line(self,style,x1,y1,x2,y2):
pass
+ def draw_wedge(self, style, centerx, centery, radius, start_angle, end_angle):
+ pass
+
def start_path(self,style,x,y):
pass
diff --git a/gramps2/src/EventEdit.py b/gramps2/src/EventEdit.py
index 27d1de288..966039720 100644
--- a/gramps2/src/EventEdit.py
+++ b/gramps2/src/EventEdit.py
@@ -83,8 +83,12 @@ class EventEditor:
self.window = self.top.get_widget("event_edit")
title_label = self.top.get_widget('title')
- Utils.set_titles(self.window,title_label,
- _('Event Editor for %s') % name,
+ if name == ", ":
+ etitle = _('Event Editor')
+ else:
+ etitle = _('Event Editor for %s') % name
+
+ Utils.set_titles(self.window,title_label, etitle,
_('Event Editor'))
self.name_field = self.top.get_widget("eventName")
diff --git a/gramps2/src/FamilyView.py b/gramps2/src/FamilyView.py
index 4ea40b971..e827f933d 100644
--- a/gramps2/src/FamilyView.py
+++ b/gramps2/src/FamilyView.py
@@ -266,7 +266,7 @@ class FamilyView:
def spouse_swap(self,obj):
if self.selected_spouse:
self.parent.active_person = self.selected_spouse
- self.load_family()
+ self.load_family(self.family)
def ap_parents_clicked(self,obj):
self.change_families(self.person)
@@ -331,9 +331,14 @@ class FamilyView:
self.child_model.clear()
self.sp_parents_model.clear()
splist = self.person.getFamilyList()
- f = None
- first_family = None
- first_spouse = None
+
+ if len(splist) > 1:
+ self.spouse_selection.set_mode(gtk.SELECTION_SINGLE)
+ else:
+ self.spouse_selection.set_mode(gtk.SELECTION_NONE)
+
+ flist = {}
+
for f in splist:
if not f:
continue
@@ -343,19 +348,8 @@ class FamilyView:
sp = f.getFather()
iter = self.spouse_model.append()
- if f == family:
- first_spouse = sp
- first_family = f
- elif first_spouse == None:
- first_spouse = sp
- first_family = f
+ flist[f.getId()] = iter
- if len(splist) > 1:
- self.spouse_selection.set_mode(gtk.SELECTION_SINGLE)
- self.spouse_selection.select_path(0)
- else:
- self.spouse_selection.set_mode(gtk.SELECTION_NONE)
-
if sp:
if f.getMarriage():
mdate = " - %s" % f.getMarriage().getDate()
@@ -367,11 +361,19 @@ class FamilyView:
else:
self.spouse_model.set(iter,0,"unknown\n")
- if first_family:
- self.display_marriage(first_family)
+ if family in splist:
+ self.display_marriage(family)
+ iter = flist[family.getId()]
+ self.spouse_selection.select_iter(iter)
+ elif len(flist) > 0:
+ f = splist[0]
+ iter = flist[f.getId()]
+ self.spouse_selection.select_iter(iter)
+ self.display_marriage(f)
+ else:
+ self.display_marriage(None)
self.update_list(self.ap_parents_model,self.ap_parents,self.person)
- self.family = first_family
def update_list(self,model,tree,person):
model.clear()
diff --git a/gramps2/src/ListModel.py b/gramps2/src/ListModel.py
index b59f93b0d..3fb50ed06 100644
--- a/gramps2/src/ListModel.py
+++ b/gramps2/src/ListModel.py
@@ -1,7 +1,7 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
-# Copyright (C) 2000-2003 Donald N. Allingham
+# Copyright (C) 2000 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -34,10 +34,8 @@ class ListModel:
self.tree.set_rules_hint(gtk.TRUE)
self.model = None
- self.new_model()
- self.selection = self.tree.get_selection()
- self.selection.set_mode(mode)
self.mode = mode
+ self.new_model()
self.data_index = l
self.count = 0
self.cid = None
@@ -84,9 +82,14 @@ class ListModel:
self.cid = self.model.get_sort_column_id()
self.count = 0
self.model = gtk.ListStore(*self.mylist)
-
+ self.selection = self.tree.get_selection()
+ self.selection.set_mode(self.mode)
+ self.sel_iter = None
+
def connect_model(self):
self.tree.set_model(self.model)
+ if self.sel_iter:
+ self.selection.select_iter(self.sel_iter)
if self.cid:
self.model.set_sort_column_id(self.cid[0],self.cid[1])
self.sort()
@@ -165,18 +168,6 @@ class ListModel:
def get_object(self,iter):
return self.model.get_value(iter,self.data_index)
- def add(self,data,info=None,select=0):
- self.count = self.count + 1
- iter = self.model.append()
- col = 0
- for object in data:
- self.model.set_value(iter,col,object)
- col = col + 1
- self.model.set_value(iter,col,info)
- if select:
- self.selection.select_iter(iter)
- return iter
-
def insert(self,position,data,info=None,select=0):
self.count = self.count + 1
iter = self.model.insert(position)
@@ -192,6 +183,18 @@ class ListModel:
def get_data(self,iter,cols):
return [ self.model.get_value(iter,c) for c in cols ]
+ def add(self,data,info=None,select=0):
+ self.count = self.count + 1
+ iter = self.model.append()
+ col = 0
+ for object in data:
+ self.model.set_value(iter,col,object)
+ col = col + 1
+ self.model.set_value(iter,col,info)
+ if select:
+ self.sel_iter = iter
+ return iter
+
def add_and_select(self,data,info=None):
self.count = self.count + 1
iter = self.model.append()
@@ -204,8 +207,9 @@ class ListModel:
def center_selected(self):
model,iter = self.selection.get_selected()
- path = model.get_path(iter)
- self.tree.scroll_to_cell(path,None,gtk.TRUE,0.5,0.5)
+ if iter:
+ path = model.get_path(iter)
+ self.tree.scroll_to_cell(path,None,gtk.TRUE,0.5,0.5)
def button_press(self,obj,event):
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
diff --git a/gramps2/src/NameEdit.py b/gramps2/src/NameEdit.py
index 19da5f72c..708da2825 100644
--- a/gramps2/src/NameEdit.py
+++ b/gramps2/src/NameEdit.py
@@ -75,7 +75,10 @@ class NameEditor:
alt_title = self.top.get_widget("title")
- tmsg = _("Alternate Name Editor for %s") % full_name
+ if full_name == ", ":
+ tmsg = _("Alternate Name Editor")
+ else:
+ tmsg = _("Alternate Name Editor for %s") % full_name
Utils.set_titles(self.window, alt_title, tmsg, _('Alternate Name Editor'))
diff --git a/gramps2/src/UrlEdit.py b/gramps2/src/UrlEdit.py
index 22792404a..55c770553 100644
--- a/gramps2/src/UrlEdit.py
+++ b/gramps2/src/UrlEdit.py
@@ -52,8 +52,13 @@ class UrlEditor:
self.priv = self.top.get_widget("priv")
title_label = self.top.get_widget("title")
- Utils.set_titles(self.window,title_label,
- _('Internet Address Editor for %s') % name,
+ if name == ", ":
+ etitle =_('Internet Address Editor')
+ else:
+ etitle =_('Internet Address Editor for %s') % name,
+
+
+ Utils.set_titles(self.window,title_label, etitle,
_('Internet Address Editor'))
if url != None:
self.des.set_text(url.get_description())
diff --git a/gramps2/src/docgen/AbiWord2Doc.py b/gramps2/src/docgen/AbiWord2Doc.py
new file mode 100644
index 000000000..0ef7e48e9
--- /dev/null
+++ b/gramps2/src/docgen/AbiWord2Doc.py
@@ -0,0 +1,278 @@
+#
+# Gramps - a GTK+/GNOME based genealogy program
+#
+# Copyright (C) 2000 Donald N. Allingham
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+"""
+Provides a TextDoc based interface to the AbiWord document format.
+"""
+
+#-------------------------------------------------------------------------
+#
+# Imported Modules
+#
+#-------------------------------------------------------------------------
+import os
+import base64
+
+import TextDoc
+from latin_utf8 import latin_to_utf8
+import string
+import Plugins
+import ImgManip
+from intl import gettext as _
+
+#-------------------------------------------------------------------------
+#
+# Class Definitions
+#
+#-------------------------------------------------------------------------
+class AbiWordDoc(TextDoc.TextDoc):
+ """AbiWord document generator. Inherits from the TextDoc generic
+ document interface class."""
+
+ def __init__(self,styles,type,template,orientation):
+ """Initializes the AbiWordDoc class, calling the __init__ routine
+ of the parent TextDoc class"""
+ TextDoc.TextDoc.__init__(self,styles,type,template,orientation)
+ self.f = None
+ self.level = 0
+ self.new_page = 0
+ self.in_table = 0
+ self.icount = 0;
+ self.imap = {}
+
+ def open(self,filename):
+ """Opens the document, writing the necessary header information.
+ AbiWord uses an XML format, so the document format is pretty easy
+ to understand"""
+ if filename[-4:] != ".abw":
+ self.filename = "%s.abw" % filename
+ else:
+ self.filename = filename
+
+ try:
+ self.f = open(self.filename,"w")
+ except IOError,msg:
+ errmsg = "%s\n%s" % (_("Could not create %s") % self.filename, msg)
+ raise Errors.ReportError(errmsg)
+ except:
+ raise Errors.ReportError(_("Could not create %s") % self.filename)
+
+ # doctype
+ self.f.write('\n')
+ self.f.write('\n')
+ self.f.write('\n')
+ self.f.write('
' % style_name)
+ if self.new_page == 1:
+ self.new_page = 0
+ self.f.write('