* src/AddrEdit.py: use new label scheme for tabs that uses an

icon to indicate used tabs
* src/AttrEdit.py: use new label scheme for tabs that uses an
icon to indicate used tabs
* src/NameEdit.py: use new label scheme for tabs
* src/Date.py: incorporate instance check form gramps20 branch
* src/EditPerson.py: add additional fields for name edit, handle
lds page better, adapt to new label scheme
* src/GrampsDbBase.py: fix typos
* src/GrampsGEDDB.py: fix undo handling
* src/GrampsInMemDB.py: fix undo handling
* src/GrampsXMLDB.py: fix undo handling
* src/PeopleView.py: don't reselect an already selected person
* src/Utils.py: new tab scheme
* src/edit_person.glade new tab scheme
* src/gramps_main.py: 1->True, 0->False replacements
* src/DbPrompter.py: bring up to date with gramps20 branch
* src/DisplayModels.py: bring up to date with gramps20 branch
* src/ReadGedcom.py: bring up to date with gramps20 branch
* src/Relationship.py: bring up to date with gramps20 branch


svn: r4406
This commit is contained in:
Don Allingham 2005-04-23 15:53:30 +00:00
parent 1153713d67
commit 5c137d199c
22 changed files with 3111 additions and 436 deletions

View File

@ -1,3 +1,25 @@
2005-04-23 Don Allingham <don@gramps-project.org>
* src/AddrEdit.py: use new label scheme for tabs that uses an
icon to indicate used tabs
* src/AttrEdit.py: use new label scheme for tabs that uses an
icon to indicate used tabs
* src/NameEdit.py: use new label scheme for tabs
* src/Date.py: incorporate instance check form gramps20 branch
* src/EditPerson.py: add additional fields for name edit, handle
lds page better, adapt to new label scheme
* src/GrampsDbBase.py: fix typos
* src/GrampsGEDDB.py: fix undo handling
* src/GrampsInMemDB.py: fix undo handling
* src/GrampsXMLDB.py: fix undo handling
* src/PeopleView.py: don't reselect an already selected person
* src/Utils.py: new tab scheme
* src/edit_person.glade new tab scheme
* src/gramps_main.py: 1->True, 0->False replacements
* src/DbPrompter.py: bring up to date with gramps20 branch
* src/DisplayModels.py: bring up to date with gramps20 branch
* src/ReadGedcom.py: bring up to date with gramps20 branch
* src/Relationship.py: bring up to date with gramps20 branch
2005-04-23 Martin Hawlisch <Martin.Hawlisch@gmx.de> 2005-04-23 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/GrampsDbBase.py (_find_from_handle,find_object_from_handle, * src/GrampsDbBase.py (_find_from_handle,find_object_from_handle,
find_place_from_handle): Fix typo find_place_from_handle): Fix typo

Binary file not shown.

View File

