Support for notes and sources in more data elements, new GEDCOM parser

svn: r66
This commit is contained in:
Don Allingham 2001-05-30 04:24:27 +00:00
parent e4392eff99
commit 4d7122c6e1
19 changed files with 2784 additions and 1429 deletions

View File

@ -29,6 +29,8 @@ import string
import re import re
import os import os
import PaperMenu
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# GTK/Gnome modules # GTK/Gnome modules
@ -91,6 +93,9 @@ lastfile = None
nameof = utils.normal_name nameof = utils.normal_name
display_attr = 0 display_attr = 0
attr_name = "" attr_name = ""
status_bar = 0
paper_preference = None
output_preference = None
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -139,10 +144,14 @@ def loadConfig(call):
global _druid global _druid
global _name_format global _name_format
global _callback global _callback
global paper_preference
global output_preference
global status_bar
_callback = call _callback = call
lastfile = gnome.config.get_string("/gramps/data/LastFile") lastfile = gnome.config.get_string("/gramps/data/LastFile")
usetabs = gnome.config.get_bool("/gramps/config/UseTabs") usetabs = gnome.config.get_bool("/gramps/config/UseTabs")
status_bar = gnome.config.get_int("/gramps/config/StatusBar")
display_attr = gnome.config.get_bool("/gramps/config/DisplayAttr") display_attr = gnome.config.get_bool("/gramps/config/DisplayAttr")
attr_name = gnome.config.get_string("/gramps/config/DisplayAttrName") attr_name = gnome.config.get_string("/gramps/config/DisplayAttrName")
@ -150,6 +159,8 @@ def loadConfig(call):
autoload = gnome.config.get_bool("/gramps/config/autoLoad") autoload = gnome.config.get_bool("/gramps/config/autoLoad")
dateFormat = gnome.config.get_int("/gramps/config/dateFormat") dateFormat = gnome.config.get_int("/gramps/config/dateFormat")
dateEntry = gnome.config.get_int("/gramps/config/dateEntry") dateEntry = gnome.config.get_int("/gramps/config/dateEntry")
paper_preference = gnome.config.get_string("/gramps/config/paperPreference")
output_preference = gnome.config.get_string("/gramps/config/outputPreference")
_name_format = gnome.config.get_int("/gramps/config/nameFormat") _name_format = gnome.config.get_int("/gramps/config/nameFormat")
name = gnome.config.get_string("/gramps/researcher/name") name = gnome.config.get_string("/gramps/researcher/name")
@ -170,6 +181,12 @@ def loadConfig(call):
ListColors.evenfg = get_config_color(EVENFGCOLOR,(0,0,0)) ListColors.evenfg = get_config_color(EVENFGCOLOR,(0,0,0))
ListColors.evenbg = get_config_color(EVENBGCOLOR,(0xffff,0xffff,0xffff)) ListColors.evenbg = get_config_color(EVENBGCOLOR,(0xffff,0xffff,0xffff))
if paper_preference == None:
paper_preference = "Letter"
if output_preference == None:
output_preference = "OpenOffice"
if display_attr == None: if display_attr == None:
display_attr = 0 display_attr = 0
@ -180,6 +197,8 @@ def loadConfig(call):
autoload = 1 autoload = 1
if usetabs == None: if usetabs == None:
usetabs = 0 usetabs = 0
if status_bar == None:
status_bar = 0
if hide_altnames == None: if hide_altnames == None:
hide_altnames = 0 hide_altnames = 0
if dateFormat == None: if dateFormat == None:
@ -265,6 +284,7 @@ def on_propertybox_apply(obj,page):
global nameof global nameof
global owner global owner
global usetabs global usetabs
global status_bar
global display_attr global display_attr
global attr_name global attr_name
global hide_altnames global hide_altnames
@ -277,10 +297,25 @@ def on_propertybox_apply(obj,page):
attr_name = string.strip(prefsTop.get_widget("attr_name").get_text()) attr_name = string.strip(prefsTop.get_widget("attr_name").get_text())
usetabs = prefsTop.get_widget("usetabs").get_active() usetabs = prefsTop.get_widget("usetabs").get_active()
hide_altnames = prefsTop.get_widget("display_altnames").get_active() hide_altnames = prefsTop.get_widget("display_altnames").get_active()
paper_obj = prefsTop.get_widget("paper_size").get_menu().get_active()
output_obj = prefsTop.get_widget("output_format").get_menu().get_active()
if prefsTop.get_widget("stat1").get_active():
status_bar = 0
elif prefsTop.get_widget("stat2").get_active():
status_bar = 1
else:
status_bar = 2
paper_preference = paper_obj.get_data("d")
output_preference = output_obj.get_data("d")
gnome.config.set_bool("/gramps/config/UseTabs",usetabs) gnome.config.set_bool("/gramps/config/UseTabs",usetabs)
gnome.config.set_int("/gramps/config/StatusBar",status_bar)
gnome.config.set_bool("/gramps/config/DisplayAttr",display_attr) gnome.config.set_bool("/gramps/config/DisplayAttr",display_attr)
gnome.config.set_string("/gramps/config/DisplayAttrName",attr_name) gnome.config.set_string("/gramps/config/DisplayAttrName",attr_name)
gnome.config.set_string("/gramps/config/paperPreference",paper_preference)
gnome.config.set_string("/gramps/config/outputPreference",output_preference)
gnome.config.set_bool("/gramps/config/autoLoad",autoload) gnome.config.set_bool("/gramps/config/autoLoad",autoload)
gnome.config.set_bool("/gramps/config/DisplayAltNames",hide_altnames) gnome.config.set_bool("/gramps/config/DisplayAltNames",hide_altnames)
@ -418,6 +453,41 @@ def display_preferences_box():
display_altnames.set_active(hide_altnames) display_altnames.set_active(hide_altnames)
paper_obj = prefsTop.get_widget("paper_size")
menu = GtkMenu()
choice = 0
for index in range(0,len(PaperMenu.paper_sizes)):
name = PaperMenu.paper_sizes[index].get_name()
if name == paper_preference:
choice = index
item = GtkMenuItem(name)
item.set_data("o",pbox)
item.set_data("d",name)
item.connect("activate", on_format_toggled)
item.show()
menu.append(item)
menu.set_active(choice)
paper_obj.set_menu(menu)
output_obj = prefsTop.get_widget("output_format")
menu = GtkMenu()
choice = 0
choice = 0
index = 0
for name in const.output_formats:
if name == output_preference:
choice = index
item = GtkMenuItem(name)
item.set_data("o",pbox)
item.set_data("d",name)
item.connect("activate", on_format_toggled)
item.show()
menu.append(item)
index = index + 1
menu.set_active(choice)
output_obj.set_menu(menu)
date_option = prefsTop.get_widget("date_format") date_option = prefsTop.get_widget("date_format")
date_menu = GtkMenu() date_menu = GtkMenu()
for index in range(0,len(_date_format_list)): for index in range(0,len(_date_format_list)):

View File

@ -61,6 +61,24 @@ class Date:
def get_stop_date(self): def get_stop_date(self):
return self.stop return self.stop
def getYear(self):
return self.get_start_date().getYear()
def getMonth(self):
return self.get_start_date().getMonth()
def getDay(self):
return self.get_start_date().getDay()
def getStopYear(self):
return self.get_stop_date().getYear()
def getStopMonth(self):
return self.get_stop_date().getMonth()
def getStopDay(self):
return self.get_stop_date().getDay()
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# #
# #

View File

@ -1261,30 +1261,6 @@
</child> </child>
</widget> </widget>
<widget>
<class>GtkEntry</class>
<name>eventDate</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label105</name> <name>label105</name>
@ -1468,6 +1444,61 @@
</child> </child>
</widget> </widget>
</widget> </widget>
<widget>
<class>GtkHBox</class>
<name>hbox19</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GtkEntry</class>
<name>eventDate</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
</widget>
<widget>
<class>GtkButton</class>
<name>edit_note</name>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_event_note_clicked</handler>
<object>eventList</object>
<last_modification_time>Tue, 29 May 2001 15:07:23 GMT</last_modification_time>
</signal>
<label>Note</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>4</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
</widget>
</widget> </widget>
<widget> <widget>
@ -1702,30 +1733,6 @@
</child> </child>
</widget> </widget>
<widget>
<class>GtkEntry</class>
<name>attr_value</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget> <widget>
<class>GtkHBox</class> <class>GtkHBox</class>
<name>hbox14</name> <name>hbox14</name>
@ -1776,7 +1783,6 @@
<widget> <widget>
<class>GtkButton</class> <class>GtkButton</class>
<name>button95</name> <name>button95</name>
<sensitive>False</sensitive>
<tooltip>Choose source information</tooltip> <tooltip>Choose source information</tooltip>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<signal> <signal>
@ -1794,6 +1800,61 @@
</child> </child>
</widget> </widget>
</widget> </widget>
<widget>
<class>GtkHBox</class>
<name>hbox20</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GtkEntry</class>
<name>attr_value</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
</widget>
<widget>
<class>GtkButton</class>
<name>button97</name>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_event_note_clicked</handler>
<object>attr_list</object>
<last_modification_time>Tue, 29 May 2001 15:26:54 GMT</last_modification_time>
</signal>
<label>Note</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>5</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
</widget>
</widget> </widget>
<widget> <widget>
@ -2014,30 +2075,6 @@
</child> </child>
</widget> </widget>
<widget>
<class>GtkEntry</class>
<name>street</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label142</name> <name>label142</name>
@ -2128,7 +2165,6 @@
<widget> <widget>
<class>GtkButton</class> <class>GtkButton</class>
<name>button91</name> <name>button91</name>
<sensitive>False</sensitive>
<tooltip>Choose source information</tooltip> <tooltip>Choose source information</tooltip>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<signal> <signal>
@ -2140,7 +2176,7 @@
<label>Source</label> <label>Source</label>
<relief>GTK_RELIEF_NORMAL</relief> <relief>GTK_RELIEF_NORMAL</relief>
<child> <child>
<padding>4</padding> <padding>5</padding>
<expand>False</expand> <expand>False</expand>
<fill>False</fill> <fill>False</fill>
</child> </child>
@ -2282,6 +2318,61 @@
</child> </child>
</widget> </widget>
</widget> </widget>
<widget>
<class>GtkHBox</class>
<name>hbox21</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GtkEntry</class>
<name>street</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
</widget>
<widget>
<class>GtkButton</class>
<name>button98</name>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_event_note_clicked</handler>
<object>addr_list</object>
<last_modification_time>Tue, 29 May 2001 15:27:27 GMT</last_modification_time>
</signal>
<label>Note</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>5</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
</widget>
</widget> </widget>
<widget> <widget>
@ -2937,4 +3028,148 @@
</widget> </widget>
</widget> </widget>
<widget>
<class>GtkDialog</class>
<name>editnote</name>
<title>Gramps - Edit Note</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
<modal>False</modal>
<allow_shrink>True</allow_shrink>
<allow_grow>True</allow_grow>
<auto_shrink>False</auto_shrink>
<widget>
<class>GtkVBox</class>
<child_name>Dialog:vbox</child_name>
<name>dialog-vbox1</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<widget>
<class>GtkHBox</class>
<child_name>Dialog:action_area</child_name>
<name>dialog-action_area1</name>
<border_width>10</border_width>
<homogeneous>True</homogeneous>
<spacing>5</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
<pack>GTK_PACK_END</pack>
</child>
<widget>
<class>GtkHButtonBox</class>
<name>hbuttonbox18</name>
<layout_style>GTK_BUTTONBOX_END</layout_style>
<spacing>30</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkButton</class>
<name>button99</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_save_note_clicked</handler>
<object>editnote</object>
<last_modification_time>Tue, 29 May 2001 15:06:53 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
<widget>
<class>GtkButton</class>
<name>button100</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>destroy_passed_object</handler>
<object>editnote</object>
<last_modification_time>Tue, 29 May 2001 15:06:38 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
</widget>
</widget>
<widget>
<class>GtkVBox</class>
<name>vbox29</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>label153</name>
<label>Edit Note</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>10</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkHSeparator</class>
<name>hseparator1</name>
<child>
<padding>5</padding>
<expand>False</expand>
<fill>True</fill>
</child>
</widget>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow21</name>
<width>450</width>
<height>300</height>
<hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkText</class>
<name>notetext</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text></text>
</widget>
</widget>
</widget>
</widget>
</widget>
</GTK-Interface> </GTK-Interface>

