diff --git a/example/gramps/data.gramps b/example/gramps/data.gramps index e2ce3daee..45e7f86e2 100644 Binary files a/example/gramps/data.gramps and b/example/gramps/data.gramps differ diff --git a/src/DbPrompter.py b/src/DbPrompter.py index 05ba8a4cf..e63eb2de4 100644 --- a/src/DbPrompter.py +++ b/src/DbPrompter.py @@ -35,9 +35,9 @@ import gtk import Utils import const import GrampsCfg -import intl import VersionControl -_ = intl.gettext +from intl import gettext +_ = gettext #------------------------------------------------------------------------- # diff --git a/src/EditPerson.py b/src/EditPerson.py index d0f0af39e..3c0e4bfb7 100644 --- a/src/EditPerson.py +++ b/src/EditPerson.py @@ -1561,19 +1561,3 @@ def reorder_child_list(person, list): list.remove(person) list.insert(target,person) return list - - -if __name__ == "__main__": - import RelLib - import os - import intl - import locale - - intl.textdomain("gramps") - intl.bindtextdomain("gramps","locale") - locale.setlocale(locale.LC_NUMERIC,"C") - - d = RelLib.GrampsDB() - p = RelLib.Person() - EditPerson(p,d) - gtk.mainloop() diff --git a/src/EditPlace.py b/src/EditPlace.py index d9587d8b2..851da31b8 100644 --- a/src/EditPlace.py +++ b/src/EditPlace.py @@ -78,7 +78,7 @@ class EditPlace: self.top_window = libglade.GladeXML(const.placesFile,"placeEditor") plwidget = self.top_window.get_widget("photolist") - self.gallery = ImageSelect.Gallery(place, self.path, plwidget, db) + self.glry = ImageSelect.Gallery(place, self.path, plwidget, db) self.title = self.top_window.get_widget("place_title") self.city = self.top_window.get_widget("city") self.parish = self.top_window.get_widget("parish") @@ -121,24 +121,24 @@ class EditPlace: self.note.set_word_wrap(1) self.top_window.signal_autoconnect({ - "destroy_passed_object" : Utils.destroy_passed_object, - "on_source_clicked" : self.on_source_clicked, - "on_photolist_select_icon" : self.gallery.on_photo_select_icon, - "on_photolist_button_press_event" : self.gallery.on_button_press_event, - "on_switch_page" : self.on_switch_page, - "on_addphoto_clicked" : self.gallery.on_add_photo_clicked, - "on_deletephoto_clicked" : self.gallery.on_delete_photo_clicked, - "on_edit_properties_clicked": self.gallery.popup_change_description, - "on_add_url_clicked" : self.on_add_url_clicked, - "on_delete_url_clicked" : self.on_delete_url_clicked, - "on_update_url_clicked" : self.on_update_url_clicked, - "on_add_loc_clicked" : self.on_add_loc_clicked, - "on_delete_loc_clicked" : self.on_delete_loc_clicked, - "on_update_loc_clicked" : self.on_update_loc_clicked, - "on_web_list_select_row" : self.on_web_list_select_row, - "on_web_go_clicked": self.on_web_go_clicked, - "on_loc_list_select_row" : self.on_loc_list_select_row, - "on_apply_clicked" : self.on_place_apply_clicked + "destroy_passed_object" : Utils.destroy_passed_object, + "on_source_clicked" : self.on_source_clicked, + "on_photolist_select_icon" : self.glry.on_photo_select_icon, + "on_photolist_button_press" : self.glry.on_button_press_event, + "on_switch_page" : self.on_switch_page, + "on_addphoto_clicked" : self.glry.on_add_photo_clicked, + "on_deletephoto_clicked" : self.glry.on_delete_photo_clicked, + "on_edit_properties_clicked": self.glry.popup_change_description, + "on_add_url_clicked" : self.on_add_url_clicked, + "on_delete_url_clicked" : self.on_delete_url_clicked, + "on_update_url_clicked" : self.on_update_url_clicked, + "on_add_loc_clicked" : self.on_add_loc_clicked, + "on_delete_loc_clicked" : self.on_delete_loc_clicked, + "on_update_loc_clicked" : self.on_update_loc_clicked, + "on_web_list_select_row" : self.on_web_list_select_row, + "on_web_go_clicked" : self.on_web_go_clicked, + "on_loc_list_select_row" : self.on_loc_list_select_row, + "on_apply_clicked" : self.on_place_apply_clicked }) self.top = self.top_window.get_widget("placeEditor") @@ -254,7 +254,7 @@ class EditPlace: def on_switch_page(self,obj,a,page): if page == 3 and self.not_loaded: self.not_loaded = 0 - self.gallery.load_images() + self.glry.load_images() elif page == 5 and self.ref_not_loaded: self.ref_not_loaded = 0 self.display_references() diff --git a/src/EditSource.py b/src/EditSource.py index 56b0a38e0..1b7401ec5 100644 --- a/src/EditSource.py +++ b/src/EditSource.py @@ -151,42 +151,32 @@ class EditSource: if sref.getBase() == self.source: f_attr_list.append((name,v.getType())) - add = self.refinfo.insert_defaults + slist = self.top_window.get_widget('slist') if len(p_event_list) > 0: - add(_("Individual Events")) - add("\n-----------------------------\n") for p in p_event_list: - add("%s: %s\n" % (p[0],const.display_pevent(p[1]))) + slist.append([_("Individual Events"),p[0], + const.display_pevent(p[1])]) if len(p_attr_list) > 0: - add(_("Individual Attributes")) - add("\n-----------------------------\n") for p in p_attr_list: - add("%s: %s\n" % (p[0],const.display_pattr(p[1]))) + slist.append([_("Individual Attributes"),p[0], + const.display_pattr(p[1])]) if len(p_name_list) > 0: - add(_("Individual Names")) - add("\n-----------------------------\n") for p in p_name_list: - add("%s: %s\n" % p) + slist.append([_("Individual Names"),p[0],p[1]]) if len(f_event_list) > 0: - add(_("Family Events")) - add("\n-----------------------------\n") for p in f_event_list: - add("%s: %s\n" % (p[0],const.display_fevent(p[1]))) + slist.append([_("Family Events"),p[0], + const.display_fevent(p[1])]) if len(f_attr_list) > 0: - add(_("Family Attributes")) - add("\n-----------------------------\n") for p in f_event_list: - add("%s: %s\n" % (p[0],const.display_fattr(p[1]))) + slist.append([_("Family Attributes"),p[0], + const.display_fattr(p[1])]) if len(m_list) > 0: - add(_("Media Objects")) - add("\n-----------------------------\n") for p in m_list: - add("%s\n" % m) - if len(m_list) > 0: - add(_("Places")) - add("\n-----------------------------\n") + slist.append([_("Media Objects"),p,'']) + if len(p_list) > 0: for p in p_list: - add("%s\n" % m) + slist.append([_("Places"),p,'']) def on_source_apply_clicked(self,obj): diff --git a/src/GenericFilter.py b/src/GenericFilter.py index 4d51590ca..bb4f9f6ce 100644 --- a/src/GenericFilter.py +++ b/src/GenericFilter.py @@ -37,7 +37,6 @@ except: # Standard Python modules # #------------------------------------------------------------------------- -import types import os from string import find,join,strip,replace import gtk @@ -329,7 +328,6 @@ class HasRelationship(Rule): cnt = cnt + len(f.getChildList()) if self.list[1] and f.getRelationship() == self.list[1]: rel_type = 1 - rval = 0 # if number of relations specified if self.list[0]: @@ -537,12 +535,6 @@ class GenericFilter: self.logical_op = 'and' self.invert = 0 - def set_logical_or(self,val): - self.logical_op = 'or' - - def get_logical_or(self): - return self.logical_op == 'or' - def set_logical_op(self,val): if val in const.logical_functions: self.logical_op = val diff --git a/src/Report.py b/src/Report.py index e70e67254..b5aa3dcfa 100644 --- a/src/Report.py +++ b/src/Report.py @@ -630,7 +630,8 @@ class ReportDialog: FILL|EXPAND,FILL|EXPAND,pad,pad) table.attach(GtkLabel(_("User Template")),0,1,1,2, FILL,FILL,pad,pad) - self.html_fileentry = GnomeFileEntry(_("HTML Template"),_("Choose File")) + self.html_fileentry = GnomeFileEntry(_("HTML Template"), + _("Choose File")) self.html_fileentry.set_sensitive(0) table.attach(self.html_fileentry,1,2,1,2, FILL|EXPAND,FILL|EXPAND,pad,pad) diff --git a/src/Sources.py b/src/Sources.py index cc63b7ae0..0fef65706 100644 --- a/src/Sources.py +++ b/src/Sources.py @@ -42,8 +42,6 @@ from RelLib import * # #------------------------------------------------------------------------- -_MENUVAL = "a" - class SourceSelector: def __init__(self,srclist,parent,update=None): @@ -206,7 +204,8 @@ class SourceEditor: page = self.get_widget("spage").get_text() date = self.get_widget("sdate").get_text() text = self.get_widget("stext").get_chars(0,-1) - conf = self.get_widget("conf").get_menu().get_active().get_data(_MENUVAL) + conf = self.get_widget("conf").get_menu().get_active().get_data('a') + comments = self.get_widget("scomment").get_chars(0,-1) self.source_ref.setPage(page) diff --git a/src/TextDoc.py b/src/TextDoc.py index 5a35fc8cb..a61361d6e 100644 --- a/src/TextDoc.py +++ b/src/TextDoc.py @@ -591,6 +591,7 @@ class TextDoc: self.lmargin = 2.54 self.rmargin = 2.54 self.title = "" + self.owner = '' self.font = FontStyle() self.style_list = styles.get_styles() @@ -599,6 +600,9 @@ class TextDoc: self.name = "" self.photo_list = [] + def set_owner(self,owner): + self.owner = owner + def add_photo(self,name,align,w_cm,h_cm): """adds a photo of the specified width (in centimeters)""" pass diff --git a/src/data/templates/blue_edge.tpkg b/src/data/templates/blue_edge.tpkg index 3946012dc..34722c11f 100644 Binary files a/src/data/templates/blue_edge.tpkg and b/src/data/templates/blue_edge.tpkg differ diff --git a/src/data/templates/sepia.tpkg b/src/data/templates/sepia.tpkg new file mode 100644 index 000000000..51adff4ed Binary files /dev/null and b/src/data/templates/sepia.tpkg differ diff --git a/src/data/templates/templates.xml b/src/data/templates/templates.xml index 948d4891c..c85628f8e 100644 --- a/src/data/templates/templates.xml +++ b/src/data/templates/templates.xml @@ -3,4 +3,5 @@ + diff --git a/src/docgen/HtmlDoc.py b/src/docgen/HtmlDoc.py index e9ab95284..4a5082bc8 100644 --- a/src/docgen/HtmlDoc.py +++ b/src/docgen/HtmlDoc.py @@ -21,10 +21,13 @@ import os import string import re +import time + import gnome.ui import Plugins import ImgManip import TarFile +import const from TextDoc import * @@ -73,7 +76,9 @@ class HtmlDoc(TextDoc): def __init__(self,styles,type,template,orientation,source=None): TextDoc.__init__(self,styles,PaperStyle("",0,0),template,None) + self.year = time.localtime(time.time())[0] if source == None: + self.copyright = 'Copyright © %d' % (self.year) self.map = None self.f = None self.filename = None @@ -85,6 +90,8 @@ class HtmlDoc(TextDoc): self.build_style_declaration() self.image_dir = "images" else: + self.owner = source.owner + self.copyright = 'Copyright © %d %s' % (self.year,self.owner) self.map = source.map self.f = None self.filename = source.filename @@ -97,7 +104,11 @@ class HtmlDoc(TextDoc): self.table_styles = source.table_styles; self.cell_styles = source.cell_styles; self.image_dir = source.image_dir - + + def set_owner(self,owner): + HtmlDoc.set_owner(self,owner) + self.copyright = 'Copyright © %d %s' % (self.year,self.owner) + def set_image_dir(self,dirname): self.image_dir = dirname @@ -180,6 +191,10 @@ class HtmlDoc(TextDoc): self.bottom = _bottom self.top = _top + def process_line(self,line): + l = string.replace(line,'$VERSION',const.version) + return string.replace(l,'$COPYRIGHT',self.copyright) + def open(self,filename): if filename[-5:] == ".html" or filename[-4:0] == ".htm": self.filename = filename @@ -200,6 +215,7 @@ class HtmlDoc(TextDoc): self.file_header = '%s