Support for notes and sources in more data elements, new GEDCOM parser
svn: r66
This commit is contained in:
parent
39b346ac59
commit
bad37fc429
@ -29,6 +29,8 @@ import string
|
||||
import re
|
||||
import os
|
||||
|
||||
import PaperMenu
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# GTK/Gnome modules
|
||||
@ -91,6 +93,9 @@ lastfile = None
|
||||
nameof = utils.normal_name
|
||||
display_attr = 0
|
||||
attr_name = ""
|
||||
status_bar = 0
|
||||
paper_preference = None
|
||||
output_preference = None
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -139,10 +144,14 @@ def loadConfig(call):
|
||||
global _druid
|
||||
global _name_format
|
||||
global _callback
|
||||
global paper_preference
|
||||
global output_preference
|
||||
global status_bar
|
||||
|
||||
_callback = call
|
||||
lastfile = gnome.config.get_string("/gramps/data/LastFile")
|
||||
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")
|
||||
attr_name = gnome.config.get_string("/gramps/config/DisplayAttrName")
|
||||
|
||||
@ -150,6 +159,8 @@ def loadConfig(call):
|
||||
autoload = gnome.config.get_bool("/gramps/config/autoLoad")
|
||||
dateFormat = gnome.config.get_int("/gramps/config/dateFormat")
|
||||
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 = gnome.config.get_string("/gramps/researcher/name")
|
||||
@ -170,6 +181,12 @@ def loadConfig(call):
|
||||
ListColors.evenfg = get_config_color(EVENFGCOLOR,(0,0,0))
|
||||
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:
|
||||
display_attr = 0
|
||||
|
||||
@ -180,6 +197,8 @@ def loadConfig(call):
|
||||
autoload = 1
|
||||
if usetabs == None:
|
||||
usetabs = 0
|
||||
if status_bar == None:
|
||||
status_bar = 0
|
||||
if hide_altnames == None:
|
||||
hide_altnames = 0
|
||||
if dateFormat == None:
|
||||
@ -265,6 +284,7 @@ def on_propertybox_apply(obj,page):
|
||||
global nameof
|
||||
global owner
|
||||
global usetabs
|
||||
global status_bar
|
||||
global display_attr
|
||||
global attr_name
|
||||
global hide_altnames
|
||||
@ -277,10 +297,25 @@ def on_propertybox_apply(obj,page):
|
||||
attr_name = string.strip(prefsTop.get_widget("attr_name").get_text())
|
||||
usetabs = prefsTop.get_widget("usetabs").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_int("/gramps/config/StatusBar",status_bar)
|
||||
gnome.config.set_bool("/gramps/config/DisplayAttr",display_attr)
|
||||
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/DisplayAltNames",hide_altnames)
|
||||
|
||||
@ -418,6 +453,41 @@ def display_preferences_box():
|
||||
|
||||
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_menu = GtkMenu()
|
||||
for index in range(0,len(_date_format_list)):
|
||||
|
18
src/Date.py
18
src/Date.py
@ -61,6 +61,24 @@ class Date:
|
||||
def get_stop_date(self):
|
||||
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()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
|
@ -1261,30 +1261,6 @@
|
||||
</child>
|
||||
</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>
|
||||
<class>GtkLabel</class>
|
||||
<name>label105</name>
|
||||
@ -1468,6 +1444,61 @@
|
||||
</child>
|
||||
</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>
|
||||
@ -1702,30 +1733,6 @@
|
||||
</child>
|
||||
</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>
|
||||
<class>GtkHBox</class>
|
||||
<name>hbox14</name>
|
||||
@ -1776,7 +1783,6 @@
|
||||
<widget>
|
||||
<class>GtkButton</class>
|
||||
<name>button95</name>
|
||||
<sensitive>False</sensitive>
|
||||
<tooltip>Choose source information</tooltip>
|
||||
<can_focus>True</can_focus>
|
||||
<signal>
|
||||
@ -1794,6 +1800,61 @@
|
||||
</child>
|
||||
</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>
|
||||
@ -2014,30 +2075,6 @@
|
||||
</child>
|
||||
</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>
|
||||
<class>GtkLabel</class>
|
||||
<name>label142</name>
|
||||
@ -2128,7 +2165,6 @@
|
||||
<widget>
|
||||
<class>GtkButton</class>
|
||||
<name>button91</name>
|
||||
<sensitive>False</sensitive>
|
||||
<tooltip>Choose source information</tooltip>
|
||||
<can_focus>True</can_focus>
|
||||
<signal>
|
||||
@ -2140,7 +2176,7 @@
|
||||
<label>Source</label>
|
||||
<relief>GTK_RELIEF_NORMAL</relief>
|
||||
<child>
|
||||
<padding>4</padding>
|
||||
<padding>5</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
@ -2282,6 +2318,61 @@
|
||||
</child>
|
||||
</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>
|
||||
@ -2937,4 +3028,148 @@
|
||||
</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>
|
||||
|
@ -154,6 +154,7 @@ class EditPerson:
|
||||
"on_photolist_button_press_event" : on_photolist_button_press_event,
|
||||
"on_addphoto_clicked" : on_add_photo_clicked,
|
||||
"on_deletephoto_clicked" : on_delete_photo_clicked,
|
||||
"on_event_note_clicked" : on_event_note_clicked,
|
||||
"on_showsource_clicked" : on_showsource_clicked,
|
||||
"on_applyPerson_clicked" : on_apply_person_clicked
|
||||
})
|
||||
@ -261,7 +262,7 @@ class EditPerson:
|
||||
|
||||
current_row = self.name_list.get_data(INDEX)
|
||||
|
||||
if self.name_index >= 0:
|
||||
if self.name_index > 0:
|
||||
if current_row <= 0:
|
||||
current_row = 0
|
||||
elif self.name_index <= current_row:
|
||||
@ -288,7 +289,7 @@ class EditPerson:
|
||||
|
||||
current_row = self.web_list.get_data(INDEX)
|
||||
|
||||
if self.web_index >= 0:
|
||||
if self.web_index > 0:
|
||||
if current_row <= 0:
|
||||
current_row = 0
|
||||
elif self.web_index <= current_row:
|
||||
@ -315,7 +316,7 @@ class EditPerson:
|
||||
|
||||
current_row = self.attr_list.get_data(INDEX)
|
||||
|
||||
if self.attr_index >= 0:
|
||||
if self.attr_index > 0:
|
||||
if current_row <= 0:
|
||||
current_row = 0
|
||||
elif self.attr_index <= current_row:
|
||||
@ -344,7 +345,7 @@ class EditPerson:
|
||||
|
||||
current_row = self.address_list.get_data(INDEX)
|
||||
|
||||
if self.address_index >= 0:
|
||||
if self.address_index > 0:
|
||||
if current_row <= 0:
|
||||
current_row = 0
|
||||
elif self.address_index <= current_row:
|
||||
@ -1076,6 +1077,38 @@ def on_savephoto_clicked(obj):
|
||||
utils.modified()
|
||||
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
|
||||
})
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
|
@ -70,19 +70,24 @@ class GrampsParser(handler.ContentHandler):
|
||||
self.note_list = []
|
||||
|
||||
self.in_note = 0
|
||||
self.in_attribute = 0
|
||||
self.in_old_attr = 0
|
||||
self.in_stext = 0
|
||||
self.in_scomments = 0
|
||||
self.in_people = 0
|
||||
self.db = database
|
||||
self.base = base
|
||||
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.family = None
|
||||
self.address = None
|
||||
self.source = None
|
||||
self.sourceRef = None
|
||||
self.source_ref = None
|
||||
self.is_import = is_import
|
||||
self.in_address = 0
|
||||
|
||||
self.resname = ""
|
||||
self.resaddr = ""
|
||||
@ -141,15 +146,21 @@ class GrampsParser(handler.ContentHandler):
|
||||
def start_event(self,attrs):
|
||||
self.event = Event()
|
||||
self.event_type = string.capwords(attrs["type"])
|
||||
|
||||
self.in_event = 1
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
#---------------------------------------------------------------------
|
||||
def start_attribute(self,attrs):
|
||||
self.in_attribute = 1
|
||||
self.attribute = Attribute()
|
||||
self.attribute.setType(string.capwords(attrs["type"]))
|
||||
if attrs.has_key('type'):
|
||||
self.in_old_attr = 1
|
||||
self.attribute.setType(string.capwords(attrs["type"]))
|
||||
else:
|
||||
self.in_old_attr = 0
|
||||
self.person.addAttribute(self.attribute)
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
@ -194,9 +205,9 @@ class GrampsParser(handler.ContentHandler):
|
||||
#
|
||||
#---------------------------------------------------------------------
|
||||
def start_people(self,attrs):
|
||||
self.in_family = 0
|
||||
self.in_people = 1
|
||||
self.in_sources = 0
|
||||
self.in_family = 0
|
||||
self.in_people = 1
|
||||
self.in_source = 0
|
||||
if self.is_import == 0 and attrs.has_key("default"):
|
||||
self.tempDefault = int(attrs["default"])
|
||||
|
||||
@ -322,9 +333,9 @@ class GrampsParser(handler.ContentHandler):
|
||||
#
|
||||
#---------------------------------------------------------------------
|
||||
def start_families(self,attrs):
|
||||
self.in_family = 1
|
||||
self.in_people = 0
|
||||
self.in_sources = 0
|
||||
self.in_family = 1
|
||||
self.in_people = 0
|
||||
self.in_source = 0
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
#
|
||||
@ -332,9 +343,9 @@ class GrampsParser(handler.ContentHandler):
|
||||
#
|
||||
#---------------------------------------------------------------------
|
||||
def start_sources(self,attrs):
|
||||
self.in_family = 0
|
||||
self.in_people = 0
|
||||
self.in_sources = 1
|
||||
self.in_family = 0
|
||||
self.in_people = 0
|
||||
self.in_source = 1
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
#
|
||||
@ -342,13 +353,21 @@ class GrampsParser(handler.ContentHandler):
|
||||
#
|
||||
#---------------------------------------------------------------------
|
||||
def start_sourceref(self,attrs):
|
||||
self.source = Source()
|
||||
self.source_ref = SourceRef()
|
||||
self.in_source_ref = 1
|
||||
if self.is_import:
|
||||
self.sourceRef = self.db.findSource(attrs["ref"],self.smap)
|
||||
self.source = self.db.findSource(attrs["ref"],self.smap)
|
||||
else:
|
||||
self.sourceRef = self.db.findSourceNoMap(attrs["ref"])
|
||||
self.source.setBase(self.sourceRef)
|
||||
self.event.setSource(self.source)
|
||||
self.source = self.db.findSourceNoMap(attrs["ref"])
|
||||
self.source_ref.setBase(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):
|
||||
if self.is_import:
|
||||
self.sourceRef = self.db.findSource(attrs["id"],self.smap)
|
||||
self.source = self.db.findSource(attrs["id"],self.smap)
|
||||
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):
|
||||
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)
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
@ -413,6 +451,7 @@ class GrampsParser(handler.ContentHandler):
|
||||
#
|
||||
#---------------------------------------------------------------------
|
||||
def stop_event(self,tag):
|
||||
self.in_event = 0
|
||||
self.event.setName(self.event_type)
|
||||
|
||||
if self.event_type == "Birth":
|
||||
@ -497,7 +536,15 @@ class GrampsParser(handler.ContentHandler):
|
||||
#
|
||||
#---------------------------------------------------------------------
|
||||
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):
|
||||
self.sourceRef.setAuthor(tag)
|
||||
self.source.setAuthor(tag)
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
#
|
||||
@ -515,7 +562,7 @@ class GrampsParser(handler.ContentHandler):
|
||||
def stop_sdate(self,tag):
|
||||
date = Date()
|
||||
date.quick_set(tag)
|
||||
self.source.setDate(date)
|
||||
self.source_ref.setDate(date)
|
||||
|
||||
def stop_street(self,tag):
|
||||
self.address.setStreet(tag)
|
||||
@ -538,7 +585,7 @@ class GrampsParser(handler.ContentHandler):
|
||||
#
|
||||
#---------------------------------------------------------------------
|
||||
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):
|
||||
self.sourceRef.setPubInfo(tag)
|
||||
self.source.setPubInfo(tag)
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
#
|
||||
@ -554,7 +601,7 @@ class GrampsParser(handler.ContentHandler):
|
||||
#
|
||||
#---------------------------------------------------------------------
|
||||
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):
|
||||
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):
|
||||
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):
|
||||
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))
|
||||
elif self.in_family == 1:
|
||||
self.family.setNote(fix_spaces(self.note_list))
|
||||
@ -715,6 +768,8 @@ class GrampsParser(handler.ContentHandler):
|
||||
"address" : (start_address, stop_address),
|
||||
"aka" : (start_name, stop_aka),
|
||||
"attribute" : (start_attribute, stop_attribute),
|
||||
"attr_type" : (None,stop_attr_type),
|
||||
"attr_value" : (None,stop_attr_value),
|
||||
"bookmark" : (start_bmark, None),
|
||||
"bookmarks" : (None, None),
|
||||
"child" : (start_child,None),
|
||||
@ -759,7 +814,7 @@ class GrampsParser(handler.ContentHandler):
|
||||
"scomments" : (None, stop_scomments),
|
||||
"sdate" : (None,stop_sdate),
|
||||
"source" : (start_source, None),
|
||||
"sourceref" : (start_sourceref, None),
|
||||
"sourceref" : (start_sourceref, stop_sourceref),
|
||||
"sources" : (start_sources, None),
|
||||
"spage" : (None, stop_spage),
|
||||
"spubinfo" : (None, stop_spubinfo),
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
import TextDoc
|
||||
import gtk
|
||||
import Config
|
||||
import intl
|
||||
|
||||
_ = intl.gettext
|
||||
@ -39,12 +40,17 @@ paper_sizes = [
|
||||
|
||||
def make_paper_menu(main_menu):
|
||||
|
||||
index = 0
|
||||
myMenu = gtk.GtkMenu()
|
||||
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.show()
|
||||
myMenu.append(menuitem)
|
||||
if name == Config.paper_preference:
|
||||
myMenu.set_active(index)
|
||||
index = index + 1
|
||||
main_menu.set_menu(myMenu)
|
||||
|
||||
def make_orientation_menu(main_menu):
|
||||
|
@ -42,7 +42,6 @@ try:
|
||||
import xml.sax.saxexts
|
||||
sax = 1
|
||||
except:
|
||||
from codecs import *
|
||||
sax = 2
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@ -67,7 +66,8 @@ def importData(database, filename, callback):
|
||||
else:
|
||||
parser = xml.sax.make_parser()
|
||||
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)
|
||||
|
||||
xml_file.close()
|
||||
@ -151,6 +151,9 @@ if __name__ == "__main__":
|
||||
t2 = time.time()
|
||||
print t2 - t1
|
||||
|
||||
for person in db.getPersonMap().values():
|
||||
print person.getPrimaryName().getName()
|
||||
|
||||
|
||||
|
||||
|
||||
|
142
src/RelLib.py
142
src/RelLib.py
@ -21,6 +21,21 @@
|
||||
from Date 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
|
||||
@ -59,6 +74,26 @@ class Attribute:
|
||||
def __init__(self):
|
||||
self.type = ""
|
||||
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):
|
||||
self.type = val
|
||||
@ -85,6 +120,26 @@ class Address:
|
||||
self.country = ""
|
||||
self.postal = ""
|
||||
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):
|
||||
self.date.set(text)
|
||||
@ -228,7 +283,7 @@ class Person:
|
||||
self.addressList = []
|
||||
self.attributeList = []
|
||||
self.urls = []
|
||||
self.note = ""
|
||||
self.note = Note()
|
||||
self.paf_uid = ""
|
||||
|
||||
def setPrimaryName(self,name) :
|
||||
@ -363,10 +418,17 @@ class Person:
|
||||
return self.MainFamily
|
||||
|
||||
def setNote(self,text):
|
||||
self.note = 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
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -380,7 +442,8 @@ class Event:
|
||||
self.date = Date()
|
||||
self.description = ""
|
||||
self.name = ""
|
||||
self.source = None
|
||||
self.source_ref = None
|
||||
self.note = Note()
|
||||
|
||||
def set(self,name,date,place,description):
|
||||
self.name = name
|
||||
@ -406,11 +469,11 @@ class Event:
|
||||
def getName(self) :
|
||||
return self.name
|
||||
|
||||
def setSource(self,id) :
|
||||
self.source = id
|
||||
def setSourceRef(self,id) :
|
||||
self.source_ref = id
|
||||
|
||||
def getSource(self) :
|
||||
return self.source
|
||||
def getSourceRef(self) :
|
||||
return self.source_ref
|
||||
|
||||
def setPlace(self,place) :
|
||||
self.place = place
|
||||
@ -418,6 +481,18 @@ class Event:
|
||||
def getPlace(self) :
|
||||
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) :
|
||||
self.description = description
|
||||
|
||||
@ -456,13 +531,19 @@ class Family:
|
||||
self.EventList = []
|
||||
self.id = -1
|
||||
self.photoList = []
|
||||
self.note = ""
|
||||
self.note = Note()
|
||||
|
||||
def getNote(self):
|
||||
return self.note
|
||||
return self.note.get()
|
||||
|
||||
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) :
|
||||
self.id = id
|
||||
@ -532,13 +613,14 @@ class Family:
|
||||
#
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class SourceBase:
|
||||
class Source:
|
||||
def __init__(self):
|
||||
self.title = ""
|
||||
self.author = ""
|
||||
self.pubinfo = ""
|
||||
self.callno = ""
|
||||
|
||||
self.note = Note()
|
||||
|
||||
def setId(self,newId):
|
||||
self.id = newId
|
||||
|
||||
@ -551,6 +633,18 @@ class SourceBase:
|
||||
def getTitle(self):
|
||||
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):
|
||||
self.author = author
|
||||
|
||||
@ -574,12 +668,12 @@ class SourceBase:
|
||||
#
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class Source:
|
||||
class SourceRef:
|
||||
def __init__(self):
|
||||
self.ref = None
|
||||
self.page = ""
|
||||
self.date = Date()
|
||||
self.comments = ""
|
||||
self.comments = Note()
|
||||
self.text = ""
|
||||
|
||||
def setBase(self,ref):
|
||||
@ -600,21 +694,24 @@ class Source:
|
||||
def getPage(self):
|
||||
return self.page
|
||||
|
||||
def getDate(self):
|
||||
return self.date
|
||||
|
||||
def setText(self,text):
|
||||
self.text = text
|
||||
|
||||
def getText(self):
|
||||
return self.text
|
||||
|
||||
def setComments(self,comments):
|
||||
self.comments = comments
|
||||
def setNoteObj(self,note):
|
||||
self.comments = note
|
||||
|
||||
def getComments(self):
|
||||
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.path = ""
|
||||
|
||||
def getBookmarks(self):
|
||||
return self.bookmarks
|
||||
|
||||
def clean_bookmarks(self):
|
||||
new_bookmarks = []
|
||||
for person in self.bookmarks:
|
||||
@ -748,7 +848,7 @@ class RelDataBase:
|
||||
if map.has_key(idVal):
|
||||
source = self.sourceMap[map[idVal]]
|
||||
else:
|
||||
source = SourceBase()
|
||||
source = Source()
|
||||
map[idVal] = self.addSource(source)
|
||||
return source
|
||||
|
||||
@ -763,7 +863,7 @@ class RelDataBase:
|
||||
if self.sourceMap.has_key(val):
|
||||
source = self.sourceMap[val]
|
||||
else:
|
||||
source = SourceBase()
|
||||
source = Source()
|
||||
self.addSourceNoMap(source,val)
|
||||
return source
|
||||
|
||||
|
259
src/Sources.py
259
src/Sources.py
@ -66,24 +66,22 @@ class SourceEditor:
|
||||
# __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.active_event = active_event
|
||||
self.active_entry = active_entry
|
||||
self.showSource = libglade.GladeXML(const.gladeFile, "sourceDisplay")
|
||||
self.showSource.signal_autoconnect({
|
||||
"on_sourceok_clicked" : on_sourceok_clicked,
|
||||
"on_selectsource_clicked" : on_selectsource_clicked,
|
||||
"destroy_passed_object" : utils.destroy_passed_object
|
||||
})
|
||||
self.sourceDisplay = self.get_widget("sourceDisplay")
|
||||
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.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.draw()
|
||||
self.sourceDisplay.set_data(SOURCEDISP,self)
|
||||
@ -98,34 +96,54 @@ class SourceEditor:
|
||||
return self.showSource.get_widget(name)
|
||||
|
||||
def draw(self):
|
||||
if self.source:
|
||||
self.get_widget("spage").set_text(self.source.getPage())
|
||||
date = self.source.getDate()
|
||||
|
||||
typeMenu = GtkMenu()
|
||||
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:
|
||||
self.get_widget("sdate").set_text(date.getDate())
|
||||
|
||||
text = self.get_widget("stext")
|
||||
text.set_point(0)
|
||||
text.insert_defaults(self.source.getText())
|
||||
text.insert_defaults(self.source_ref.getText())
|
||||
text.set_word_wrap(1)
|
||||
|
||||
scom = self.get_widget("scomment")
|
||||
scom.set_point(0)
|
||||
scom.insert_defaults(self.source.getComments())
|
||||
scom.insert_defaults(self.source_ref.getComments())
|
||||
scom.set_word_wrap(1)
|
||||
|
||||
srcRef = self.source.getBase()
|
||||
self.active_source = srcRef
|
||||
if srcRef:
|
||||
self.title_field.set_text(srcRef.getTitle())
|
||||
self.author_field.set_text(srcRef.getAuthor())
|
||||
self.pub_field.set_text(srcRef.getPubInfo())
|
||||
self.callno_field.set_text(srcRef.getCallNumber())
|
||||
src = self.source_ref.getBase()
|
||||
self.active_source = src
|
||||
if src:
|
||||
self.author_field.set_text(src.getAuthor())
|
||||
self.pub_field.set_text(src.getPubInfo())
|
||||
else:
|
||||
self.title_field.set_text("")
|
||||
self.author_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)
|
||||
|
||||
if src_edit.active_event:
|
||||
current_source = src_edit.active_event.getSource()
|
||||
if current_source == None:
|
||||
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()
|
||||
page = src_edit.get_widget("spage").get_text()
|
||||
date = src_edit.get_widget("sdate").get_text()
|
||||
text = src_edit.get_widget("stext").get_chars(0,-1)
|
||||
comments = src_edit.get_widget("scomment").get_chars(0,-1)
|
||||
|
||||
current_source.setPage(page)
|
||||
current_source.getDate().set(date)
|
||||
current_source.setText(text)
|
||||
current_source.setComments(comments)
|
||||
current_source_ref = src_edit.active_entry.getSourceRef()
|
||||
if src_edit.active_source != current_source_ref.getBase():
|
||||
src_edit.active_entry.getSourceRef().setBase(src_edit.active_source)
|
||||
utils.modified()
|
||||
|
||||
page = src_edit.get_widget("spage").get_text()
|
||||
date = src_edit.get_widget("sdate").get_text()
|
||||
text = src_edit.get_widget("stext").get_chars(0,-1)
|
||||
comments = src_edit.get_widget("scomment").get_chars(0,-1)
|
||||
|
||||
current_source_ref.setPage(page)
|
||||
current_source_ref.getDate().set(date)
|
||||
current_source_ref.setText(text)
|
||||
current_source_ref.setComments(comments)
|
||||
utils.modified()
|
||||
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)
|
||||
SourceChoose(src_edit)
|
||||
src_entry = obj.get_data("o")
|
||||
src_entry.active_source = obj.get_data("s")
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
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())
|
||||
if src_entry.active_source == None:
|
||||
src_entry.author_field.set_text("")
|
||||
src_entry.pub_field.set_text("")
|
||||
else:
|
||||
src_obj.title_field.set_text("")
|
||||
src_obj.author_field.set_text("")
|
||||
src_obj.pub_field.set_text("")
|
||||
src_obj.callno_field.set_text("")
|
||||
src_entry.author_field.set_text(src_entry.active_source.getAuthor())
|
||||
src_entry.pub_field.set_text(src_entry.active_source.getPubInfo())
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
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"))
|
||||
|
||||
|
@ -97,24 +97,34 @@ def dump_my_event(g,name,event):
|
||||
write_line(g,"date",date)
|
||||
write_line(g,"place",place)
|
||||
write_line(g,"description",description)
|
||||
source = event.getSource()
|
||||
if source:
|
||||
sourceRef = source.getBase()
|
||||
if sourceRef:
|
||||
p = source.getPage()
|
||||
c = source.getComments()
|
||||
t = source.getText()
|
||||
d = source.getDate().getSaveDate()
|
||||
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:
|
||||
p = source_ref.getPage()
|
||||
c = source_ref.getComments()
|
||||
t = source_ref.getText()
|
||||
d = source_ref.getDate().getSaveDate()
|
||||
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:
|
||||
g.write("<sourceref ref=\"%d\">\n" % sourceRef.getId())
|
||||
g.write("<sourceref ref=\"%d\">\n" % source.getId())
|
||||
write_line(g,"spage",p)
|
||||
writeNote(g,"scomments",c)
|
||||
writeNote(g,"stext",t)
|
||||
write_line(g,"sdate",c)
|
||||
g.write("</sourceref>\n")
|
||||
g.write("</event>\n")
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -263,15 +273,26 @@ def exportData(database, filename, callback):
|
||||
write_line(g,"state",address.getState())
|
||||
write_line(g,"country",address.getCountry())
|
||||
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('</addresses>\n')
|
||||
|
||||
if len(person.getAttributeList()) > 0:
|
||||
g.write("<attributes>\n")
|
||||
for attr in person.getAttributeList():
|
||||
g.write('<attribute type="%s">' % attr.getType())
|
||||
g.write(fix(attr.getValue()))
|
||||
g.write('</attribute>\n')
|
||||
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(fix(attr.getValue()))
|
||||
g.write('</attribute>\n')
|
||||
g.write('</attributes>\n')
|
||||
|
||||
if len(person.getUrlList()) > 0:
|
||||
@ -335,12 +356,14 @@ def exportData(database, filename, callback):
|
||||
write_line(g,"sauthor",source.getAuthor())
|
||||
write_line(g,"spubinfo",source.getPubInfo())
|
||||
write_line(g,"scallno",source.getCallNumber())
|
||||
if source.getNote() != "":
|
||||
writeNote(g,"note",source.getNote())
|
||||
g.write("</source>\n")
|
||||
g.write("</sources>\n")
|
||||
|
||||
if len(db.bookmarks) > 0:
|
||||
if len(db.getBookmarks()) > 0:
|
||||
g.write("<bookmarks>\n")
|
||||
for person in db.bookmarks:
|
||||
for person in db.getBookmarks():
|
||||
g.write("<bookmark ref=\"" + str(person.getId()) + "\"/>\n")
|
||||
g.write("</bookmarks>\n")
|
||||
|
||||
|
416
src/config.glade
416
src/config.glade
@ -250,7 +250,7 @@
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>label199</name>
|
||||
<label>Date Format : </label>
|
||||
<label>Date Format</label>
|
||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>1</xalign>
|
||||
@ -276,7 +276,7 @@
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>label200</name>
|
||||
<label>Name Format : </label>
|
||||
<label>Name Format</label>
|
||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>1</xalign>
|
||||
@ -303,7 +303,8 @@
|
||||
<class>GtkOptionMenu</class>
|
||||
<name>date_format</name>
|
||||
<can_focus>True</can_focus>
|
||||
<items></items>
|
||||
<items>
|
||||
</items>
|
||||
<initial_choice>0</initial_choice>
|
||||
<child>
|
||||
<left_attach>1</left_attach>
|
||||
@ -325,7 +326,8 @@
|
||||
<class>GtkOptionMenu</class>
|
||||
<name>name_format</name>
|
||||
<can_focus>True</can_focus>
|
||||
<items></items>
|
||||
<items>
|
||||
</items>
|
||||
<initial_choice>0</initial_choice>
|
||||
<child>
|
||||
<left_attach>1</left_attach>
|
||||
@ -369,7 +371,7 @@
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>label201</name>
|
||||
<label>Date Format : </label>
|
||||
<label>Date Format</label>
|
||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>1</xalign>
|
||||
@ -396,7 +398,8 @@
|
||||
<class>GtkOptionMenu</class>
|
||||
<name>date_entry_format</name>
|
||||
<can_focus>True</can_focus>
|
||||
<items></items>
|
||||
<items>
|
||||
</items>
|
||||
<initial_choice>0</initial_choice>
|
||||
<child>
|
||||
<left_attach>1</left_attach>
|
||||
@ -433,41 +436,12 @@
|
||||
<widget>
|
||||
<class>GtkTable</class>
|
||||
<name>table21</name>
|
||||
<rows>2</rows>
|
||||
<columns>1</columns>
|
||||
<rows>1</rows>
|
||||
<columns>2</columns>
|
||||
<homogeneous>False</homogeneous>
|
||||
<row_spacing>0</row_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>
|
||||
<class>GtkFrame</class>
|
||||
<name>frame4</name>
|
||||
@ -477,8 +451,8 @@
|
||||
<child>
|
||||
<left_attach>0</left_attach>
|
||||
<right_attach>1</right_attach>
|
||||
<top_attach>1</top_attach>
|
||||
<bottom_attach>2</bottom_attach>
|
||||
<top_attach>0</top_attach>
|
||||
<bottom_attach>1</bottom_attach>
|
||||
<xpad>5</xpad>
|
||||
<ypad>5</ypad>
|
||||
<xexpand>False</xexpand>
|
||||
@ -492,7 +466,7 @@
|
||||
<widget>
|
||||
<class>GtkTable</class>
|
||||
<name>table22</name>
|
||||
<rows>4</rows>
|
||||
<rows>5</rows>
|
||||
<columns>2</columns>
|
||||
<homogeneous>False</homogeneous>
|
||||
<row_spacing>0</row_spacing>
|
||||
@ -514,8 +488,8 @@
|
||||
<child>
|
||||
<left_attach>1</left_attach>
|
||||
<right_attach>2</right_attach>
|
||||
<top_attach>0</top_attach>
|
||||
<bottom_attach>1</bottom_attach>
|
||||
<top_attach>1</top_attach>
|
||||
<bottom_attach>2</bottom_attach>
|
||||
<xpad>5</xpad>
|
||||
<ypad>5</ypad>
|
||||
<xexpand>False</xexpand>
|
||||
@ -543,8 +517,8 @@
|
||||
<child>
|
||||
<left_attach>1</left_attach>
|
||||
<right_attach>2</right_attach>
|
||||
<top_attach>1</top_attach>
|
||||
<bottom_attach>2</bottom_attach>
|
||||
<top_attach>2</top_attach>
|
||||
<bottom_attach>3</bottom_attach>
|
||||
<xpad>5</xpad>
|
||||
<ypad>5</ypad>
|
||||
<xexpand>False</xexpand>
|
||||
@ -572,8 +546,8 @@
|
||||
<child>
|
||||
<left_attach>1</left_attach>
|
||||
<right_attach>2</right_attach>
|
||||
<top_attach>2</top_attach>
|
||||
<bottom_attach>3</bottom_attach>
|
||||
<top_attach>3</top_attach>
|
||||
<bottom_attach>4</bottom_attach>
|
||||
<xpad>5</xpad>
|
||||
<ypad>5</ypad>
|
||||
<xexpand>False</xexpand>
|
||||
@ -601,8 +575,8 @@
|
||||
<child>
|
||||
<left_attach>1</left_attach>
|
||||
<right_attach>2</right_attach>
|
||||
<top_attach>3</top_attach>
|
||||
<bottom_attach>4</bottom_attach>
|
||||
<top_attach>4</top_attach>
|
||||
<bottom_attach>5</bottom_attach>
|
||||
<xpad>5</xpad>
|
||||
<ypad>5</ypad>
|
||||
<xexpand>False</xexpand>
|
||||
@ -617,33 +591,7 @@
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>label195</name>
|
||||
<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>
|
||||
<label>Odd Row Foreground</label>
|
||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>1</xalign>
|
||||
@ -661,15 +609,15 @@
|
||||
<yexpand>False</yexpand>
|
||||
<xshrink>False</xshrink>
|
||||
<yshrink>False</yshrink>
|
||||
<xfill>False</xfill>
|
||||
<xfill>True</xfill>
|
||||
<yfill>False</yfill>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>label197</name>
|
||||
<label>Even Row Foreground : </label>
|
||||
<name>label196</name>
|
||||
<label>Odd Row Background</label>
|
||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>1</xalign>
|
||||
@ -687,15 +635,15 @@
|
||||
<yexpand>False</yexpand>
|
||||
<xshrink>False</xshrink>
|
||||
<yshrink>False</yshrink>
|
||||
<xfill>False</xfill>
|
||||
<xfill>True</xfill>
|
||||
<yfill>False</yfill>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>label198</name>
|
||||
<label>Even Row Background : </label>
|
||||
<name>label197</name>
|
||||
<label>Even Row Foreground</label>
|
||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>1</xalign>
|
||||
@ -713,10 +661,157 @@
|
||||
<yexpand>False</yexpand>
|
||||
<xshrink>False</xshrink>
|
||||
<yshrink>False</yshrink>
|
||||
<xfill>False</xfill>
|
||||
<xfill>True</xfill>
|
||||
<yfill>False</yfill>
|
||||
</child>
|
||||
</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>
|
||||
@ -938,7 +1033,7 @@
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>label143</name>
|
||||
<label>Name :</label>
|
||||
<label>Name</label>
|
||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>1</xalign>
|
||||
@ -950,7 +1045,7 @@
|
||||
<right_attach>1</right_attach>
|
||||
<top_attach>0</top_attach>
|
||||
<bottom_attach>1</bottom_attach>
|
||||
<xpad>0</xpad>
|
||||
<xpad>5</xpad>
|
||||
<ypad>0</ypad>
|
||||
<xexpand>False</xexpand>
|
||||
<yexpand>False</yexpand>
|
||||
@ -964,7 +1059,7 @@
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>label144</name>
|
||||
<label>Address :</label>
|
||||
<label>Address</label>
|
||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>1</xalign>
|
||||
@ -976,7 +1071,7 @@
|
||||
<right_attach>1</right_attach>
|
||||
<top_attach>1</top_attach>
|
||||
<bottom_attach>2</bottom_attach>
|
||||
<xpad>0</xpad>
|
||||
<xpad>5</xpad>
|
||||
<ypad>0</ypad>
|
||||
<xexpand>False</xexpand>
|
||||
<yexpand>False</yexpand>
|
||||
@ -990,7 +1085,7 @@
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>label145</name>
|
||||
<label>City :</label>
|
||||
<label>City</label>
|
||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>1</xalign>
|
||||
@ -1002,7 +1097,7 @@
|
||||
<right_attach>1</right_attach>
|
||||
<top_attach>2</top_attach>
|
||||
<bottom_attach>3</bottom_attach>
|
||||
<xpad>0</xpad>
|
||||
<xpad>5</xpad>
|
||||
<ypad>0</ypad>
|
||||
<xexpand>False</xexpand>
|
||||
<yexpand>False</yexpand>
|
||||
@ -1016,7 +1111,7 @@
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>label146</name>
|
||||
<label>State/Province :</label>
|
||||
<label>State/Province</label>
|
||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>1</xalign>
|
||||
@ -1028,7 +1123,7 @@
|
||||
<right_attach>1</right_attach>
|
||||
<top_attach>3</top_attach>
|
||||
<bottom_attach>4</bottom_attach>
|
||||
<xpad>0</xpad>
|
||||
<xpad>5</xpad>
|
||||
<ypad>0</ypad>
|
||||
<xexpand>False</xexpand>
|
||||
<yexpand>False</yexpand>
|
||||
@ -1042,7 +1137,7 @@
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>label147</name>
|
||||
<label>Country :</label>
|
||||
<label>Country</label>
|
||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>1</xalign>
|
||||
@ -1054,7 +1149,7 @@
|
||||
<right_attach>1</right_attach>
|
||||
<top_attach>4</top_attach>
|
||||
<bottom_attach>5</bottom_attach>
|
||||
<xpad>0</xpad>
|
||||
<xpad>5</xpad>
|
||||
<ypad>0</ypad>
|
||||
<xexpand>False</xexpand>
|
||||
<yexpand>False</yexpand>
|
||||
@ -1068,7 +1163,7 @@
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>label148</name>
|
||||
<label>Zip/Postal Code :</label>
|
||||
<label>Zip/Postal Code</label>
|
||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>1</xalign>
|
||||
@ -1080,7 +1175,7 @@
|
||||
<right_attach>1</right_attach>
|
||||
<top_attach>5</top_attach>
|
||||
<bottom_attach>6</bottom_attach>
|
||||
<xpad>0</xpad>
|
||||
<xpad>5</xpad>
|
||||
<ypad>0</ypad>
|
||||
<xexpand>False</xexpand>
|
||||
<yexpand>False</yexpand>
|
||||
@ -1094,7 +1189,7 @@
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>label149</name>
|
||||
<label>Phone :</label>
|
||||
<label>Phone</label>
|
||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>1</xalign>
|
||||
@ -1106,7 +1201,7 @@
|
||||
<right_attach>1</right_attach>
|
||||
<top_attach>6</top_attach>
|
||||
<bottom_attach>7</bottom_attach>
|
||||
<xpad>0</xpad>
|
||||
<xpad>5</xpad>
|
||||
<ypad>0</ypad>
|
||||
<xexpand>False</xexpand>
|
||||
<yexpand>False</yexpand>
|
||||
@ -1120,7 +1215,7 @@
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>label150</name>
|
||||
<label>email :</label>
|
||||
<label>email</label>
|
||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>1</xalign>
|
||||
@ -1132,7 +1227,7 @@
|
||||
<right_attach>1</right_attach>
|
||||
<top_attach>7</top_attach>
|
||||
<bottom_attach>8</bottom_attach>
|
||||
<xpad>0</xpad>
|
||||
<xpad>5</xpad>
|
||||
<ypad>0</ypad>
|
||||
<xexpand>False</xexpand>
|
||||
<yexpand>False</yexpand>
|
||||
@ -1156,6 +1251,131 @@
|
||||
<xpad>0</xpad>
|
||||
<ypad>0</ypad>
|
||||
</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>
|
||||
|
||||
|
@ -54,6 +54,7 @@ marriageFile = rootDir + os.sep + "marriage.glade"
|
||||
editPersonFile = rootDir + os.sep + "EditPerson.glade"
|
||||
bookFile = rootDir + os.sep + "bookmarks.glade"
|
||||
pluginsFile = rootDir + os.sep + "plugins.glade"
|
||||
notesFile = rootDir + os.sep + "editnote.glade"
|
||||
|
||||
configFile = rootDir + os.sep + "config.glade"
|
||||
pluginsDir = rootDir + os.sep + "plugins"
|
||||
@ -67,7 +68,7 @@ gtkrcFile = rootDir + os.sep + "gtkrc"
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
progName = "gramps"
|
||||
version = "0.1.5"
|
||||
version = "0.2.0pre"
|
||||
copyright = "(C) 2001 Donald N. Allingham"
|
||||
authors = ["Donald N. Allingham"]
|
||||
comments = _("Gramps (Genealogical Research and Analysis Management ") +\
|
||||
@ -98,6 +99,9 @@ helpMenu = "contents.html"
|
||||
# Constants
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
output_formats = ["OpenOffice", "AbiWord", "PDF", "HTML" ]
|
||||
|
||||
childRelations = [
|
||||
"Biological",
|
||||
"Adopted",
|
||||
|
911
src/gramps.glade
911
src/gramps.glade
File diff suppressed because it is too large
Load Diff
@ -100,6 +100,7 @@ topWindow = None
|
||||
statusbar = None
|
||||
Main = None
|
||||
person_list = None
|
||||
source_list = None
|
||||
database = None
|
||||
family_window = None
|
||||
queryTop = None
|
||||
@ -146,6 +147,16 @@ def deathday(person):
|
||||
return person.getDeath().getQuoteDate()
|
||||
else:
|
||||
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)
|
||||
person_list.clear()
|
||||
load_family()
|
||||
load_sources()
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -594,9 +606,113 @@ def update_display(changed):
|
||||
goto_active_person()
|
||||
elif page == 1:
|
||||
load_family()
|
||||
elif page == 3:
|
||||
load_sources()
|
||||
else:
|
||||
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():
|
||||
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.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
|
||||
@ -1284,16 +1415,18 @@ def on_pedegree1_activate(obj):
|
||||
def on_notebook1_switch_page(obj,junk,page):
|
||||
if not active_person:
|
||||
return
|
||||
if (page == 0):
|
||||
if page == 0:
|
||||
if id2col.has_key(active_person):
|
||||
column = id2col[active_person]
|
||||
person_list.select_row(column,0)
|
||||
person_list.moveto(column,0)
|
||||
elif (page == 1):
|
||||
elif page == 1:
|
||||
load_family()
|
||||
elif (page == 2):
|
||||
elif page == 2:
|
||||
load_tree()
|
||||
|
||||
elif page == 3:
|
||||
load_sources()
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
@ -1797,7 +1930,7 @@ def setup_bookmarks():
|
||||
|
||||
menu = Main.get_widget("jump_to")
|
||||
person_map = database.getPersonMap()
|
||||
bookmarks = Bookmarks.Bookmarks(database.bookmarks,person_map,\
|
||||
bookmarks = Bookmarks.Bookmarks(database.getBookmarks(),person_map,\
|
||||
menu,bookmark_callback)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@ -1989,7 +2122,7 @@ def on_preferences_activate(obj):
|
||||
def main(arg):
|
||||
global database, Main
|
||||
global statusbar
|
||||
global person_list, pv
|
||||
global person_list, source_list, pv
|
||||
global topWindow
|
||||
|
||||
import ReadXML
|
||||
@ -2008,6 +2141,7 @@ def main(arg):
|
||||
topWindow = Main.get_widget("gramps")
|
||||
statusbar = Main.get_widget("statusbar")
|
||||
person_list = Main.get_widget("person_list")
|
||||
source_list = Main.get_widget("source_list")
|
||||
filter_list = Main.get_widget("filter_list")
|
||||
|
||||
myMenu = GtkMenu()
|
||||
@ -2035,6 +2169,7 @@ def main(arg):
|
||||
"on_reports_clicked" : on_reports_clicked,
|
||||
"on_person_list1_activate": on_person_list1_activate,
|
||||
"on_family1_activate" : on_family1_activate,
|
||||
"on_sources_activate" : on_sources_activate,
|
||||
"on_pedegree1_activate" : on_pedegree1_activate,
|
||||
"on_notebook1_switch_page": on_notebook1_switch_page,
|
||||
"on_ok_button1_clicked": on_ok_button1_clicked,
|
||||
@ -2077,6 +2212,12 @@ def main(arg):
|
||||
"on_edit_mother_clicked" : on_edit_mother_clicked,
|
||||
"on_exit_activate" : on_exit_activate,
|
||||
"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
|
||||
})
|
||||
|
||||
|
@ -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
|
||||
|
||||
@ -26,9 +45,8 @@ try:
|
||||
except:
|
||||
|
||||
def utf8_to_latin(s):
|
||||
return s
|
||||
return s.encode('latin-1')
|
||||
|
||||
def latin_to_utf8(s):
|
||||
return s
|
||||
|
||||
return s.encode('utf-8')
|
||||
|
||||
|
@ -293,8 +293,16 @@ class IndivSummary:
|
||||
|
||||
family = self.person.getMainFamily()
|
||||
if family:
|
||||
father = family.getFather().getPrimaryName().getRegularName()
|
||||
mother = family.getMother().getPrimaryName().getRegularName()
|
||||
father_inst = family.getFather()
|
||||
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:
|
||||
father = ""
|
||||
mother = ""
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -26,6 +26,8 @@ import string
|
||||
import time
|
||||
import const
|
||||
import utils
|
||||
import intl
|
||||
_ = intl.gettext
|
||||
|
||||
from gtk import *
|
||||
from gnome.ui import *
|
||||
@ -192,9 +194,9 @@ def add_persons_sources(person):
|
||||
if person.getDeath():
|
||||
elist.append(person.getDeath())
|
||||
for event in elist:
|
||||
source = event.getSource()
|
||||
if source != None:
|
||||
source_list.append(source)
|
||||
source_ref = event.getSourceRef()
|
||||
if source_ref != None:
|
||||
source_list.append(source_ref)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -208,9 +210,9 @@ def add_familys_sources(family):
|
||||
if family.getDivorce():
|
||||
elist.append(family.getDivorce())
|
||||
for event in elist:
|
||||
source = event.getSource()
|
||||
if source != None:
|
||||
source_list.append(source)
|
||||
source_ref = event.getSourceRef()
|
||||
if source_ref != None:
|
||||
source_list.append(source_ref)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -233,6 +233,26 @@
|
||||
</child>
|
||||
</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>
|
||||
<class>GtkRadioButton</class>
|
||||
<name>pdf</name>
|
||||
|
Loading…
x
Reference in New Issue
Block a user