View File

@ -154,6 +154,7 @@ class EditPerson:
"on_photolist_button_press_event" : on_photolist_button_press_event, "on_photolist_button_press_event" : on_photolist_button_press_event,
"on_addphoto_clicked" : on_add_photo_clicked, "on_addphoto_clicked" : on_add_photo_clicked,
"on_deletephoto_clicked" : on_delete_photo_clicked, "on_deletephoto_clicked" : on_delete_photo_clicked,
"on_event_note_clicked" : on_event_note_clicked,
"on_showsource_clicked" : on_showsource_clicked, "on_showsource_clicked" : on_showsource_clicked,
"on_applyPerson_clicked" : on_apply_person_clicked "on_applyPerson_clicked" : on_apply_person_clicked
}) })
@ -261,7 +262,7 @@ class EditPerson:
current_row = self.name_list.get_data(INDEX) current_row = self.name_list.get_data(INDEX)
if self.name_index >= 0: if self.name_index > 0:
if current_row <= 0: if current_row <= 0:
current_row = 0 current_row = 0
elif self.name_index <= current_row: elif self.name_index <= current_row:
@ -288,7 +289,7 @@ class EditPerson:
current_row = self.web_list.get_data(INDEX) current_row = self.web_list.get_data(INDEX)
if self.web_index >= 0: if self.web_index > 0:
if current_row <= 0: if current_row <= 0:
current_row = 0 current_row = 0
elif self.web_index <= current_row: elif self.web_index <= current_row:
@ -315,7 +316,7 @@ class EditPerson:
current_row = self.attr_list.get_data(INDEX) current_row = self.attr_list.get_data(INDEX)
if self.attr_index >= 0: if self.attr_index > 0:
if current_row <= 0: if current_row <= 0:
current_row = 0 current_row = 0
elif self.attr_index <= current_row: elif self.attr_index <= current_row:
@ -344,7 +345,7 @@ class EditPerson:
current_row = self.address_list.get_data(INDEX) current_row = self.address_list.get_data(INDEX)
if self.address_index >= 0: if self.address_index > 0:
if current_row <= 0: if current_row <= 0:
current_row = 0 current_row = 0
elif self.address_index <= current_row: elif self.address_index <= current_row:
@ -1076,6 +1077,38 @@ def on_savephoto_clicked(obj):
utils.modified() utils.modified()
utils.destroy_passed_object(obj) utils.destroy_passed_object(obj)
def on_save_note_clicked(obj):
textbox = obj.get_data("w")
data = obj.get_data("n")
text = textbox.get_chars(0,-1)
if text != data.getNote():
data.setNote(text)
utils.modified()
utils.destroy_passed_object(obj)
def on_event_note_clicked(obj):
row = obj.get_data(INDEX)
data = obj.get_row_data(row)
edit_person_obj = obj.get_data(EDITPERSON)
if row >= 0:
editnote = libglade.GladeXML(const.editPersonFile,"editnote")
textobj = editnote.get_widget("notetext")
en_obj = editnote.get_widget("editnote")
en_obj.set_data("n",data)
en_obj.set_data("w",textobj)
textobj.set_point(0)
textobj.insert_defaults(data.getNote())
textobj.set_word_wrap(1)
editnote.signal_autoconnect({
"on_save_note_clicked" : on_save_note_clicked,
"destroy_passed_object" : utils.destroy_passed_object
})
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# #

View File

@ -70,19 +70,24 @@ class GrampsParser(handler.ContentHandler):
self.note_list = [] self.note_list = []
self.in_note = 0 self.in_note = 0
self.in_attribute = 0
self.in_old_attr = 0
self.in_stext = 0 self.in_stext = 0
self.in_scomments = 0 self.in_scomments = 0
self.in_people = 0 self.in_people = 0
self.db = database self.db = database
self.base = base self.base = base
self.in_family = 0 self.in_family = 0
self.in_sources = 0 self.in_source_ref = 0
self.in_source = 0
self.in_address = 0
self.in_event = 0
self.person = None self.person = None
self.family = None self.family = None
self.address = None
self.source = None self.source = None
self.sourceRef = None self.source_ref = None
self.is_import = is_import self.is_import = is_import
self.in_address = 0
self.resname = "" self.resname = ""
self.resaddr = "" self.resaddr = ""
@ -141,6 +146,7 @@ class GrampsParser(handler.ContentHandler):
def start_event(self,attrs): def start_event(self,attrs):
self.event = Event() self.event = Event()
self.event_type = string.capwords(attrs["type"]) self.event_type = string.capwords(attrs["type"])
self.in_event = 1
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# #
@ -148,8 +154,13 @@ class GrampsParser(handler.ContentHandler):
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
def start_attribute(self,attrs): def start_attribute(self,attrs):
self.in_attribute = 1
self.attribute = Attribute() self.attribute = Attribute()
if attrs.has_key('type'):
self.in_old_attr = 1
self.attribute.setType(string.capwords(attrs["type"])) self.attribute.setType(string.capwords(attrs["type"]))
else:
self.in_old_attr = 0
self.person.addAttribute(self.attribute) self.person.addAttribute(self.attribute)
#--------------------------------------------------------------------- #---------------------------------------------------------------------
@ -196,7 +207,7 @@ class GrampsParser(handler.ContentHandler):
def start_people(self,attrs): def start_people(self,attrs):
self.in_family = 0 self.in_family = 0
self.in_people = 1 self.in_people = 1
self.in_sources = 0 self.in_source = 0
if self.is_import == 0 and attrs.has_key("default"): if self.is_import == 0 and attrs.has_key("default"):
self.tempDefault = int(attrs["default"]) self.tempDefault = int(attrs["default"])
@ -324,7 +335,7 @@ class GrampsParser(handler.ContentHandler):
def start_families(self,attrs): def start_families(self,attrs):
self.in_family = 1 self.in_family = 1
self.in_people = 0 self.in_people = 0
self.in_sources = 0 self.in_source = 0
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# #
@ -334,7 +345,7 @@ class GrampsParser(handler.ContentHandler):
def start_sources(self,attrs): def start_sources(self,attrs):
self.in_family = 0 self.in_family = 0
self.in_people = 0 self.in_people = 0
self.in_sources = 1 self.in_source = 1
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# #
@ -342,13 +353,21 @@ class GrampsParser(handler.ContentHandler):
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
def start_sourceref(self,attrs): def start_sourceref(self,attrs):
self.source = Source() self.source_ref = SourceRef()
self.in_source_ref = 1
if self.is_import: if self.is_import:
self.sourceRef = self.db.findSource(attrs["ref"],self.smap) self.source = self.db.findSource(attrs["ref"],self.smap)
else: else:
self.sourceRef = self.db.findSourceNoMap(attrs["ref"]) self.source = self.db.findSourceNoMap(attrs["ref"])
self.source.setBase(self.sourceRef) self.source_ref.setBase(self.source)
self.event.setSource(self.source) if self.in_address:
self.address.setSourceRef(self.source_ref)
elif self.in_event:
self.event.setSourceRef(self.source_ref)
elif self.in_attribute:
self.attribute.setSourceRef(self.source_ref)
else:
print "Sorry, I'm lost"
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# #
@ -357,9 +376,9 @@ class GrampsParser(handler.ContentHandler):
#--------------------------------------------------------------------- #---------------------------------------------------------------------
def start_source(self,attrs): def start_source(self,attrs):
if self.is_import: if self.is_import:
self.sourceRef = self.db.findSource(attrs["id"],self.smap) self.source = self.db.findSource(attrs["id"],self.smap)
else: else:
self.sourceRef = self.db.findSourceNoMap(attrs["id"]) self.source = self.db.findSourceNoMap(attrs["id"])
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# #
@ -397,6 +416,25 @@ class GrampsParser(handler.ContentHandler):
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
def stop_attribute(self,tag): def stop_attribute(self,tag):
self.in_attribute = 0
if self.in_old_attr:
self.attribute.setValue(tag)
self.in_old_attr = 0
#---------------------------------------------------------------------
#
#
#
#---------------------------------------------------------------------
def stop_attr_type(self,tag):
self.attribute.setType(tag)
#---------------------------------------------------------------------
#
#
#
#---------------------------------------------------------------------
def stop_attr_value(self,tag):
self.attribute.setValue(tag) self.attribute.setValue(tag)
#--------------------------------------------------------------------- #---------------------------------------------------------------------
@ -413,6 +451,7 @@ class GrampsParser(handler.ContentHandler):
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
def stop_event(self,tag): def stop_event(self,tag):
self.in_event = 0
self.event.setName(self.event_type) self.event.setName(self.event_type)
if self.event_type == "Birth": if self.event_type == "Birth":
@ -497,7 +536,15 @@ class GrampsParser(handler.ContentHandler):
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
def stop_stitle(self,tag): def stop_stitle(self,tag):
self.sourceRef.setTitle(tag) self.source.setTitle(tag)
#---------------------------------------------------------------------
#
#
#
#---------------------------------------------------------------------
def stop_sourceref(self,tag):
self.in_source_ref = 0
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# #
@ -505,7 +552,7 @@ class GrampsParser(handler.ContentHandler):
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
def stop_sauthor(self,tag): def stop_sauthor(self,tag):
self.sourceRef.setAuthor(tag) self.source.setAuthor(tag)
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# #
@ -515,7 +562,7 @@ class GrampsParser(handler.ContentHandler):
def stop_sdate(self,tag): def stop_sdate(self,tag):
date = Date() date = Date()
date.quick_set(tag) date.quick_set(tag)
self.source.setDate(date) self.source_ref.setDate(date)
def stop_street(self,tag): def stop_street(self,tag):
self.address.setStreet(tag) self.address.setStreet(tag)
@ -538,7 +585,7 @@ class GrampsParser(handler.ContentHandler):
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
def stop_spage(self,tag): def stop_spage(self,tag):
self.source.setPage(tag) self.source_ref.setPage(tag)
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# #
@ -546,7 +593,7 @@ class GrampsParser(handler.ContentHandler):
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
def stop_spubinfo(self,tag): def stop_spubinfo(self,tag):
self.sourceRef.setPubInfo(tag) self.source.setPubInfo(tag)
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# #
@ -554,7 +601,7 @@ class GrampsParser(handler.ContentHandler):
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
def stop_scallno(self,tag): def stop_scallno(self,tag):
self.sourceRef.setCallNumber(tag) self.source.setCallNumber(tag)
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# #
@ -562,7 +609,7 @@ class GrampsParser(handler.ContentHandler):
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
def stop_stext(self,tag): def stop_stext(self,tag):
self.source.setText(fix_spaces(tag)) self.source_ref.setText(fix_spaces(tag))
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# #
@ -570,7 +617,7 @@ class GrampsParser(handler.ContentHandler):
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
def stop_scomments(self,tag): def stop_scomments(self,tag):
self.source.setComments(fix_spaces(self.scomments_list)) self.source_ref.setComments(fix_spaces(self.scomments_list))
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# #
@ -611,7 +658,13 @@ class GrampsParser(handler.ContentHandler):
#--------------------------------------------------------------------- #---------------------------------------------------------------------
def stop_note(self,tag): def stop_note(self,tag):
self.in_note = 0 self.in_note = 0
if self.in_people == 1: if self.in_address == 1:
self.address.setNote(fix_spaces(self.note_list))
elif self.in_source_ref == 1:
self.source_ref.setNote(fix_spaces(self.note_list))
elif self.in_event == 1:
self.event.setNote(fix_spaces(self.note_list))
elif self.in_people == 1:
self.person.setNote(fix_spaces(self.note_list)) self.person.setNote(fix_spaces(self.note_list))
elif self.in_family == 1: elif self.in_family == 1:
self.family.setNote(fix_spaces(self.note_list)) self.family.setNote(fix_spaces(self.note_list))
@ -715,6 +768,8 @@ class GrampsParser(handler.ContentHandler):
"address" : (start_address, stop_address), "address" : (start_address, stop_address),
"aka" : (start_name, stop_aka), "aka" : (start_name, stop_aka),
"attribute" : (start_attribute, stop_attribute), "attribute" : (start_attribute, stop_attribute),
"attr_type" : (None,stop_attr_type),
"attr_value" : (None,stop_attr_value),
"bookmark" : (start_bmark, None), "bookmark" : (start_bmark, None),
"bookmarks" : (None, None), "bookmarks" : (None, None),
"child" : (start_child,None), "child" : (start_child,None),
@ -759,7 +814,7 @@ class GrampsParser(handler.ContentHandler):
"scomments" : (None, stop_scomments), "scomments" : (None, stop_scomments),
"sdate" : (None,stop_sdate), "sdate" : (None,stop_sdate),
"source" : (start_source, None), "source" : (start_source, None),
"sourceref" : (start_sourceref, None), "sourceref" : (start_sourceref, stop_sourceref),
"sources" : (start_sources, None), "sources" : (start_sources, None),
"spage" : (None, stop_spage), "spage" : (None, stop_spage),
"spubinfo" : (None, stop_spubinfo), "spubinfo" : (None, stop_spubinfo),