@ -96,8 +96,9 @@ class AddressEditor:
self.note_field = self.top.get_widget("addr_note") self.note_field = self.top.get_widget("addr_note")
self.priv = self.top.get_widget("priv") self.priv = self.top.get_widget("priv")
self.slist = self.top.get_widget("slist") self.slist = self.top.get_widget("slist")
self.sources_label = self.top.get_widget("sourcesAddr") self.sources_label = self.top.get_widget("sources_tab")
self.notes_label = self.top.get_widget("noteAddr") self.notes_label = self.top.get_widget("note_tab")
self.general_label = self.top.get_widget("general_tab")
self.flowed = self.top.get_widget("addr_flowed") self.flowed = self.top.get_widget("addr_flowed")
self.preform = self.top.get_widget("addr_preform") self.preform = self.top.get_widget("addr_preform")
@ -123,9 +124,15 @@ class AddressEditor:
self.preform.set_active(1) self.preform.set_active(1)
else: else:
self.flowed.set_active(1) self.flowed.set_active(1)
Utils.bold_label(self.general_label)
else: else:
Utils.unbold_label(self.sources_label)
Utils.bold_label(self.general_label)
else:
Utils.unbold_label(self.general_label)
self.addr_date_obj = Date.Date() self.addr_date_obj = Date.Date()
self.srcreflist = [] self.srcreflist = []
self.switch_page()
self.sourcetab = Sources.SourceTab( self.sourcetab = Sources.SourceTab(
self.srcreflist, self, self.top, self.window, self.slist, self.srcreflist, self, self.top, self.window, self.slist,
@ -240,8 +247,13 @@ class AddressEditor:
self.check(self.addr.get_privacy,self.addr.set_privacy,priv) self.check(self.addr.get_privacy,self.addr.set_privacy,priv)
def on_switch_page(self,obj,a,page): def on_switch_page(self,obj,a,page):
self.switch_page()
def switch_page(self):
buf = self.note_field.get_buffer() buf = self.note_field.get_buffer()
text = unicode(buf.get_text(buf.get_start_iter(),buf.get_end_iter(),False)) start = buf.get_start_iter()
stop = buf.get_end_iter()
text = unicode(buf.get_text(start,stop,False))
if text: if text:
Utils.bold_label(self.notes_label) Utils.bold_label(self.notes_label)
else: else:

View File

@ -98,8 +98,9 @@ class AttributeEditor:
self.type_field = self.attrib_menu.child self.type_field = self.attrib_menu.child
self.source_field = self.top.get_widget("attr_source") self.source_field = self.top.get_widget("attr_source")
self.priv = self.top.get_widget("priv") self.priv = self.top.get_widget("priv")
self.sources_label = self.top.get_widget("sourcesAttr") self.general_label = self.top.get_widget("general_tab")
self.notes_label = self.top.get_widget("noteAttr") self.sources_label = self.top.get_widget("sources_tab")
self.notes_label = self.top.get_widget("note_tab")
self.flowed = self.top.get_widget("attr_flowed") self.flowed = self.top.get_widget("attr_flowed")
self.preform = self.top.get_widget("attr_preform") self.preform = self.top.get_widget("attr_preform")
@ -133,9 +134,11 @@ class AttributeEditor:
self.note_field.get_buffer().set_text(attrib.get_note()) self.note_field.get_buffer().set_text(attrib.get_note())
Utils.bold_label(self.notes_label) Utils.bold_label(self.notes_label)
if attrib.get_note_format() == 1: if attrib.get_note_format() == 1:
self.preform.set_active(1) self.preform.set_active(True)
else: else:
self.flowed.set_active(1) self.flowed.set_active(True)
else:
Utils.unbold_label(self.notes_label)
self.top.signal_autoconnect({ self.top.signal_autoconnect({
"on_help_attr_clicked" : self.on_help_clicked, "on_help_attr_clicked" : self.on_help_clicked,
@ -148,6 +151,7 @@ class AttributeEditor:
if parent_window: if parent_window:
self.window.set_transient_for(parent_window) self.window.set_transient_for(parent_window)
self.add_itself_to_menu() self.add_itself_to_menu()
self.update_note_page()
self.window.show() self.window.show()
def on_delete_event(self,obj,b): def on_delete_event(self,obj,b):
@ -242,8 +246,13 @@ class AttributeEditor:
self.check(self.attrib.get_privacy,self.attrib.set_privacy,priv) self.check(self.attrib.get_privacy,self.attrib.set_privacy,priv)
def on_switch_page(self,obj,a,page): def on_switch_page(self,obj,a,page):
self.update_note_page()
def update_note_page(self):
buf = self.note_field.get_buffer() buf = self.note_field.get_buffer()
text = unicode(buf.get_text(buf.get_start_iter(),buf.get_end_iter(),False)) start = buf.get_start_iter()
end = buf.get_end_iter()
text = unicode(buf.get_text(start,end,False))
if text: if text:
Utils.bold_label(self.notes_label) Utils.bold_label(self.notes_label)
else: else:

View File

@ -135,7 +135,10 @@ class Date:
Comparison function. Allows the usage of equality tests. Comparison function. Allows the usage of equality tests.
This allows you do run statements like 'date1 <= date2' This allows you do run statements like 'date1 <= date2'
""" """
if isinstance(other,Date):
return cmp(self.sortval,other.sortval) return cmp(self.sortval,other.sortval)
else:
return -1
def is_equal(self,other): def is_equal(self,other):
""" """

View File

@ -297,7 +297,13 @@ class ImportDbPrompter:
filename = choose.get_filename() filename = choose.get_filename()
filetype = type_selector.get_value() filetype = type_selector.get_value()
if filetype == 'auto': if filetype == 'auto':
try:
filetype = get_mime_type(filename) filetype = get_mime_type(filename)
except RuntimeError,msg:
QuestionDialog.ErrorDialog(
_("Could not open file: %s") % filename,
str(msg))
return False
if filetype == const.app_gramps: if filetype == const.app_gramps:
choose.destroy() choose.destroy()

View File

@ -111,7 +111,7 @@ class BaseModel(gtk.GenericTreeModel):
def on_get_path(self, node): def on_get_path(self, node):
'''returns the tree path (a tuple of indices at the various '''returns the tree path (a tuple of indices at the various
levels) for a particular node.''' levels) for a particular node.'''
return self.indexlist[node[0]] return self.indexlist[node]
def on_get_column_type(self,index): def on_get_column_type(self,index):
return gobject.TYPE_STRING return gobject.TYPE_STRING

View File

@ -85,6 +85,15 @@ class DisplayTrace:
msg.write("Python : %s.%s.%s %s\n" % (ver[0],ver[1],ver[2],ver[3])) msg.write("Python : %s.%s.%s %s\n" % (ver[0],ver[1],ver[2],ver[3]))
msg.write("GTK : %s.%s.%s\n" % gtk.gtk_version) msg.write("GTK : %s.%s.%s\n" % gtk.gtk_version)
msg.write('PyGTK : %d.%d.%d\n' % gtk.pygtk_version) msg.write('PyGTK : %d.%d.%d\n' % gtk.pygtk_version)
n = '/etc/lsb-release'
if os.path.isfile(n):
f = open(n)
for line in f.readlines():
(val,text) = line.split('=')
if val == "DISTRIB_DESCRIPTION":
msg.write("OS : %s\n" % text.replace('"',''))
f.close()
else:
for n in _release_files: for n in _release_files:
if os.path.isfile(n): if os.path.isfile(n):
try: try:

View File

@ -128,8 +128,8 @@ class EditPerson:
mod = not self.db.readonly mod = not self.db.readonly
self.load_obj = None self.load_obj = None
self.top = gtk.glade.XML(const.editPersonFile, "editPerson","gramps") self.top = gtk.glade.XML(const.editPersonFile, "edit_person","gramps")
self.window = self.get_widget("editPerson") self.window = self.get_widget("edit_person")
self.window.set_title("%s - GRAMPS" % _('Edit Person')) self.window.set_title("%s - GRAMPS" % _('Edit Person'))
self.icon_list = self.top.get_widget("iconlist") self.icon_list = self.top.get_widget("iconlist")
@ -211,12 +211,12 @@ class EditPerson:
self.gid = self.get_widget("gid") self.gid = self.get_widget("gid")
self.gid.set_editable(mod) self.gid.set_editable(mod)
self.slist = self.get_widget("slist") self.slist = self.get_widget("slist")
self.general_label = self.get_widget("general_label")
self.names_label = self.get_widget("names_label") self.names_label = self.get_widget("names_label")
self.attr_label = self.get_widget("attr_label") self.attr_label = self.get_widget("attr_label")
self.addr_label = self.get_widget("addr_label") self.addr_label = self.get_widget("addr_label")
self.notes_label = self.get_widget("notes_label") self.notes_label = self.get_widget("notes_label")
self.sources_label = self.get_widget("sources_label") self.sources_label = self.get_widget("sources_label")
self.events_label = self.get_widget("events_label")
self.inet_label = self.get_widget("inet_label") self.inet_label = self.get_widget("inet_label")
self.gallery_label = self.get_widget("gallery_label") self.gallery_label = self.get_widget("gallery_label")
self.lds_tab = self.get_widget("lds_tab") self.lds_tab = self.get_widget("lds_tab")
@ -264,29 +264,33 @@ class EditPerson:
else: else:
self.srcreflist = [] self.srcreflist = []
#Utils.bold_label(self.general_label) if self.event_list:
#if self.srcreflist: Utils.bold_label(self.events_label)
# Utils.bold_label(self.sources_label) if self.srcreflist:
#if self.nlist: Utils.bold_label(self.sources_label)
# Utils.bold_label(self.names_label) if self.nlist:
#if self.alist: Utils.bold_label(self.names_label)
# Utils.bold_label(self.attr_label) if self.alist:
#if self.ulist: Utils.bold_label(self.attr_label)
# Utils.bold_label(self.inet_label) if self.ulist:
#if self.plist: Utils.bold_label(self.inet_label)
# Utils.bold_label(self.addr_label) if self.plist:
#if self.person.get_media_list(): Utils.bold_label(self.addr_label)
# Utils.bold_label(self.gallery_label) if self.person.get_media_list():
Utils.bold_label(self.gallery_label)
# event display # event display
event_default = [ 'Event', 'Description', 'Date', 'Place' ] event_default = [ 'Event', 'Description', 'Date', 'Place',
'Source', 'Note' ]
self.event_trans = TransTable.TransTable(event_default) self.event_trans = TransTable.TransTable(event_default)
evalues = { evalues = {
'Event' : (_('Event'),-1,150), 'Event' : (_('Event'),-1,125),
'Description' : (_('Description'),-1,150), 'Description' : (_('Description'),-1,150),
'Date' : (_('Date'),-1,100), 'Date' : (_('Date'),-1,100),
'Place' : (_('Place'),-1,100) 'Place' : (_('Place'),-1,100),
'Source' : (_(':Source'),-1,50),
'Note' : (_(':Note'),-1,50)
} }
if not self.db.readonly: if not self.db.readonly:
@ -315,7 +319,9 @@ class EditPerson:
self.on_update_addr_clicked) self.on_update_addr_clicked)
# name display # name display
ntitles = [(_('Name'),-1,250),(_('Type'),-1,100)] ntitles = [(_('Family Name'),-1,250),(_('Prefix'),-1,50),
(_('Given Name'),-1,200),(_('Suffix'),-1,50),
(_('Type'),-1,100)]
self.ntree = ListModel.ListModel(self.name_list,ntitles, self.ntree = ListModel.ListModel(self.name_list,ntitles,
self.on_name_select_row) self.on_name_select_row)
self.ntree.tree.connect('event',self.aka_double_click) self.ntree.tree.connect('event',self.aka_double_click)
@ -340,16 +346,12 @@ class EditPerson:
self.lds_endowment = RelLib.LdsOrd(self.person.get_lds_endowment()) self.lds_endowment = RelLib.LdsOrd(self.person.get_lds_endowment())
self.lds_sealing = RelLib.LdsOrd(self.person.get_lds_sealing()) self.lds_sealing = RelLib.LdsOrd(self.person.get_lds_sealing())
if GrampsKeys.get_uselds() \
or (not self.lds_baptism.is_empty()) \
or (not self.lds_endowment.is_empty()) \
or (not self.lds_sealing.is_empty()):
self.get_widget("lds_tab").show() self.get_widget("lds_tab").show()
self.get_widget("lds_page").show() self.get_widget("lds_page").show()
#if (not self.lds_baptism.is_empty()) \ if (not self.lds_baptism.is_empty()) \
# or (not self.lds_endowment.is_empty()) \ or (not self.lds_endowment.is_empty()) \
# or (not self.lds_sealing.is_empty()): or (not self.lds_sealing.is_empty()):
# Utils.bold_label(self.lds_tab) Utils.bold_label(self.lds_tab)
types = const.NameTypesMap.get_values() types = const.NameTypesMap.get_values()
types.sort() types.sort()
@ -366,7 +368,7 @@ class EditPerson:
self.preform.set_active(1) self.preform.set_active(1)
else: else:
self.flowed.set_active(1) self.flowed.set_active(1)
#Utils.bold_label(self.notes_label) Utils.bold_label(self.notes_label)
self.name_list.drag_dest_set(gtk.DEST_DEFAULT_ALL, self.name_list.drag_dest_set(gtk.DEST_DEFAULT_ALL,
[DdTargets.NAME.target()], [DdTargets.NAME.target()],
@ -678,7 +680,6 @@ class EditPerson:
self.ldssealstat = self.get_widget("sealstat") self.ldssealstat = self.get_widget("sealstat")
self.ldssealstat.set_sensitive(not self.db.readonly) self.ldssealstat.set_sensitive(not self.db.readonly)
self.bstat = self.lds_field( self.bstat = self.lds_field(
self.lds_baptism, self.ldsbap_temple, self.lds_baptism, self.ldsbap_temple,
self.ldsbap_date, self.ldsbapplace) self.ldsbap_date, self.ldsbapplace)
@ -968,13 +969,16 @@ class EditPerson:
self.ntree.clear() self.ntree.clear()
self.nmap = {} self.nmap = {}
for name in self.nlist: for name in self.nlist:
node = self.ntree.add([name.get_name(),_(name.get_type())],name) node = self.ntree.add([
name.get_surname(),name.get_surname_prefix(),
name.get_first_name(), name.get_suffix(),
_(name.get_type())],name)
self.nmap[str(name)] = node self.nmap[str(name)] = node
if self.nlist: if self.nlist:
self.ntree.select_row(0) self.ntree.select_row(0)
# Utils.bold_label(self.names_label) Utils.bold_label(self.names_label)
# else: else:
# Utils.unbold_label(self.names_label) Utils.unbold_label(self.names_label)
def redraw_url_list(self): def redraw_url_list(self):
"""redraws the url list, disabling the go button if no url """redraws the url list, disabling the go button if no url
@ -988,12 +992,10 @@ class EditPerson:
if len(self.ulist) > 0: if len(self.ulist) > 0:
self.web_go.set_sensitive(False) self.web_go.set_sensitive(False)
self.wtree.select_row(0) self.wtree.select_row(0)
# Utils.bold_label(self.inet_label) Utils.bold_label(self.inet_label)
else: else:
self.web_go.set_sensitive(False) self.web_go.set_sensitive(False)
# self.web_url.set_text("") Utils.unbold_label(self.inet_label)
# self.web_description.set_text("")
# Utils.unbold_label(self.inet_label)
def redraw_addr_list(self): def redraw_addr_list(self):
"""Redraws the address list""" """Redraws the address list"""
@ -1006,9 +1008,9 @@ class EditPerson:
self.pmap[str(addr)] = node self.pmap[str(addr)] = node
if self.plist: if self.plist:
self.ptree.select_row(0) self.ptree.select_row(0)
# Utils.bold_label(self.addr_label) Utils.bold_label(self.addr_label)
# else: else:
# Utils.unbold_label(self.addr_label) Utils.unbold_label(self.addr_label)
def redraw_attr_list(self): def redraw_attr_list(self):
"""redraws the attribute list for the person""" """redraws the attribute list for the person"""
@ -1019,9 +1021,9 @@ class EditPerson:
self.amap[str(attr)] = node self.amap[str(attr)] = node
if self.alist: if self.alist:
self.atree.select_row(0) self.atree.select_row(0)
# Utils.bold_label(self.attr_label) Utils.bold_label(self.attr_label)
# else: else:
# Utils.unbold_label(self.attr_label) Utils.unbold_label(self.attr_label)
def name_edit_callback(self,name): def name_edit_callback(self,name):
self.redraw_name_list() self.redraw_name_list()
@ -1060,11 +1062,14 @@ class EditPerson:
for event_handle in self.elist: for event_handle in self.elist:
event = self.db.get_event_from_handle(event_handle) event = self.db.get_event_from_handle(event_handle)
pname = place_title(self.db,event) pname = place_title(self.db,event)
node = self.etree.add([const.display_pevent(event.get_name()), has_note = event.get_note()
event.get_description(), has_source = len(event.get_source_references())> 0
event.get_date(),pname],event) data = [const.display_pevent(event.get_name()),
event.get_description(), event.get_date(),
pname, has_source, has_note]
node = self.etree.add(data, event)
self.emap[str(event)] = node self.emap[str(event)] = node
node = self.etree.add(["","","",""],None) node = self.etree.add(["","","","",False,False],None)
def strip_id(self,text): def strip_id(self,text):
index = text.rfind('[') index = text.rfind('[')
@ -1450,7 +1455,7 @@ class EditPerson:
def on_apply_person_clicked(self,obj): def on_apply_person_clicked(self,obj):
if self.is_unknown.get_active(): if self.gender.get_active() == RelLib.Person.UNKNOWN:
dialog = QuestionDialog2( dialog = QuestionDialog2(
_("Unknown gender specified"), _("Unknown gender specified"),
_("The gender of the person is currently unknown. " _("The gender of the person is currently unknown. "
@ -1731,27 +1736,27 @@ class EditPerson:
if page == 0: if page == 0:
self.load_person_image() self.load_person_image()
self.redraw_event_list() self.redraw_event_list()
elif page == 7 and self.not_loaded: elif page == 6 and self.not_loaded:
self.not_loaded = False self.not_loaded = False
elif page == 9 and self.lds_not_loaded: elif page == 8 and self.lds_not_loaded:
self.lds_not_loaded = False self.lds_not_loaded = False
self.draw_lds() self.draw_lds()
note_buf = self.notes_buffer note_buf = self.notes_buffer
text = unicode(note_buf.get_text(note_buf.get_start_iter(), text = unicode(note_buf.get_text(note_buf.get_start_iter(),
note_buf.get_end_iter(),False)) note_buf.get_end_iter(),False))
# if text: if text:
# Utils.bold_label(self.notes_label) Utils.bold_label(self.notes_label)
# else: else:
# Utils.unbold_label(self.notes_label) Utils.unbold_label(self.notes_label)
if not self.lds_not_loaded: if not self.lds_not_loaded:
self.check_lds() self.check_lds()
# if self.lds_baptism.is_empty() \ if self.lds_baptism.is_empty() \
# and self.lds_endowment.is_empty() \ and self.lds_endowment.is_empty() \
# and self.lds_sealing.is_empty(): and self.lds_sealing.is_empty():
# Utils.unbold_label(self.lds_tab) Utils.unbold_label(self.lds_tab)
# else: else:
# Utils.bold_label(self.lds_tab) Utils.bold_label(self.lds_tab)
def change_name(self,obj): def change_name(self,obj):
sel_objs = self.ntree.get_selected_objects() sel_objs = self.ntree.get_selected_objects()

View File

@ -464,36 +464,36 @@ class GrampsDbBase(GrampsDBCallback.GrampsDBCallback):
def _find_from_handle(self,handle,transaction,class_type,dmap,add_func): def _find_from_handle(self,handle,transaction,class_type,dmap,add_func):
obj = class_type() obj = class_type()
val = str(handle) handle = str(handle)
if dmap.get(val): if dmap.get(handle):
obj.unserialize(dmap.get(val)) obj.unserialize(dmap.get(handle))
else: else:
obj.set_handle(val) obj.set_handle(handle)
add_func(obj,transaction) add_func(obj,transaction)
return obj return obj
def find_person_from_handle(self,val,transaction): def find_person_from_handle(self,handle,transaction):
""" """
Finds a Person in the database from the passed GRAMPS ID. Finds a Person in the database from the passed GRAMPS ID.
If no such Person exists, a new Person is added to the database. If no such Person exists, a new Person is added to the database.
""" """
return self._find_from_handle(val,transaction,Person, return self._find_from_handle(handle,transaction,Person,
self.person_map,self.add_person) self.person_map,self.add_person)
def find_source_from_handle(self,val,transaction): def find_source_from_handle(self,handle,transaction):
""" """
Finds a Source in the database from the passed GRAMPS ID. Finds a Source in the database from the passed GRAMPS ID.
If no such Source exists, a new Source is added to the database. If no such Source exists, a new Source is added to the database.
""" """
return self._find_from_handle(val,transaction,Source, return self._find_from_handle(handle,transaction,Source,
self.source_map,self.add_source) self.source_map,self.add_source)
def find_event_from_handle(self,val,transaction): def find_event_from_handle(self,handle,transaction):
""" """
Finds a Event in the database from the passed GRAMPS ID. Finds a Event in the database from the passed GRAMPS ID.
If no such Event exists, a new Event is added to the database. If no such Event exists, a new Event is added to the database.
""" """
return self._find_from_handle(val,transaction,Event, return self._find_from_handle(handle,transaction,Event,
self.event_map,self.add_event) self.event_map,self.add_event)
def find_object_from_handle(self,val,transaction): def find_object_from_handle(self,val,transaction):
@ -501,7 +501,7 @@ class GrampsDbBase(GrampsDBCallback.GrampsDBCallback):
Finds an MediaObject in the database from the passed GRAMPS ID. Finds an MediaObject in the database from the passed GRAMPS ID.
If no such MediaObject exists, a new Object is added to the database.""" If no such MediaObject exists, a new Object is added to the database."""
return self._find_from_handle(val,transaction,MediaObject, return self._find_from_handle(handle,transaction,MediaObject,
self.media_map,self.add_object) self.media_map,self.add_object)
def find_place_from_handle(self,val,transaction): def find_place_from_handle(self,val,transaction):
@ -509,15 +509,15 @@ class GrampsDbBase(GrampsDBCallback.GrampsDBCallback):
Finds a Place in the database from the passed GRAMPS ID. Finds a Place in the database from the passed GRAMPS ID.
If no such Place exists, a new Place is added to the database. If no such Place exists, a new Place is added to the database.
""" """
return self._find_from_handle(val,transaction,Place, return self._find_from_handle(handle,transaction,Place,
self.place_map,self.add_place) self.place_map,self.add_place)
def find_family_from_handle(self,val,transaction): def find_family_from_handle(self,handle,transaction):
""" """
Finds a Family in the database from the passed gramps' ID. Finds a Family in the database from the passed gramps' ID.
If no such Family exists, a new Family is added to the database. If no such Family exists, a new Family is added to the database.
""" """
return self._find_from_handle(val,transaction,Family, return self._find_from_handle(handle,transaction,Family,
self.family_map,self.add_family) self.family_map,self.add_family)
def get_person_from_gramps_id(self,val): def get_person_from_gramps_id(self,val):
@ -1251,6 +1251,7 @@ class Transaction:
self.first = None self.first = None
self.last = None self.last = None
self.batch = False self.batch = False
self.length = 0
self.person_add = [] self.person_add = []
self.person_del = [] self.person_del = []
@ -1330,3 +1331,4 @@ class Transaction:
if self.last and self.first: if self.last and self.first:
return self.last - self.first + 1 return self.last - self.first + 1
return 0 return 0

View File

@ -45,11 +45,9 @@ class GrampsGEDDB(GrampsInMemDB):
GrampsInMemDB.__init__(self) GrampsInMemDB.__init__(self)
def load(self,name,callback, mode="w"): def load(self,name,callback, mode="w"):
self.filename = name GrampsInMemDB.load(self,name,callback,mode)
ReadGedcom.importData(self,name,use_trans=False) ReadGedcom.importData(self,name,use_trans=False)
self.readonly = mode == "r"
self.bookmarks = self.metadata.get('bookmarks') self.bookmarks = self.metadata.get('bookmarks')
if self.bookmarks == None: if self.bookmarks == None:
self.bookmarks = [] self.bookmarks = []

View File

@ -25,6 +25,8 @@ Provides the common infrastructure for database formats that
must hold all of their data in memory. must hold all of their data in memory.
""" """
from bsddb import dbshelve, db
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# GRAMPS modules # GRAMPS modules
@ -86,8 +88,12 @@ class GrampsInMemDB(GrampsDbBase):
self.eventnames = {} self.eventnames = {}
self.undodb = [] self.undodb = []
def load(self,name,callback): def load(self,name,callback,mode="w"):
pass self.undolog = "%s.log" % name
self.undodb = db.DB()
self.undodb.open(self.undolog, db.DB_RECNO, db.DB_CREATE)
self.filename = name
self.readonly = mode == "r"
def get_person_cursor(self): def get_person_cursor(self):
return GrampsInMemCursor(self.person_map) return GrampsInMemCursor(self.person_map)
@ -105,6 +111,11 @@ class GrampsInMemDB(GrampsDbBase):
return GrampsInMemCursor(self.media_map) return GrampsInMemCursor(self.media_map)
def close(self): def close(self):
if not self.readonly:
self.undodb.close()
try:
os.remove(self.undolog)
except:
pass pass
def abort_changes(self): def abort_changes(self):

View File

@ -45,11 +45,9 @@ class GrampsXMLDB(GrampsInMemDB):
GrampsInMemDB.__init__(self) GrampsInMemDB.__init__(self)
def load(self,name,callback,mode="w"): def load(self,name,callback,mode="w"):
self.filename = name GrampsInMemDB.load(self,name,callback,mode)
self.id_trans = {} self.id_trans = {}
self.readonly = mode == "r"
ReadXML.importData(self,name,use_trans=False) ReadXML.importData(self,name,use_trans=False)
self.bookmarks = self.metadata.get('bookmarks') self.bookmarks = self.metadata.get('bookmarks')

View File

@ -18,7 +18,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# #
from gobject import TYPE_STRING, TYPE_PYOBJECT, TYPE_OBJECT from gobject import TYPE_STRING, TYPE_PYOBJECT, TYPE_OBJECT, TYPE_BOOLEAN
import gtk import gtk
import const import const
@ -33,8 +33,13 @@ class ListModel:
def __init__(self,tree,dlist,select_func=None, def __init__(self,tree,dlist,select_func=None,
event_func=None,mode=gtk.SELECTION_SINGLE): event_func=None,mode=gtk.SELECTION_SINGLE):
self.tree = tree self.tree = tree
l = len(dlist) self.mylist = []
self.mylist = [TYPE_STRING]*l + [TYPE_PYOBJECT] for l in dlist:
if l[0] and l[0][0] == ':':
self.mylist.append(TYPE_BOOLEAN)
else:
self.mylist.append(TYPE_STRING)
self.mylist.append(TYPE_PYOBJECT)
self.tree.set_rules_hint(True) self.tree.set_rules_hint(True)
self.model = None self.model = None
@ -60,11 +65,19 @@ class ListModel:
cnum = 0 cnum = 0
for name in dlist: for name in dlist:
if gtk26 and cnum == 0: if name[0] and name[0][0] == ':':
renderer = gtk.CellRendererToggle()
column = gtk.TreeViewColumn(name[0][1:],renderer)
column.add_attribute(renderer,'active',cnum)
elif gtk26 and cnum == 0:
renderer = gtk.CellRendererCombo() renderer = gtk.CellRendererCombo()
renderer.set_property('model',model) renderer.set_property('model',model)
renderer.set_property('text_column',0) renderer.set_property('text_column',0)
renderer.set_property('editable',True) renderer.set_property('editable',True)
renderer.set_fixed_height_from_font(True)
renderer.connect('edited',self.edited_cb, cnum)
column = gtk.TreeViewColumn(name[0],renderer,text=cnum)
column.set_reorderable(True)
else: else:
renderer = gtk.CellRendererText() renderer = gtk.CellRendererText()
renderer.set_property('editable',True) renderer.set_property('editable',True)

View File

@ -105,8 +105,9 @@ class NameEditor:
self.note_field = self.top.get_widget("alt_note") self.note_field = self.top.get_widget("alt_note")
self.slist = self.top.get_widget('slist') self.slist = self.top.get_widget('slist')
self.priv = self.top.get_widget("priv") self.priv = self.top.get_widget("priv")
self.sources_label = self.top.get_widget("sourcesName") self.general_label = self.top.get_widget("general_tab")
self.notes_label = self.top.get_widget("noteName") self.sources_label = self.top.get_widget("sources_tab")
self.notes_label = self.top.get_widget("note_tab")
self.flowed = self.top.get_widget("alt_flowed") self.flowed = self.top.get_widget("alt_flowed")
self.preform = self.top.get_widget("alt_preform") self.preform = self.top.get_widget("alt_preform")
self.group_over = self.top.get_widget('group_over') self.group_over = self.top.get_widget('group_over')
@ -115,6 +116,7 @@ class NameEditor:
types.sort() types.sort()
AutoComp.fill_combo(self.type_combo,types) AutoComp.fill_combo(self.type_combo,types)
self.type_field = self.type_combo.get_child() self.type_field = self.type_combo.get_child()
self.type_field.set_text(types[0])
full_name = NameDisplay.displayer.display_name(name) full_name = NameDisplay.displayer.display_name(name)
@ -152,6 +154,7 @@ class NameEditor:
self.type_field.set_text(_(name.get_type())) self.type_field.set_text(_(name.get_type()))
self.patronymic_field.set_text(name.get_patronymic()) self.patronymic_field.set_text(name.get_patronymic())
self.priv.set_active(name.get_privacy()) self.priv.set_active(name.get_privacy())
Utils.bold_label(self.general_label)
if name.get_note(): if name.get_note():
self.note_buffer.set_text(name.get_note()) self.note_buffer.set_text(name.get_note())
Utils.bold_label(self.notes_label) Utils.bold_label(self.notes_label)
@ -159,6 +162,8 @@ class NameEditor:
self.preform.set_active(1) self.preform.set_active(1)
else: else:
self.flowed.set_active(1) self.flowed.set_active(1)
else:
Utils.unbold_label(self.notes_label)
self.display_as.set_active(name.get_display_as()) self.display_as.set_active(name.get_display_as())
self.sort_as.set_active(name.get_display_as()) self.sort_as.set_active(name.get_display_as())
grp_as = name.get_group_as() grp_as = name.get_group_as()
@ -169,6 +174,9 @@ class NameEditor:
else: else:
self.display_as.set_active(0) self.display_as.set_active(0)
self.sort_as.set_active(0) self.sort_as.set_active(0)
Utils.unbold_label(self.notes_label)
Utils.unbold_label(self.sources_label)
Utils.unbold_label(self.general_label)
if parent_window: if parent_window:
self.window.set_transient_for(parent_window) self.window.set_transient_for(parent_window)

View File

@ -117,15 +117,11 @@ class PeopleView:
selected_ids = self.get_selected_objects() selected_ids = self.get_selected_objects()
if len(selected_ids) == 1: if len(selected_ids) == 1:
self.person_tree.drag_source_set(BUTTON1_MASK, self.person_tree.drag_source_set(
[DdTargets.PERSON_LINK.target()], BUTTON1_MASK, [DdTargets.PERSON_LINK.target()], ACTION_COPY)
ACTION_COPY)
elif len(selected_ids) > 1: elif len(selected_ids) > 1:
self.person_tree.drag_source_set(BUTTON1_MASK, self.person_tree.drag_source_set(
[DdTargets.PERSON_LINK_LIST.target()], BUTTON1_MASK, [DdTargets.PERSON_LINK_LIST.target()], ACTION_COPY)
ACTION_COPY)
def sort_clicked(self,obj): def sort_clicked(self,obj):
for col in self.columns: for col in self.columns:
@ -248,6 +244,10 @@ class PeopleView:
top_name = self.parent.db.get_name_group_mapping(group_name) top_name = self.parent.db.get_name_group_mapping(group_name)
top_path = self.person_model.on_get_path(top_name) top_path = self.person_model.on_get_path(top_name)
self.person_tree.expand_row(top_path,0) self.person_tree.expand_row(top_path,0)
current = self.person_model.on_get_iter(path)
selected = self.person_selection.path_is_selected(path)
if current != p.get_handle() or not selected:
self.person_selection.unselect_all() self.person_selection.unselect_all()
self.person_selection.select_path(path) self.person_selection.select_path(path)
self.person_tree.scroll_to_cell(path,None,1,0.5,0) self.person_tree.scroll_to_cell(path,None,1,0.5,0)
@ -350,7 +350,6 @@ class PeopleView:
self.person_model.rebuild_data(self.DataFilter,skip=node) self.person_model.rebuild_data(self.DataFilter,skip=node)
def person_updated(self,handle_list): def person_updated(self,handle_list):
for node in handle_list: for node in handle_list:
person = self.parent.db.get_person_from_handle(node) person = self.parent.db.get_person_from_handle(node)
try: try:

View File

@ -89,6 +89,7 @@ rel_types = (RelLib.Person.CHILD_REL_BIRTH,
pedi_type = { pedi_type = {
'birth' : RelLib.Person.CHILD_REL_BIRTH, 'birth' : RelLib.Person.CHILD_REL_BIRTH,
'natural': RelLib.Person.CHILD_REL_BIRTH,
'adopted': RelLib.Person.CHILD_REL_ADOPT, 'adopted': RelLib.Person.CHILD_REL_ADOPT,
'foster' : RelLib.Person.CHILD_REL_FOST, 'foster' : RelLib.Person.CHILD_REL_FOST,
} }
@ -210,7 +211,8 @@ def import2(database, filename, cb, codeset, use_trans):
DisplayTrace.DisplayTrace() DisplayTrace.DisplayTrace()
return return
statusTop.get_widget("close").set_sensitive(1) statusTop.get_widget("close").set_sensitive(True)
statusWindow.set_modal(False)
if close: if close:
statusWindow.destroy() statusWindow.destroy()
@ -768,12 +770,10 @@ class GedcomParser:
return (mrel,frel) return (mrel,frel)
# FTW # FTW
elif matches[1] == "_FREL": elif matches[1] == "_FREL":
if matches[2].lower() != "natural": frel = pedi_type.get(matches[2].lower(),RelLib.Person.CHILD_REL_BIRTH)
frel = matches[2].capitalize()
# FTW # FTW
elif matches[1] == "_MREL": elif matches[1] == "_MREL":
if matches[2].lower() != "natural": mrel = pedi_type.get(matches[2].lower(),RelLib.Person.CHILD_REL_BIRTH)
mrel = RelLib.Person.CHILD_REL_BIRTH
elif matches[1] == "ADOP": elif matches[1] == "ADOP":
mrel = RelLib.Person.CHILD_REL_ADOPT mrel = RelLib.Person.CHILD_REL_ADOPT
frel = RelLib.Person.CHILD_REL_ADOPT frel = RelLib.Person.CHILD_REL_ADOPT
@ -981,8 +981,8 @@ class GedcomParser:
break break
else: else:
if ftype in rel_types: if ftype in rel_types:
self.person.add_parent_family_handle(handle, self.person.add_parent_family_handle(
RelLib.Person.CHILD_REL_BIRTH, handle, RelLib.Person.CHILD_REL_BIRTH,
RelLib.Person.CHILD_REL_BIRTH) RelLib.Person.CHILD_REL_BIRTH)
else: else:
if self.person.get_main_parents_family_handle() == handle: if self.person.get_main_parents_family_handle() == handle:
@ -1427,8 +1427,8 @@ class GedcomParser:
self.barf(level+1) self.barf(level+1)
def parse_adopt_famc(self,level): def parse_adopt_famc(self,level):
mrel = "Adopted" mrel = RelLib.Person.CHILD_REL_ADOPT
frel = "Adopted" frel = RelLib.Person.CHILD_REL_ADOPT
while 1: while 1:
matches = self.get_next() matches = self.get_next()
if int(matches[0]) < level: if int(matches[0]) < level:

View File

@ -170,8 +170,8 @@ class RelationshipCalculator:
pmap[person.get_handle()] = rel_str pmap[person.get_handle()] = rel_str
family_handle = person.get_main_parents_family_handle() family_handle = person.get_main_parents_family_handle()
if family_handle != None:
family = self.db.get_family_from_handle(family_handle) family = self.db.get_family_from_handle(family_handle)
if family_handle != None and family:
father = self.db.get_person_from_handle(family.get_father_handle()) father = self.db.get_person_from_handle(family.get_father_handle())
mother = self.db.get_person_from_handle(family.get_mother_handle()) mother = self.db.get_person_from_handle(family.get_mother_handle())
self.apply_filter(father,rel_str+'f',plist,pmap) self.apply_filter(father,rel_str+'f',plist,pmap)

View File

@ -403,16 +403,20 @@ def search_for(name):
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def bold_label(label): def bold_label(label):
text = unicode(label.get_text()) clist = label.get_children()
label.set_text("<b>%s</b>" % text ) text = unicode(clist[1].get_text())
label.set_use_markup(1) clist[0].show()
clist[1].set_text("<b>%s</b>" % text )
clist[1].set_use_markup(True)
def unbold_label(label): def unbold_label(label):
text = unicode(label.get_text()) clist = label.get_children()
text = unicode(clist[1].get_text())
text = text.replace('<b>','') text = text.replace('<b>','')
text = text.replace('</b>','') text = text.replace('</b>','')
label.set_text(text) clist[0].hide()
label.set_use_markup(0) clist[1].set_text(text)
clist[1].set_use_markup(False)
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #

View File

@ -3,7 +3,7 @@
<glade-interface> <glade-interface>
<widget class="GtkDialog" id="editPerson"> <widget class="GtkDialog" id="edit_person">
<property name="has_focus">True</property> <property name="has_focus">True</property>
<property name="title" translatable="yes"></property> <property name="title" translatable="yes"></property>
<property name="type">GTK_WINDOW_TOPLEVEL</property> <property name="type">GTK_WINDOW_TOPLEVEL</property>
@ -223,6 +223,7 @@
<property name="has_frame">True</property> <property name="has_frame">True</property>
<property name="invisible_char">*</property> <property name="invisible_char">*</property>
<property name="activates_default">False</property> <property name="activates_default">False</property>
<property name="width_chars">13</property>
</widget> </widget>
<packing> <packing>
<property name="left_attach">2</property> <property name="left_attach">2</property>
@ -851,7 +852,7 @@ Unknown</property>
</child> </child>
<child> <child>
<widget class="GtkHBox" id="hbox116"> <widget class="GtkHBox" id="events_label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">0</property>
@ -874,7 +875,7 @@ Unknown</property>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="events_label"> <widget class="GtkLabel" id="events_text">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Events</property> <property name="label" translatable="yes">Events</property>
<property name="use_underline">False</property> <property name="use_underline">False</property>
@ -1050,7 +1051,7 @@ Unknown</property>
</child> </child>
<child> <child>
<widget class="GtkHBox" id="hbox108"> <widget class="GtkHBox" id="names_label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">0</property>
@ -1073,7 +1074,7 @@ Unknown</property>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="names_label"> <widget class="GtkLabel" id="names_text">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Names</property> <property name="label" translatable="yes">Names</property>
<property name="use_underline">False</property> <property name="use_underline">False</property>
@ -1274,7 +1275,7 @@ Unknown</property>
</child> </child>
<child> <child>
<widget class="GtkHBox" id="hbox109"> <widget class="GtkHBox" id="attr_label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">0</property>
@ -1297,7 +1298,7 @@ Unknown</property>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="attr_label"> <widget class="GtkLabel" id="attr_text">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Attributes</property> <property name="label" translatable="yes">Attributes</property>
<property name="use_underline">False</property> <property name="use_underline">False</property>
@ -1472,7 +1473,7 @@ Unknown</property>
</child> </child>
<child> <child>
<widget class="GtkHBox" id="hbox110"> <widget class="GtkHBox" id="addr_label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">0</property>
@ -1495,7 +1496,7 @@ Unknown</property>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="addr_label"> <widget class="GtkLabel" id="addr_text">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Addresses</property> <property name="label" translatable="yes">Addresses</property>
<property name="use_underline">False</property> <property name="use_underline">False</property>
@ -1667,7 +1668,7 @@ Unknown</property>
</child> </child>
<child> <child>
<widget class="GtkHBox" id="hbox111"> <widget class="GtkHBox" id="notes_label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">0</property>
@ -1690,7 +1691,7 @@ Unknown</property>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="notes_label"> <widget class="GtkLabel" id="notes_text">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Notes</property> <property name="label" translatable="yes">Notes</property>
<property name="use_underline">False</property> <property name="use_underline">False</property>
@ -1859,7 +1860,7 @@ Unknown</property>
</child> </child>
<child> <child>
<widget class="GtkHBox" id="hbox112"> <widget class="GtkHBox" id="sources_label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">0</property>
@ -1882,7 +1883,7 @@ Unknown</property>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="sources_label"> <widget class="GtkLabel" id="sources_text">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Sources</property> <property name="label" translatable="yes">Sources</property>
<property name="use_underline">False</property> <property name="use_underline">False</property>
@ -1938,7 +1939,7 @@ Unknown</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="selection_mode">GTK_SELECTION_SINGLE</property> <property name="selection_mode">GTK_SELECTION_SINGLE</property>
<property name="orientation">GTK_ORIENTATION_VERTICAL</property> <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
</widget> </widget>
</child> </child>
</widget> </widget>
@ -2087,7 +2088,7 @@ Unknown</property>
</child> </child>
<child> <child>
<widget class="GtkHBox" id="hbox113"> <widget class="GtkHBox" id="gallery_label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">0</property>
@ -2110,7 +2111,7 @@ Unknown</property>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="gallery_label"> <widget class="GtkLabel" id="gallery_text">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Gallery</property> <property name="label" translatable="yes">Gallery</property>
<property name="use_underline">False</property> <property name="use_underline">False</property>
@ -2326,13 +2327,13 @@ Unknown</property>
</child> </child>
<child> <child>
<widget class="GtkHBox" id="hbox114"> <widget class="GtkHBox" id="inet_label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">0</property>
<child> <child>
<widget class="GtkImage" id="image2586"> <widget class="GtkImage" id="image2589">
<property name="visible">True</property> <property name="visible">True</property>
<property name="icon_size">4</property> <property name="icon_size">4</property>
<property name="icon_name">gtk-file</property> <property name="icon_name">gtk-file</property>
@ -2349,7 +2350,7 @@ Unknown</property>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="inet_label"> <widget class="GtkLabel" id="inet_text">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Internet</property> <property name="label" translatable="yes">Internet</property>
<property name="use_underline">False</property> <property name="use_underline">False</property>
@ -3336,7 +3337,7 @@ Unknown</property>
</child> </child>
<child> <child>
<widget class="GtkHBox" id="hbox115"> <widget class="GtkHBox" id="lds_tab">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">0</property>
@ -3359,7 +3360,8 @@ Unknown</property>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="lds_tab"> <widget class="GtkLabel" id="lds_label">
<property name="visible">True</property>
<property name="label" translatable="yes">LDS</property> <property name="label" translatable="yes">LDS</property>
<property name="use_underline">False</property> <property name="use_underline">False</property>
<property name="use_markup">False</property> <property name="use_markup">False</property>

File diff suppressed because it is too large Load Diff

View File

@ -743,20 +743,20 @@ class Gramps(GrampsDBCallback.GrampsDBCallback):
self.redraw_histmenu() self.redraw_histmenu()
self.set_buttons(1) self.set_buttons(1)
if self.hindex == 0: if self.hindex == 0:
self.backbtn.set_sensitive(0) self.backbtn.set_sensitive(False)
self.back.set_sensitive(0) self.back.set_sensitive(False)
else: else:
self.backbtn.set_sensitive(1) self.backbtn.set_sensitive(True)
self.back.set_sensitive(1) self.back.set_sensitive(True)
self.fwdbtn.set_sensitive(1) self.fwdbtn.set_sensitive(True)
self.forward.set_sensitive(1) self.forward.set_sensitive(True)
except: except:
self.clear_history() self.clear_history()
else: else:
self.backbtn.set_sensitive(0) self.backbtn.set_sensitive(False)
self.back.set_sensitive(0) self.back.set_sensitive(False)
self.fwdbtn.set_sensitive(1) self.fwdbtn.set_sensitive(True)
self.forward.set_sensitive(1) self.forward.set_sensitive(True)
self.goto_active_person() self.goto_active_person()
self.lock_history = False self.lock_history = False
@ -773,20 +773,20 @@ class Gramps(GrampsDBCallback.GrampsDBCallback):
self.redraw_histmenu() self.redraw_histmenu()
self.set_buttons(1) self.set_buttons(1)
if self.hindex == len(self.history)-1: if self.hindex == len(self.history)-1:
self.fwdbtn.set_sensitive(0) self.fwdbtn.set_sensitive(False)
self.forward.set_sensitive(0) self.forward.set_sensitive(False)
else: else:
self.fwdbtn.set_sensitive(1) self.fwdbtn.set_sensitive(True)
self.forward.set_sensitive(1) self.forward.set_sensitive(True)
self.backbtn.set_sensitive(1) self.backbtn.set_sensitive(True)
self.back.set_sensitive(1) self.back.set_sensitive(True)
except: except:
self.clear_history() self.clear_history()
else: else:
self.fwdbtn.set_sensitive(0) self.fwdbtn.set_sensitive(False)
self.forward.set_sensitive(0) self.forward.set_sensitive(False)
self.backbtn.set_sensitive(1) self.backbtn.set_sensitive(True)
self.back.set_sensitive(1) self.back.set_sensitive(True)
self.goto_active_person() self.goto_active_person()
self.lock_history = False self.lock_history = False
@ -848,10 +848,10 @@ class Gramps(GrampsDBCallback.GrampsDBCallback):
def enable_sidebar(self,val): def enable_sidebar(self,val):
if val: if val:
self.sidebar.show() self.sidebar.show()
self.views.set_show_tabs(0) self.views.set_show_tabs(False)
else: else:
self.sidebar.hide() self.sidebar.hide()
self.views.set_show_tabs(1) self.views.set_show_tabs(True)
def enable_filter(self,val): def enable_filter(self,val):
if val: if val:
@ -875,8 +875,8 @@ class Gramps(GrampsDBCallback.GrampsDBCallback):
self.report_menu = self.gtop.get_widget("reports_menu") self.report_menu = self.gtop.get_widget("reports_menu")
self.tools_menu = self.gtop.get_widget("tools_menu") self.tools_menu = self.gtop.get_widget("tools_menu")
self.report_menu.set_sensitive(0) self.report_menu.set_sensitive(False)
self.tools_menu.set_sensitive(0) self.tools_menu.set_sensitive(False)
error = PluginMgr.load_plugins(const.docgenDir) error = PluginMgr.load_plugins(const.docgenDir)
error |= PluginMgr.load_plugins(os.path.expanduser("~/.gramps/docgen")) error |= PluginMgr.load_plugins(os.path.expanduser("~/.gramps/docgen"))