View File

@ -20,6 +20,7 @@
import TextDoc import TextDoc
import gtk import gtk
import Config
import intl import intl
_ = intl.gettext _ = intl.gettext
@ -39,12 +40,17 @@ paper_sizes = [
def make_paper_menu(main_menu): def make_paper_menu(main_menu):
index = 0
myMenu = gtk.GtkMenu() myMenu = gtk.GtkMenu()
for paper in paper_sizes: for paper in paper_sizes:
menuitem = gtk.GtkMenuItem(paper.get_name()) name = paper.get_name()
menuitem = gtk.GtkMenuItem(name)
menuitem.set_data("i",paper) menuitem.set_data("i",paper)
menuitem.show() menuitem.show()
myMenu.append(menuitem) myMenu.append(menuitem)
if name == Config.paper_preference:
myMenu.set_active(index)
index = index + 1
main_menu.set_menu(myMenu) main_menu.set_menu(myMenu)
def make_orientation_menu(main_menu): def make_orientation_menu(main_menu):

View File

@ -42,7 +42,6 @@ try:
import xml.sax.saxexts import xml.sax.saxexts
sax = 1 sax = 1
except: except:
from codecs import *
sax = 2 sax = 2
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -67,7 +66,8 @@ def importData(database, filename, callback):
else: else:
parser = xml.sax.make_parser() parser = xml.sax.make_parser()
parser.setContentHandler(GrampsParser(database,callback,basefile,1)) parser.setContentHandler(GrampsParser(database,callback,basefile,1))
xml_file = EncodedFile(gzip.open(filename,"rb"),'utf-8','latin-1') xml_file = gzip.open(filename,"rb")
# xml_file = EncodedFile(gzip.open(filename,"rb"),'utf-8','latin-1')
parser.parse(xml_file) parser.parse(xml_file)
xml_file.close() xml_file.close()
@ -151,6 +151,9 @@ if __name__ == "__main__":
t2 = time.time() t2 = time.time()
print t2 - t1 print t2 - t1
for person in db.getPersonMap().values():
print person.getPrimaryName().getName()

View File

@ -21,6 +21,21 @@
from Date import * from Date import *
from Researcher import * from Researcher import *
#-------------------------------------------------------------------------
#
# Note class.
#
#-------------------------------------------------------------------------
class Note:
def __init__(self,text = ""):
self.text = text
def set(self,text):
self.text = text
def get(self):
return self.text
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Photo class. Contains information about a photo stored in the database # Photo class. Contains information about a photo stored in the database
@ -59,6 +74,26 @@ class Attribute:
def __init__(self): def __init__(self):
self.type = "" self.type = ""
self.value = "" self.value = ""
self.source_ref = SourceRef()
self.note = Note()
def setNote(self,text):
self.note.set(text)
def getNote(self):
return self.note.get()
def setNoteObj(self,obj):
self.note = obj
def getNoteObj(self,obj):
return self.note
def setSourceRef(self,id) :
self.source_ref = id
def getSourceRef(self) :
return self.source_ref
def setType(self,val): def setType(self,val):
self.type = val self.type = val
@ -85,6 +120,26 @@ class Address:
self.country = "" self.country = ""
self.postal = "" self.postal = ""
self.date = Date() self.date = Date()
self.note = Note()
self.source_ref = SourceRef()
def setSourceRef(self,id) :
self.source_ref = id
def getSourceRef(self) :
return self.source_ref
def setNote(self,text):
self.note.set(text)
def getNote(self):
return self.note.get()
def setNoteObj(self,obj):
self.note = obj
def getNoteObj(self,obj):
return self.note
def setDate(self,text): def setDate(self,text):
self.date.set(text) self.date.set(text)
@ -228,7 +283,7 @@ class Person:
self.addressList = [] self.addressList = []
self.attributeList = [] self.attributeList = []
self.urls = [] self.urls = []
self.note = "" self.note = Note()
self.paf_uid = "" self.paf_uid = ""
def setPrimaryName(self,name) : def setPrimaryName(self,name) :
@ -363,11 +418,18 @@ class Person:
return self.MainFamily return self.MainFamily
def setNote(self,text): def setNote(self,text):
self.note = text self.note.set(text)
def getNote(self): def getNote(self):
return self.note.get()
def setNoteObj(self,obj):
self.note = obj
def getNoteObj(self,obj):
return self.note return self.note
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# #
@ -380,7 +442,8 @@ class Event:
self.date = Date() self.date = Date()
self.description = "" self.description = ""
self.name = "" self.name = ""
self.source = None self.source_ref = None
self.note = Note()
def set(self,name,date,place,description): def set(self,name,date,place,description):
self.name = name self.name = name
@ -406,11 +469,11 @@ class Event:
def getName(self) : def getName(self) :
return self.name return self.name
def setSource(self,id) : def setSourceRef(self,id) :
self.source = id self.source_ref = id
def getSource(self) : def getSourceRef(self) :
return self.source return self.source_ref
def setPlace(self,place) : def setPlace(self,place) :
self.place = place self.place = place
@ -418,6 +481,18 @@ class Event:
def getPlace(self) : def getPlace(self) :
return self.place return self.place
def setNote(self,note) :
self.note.set(note)
def getNote(self) :
return self.note.get()
def setNoteObj(self,note) :
self.note = note
def getNoteObj(self) :
return self.note
def setDescription(self,description) : def setDescription(self,description) :
self.description = description self.description = description
@ -456,13 +531,19 @@ class Family:
self.EventList = [] self.EventList = []
self.id = -1 self.id = -1
self.photoList = [] self.photoList = []
self.note = "" self.note = Note()
def getNote(self): def getNote(self):
return self.note return self.note.get()
def setNote(self,text): def setNote(self,text):
self.note = text self.note.set(text)
def getNoteObj(self):
return self.note
def setNoteObj(self,obj):
self.note = obj
def setId(self,id) : def setId(self,id) :
self.id = id self.id = id
@ -532,12 +613,13 @@ class Family:
# #
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
class SourceBase: class Source:
def __init__(self): def __init__(self):
self.title = "" self.title = ""
self.author = "" self.author = ""
self.pubinfo = "" self.pubinfo = ""
self.callno = "" self.callno = ""
self.note = Note()
def setId(self,newId): def setId(self,newId):
self.id = newId self.id = newId
@ -551,6 +633,18 @@ class SourceBase:
def getTitle(self): def getTitle(self):
return self.title return self.title
def setNote(self,text):
self.note.set(text)
def getNote(self):
return self.note.get()
def setNoteObj(self,obj):
self.note = obj
def getNoteObj(self):
return self.note
def setAuthor(self,author): def setAuthor(self,author):
self.author = author self.author = author
@ -574,12 +668,12 @@ class SourceBase:
# #
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
class Source: class SourceRef:
def __init__(self): def __init__(self):
self.ref = None self.ref = None
self.page = "" self.page = ""
self.date = Date() self.date = Date()
self.comments = "" self.comments = Note()
self.text = "" self.text = ""
def setBase(self,ref): def setBase(self,ref):
@ -600,21 +694,24 @@ class Source:
def getPage(self): def getPage(self):
return self.page return self.page
def getDate(self):
return self.date
def setText(self,text): def setText(self,text):
self.text = text self.text = text
def getText(self): def getText(self):
return self.text return self.text
def setComments(self,comments): def setNoteObj(self,note):
self.comments = comments self.comments = note
def getComments(self): def getComments(self):
return self.comments return self.comments
def setComments(self,comments):
self.comments.set(comments)
def getComments(self):
return self.comments.get()
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# #
@ -637,6 +734,9 @@ class RelDataBase:
self.bookmarks = [] self.bookmarks = []
self.path = "" self.path = ""
def getBookmarks(self):
return self.bookmarks
def clean_bookmarks(self): def clean_bookmarks(self):
new_bookmarks = [] new_bookmarks = []
for person in self.bookmarks: for person in self.bookmarks:
@ -748,7 +848,7 @@ class RelDataBase:
if map.has_key(idVal): if map.has_key(idVal):
source = self.sourceMap[map[idVal]] source = self.sourceMap[map[idVal]]
else: else:
source = SourceBase() source = Source()
map[idVal] = self.addSource(source) map[idVal] = self.addSource(source)
return source return source
@ -763,7 +863,7 @@ class RelDataBase:
if self.sourceMap.has_key(val): if self.sourceMap.has_key(val):
source = self.sourceMap[val] source = self.sourceMap[val]
else: else:
source = SourceBase() source = Source()
self.addSourceNoMap(source,val) self.addSourceNoMap(source,val)
return source return source

View File

@ -66,24 +66,22 @@ class SourceEditor:
# __init__ - Creates a source editor window associated with an event # __init__ - Creates a source editor window associated with an event
# #
#--------------------------------------------------------------------- #---------------------------------------------------------------------
def __init__(self,active_event,database): def __init__(self,active_entry,database):
self.db = database self.db = database
self.active_event = active_event self.active_entry = active_entry
self.showSource = libglade.GladeXML(const.gladeFile, "sourceDisplay") self.showSource = libglade.GladeXML(const.gladeFile, "sourceDisplay")
self.showSource.signal_autoconnect({ self.showSource.signal_autoconnect({
"on_sourceok_clicked" : on_sourceok_clicked, "on_sourceok_clicked" : on_sourceok_clicked,
"on_selectsource_clicked" : on_selectsource_clicked,
"destroy_passed_object" : utils.destroy_passed_object "destroy_passed_object" : utils.destroy_passed_object
}) })
self.sourceDisplay = self.get_widget("sourceDisplay") self.sourceDisplay = self.get_widget("sourceDisplay")
self.source_field = self.get_widget("sourceList") self.source_field = self.get_widget("sourceList")
self.title_field = self.get_widget("stitle") self.title_menu = self.get_widget("source_title")
self.author_field = self.get_widget("sauthor") self.author_field = self.get_widget("sauthor")
self.pub_field = self.get_widget("spubinfo") self.pub_field = self.get_widget("spubinfo")
self.callno_field = self.get_widget("scallno")
self.source = active_event.getSource() self.source_ref = active_entry.getSourceRef()
self.active_source = None self.active_source = None
self.draw() self.draw()
self.sourceDisplay.set_data(SOURCEDISP,self) self.sourceDisplay.set_data(SOURCEDISP,self)
@ -98,34 +96,54 @@ class SourceEditor:
return self.showSource.get_widget(name) return self.showSource.get_widget(name)
def draw(self): def draw(self):
if self.source:
self.get_widget("spage").set_text(self.source.getPage()) typeMenu = GtkMenu()
date = self.source.getDate() menuitem = GtkMenuItem('None')
menuitem.set_data("s",None)
menuitem.set_data("o",self)
menuitem.connect("activate",on_source_changed)
menuitem.show()
typeMenu.append(menuitem)
index = 1
save = 0
self.base = self.source_ref.getBase()
for src in self.db.getSourceMap().values():
if src == self.base:
save = index
menuitem = GtkMenuItem(src.getTitle())
menuitem.set_data("s",src)
menuitem.set_data("o",self)
menuitem.connect("activate",on_source_changed)
menuitem.show()
typeMenu.append(menuitem)
index = index + 1
typeMenu.set_active(save)
self.title_menu.set_menu(typeMenu)
if self.source_ref:
self.get_widget("spage").set_text(self.source_ref.getPage())
date = self.source_ref.getDate()
if date: if date:
self.get_widget("sdate").set_text(date.getDate()) self.get_widget("sdate").set_text(date.getDate())
text = self.get_widget("stext") text = self.get_widget("stext")
text.set_point(0) text.set_point(0)
text.insert_defaults(self.source.getText()) text.insert_defaults(self.source_ref.getText())
text.set_word_wrap(1) text.set_word_wrap(1)
scom = self.get_widget("scomment") scom = self.get_widget("scomment")
scom.set_point(0) scom.set_point(0)
scom.insert_defaults(self.source.getComments()) scom.insert_defaults(self.source_ref.getComments())
scom.set_word_wrap(1) scom.set_word_wrap(1)
srcRef = self.source.getBase() src = self.source_ref.getBase()
self.active_source = srcRef self.active_source = src
if srcRef: if src:
self.title_field.set_text(srcRef.getTitle()) self.author_field.set_text(src.getAuthor())
self.author_field.set_text(srcRef.getAuthor()) self.pub_field.set_text(src.getPubInfo())
self.pub_field.set_text(srcRef.getPubInfo())
self.callno_field.set_text(srcRef.getCallNumber())
else: else:
self.title_field.set_text("")
self.author_field.set_text("") self.author_field.set_text("")
self.pub_field.set_text("") self.pub_field.set_text("")
self.callno_field.set_text("")
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -136,31 +154,20 @@ def on_sourceok_clicked(obj):
src_edit = obj.get_data(SOURCEDISP) src_edit = obj.get_data(SOURCEDISP)
if src_edit.active_event: current_source_ref = src_edit.active_entry.getSourceRef()
current_source = src_edit.active_event.getSource() if src_edit.active_source != current_source_ref.getBase():
if current_source == None: src_edit.active_entry.getSourceRef().setBase(src_edit.active_source)
if src_edit.active_source:
current_source = Source()
src_edit.active_event.setSource(current_source)
else:
return
if src_edit.active_source != current_source.getBase():
src_edit.active_event.getSource().setBase(src_edit.active_source)
utils.modified()
if current_source.getBase() != src_edit.active_source:
current_source.setBase(src_edit.active_source)
utils.modified() utils.modified()
page = src_edit.get_widget("spage").get_text() page = src_edit.get_widget("spage").get_text()
date = src_edit.get_widget("sdate").get_text() date = src_edit.get_widget("sdate").get_text()
text = src_edit.get_widget("stext").get_chars(0,-1) text = src_edit.get_widget("stext").get_chars(0,-1)
comments = src_edit.get_widget("scomment").get_chars(0,-1) comments = src_edit.get_widget("scomment").get_chars(0,-1)
current_source.setPage(page) current_source_ref.setPage(page)
current_source.getDate().set(date) current_source_ref.getDate().set(date)
current_source.setText(text) current_source_ref.setText(text)
current_source.setComments(comments) current_source_ref.setComments(comments)
utils.modified() utils.modified()
utils.destroy_passed_object(obj) utils.destroy_passed_object(obj)
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -168,164 +175,16 @@ def on_sourceok_clicked(obj):
# #
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def on_selectsource_clicked(obj): def on_source_changed(obj):
src_edit = obj.get_data(SOURCEDISP) src_entry = obj.get_data("o")
SourceChoose(src_edit) src_entry.active_source = obj.get_data("s")
#------------------------------------------------------------------------- if src_entry.active_source == None:
# src_entry.author_field.set_text("")
# src_entry.pub_field.set_text("")
#
#-------------------------------------------------------------------------
class SourceChoose:
def __init__(self,source_info):
self.db = source_info.db
self.source_info = source_info
self.active_source = source_info.active_source
self.selSrc = libglade.GladeXML(const.gladeFile, "sourceEditor")
self.selSrc.signal_autoconnect({
"on_addsource_clicked" : on_addsource_clicked,
"on_updatesource_clicked" : on_updatesource_clicked,
"on_deletesource_clicked" : on_deletesource_clicked,
"on_sourceapply_clicked" : on_sourceapply_clicked,
"on_sourceList_select_row" : on_sourceList_select_row,
"destroy_passed_object" : utils.destroy_passed_object
})
self.title_field = self.selSrc.get_widget("source_title")
self.author_field = self.selSrc.get_widget("author")
self.pub_field = self.selSrc.get_widget("pubinfo")
self.callno_field = self.selSrc.get_widget("callno")
self.src_list = self.selSrc.get_widget("sourceList")
if source_info.active_source:
actsrc = source_info.active_source
self.title_field.set_text(actsrc.getTitle())
self.author_field.set_text(actsrc.getAuthor())
self.pub_field.set_text(actsrc.getPubInfo())
self.callno_field.set_text(actsrc.getCallNumber())
self.active_source = source_info.active_source
self.src_list.set_data(ACTIVESRC,self)
self.src_list.set_data(INDEX,-1)
self.redraw_sources()
#---------------------------------------------------------------------
#
#
#
#---------------------------------------------------------------------
def redraw_sources(self):
self.src_list.clear()
self.src_list.freeze()
current_row = -1
self.index = 0
for src in self.db.getSourceMap().values():
self.src_list.append([src.getTitle(),src.getAuthor()])
self.src_list.set_row_data(self.index,src)
if self.active_source == src:
current_row = self.index
self.index = self.index + 1
self.src_list.select_row(current_row,0)
self.src_list.moveto(current_row,0)
self.src_list.set_data(INDEX,current_row)
self.src_list.thaw()
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_addsource_clicked(obj):
src_obj = obj.get_data(ACTIVESRC)
src_obj.active_source = SourceBase()
title = src_obj.title_field.get_text()
author = src_obj.author_field.get_text()
src_obj.src_list.append([title,author])
src_obj.db.addSource(src_obj.active_source)
src_obj.active_source.setTitle(title)
src_obj.active_source.setAuthor(author)
src_obj.active_source.setCallNumber(src_obj.callno_field.get_text())
src_obj.active_source.setPubInfo(src_obj.pub_field.get_text())
src_obj.redraw_sources()
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_deletesource_clicked(obj):
src_obj = obj.get_data(ACTIVESRC)
src_obj.active_source = None
obj.set_data(INDEX,-1)
src_obj.redraw_sources()
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_updatesource_clicked(obj):
src_obj = obj.get_data(ACTIVESRC)
if src_obj.active_source:
src_obj.active_source.setTitle(src_obj.title_field.get_text())
src_obj.active_source.setAuthor(src_obj.author_field.get_text())
src_obj.active_source.setCallNumber(src_obj.callno_field.get_text())
src_obj.active_source.setPubInfo(src_obj.pub_field.get_text())
src_obj.redraw_sources()
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_sourceList_select_row(obj,row,b,c):
obj.set_data(INDEX,row)
src_obj = obj.get_data(ACTIVESRC)
src_obj.active_source = obj.get_row_data(row)
select_source = src_obj.active_source
if select_source:
src_obj.title_field.set_text(select_source.getTitle())
src_obj.author_field.set_text(select_source.getAuthor())
src_obj.pub_field.set_text(select_source.getPubInfo())
src_obj.callno_field.set_text(select_source.getCallNumber())
else: else:
src_obj.title_field.set_text("") src_entry.author_field.set_text(src_entry.active_source.getAuthor())
src_obj.author_field.set_text("") src_entry.pub_field.set_text(src_entry.active_source.getPubInfo())
src_obj.pub_field.set_text("")
src_obj.callno_field.set_text("")
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_sourceapply_clicked(obj):
row = obj.get_data(INDEX)
src_obj = obj.get_data(ACTIVESRC)
src_obj.active_source = obj.get_row_data(row)
if row == -1:
src_obj.active_source = None
elif not src_obj.active_source:
src_obj.active_source = Source()
if not src_obj.source_info.source:
src_obj.source_info.source = Source()
src_obj.source_info.source.setBase(src_obj.active_source)
src_obj.source_info.draw()
utils.destroy_passed_object(src_obj.selSrc.get_widget("sourceEditor"))

View File

@ -97,24 +97,34 @@ def dump_my_event(g,name,event):
write_line(g,"date",date) write_line(g,"date",date)
write_line(g,"place",place) write_line(g,"place",place)
write_line(g,"description",description) write_line(g,"description",description)
source = event.getSource() if event.getNote() != "":
writeNote(g,"note",event.getNote())
dump_source_ref(g,event.getSourceRef())
g.write("</event>\n")
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def dump_source_ref(g,source_ref):
if source_ref:
source = source_ref.getBase()
if source: if source:
sourceRef = source.getBase() p = source_ref.getPage()
if sourceRef: c = source_ref.getComments()
p = source.getPage() t = source_ref.getText()
c = source.getComments() d = source_ref.getDate().getSaveDate()
t = source.getText()
d = source.getDate().getSaveDate()
if p == "" and c == "" and t == "" and d == "": if p == "" and c == "" and t == "" and d == "":
g.write("<sourceref ref=\"%d\"/>\n" % sourceRef.getId()) g.write("<sourceref ref=\"%d\"/>\n" % source.getId())
else: else:
g.write("<sourceref ref=\"%d\">\n" % sourceRef.getId()) g.write("<sourceref ref=\"%d\">\n" % source.getId())
write_line(g,"spage",p) write_line(g,"spage",p)
writeNote(g,"scomments",c) writeNote(g,"scomments",c)
writeNote(g,"stext",t) writeNote(g,"stext",t)
write_line(g,"sdate",c) write_line(g,"sdate",c)
g.write("</sourceref>\n") g.write("</sourceref>\n")
g.write("</event>\n")
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -263,12 +273,23 @@ def exportData(database, filename, callback):
write_line(g,"state",address.getState()) write_line(g,"state",address.getState())
write_line(g,"country",address.getCountry()) write_line(g,"country",address.getCountry())
write_line(g,"postal",address.getPostal()) write_line(g,"postal",address.getPostal())
if address.getNote() != "":
writeNote(g,"note",address.getNote())
dump_source_ref(g,address.getSourceRef())
g.write('</address>\n') g.write('</address>\n')
g.write('</addresses>\n') g.write('</addresses>\n')
if len(person.getAttributeList()) > 0: if len(person.getAttributeList()) > 0:
g.write("<attributes>\n") g.write("<attributes>\n")
for attr in person.getAttributeList(): for attr in person.getAttributeList():
if attr.getSourceRef() or attr.getNote():
g.write('<attribute>')
write_line(g,"attr_type",attr.getType())
write_line(g,"attr_value",attr.getValue())
dump_source_ref(g,attr.getSourceRef())
writeNote(g,"note",attr.getNote())
g.write('</attribute>\n')
else:
g.write('<attribute type="%s">' % attr.getType()) g.write('<attribute type="%s">' % attr.getType())
g.write(fix(attr.getValue())) g.write(fix(attr.getValue()))
g.write('</attribute>\n') g.write('</attribute>\n')
@ -335,12 +356,14 @@ def exportData(database, filename, callback):
write_line(g,"sauthor",source.getAuthor()) write_line(g,"sauthor",source.getAuthor())
write_line(g,"spubinfo",source.getPubInfo()) write_line(g,"spubinfo",source.getPubInfo())
write_line(g,"scallno",source.getCallNumber()) write_line(g,"scallno",source.getCallNumber())
if source.getNote() != "":
writeNote(g,"note",source.getNote())
g.write("</source>\n") g.write("</source>\n")
g.write("</sources>\n") g.write("</sources>\n")
if len(db.bookmarks) > 0: if len(db.getBookmarks()) > 0:
g.write("<bookmarks>\n") g.write("<bookmarks>\n")
for person in db.bookmarks: for person in db.getBookmarks():
g.write("<bookmark ref=\"" + str(person.getId()) + "\"/>\n") g.write("<bookmark ref=\"" + str(person.getId()) + "\"/>\n")
g.write("</bookmarks>\n") g.write("</bookmarks>\n")

View File

@ -250,7 +250,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label199</name> <name>label199</name>
<label>Date Format : </label> <label>Date Format</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>1</xalign> <xalign>1</xalign>
@ -276,7 +276,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label200</name> <name>label200</name>
<label>Name Format : </label> <label>Name Format</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>1</xalign> <xalign>1</xalign>
@ -303,7 +303,8 @@
<class>GtkOptionMenu</class> <class>GtkOptionMenu</class>
<name>date_format</name> <name>date_format</name>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<items></items> <items>
</items>
<initial_choice>0</initial_choice> <initial_choice>0</initial_choice>
<child> <child>
<left_attach>1</left_attach> <left_attach>1</left_attach>
@ -325,7 +326,8 @@
<class>GtkOptionMenu</class> <class>GtkOptionMenu</class>
<name>name_format</name> <name>name_format</name>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<items></items> <items>
</items>
<initial_choice>0</initial_choice> <initial_choice>0</initial_choice>
<child> <child>
<left_attach>1</left_attach> <left_attach>1</left_attach>
@ -369,7 +371,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label201</name> <name>label201</name>
<label>Date Format : </label> <label>Date Format</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>1</xalign> <xalign>1</xalign>
@ -396,7 +398,8 @@
<class>GtkOptionMenu</class> <class>GtkOptionMenu</class>
<name>date_entry_format</name> <name>date_entry_format</name>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<items></items> <items>
</items>
<initial_choice>0</initial_choice> <initial_choice>0</initial_choice>
<child> <child>
<left_attach>1</left_attach> <left_attach>1</left_attach>
@ -433,41 +436,12 @@
<widget> <widget>
<class>GtkTable</class> <class>GtkTable</class>
<name>table21</name> <name>table21</name>
<rows>2</rows> <rows>1</rows>
<columns>1</columns> <columns>2</columns>
<homogeneous>False</homogeneous> <homogeneous>False</homogeneous>
<row_spacing>0</row_spacing> <row_spacing>0</row_spacing>
<column_spacing>0</column_spacing> <column_spacing>0</column_spacing>
<widget>
<class>GtkCheckButton</class>
<name>enableColors</name>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
<handler>on_color_toggled</handler>
<object>propertybox</object>
<last_modification_time>Sat, 17 Feb 2001 14:19:39 GMT</last_modification_time>
</signal>
<label>Enable Custom Colors</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>5</xpad>
<ypad>10</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget> <widget>
<class>GtkFrame</class> <class>GtkFrame</class>
<name>frame4</name> <name>frame4</name>
@ -477,8 +451,8 @@
<child> <child>
<left_attach>0</left_attach> <left_attach>0</left_attach>
<right_attach>1</right_attach> <right_attach>1</right_attach>
<top_attach>1</top_attach> <top_attach>0</top_attach>
<bottom_attach>2</bottom_attach> <bottom_attach>1</bottom_attach>
<xpad>5</xpad> <xpad>5</xpad>
<ypad>5</ypad> <ypad>5</ypad>
<xexpand>False</xexpand> <xexpand>False</xexpand>
@ -492,7 +466,7 @@
<widget> <widget>
<class>GtkTable</class> <class>GtkTable</class>
<name>table22</name> <name>table22</name>
<rows>4</rows> <rows>5</rows>
<columns>2</columns> <columns>2</columns>
<homogeneous>False</homogeneous> <homogeneous>False</homogeneous>
<row_spacing>0</row_spacing> <row_spacing>0</row_spacing>
@ -514,8 +488,8 @@
<child> <child>
<left_attach>1</left_attach> <left_attach>1</left_attach>
<right_attach>2</right_attach> <right_attach>2</right_attach>
<top_attach>0</top_attach> <top_attach>1</top_attach>
<bottom_attach>1</bottom_attach> <bottom_attach>2</bottom_attach>
<xpad>5</xpad> <xpad>5</xpad>
<ypad>5</ypad> <ypad>5</ypad>
<xexpand>False</xexpand> <xexpand>False</xexpand>
@ -543,8 +517,8 @@
<child> <child>
<left_attach>1</left_attach> <left_attach>1</left_attach>
<right_attach>2</right_attach> <right_attach>2</right_attach>
<top_attach>1</top_attach> <top_attach>2</top_attach>
<bottom_attach>2</bottom_attach> <bottom_attach>3</bottom_attach>
<xpad>5</xpad> <xpad>5</xpad>
<ypad>5</ypad> <ypad>5</ypad>
<xexpand>False</xexpand> <xexpand>False</xexpand>
@ -572,8 +546,8 @@
<child> <child>
<left_attach>1</left_attach> <left_attach>1</left_attach>
<right_attach>2</right_attach> <right_attach>2</right_attach>
<top_attach>2</top_attach> <top_attach>3</top_attach>
<bottom_attach>3</bottom_attach> <bottom_attach>4</bottom_attach>
<xpad>5</xpad> <xpad>5</xpad>
<ypad>5</ypad> <ypad>5</ypad>
<xexpand>False</xexpand> <xexpand>False</xexpand>
@ -601,8 +575,8 @@
<child> <child>
<left_attach>1</left_attach> <left_attach>1</left_attach>
<right_attach>2</right_attach> <right_attach>2</right_attach>
<top_attach>3</top_attach> <top_attach>4</top_attach>
<bottom_attach>4</bottom_attach> <bottom_attach>5</bottom_attach>
<xpad>5</xpad> <xpad>5</xpad>
<ypad>5</ypad> <ypad>5</ypad>
<xexpand>False</xexpand> <xexpand>False</xexpand>
@ -617,33 +591,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label195</name> <name>label195</name>
<label>Odd Row Foreground : </label> <label>Odd Row Foreground</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>5</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>False</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label196</name>
<label>Odd Row Background : </label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>1</xalign> <xalign>1</xalign>
@ -661,15 +609,15 @@
<yexpand>False</yexpand> <yexpand>False</yexpand>
<xshrink>False</xshrink> <xshrink>False</xshrink>
<yshrink>False</yshrink> <yshrink>False</yshrink>
<xfill>False</xfill> <xfill>True</xfill>
<yfill>False</yfill> <yfill>False</yfill>
</child> </child>
</widget> </widget>
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label197</name> <name>label196</name>
<label>Even Row Foreground : </label> <label>Odd Row Background</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>1</xalign> <xalign>1</xalign>
@ -687,15 +635,15 @@
<yexpand>False</yexpand> <yexpand>False</yexpand>
<xshrink>False</xshrink> <xshrink>False</xshrink>
<yshrink>False</yshrink> <yshrink>False</yshrink>
<xfill>False</xfill> <xfill>True</xfill>
<yfill>False</yfill> <yfill>False</yfill>
</child> </child>
</widget> </widget>
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label198</name> <name>label197</name>
<label>Even Row Background : </label> <label>Even Row Foreground</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>1</xalign> <xalign>1</xalign>
@ -713,10 +661,157 @@
<yexpand>False</yexpand> <yexpand>False</yexpand>
<xshrink>False</xshrink> <xshrink>False</xshrink>
<yshrink>False</yshrink> <yshrink>False</yshrink>
<xfill>False</xfill> <xfill>True</xfill>
<yfill>False</yfill> <yfill>False</yfill>
</child> </child>
</widget> </widget>
<widget>
<class>GtkLabel</class>
<name>label198</name>
<label>Even Row Background</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>5</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>enableColors</name>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
<handler>on_color_toggled</handler>
<object>propertybox</object>
<last_modification_time>Sat, 17 Feb 2001 14:19:39 GMT</last_modification_time>
</signal>
<label>Enable Custom Colors</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
</widget>
</widget>
<widget>
<class>GtkFrame</class>
<name>frame7</name>
<label>Status Bar</label>
<label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>True</xexpand>
<yexpand>True</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GtkVBox</class>
<name>vbox25</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<widget>
<class>GtkRadioButton</class>
<name>stat1</name>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
<handler>on_object_toggled</handler>
<object>propertybox</object>
<last_modification_time>Wed, 30 May 2001 02:18:01 GMT</last_modification_time>
</signal>
<label>Active person's name only</label>
<active>True</active>
<draw_indicator>True</draw_indicator>
<group>status</group>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkRadioButton</class>
<name>stat2</name>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
<handler>on_object_toggled</handler>
<object>propertybox</object>
<last_modification_time>Wed, 30 May 2001 02:18:16 GMT</last_modification_time>
</signal>
<label>Active person's name and gramps ID</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<group>status</group>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkRadioButton</class>
<name>stat3</name>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
<handler>on_object_toggled</handler>
<object>propertybox</object>
<last_modification_time>Wed, 30 May 2001 02:18:29 GMT</last_modification_time>
</signal>
<label>Active person's name and attribute</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<group>status</group>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
</widget> </widget>
</widget> </widget>
</widget> </widget>
@ -938,7 +1033,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label143</name> <name>label143</name>
<label>Name :</label> <label>Name</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>1</xalign> <xalign>1</xalign>
@ -950,7 +1045,7 @@
<right_attach>1</right_attach> <right_attach>1</right_attach>
<top_attach>0</top_attach> <top_attach>0</top_attach>
<bottom_attach>1</bottom_attach> <bottom_attach>1</bottom_attach>
<xpad>0</xpad> <xpad>5</xpad>
<ypad>0</ypad> <ypad>0</ypad>
<xexpand>False</xexpand> <xexpand>False</xexpand>
<yexpand>False</yexpand> <yexpand>False</yexpand>
@ -964,7 +1059,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label144</name> <name>label144</name>
<label>Address :</label> <label>Address</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>1</xalign> <xalign>1</xalign>
@ -976,7 +1071,7 @@
<right_attach>1</right_attach> <right_attach>1</right_attach>
<top_attach>1</top_attach> <top_attach>1</top_attach>
<bottom_attach>2</bottom_attach> <bottom_attach>2</bottom_attach>
<xpad>0</xpad> <xpad>5</xpad>
<ypad>0</ypad> <ypad>0</ypad>
<xexpand>False</xexpand> <xexpand>False</xexpand>
<yexpand>False</yexpand> <yexpand>False</yexpand>
@ -990,7 +1085,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label145</name> <name>label145</name>
<label>City :</label> <label>City</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>1</xalign> <xalign>1</xalign>
@ -1002,7 +1097,7 @@
<right_attach>1</right_attach> <right_attach>1</right_attach>
<top_attach>2</top_attach> <top_attach>2</top_attach>
<bottom_attach>3</bottom_attach> <bottom_attach>3</bottom_attach>
<xpad>0</xpad> <xpad>5</xpad>
<ypad>0</ypad> <ypad>0</ypad>
<xexpand>False</xexpand> <xexpand>False</xexpand>
<yexpand>False</yexpand> <yexpand>False</yexpand>
@ -1016,7 +1111,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label146</name> <name>label146</name>
<label>State/Province :</label> <label>State/Province</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>1</xalign> <xalign>1</xalign>
@ -1028,7 +1123,7 @@
<right_attach>1</right_attach> <right_attach>1</right_attach>
<top_attach>3</top_attach> <top_attach>3</top_attach>
<bottom_attach>4</bottom_attach> <bottom_attach>4</bottom_attach>
<xpad>0</xpad> <xpad>5</xpad>
<ypad>0</ypad> <ypad>0</ypad>
<xexpand>False</xexpand> <xexpand>False</xexpand>
<yexpand>False</yexpand> <yexpand>False</yexpand>
@ -1042,7 +1137,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label147</name> <name>label147</name>
<label>Country :</label> <label>Country</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>1</xalign> <xalign>1</xalign>
@ -1054,7 +1149,7 @@
<right_attach>1</right_attach> <right_attach>1</right_attach>
<top_attach>4</top_attach> <top_attach>4</top_attach>
<bottom_attach>5</bottom_attach> <bottom_attach>5</bottom_attach>
<xpad>0</xpad> <xpad>5</xpad>
<ypad>0</ypad> <ypad>0</ypad>
<xexpand>False</xexpand> <xexpand>False</xexpand>
<yexpand>False</yexpand> <yexpand>False</yexpand>
@ -1068,7 +1163,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label148</name> <name>label148</name>
<label>Zip/Postal Code :</label> <label>Zip/Postal Code</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>1</xalign> <xalign>1</xalign>
@ -1080,7 +1175,7 @@
<right_attach>1</right_attach> <right_attach>1</right_attach>
<top_attach>5</top_attach> <top_attach>5</top_attach>
<bottom_attach>6</bottom_attach> <bottom_attach>6</bottom_attach>
<xpad>0</xpad> <xpad>5</xpad>
<ypad>0</ypad> <ypad>0</ypad>
<xexpand>False</xexpand> <xexpand>False</xexpand>
<yexpand>False</yexpand> <yexpand>False</yexpand>
@ -1094,7 +1189,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label149</name> <name>label149</name>
<label>Phone :</label> <label>Phone</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>1</xalign> <xalign>1</xalign>
@ -1106,7 +1201,7 @@
<right_attach>1</right_attach> <right_attach>1</right_attach>
<top_attach>6</top_attach> <top_attach>6</top_attach>
<bottom_attach>7</bottom_attach> <bottom_attach>7</bottom_attach>
<xpad>0</xpad> <xpad>5</xpad>
<ypad>0</ypad> <ypad>0</ypad>
<xexpand>False</xexpand> <xexpand>False</xexpand>
<yexpand>False</yexpand> <yexpand>False</yexpand>
@ -1120,7 +1215,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label150</name> <name>label150</name>
<label>email :</label> <label>email</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>1</xalign> <xalign>1</xalign>
@ -1132,7 +1227,7 @@
<right_attach>1</right_attach> <right_attach>1</right_attach>
<top_attach>7</top_attach> <top_attach>7</top_attach>
<bottom_attach>8</bottom_attach> <bottom_attach>8</bottom_attach>
<xpad>0</xpad> <xpad>5</xpad>
<ypad>0</ypad> <ypad>0</ypad>
<xexpand>False</xexpand> <xexpand>False</xexpand>
<yexpand>False</yexpand> <yexpand>False</yexpand>
@ -1156,6 +1251,131 @@
<xpad>0</xpad> <xpad>0</xpad>
<ypad>0</ypad> <ypad>0</ypad>
</widget> </widget>
<widget>
<class>GtkTable</class>
<name>table25</name>
<rows>3</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<widget>
<class>GtkLabel</class>
<name>label203</name>
<label>Preferred Output Format</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label204</name>
<label>Preferred Paper Size</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkOptionMenu</class>
<name>paper_size</name>
<can_focus>True</can_focus>
<items>Letter
A4
</items>
<initial_choice>0</initial_choice>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkOptionMenu</class>
<name>output_format</name>
<can_focus>True</can_focus>
<items>OpenOffice
HTML
PDF
AbiWord
</items>
<initial_choice>0</initial_choice>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>Notebook:tab</child_name>
<name>label202</name>
<label>Reports</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget> </widget>
</widget> </widget>

View File

@ -54,6 +54,7 @@ marriageFile = rootDir + os.sep + "marriage.glade"
editPersonFile = rootDir + os.sep + "EditPerson.glade" editPersonFile = rootDir + os.sep + "EditPerson.glade"
bookFile = rootDir + os.sep + "bookmarks.glade" bookFile = rootDir + os.sep + "bookmarks.glade"
pluginsFile = rootDir + os.sep + "plugins.glade" pluginsFile = rootDir + os.sep + "plugins.glade"
notesFile = rootDir + os.sep + "editnote.glade"
configFile = rootDir + os.sep + "config.glade" configFile = rootDir + os.sep + "config.glade"
pluginsDir = rootDir + os.sep + "plugins" pluginsDir = rootDir + os.sep + "plugins"
@ -67,7 +68,7 @@ gtkrcFile = rootDir + os.sep + "gtkrc"
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
progName = "gramps" progName = "gramps"
version = "0.1.5" version = "0.2.0pre"
copyright = "(C) 2001 Donald N. Allingham" copyright = "(C) 2001 Donald N. Allingham"
authors = ["Donald N. Allingham"] authors = ["Donald N. Allingham"]
comments = _("Gramps (Genealogical Research and Analysis Management ") +\ comments = _("Gramps (Genealogical Research and Analysis Management ") +\
@ -98,6 +99,9 @@ helpMenu = "contents.html"
# Constants # Constants
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
output_formats = ["OpenOffice", "AbiWord", "PDF", "HTML" ]
childRelations = [ childRelations = [
"Biological", "Biological",
"Adopted", "Adopted",

View File

@ -20,7 +20,12 @@
<signal> <signal>
<name>destroy</name> <name>destroy</name>
<handler>on_exit_activate</handler> <handler>on_exit_activate</handler>
<last_modification_time>Thu, 19 Oct 2000 14:26:14 GMT</last_modification_time> <last_modification_time>Tue, 29 May 2001 23:11:49 GMT</last_modification_time>
</signal>
<signal>
<name>delete_event</name>
<handler>delete_event</handler>
<last_modification_time>Tue, 29 May 2001 23:19:12 GMT</last_modification_time>
</signal> </signal>
<title>Gramps</title> <title>Gramps</title>
<type>GTK_WINDOW_TOPLEVEL</type> <type>GTK_WINDOW_TOPLEVEL</type>
@ -207,6 +212,18 @@
<label>_Pedegree</label> <label>_Pedegree</label>
<right_justify>False</right_justify> <right_justify>False</right_justify>
</widget> </widget>
<widget>
<class>GtkMenuItem</class>
<name>sources</name>
<signal>
<name>activate</name>
<handler>on_sources_activate</handler>
<last_modification_time>Wed, 30 May 2001 01:59:42 GMT</last_modification_time>
</signal>
<label>Sources</label>
<right_justify>False</right_justify>
</widget>
</widget> </widget>
</widget> </widget>
@ -446,6 +463,26 @@
<icon>pedegree.xpm</icon> <icon>pedegree.xpm</icon>
</widget> </widget>
<widget>
<class>GtkButton</class>
<child_name>Toolbar:button</child_name>
<name>button105</name>
<signal>
<name>clicked</name>
<handler>on_sources_activate</handler>
<last_modification_time>Wed, 30 May 2001 02:01:04 GMT</last_modification_time>
</signal>
<label>Sources</label>
<stock_pixmap>GNOME_STOCK_PIXMAP_PROPERTIES</stock_pixmap>
<child>
<new_group>True</new_group>
</child>
</widget>
<widget>
<class>Placeholder</class>
</widget>
<widget> <widget>
<class>GtkButton</class> <class>GtkButton</class>
<child_name>Toolbar:button</child_name> <child_name>Toolbar:button</child_name>
@ -2307,6 +2344,138 @@
<xpad>0</xpad> <xpad>0</xpad>
<ypad>0</ypad> <ypad>0</ypad>
</widget> </widget>
<widget>
<class>GtkVBox</class>
<name>vbox33</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow24</name>
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkCList</class>
<name>source_list</name>
<can_focus>True</can_focus>
<signal>
<name>select_row</name>
<handler>on_source_list_select_row</handler>
<last_modification_time>Tue, 29 May 2001 21:23:02 GMT</last_modification_time>
</signal>
<columns>2</columns>
<column_widths>300,80</column_widths>
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
<show_titles>True</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label215</name>
<label>Title</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label216</name>
<label>Author</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
</widget>
<widget>
<class>GtkHButtonBox</class>
<name>hbuttonbox20</name>
<layout_style>GTK_BUTTONBOX_SPREAD</layout_style>
<spacing>30</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkButton</class>
<name>button102</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_add_source_clicked</handler>
<object>source_list</object>
<last_modification_time>Tue, 29 May 2001 21:16:02 GMT</last_modification_time>
</signal>
<label>Add Source</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
<widget>
<class>GtkButton</class>
<name>button103</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_edit_source_clicked</handler>
<object>source_list</object>
<last_modification_time>Tue, 29 May 2001 21:15:39 GMT</last_modification_time>
</signal>
<label>Edit Source</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
<widget>
<class>GtkButton</class>
<name>button104</name>
<sensitive>False</sensitive>
<can_default>True</can_default>
<can_focus>True</can_focus>
<label>Delete Source</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
</widget>
</widget>
<widget>
<class>GtkLabel</class>
<child_name>Notebook:tab</child_name>
<name>label214</name>
<label>Sources</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget> </widget>
</widget> </widget>
@ -3282,7 +3451,7 @@ Other
<signal> <signal>
<name>clicked</name> <name>clicked</name>
<handler>on_sourceapply_clicked</handler> <handler>on_sourceapply_clicked</handler>
<object>sourceList</object> <object>sourceEditor</object>
<last_modification_time>Thu, 18 Jan 2001 02:53:13 GMT</last_modification_time> <last_modification_time>Thu, 18 Jan 2001 02:53:13 GMT</last_modification_time>
</signal> </signal>
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button> <stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
@ -3347,19 +3516,33 @@ Other
</widget> </widget>
<widget> <widget>
<class>GtkTable</class> <class>GtkNotebook</class>
<name>table17</name> <name>notebook2</name>
<rows>4</rows> <width>450</width>
<columns>2</columns> <height>250</height>
<homogeneous>False</homogeneous> <can_focus>True</can_focus>
<row_spacing>0</row_spacing> <show_tabs>True</show_tabs>
<column_spacing>0</column_spacing> <show_border>True</show_border>
<tab_pos>GTK_POS_TOP</tab_pos>
<scrollable>False</scrollable>
<tab_hborder>2</tab_hborder>
<tab_vborder>2</tab_vborder>
<popup_enable>False</popup_enable>
<child> <child>
<padding>0</padding> <padding>0</padding>
<expand>True</expand> <expand>True</expand>
<fill>True</fill> <fill>True</fill>
</child> </child>
<widget>
<class>GtkTable</class>
<name>table17</name>
<rows>3</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label165</name> <name>label165</name>
@ -3438,32 +3621,6 @@ Other
</child> </child>
</widget> </widget>
<widget>
<class>GtkLabel</class>
<name>label168</name>
<label>Call Number : </label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget> <widget>
<class>GtkEntry</class> <class>GtkEntry</class>
<name>source_title</name> <name>source_title</name>
@ -3477,8 +3634,8 @@ Other
<right_attach>2</right_attach> <right_attach>2</right_attach>
<top_attach>0</top_attach> <top_attach>0</top_attach>
<bottom_attach>1</bottom_attach> <bottom_attach>1</bottom_attach>
<xpad>2</xpad> <xpad>5</xpad>
<ypad>2</ypad> <ypad>5</ypad>
<xexpand>True</xexpand> <xexpand>True</xexpand>
<yexpand>False</yexpand> <yexpand>False</yexpand>
<xshrink>False</xshrink> <xshrink>False</xshrink>
@ -3501,8 +3658,8 @@ Other
<right_attach>2</right_attach> <right_attach>2</right_attach>
<top_attach>1</top_attach> <top_attach>1</top_attach>
<bottom_attach>2</bottom_attach> <bottom_attach>2</bottom_attach>
<xpad>2</xpad> <xpad>5</xpad>
<ypad>2</ypad> <ypad>5</ypad>
<xexpand>True</xexpand> <xexpand>True</xexpand>
<yexpand>False</yexpand> <yexpand>False</yexpand>
<xshrink>False</xshrink> <xshrink>False</xshrink>
@ -3525,8 +3682,8 @@ Other
<right_attach>2</right_attach> <right_attach>2</right_attach>
<top_attach>2</top_attach> <top_attach>2</top_attach>
<bottom_attach>3</bottom_attach> <bottom_attach>3</bottom_attach>
<xpad>2</xpad> <xpad>5</xpad>
<ypad>2</ypad> <ypad>5</ypad>
<xexpand>True</xexpand> <xexpand>True</xexpand>
<yexpand>False</yexpand> <yexpand>False</yexpand>
<xshrink>False</xshrink> <xshrink>False</xshrink>
@ -3535,67 +3692,43 @@ Other
<yfill>False</yfill> <yfill>False</yfill>
</child> </child>
</widget> </widget>
</widget>
<widget> <widget>
<class>GtkEntry</class> <class>GtkLabel</class>
<name>callno</name> <child_name>Notebook:tab</child_name>
<can_focus>True</can_focus> <name>label204</name>
<editable>True</editable> <label>General</label>
<text_visible>True</text_visible> <justify>GTK_JUSTIFY_CENTER</justify>
<text_max_length>0</text_max_length> <wrap>False</wrap>
<text></text> <xalign>0.5</xalign>
<child> <yalign>0.5</yalign>
<left_attach>1</left_attach> <xpad>0</xpad>
<right_attach>2</right_attach> <ypad>0</ypad>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>2</xpad>
<ypad>2</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
</widget> </widget>
<widget> <widget>
<class>GtkScrolledWindow</class> <class>GtkScrolledWindow</class>
<name>scrolledwindow19</name> <name>scrolledwindow23</name>
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy> <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy> <vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy> <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy> <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget> <widget>
<class>GtkCList</class> <class>GtkText</class>
<name>sourceList</name> <name>source_note</name>
<width>400</width>
<height>150</height>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<signal> <editable>False</editable>
<name>select_row</name> <text></text>
<handler>on_sourceList_select_row</handler> </widget>
<last_modification_time>Thu, 18 Jan 2001 15:09:10 GMT</last_modification_time> </widget>
</signal>
<columns>2</columns>
<column_widths>171,80</column_widths>
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
<show_titles>True</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<child_name>CList:title</child_name> <child_name>Notebook:tab</child_name>
<name>label169</name> <name>label205</name>
<label>Title</label> <label>Note</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>0.5</xalign> <xalign>0.5</xalign>
@ -3604,11 +3737,15 @@ Other
<ypad>0</ypad> <ypad>0</ypad>
</widget> </widget>
<widget>
<class>Placeholder</class>
</widget>
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<child_name>CList:title</child_name> <child_name>Notebook:tab</child_name>
<name>label170</name> <name>label206</name>
<label>Author</label> <label>Gallery</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>0.5</xalign> <xalign>0.5</xalign>
@ -3618,68 +3755,6 @@ Other
</widget> </widget>
</widget> </widget>
</widget> </widget>
<widget>
<class>GtkHButtonBox</class>
<name>hbuttonbox16</name>
<layout_style>GTK_BUTTONBOX_SPREAD</layout_style>
<spacing>30</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkButton</class>
<name>button91</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_addsource_clicked</handler>
<object>sourceList</object>
<last_modification_time>Thu, 18 Jan 2001 02:53:25 GMT</last_modification_time>
</signal>
<label>Add</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
<widget>
<class>GtkButton</class>
<name>button92</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_updatesource_clicked</handler>
<object>sourceList</object>
<last_modification_time>Fri, 02 Mar 2001 21:01:33 GMT</last_modification_time>
</signal>
<label>Update</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
<widget>
<class>GtkButton</class>
<name>button93</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_deletesource_clicked</handler>
<object>sourceList</object>
<last_modification_time>Thu, 18 Jan 2001 02:53:52 GMT</last_modification_time>
</signal>
<label>Delete</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
</widget>
</widget>
</widget> </widget>
</widget> </widget>
@ -3799,7 +3874,7 @@ Other
<widget> <widget>
<class>GtkTable</class> <class>GtkTable</class>
<name>table18</name> <name>table18</name>
<rows>6</rows> <rows>4</rows>
<columns>2</columns> <columns>2</columns>
<homogeneous>False</homogeneous> <homogeneous>False</homogeneous>
<row_spacing>0</row_spacing> <row_spacing>0</row_spacing>
@ -3810,32 +3885,6 @@ Other
<fill>True</fill> <fill>True</fill>
</child> </child>
<widget>
<class>GtkLabel</class>
<name>label172</name>
<label>Call Number :</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label173</name> <name>label173</name>
@ -3920,8 +3969,8 @@ Other
<child> <child>
<left_attach>0</left_attach> <left_attach>0</left_attach>
<right_attach>2</right_attach> <right_attach>2</right_attach>
<top_attach>5</top_attach> <top_attach>3</top_attach>
<bottom_attach>6</bottom_attach> <bottom_attach>4</bottom_attach>
<xpad>0</xpad> <xpad>0</xpad>
<ypad>0</ypad> <ypad>0</ypad>
<xexpand>False</xexpand> <xexpand>False</xexpand>
@ -3934,23 +3983,20 @@ Other
</widget> </widget>
<widget> <widget>
<class>GtkLabel</class> <class>GtkOptionMenu</class>
<name>stitle</name> <name>source_title</name>
<label></label> <can_focus>True</can_focus>
<justify>GTK_JUSTIFY_LEFT</justify> <items>
<wrap>False</wrap> </items>
<xalign>0</xalign> <initial_choice>0</initial_choice>
<yalign>0.5</yalign>
<xpad>3</xpad>
<ypad>0</ypad>
<child> <child>
<left_attach>1</left_attach> <left_attach>1</left_attach>
<right_attach>2</right_attach> <right_attach>2</right_attach>
<top_attach>0</top_attach> <top_attach>0</top_attach>
<bottom_attach>1</bottom_attach> <bottom_attach>1</bottom_attach>
<xpad>0</xpad> <xpad>5</xpad>
<ypad>0</ypad> <ypad>5</ypad>
<xexpand>True</xexpand> <xexpand>False</xexpand>
<yexpand>False</yexpand> <yexpand>False</yexpand>
<xshrink>False</xshrink> <xshrink>False</xshrink>
<yshrink>False</yshrink> <yshrink>False</yshrink>
@ -3974,8 +4020,8 @@ Other
<right_attach>2</right_attach> <right_attach>2</right_attach>
<top_attach>1</top_attach> <top_attach>1</top_attach>
<bottom_attach>2</bottom_attach> <bottom_attach>2</bottom_attach>
<xpad>0</xpad> <xpad>5</xpad>
<ypad>0</ypad> <ypad>5</ypad>
<xexpand>True</xexpand> <xexpand>True</xexpand>
<yexpand>False</yexpand> <yexpand>False</yexpand>
<xshrink>False</xshrink> <xshrink>False</xshrink>
@ -4000,8 +4046,8 @@ Other
<right_attach>2</right_attach> <right_attach>2</right_attach>
<top_attach>2</top_attach> <top_attach>2</top_attach>
<bottom_attach>3</bottom_attach> <bottom_attach>3</bottom_attach>
<xpad>0</xpad> <xpad>5</xpad>
<ypad>0</ypad> <ypad>5</ypad>
<xexpand>True</xexpand> <xexpand>True</xexpand>
<yexpand>False</yexpand> <yexpand>False</yexpand>
<xshrink>False</xshrink> <xshrink>False</xshrink>
@ -4010,82 +4056,6 @@ Other
<yfill>False</yfill> <yfill>False</yfill>
</child> </child>
</widget> </widget>
<widget>
<class>GtkLabel</class>
<name>scallno</name>
<label></label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>3</xpad>
<ypad>0</ypad>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkHButtonBox</class>
<name>hbuttonbox18</name>
<layout_style>GTK_BUTTONBOX_DEFAULT_STYLE</layout_style>
<spacing>30</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
<child>
<left_attach>0</left_attach>
<right_attach>2</right_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>True</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GtkButton</class>
<name>button96</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_selectsource_clicked</handler>
<object>sourceDisplay</object>
<last_modification_time>Tue, 16 Jan 2001 19:59:32 GMT</last_modification_time>
</signal>
<label>Select Source</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
</widget>
</widget>
<widget>
<class>GtkVSeparator</class>
<name>vseparator9</name>
<child>
<padding>3</padding>
<expand>True</expand>
<fill>True</fill>
</child>
</widget> </widget>
<widget> <widget>
@ -4154,58 +4124,6 @@ Other
</child> </child>
</widget> </widget>
<widget>
<class>GtkLabel</class>
<name>label182</name>
<label>Text :</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label183</name>
<label>Comments :</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget> <widget>
<class>GtkScrolledWindow</class> <class>GtkScrolledWindow</class>
<name>scrolledwindow20</name> <name>scrolledwindow20</name>
@ -4231,6 +4149,7 @@ Other
<widget> <widget>
<class>GtkText</class> <class>GtkText</class>
<name>scomment</name> <name>scomment</name>
<width>300</width>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<editable>True</editable> <editable>True</editable>
<text></text> <text></text>
@ -4316,6 +4235,58 @@ Other
<yfill>False</yfill> <yfill>False</yfill>
</child> </child>
</widget> </widget>
<widget>
<class>GtkLabel</class>
<name>label183</name>
<label>Comments :</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0</yalign>
<xpad>0</xpad>
<ypad>10</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label182</name>
<label>Text :</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0</yalign>
<xpad>0</xpad>
<ypad>5</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
</widget>
</widget> </widget>
</widget> </widget>
</widget> </widget>

View File

@ -100,6 +100,7 @@ topWindow = None
statusbar = None statusbar = None
Main = None Main = None
person_list = None person_list = None
source_list = None
database = None database = None
family_window = None family_window = None
queryTop = None queryTop = None
@ -147,6 +148,16 @@ def deathday(person):
else: else:
return "" return ""
def delete_event(widget, event):
widget.hide()
if utils.wasModified():
question = _("Unsaved changes exist in the current database\n") + \
_("Do you wish to save the changes?")
topWindow.question(question,save_query)
else:
mainquit(widget)
return TRUE
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# #
@ -560,6 +571,7 @@ def new_database_response(val):
change_active_person(None) change_active_person(None)
person_list.clear() person_list.clear()
load_family() load_family()
load_sources()
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -594,9 +606,113 @@ def update_display(changed):
goto_active_person() goto_active_person()
elif page == 1: elif page == 1:
load_family() load_family()
elif page == 3:
load_sources()
else: else:
load_tree() load_tree()
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def load_sources():
source_list.clear()
source_list.freeze()
color_clist = ListColors.ColorList(source_list,1)
current_row = source_list.get_data("i")
if current_row == None:
current_row = -1
index = 0
for src in database.getSourceMap().values():
source_list.append([src.getTitle(),src.getAuthor()])
source_list.set_row_data(index,src)
index = index + 1
if index > 0:
if current_row == -1:
current_row = 0
source_list.select_row(current_row,0)
source_list.moveto(current_row,0)
source_list.set_data("i",current_row)
source_list.thaw()
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_source_list_button_press_event(obj,event):
if event.button == 1 and event.type == GDK._2BUTTON_PRESS:
index = obj.get_data("i")
if index == -1:
return
source = obj.get_row_data(index)
EditSource.EditSource(source,database,update_source_after_edit)
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_source_list_select_row(obj,a,b,c):
obj.set_data("i",a)
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_add_source_clicked(obj):
import EditSource
EditSource.EditSource(Source(),database,new_source_after_edit)
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_delete_source_clicked(obj):
pass
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_edit_source_clicked(obj):
import EditSource
index = obj.get_data("i")
if index == -1:
return
source = obj.get_row_data(index)
EditSource.EditSource(source,database,update_source_after_edit)
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def new_source_after_edit(source):
database.addSource(source.source)
update_display(1)
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def update_source_after_edit(source):
update_display(1)
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# #
@ -1153,7 +1269,18 @@ def change_active_person(person):
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def modify_statusbar(): def modify_statusbar():
statusbar.set_status(Config.nameof(active_person)) pname = Config.nameof(active_person)
if Config.status_bar == 1:
name = "[%s] %s" % (str(active_person.getId()),pname)
elif Config.status_bar == 2:
name = pname
for attr in active_person.getAttributeList():
if attr.getType() == Config.attr_name:
name = "[%s] %s" % (attr.getValue(),pname)
break
else:
name = pname
statusbar.set_status(name)
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -1276,6 +1403,10 @@ def on_pedegree1_activate(obj):
notebk = Main.get_widget(NOTEBOOK) notebk = Main.get_widget(NOTEBOOK)
notebk.set_page(2) notebk.set_page(2)
def on_sources_activate(obj):
notebk = Main.get_widget(NOTEBOOK)
notebk.set_page(3)
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Load the appropriate page after a notebook switch # Load the appropriate page after a notebook switch
@ -1284,15 +1415,17 @@ def on_pedegree1_activate(obj):
def on_notebook1_switch_page(obj,junk,page): def on_notebook1_switch_page(obj,junk,page):
if not active_person: if not active_person:
return return
if (page == 0): if page == 0:
if id2col.has_key(active_person): if id2col.has_key(active_person):
column = id2col[active_person] column = id2col[active_person]
person_list.select_row(column,0) person_list.select_row(column,0)
person_list.moveto(column,0) person_list.moveto(column,0)
elif (page == 1): elif page == 1:
load_family() load_family()
elif (page == 2): elif page == 2:
load_tree() load_tree()
elif page == 3:
load_sources()
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -1797,7 +1930,7 @@ def setup_bookmarks():
menu = Main.get_widget("jump_to") menu = Main.get_widget("jump_to")
person_map = database.getPersonMap() person_map = database.getPersonMap()
bookmarks = Bookmarks.Bookmarks(database.bookmarks,person_map,\ bookmarks = Bookmarks.Bookmarks(database.getBookmarks(),person_map,\
menu,bookmark_callback) menu,bookmark_callback)
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -1989,7 +2122,7 @@ def on_preferences_activate(obj):
def main(arg): def main(arg):
global database, Main global database, Main
global statusbar global statusbar
global person_list, pv global person_list, source_list, pv
global topWindow global topWindow
import ReadXML import ReadXML
@ -2008,6 +2141,7 @@ def main(arg):
topWindow = Main.get_widget("gramps") topWindow = Main.get_widget("gramps")
statusbar = Main.get_widget("statusbar") statusbar = Main.get_widget("statusbar")
person_list = Main.get_widget("person_list") person_list = Main.get_widget("person_list")
source_list = Main.get_widget("source_list")
filter_list = Main.get_widget("filter_list") filter_list = Main.get_widget("filter_list")
myMenu = GtkMenu() myMenu = GtkMenu()
@ -2035,6 +2169,7 @@ def main(arg):
"on_reports_clicked" : on_reports_clicked, "on_reports_clicked" : on_reports_clicked,
"on_person_list1_activate": on_person_list1_activate, "on_person_list1_activate": on_person_list1_activate,
"on_family1_activate" : on_family1_activate, "on_family1_activate" : on_family1_activate,
"on_sources_activate" : on_sources_activate,
"on_pedegree1_activate" : on_pedegree1_activate, "on_pedegree1_activate" : on_pedegree1_activate,
"on_notebook1_switch_page": on_notebook1_switch_page, "on_notebook1_switch_page": on_notebook1_switch_page,
"on_ok_button1_clicked": on_ok_button1_clicked, "on_ok_button1_clicked": on_ok_button1_clicked,
@ -2077,6 +2212,12 @@ def main(arg):
"on_edit_mother_clicked" : on_edit_mother_clicked, "on_edit_mother_clicked" : on_edit_mother_clicked,
"on_exit_activate" : on_exit_activate, "on_exit_activate" : on_exit_activate,
"on_statusbar_unmap" : on_statusbar_unmap, "on_statusbar_unmap" : on_statusbar_unmap,
"on_add_source_clicked" : on_add_source_clicked,
"on_source_list_button_press_event" : on_source_list_button_press_event,
"on_source_list_select_row": on_source_list_select_row,
"on_delete_source_clicked" : on_delete_source_clicked,
"on_edit_source_clicked" : on_edit_source_clicked,
"delete_event" : delete_event,
"on_open_activate" : on_open_activate "on_open_activate" : on_open_activate
}) })

View File

@ -1,3 +1,22 @@
#
# 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
#
import cStringIO import cStringIO
@ -26,9 +45,8 @@ try:
except: except:
def utf8_to_latin(s): def utf8_to_latin(s):
return s return s.encode('latin-1')
def latin_to_utf8(s): def latin_to_utf8(s):
return s return s.encode('utf-8')

View File

@ -293,8 +293,16 @@ class IndivSummary:
family = self.person.getMainFamily() family = self.person.getMainFamily()
if family: if family:
father = family.getFather().getPrimaryName().getRegularName() father_inst = family.getFather()
mother = family.getMother().getPrimaryName().getRegularName() if father_inst:
father = father_inst.getPrimaryName().getRegularName()
else:
father = ""
mother_inst = family.getMother()
if mother_inst:
mother = mother_inst.getPrimaryName().getRegularName()
else:
mother = ""
else: else:
father = "" father = ""
mother = "" mother = ""

File diff suppressed because it is too large Load Diff

View File

@ -26,6 +26,8 @@ import string
import time import time
import const import const
import utils import utils
import intl
_ = intl.gettext
from gtk import * from gtk import *
from gnome.ui import * from gnome.ui import *
@ -192,9 +194,9 @@ def add_persons_sources(person):
if person.getDeath(): if person.getDeath():
elist.append(person.getDeath()) elist.append(person.getDeath())
for event in elist: for event in elist:
source = event.getSource() source_ref = event.getSourceRef()
if source != None: if source_ref != None:
source_list.append(source) source_list.append(source_ref)
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -208,9 +210,9 @@ def add_familys_sources(family):
if family.getDivorce(): if family.getDivorce():
elist.append(family.getDivorce()) elist.append(family.getDivorce())
for event in elist: for event in elist:
source = event.getSource() source_ref = event.getSourceRef()
if source != None: if source_ref != None:
source_list.append(source) source_list.append(source_ref)
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #

View File

@ -233,6 +233,26 @@
</child> </child>
</widget> </widget>
<widget>
<class>GtkRadioButton</class>
<name>abiword</name>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
<handler>on_html_toggled</handler>
<last_modification_time>Tue, 20 Mar 2001 17:02:37 GMT</last_modification_time>
</signal>
<label>AbiWord</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<group>format</group>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget> <widget>
<class>GtkRadioButton</class> <class>GtkRadioButton</class>
<name>pdf</name> <name>pdf</name>