* src/FamilyView.py: delete unused code

* src/PeopleView.py: handle uncaught exception
* src/RelLib.py: rebuild person table
* src/gramps_main.py: rebuild display after preferences


svn: r2338
This commit is contained in:
Don Allingham 2003-11-14 05:12:38 +00:00
parent 1ca20ccdc1
commit c688da8615
5 changed files with 26 additions and 24 deletions

View File

@ -791,7 +791,6 @@ class FamilyView:
i = 0 i = 0
fiter = None fiter = None
child_list = list(family.getChildList()) child_list = list(family.getChildList())
# child_list.sort(sort.by_birthdate)
self.child_map = {} self.child_map = {}

View File

@ -93,10 +93,10 @@ _date_entry_list = [
] ]
_name_format_list = [ _name_format_list = [
(_("Firstname Surname"), Utils.normal_name), (_("Firstname Surname"), Utils.normal_name, Utils.phonebook_name, lambda x: x.getSurname()),
(_("Surname, Firstname"), Utils.phonebook_name), (_("Surname, Firstname"), Utils.phonebook_name, Utils.phonebook_name, lambda x: x.getSurname()),
(_("Firstname SURNAME"), Utils.upper_name), (_("Firstname SURNAME"), Utils.upper_name, Utils.phonebook_upper_name, lambda x : x.getUpperSurname()),
(_("SURNAME, Firstname"), Utils.phonebook_upper_name), (_("SURNAME, Firstname"), Utils.phonebook_upper_name, Utils.phonebook_upper_name, lambda x: x.getUpperSurname()),
] ]
panellist = [ panellist = [
@ -226,7 +226,6 @@ def loadConfig(call):
global mediaref global mediaref
global globalprop global globalprop
global localprop global localprop
# global capitalize
global defaultview global defaultview
global familyview global familyview
@ -242,7 +241,6 @@ def loadConfig(call):
vc_comment = get_bool("/apps/gramps/use-comment") vc_comment = get_bool("/apps/gramps/use-comment")
uncompress = get_bool("/apps/gramps/dont-compress-xml") uncompress = get_bool("/apps/gramps/dont-compress-xml")
id_edit = get_bool("/apps/gramps/id-edit") id_edit = get_bool("/apps/gramps/id-edit")
# capitalize = get_bool("/apps/gramps/capitalize")
index_visible = get_bool("/apps/gramps/index-visible") index_visible = get_bool("/apps/gramps/index-visible")
status_bar = get_int("/apps/gramps/statusbar") status_bar = get_int("/apps/gramps/statusbar")
gnome_toolbar_str = get_string("/desktop/gnome/interface/toolbar_style") gnome_toolbar_str = get_string("/desktop/gnome/interface/toolbar_style")
@ -316,13 +314,8 @@ def loadConfig(call):
Calendar.Calendar.ENTRYCODE = dateEntry Calendar.Calendar.ENTRYCODE = dateEntry
nameof = _name_format_list[_name_format][1] nameof = _name_format_list[_name_format][1]
display_name = _name_format_list[_name_format][2]
if _name_format > 1: display_surname = _name_format_list[_name_format][3]
display_name = Utils.phonebook_upper_name
display_surname = lambda x : x.getUpperSurname()
else:
display_name = Utils.phonebook_name
display_surname = lambda x : x.getSurname()
make_path(os.path.expanduser("~/.gramps")) make_path(os.path.expanduser("~/.gramps"))
make_path(os.path.expanduser("~/.gramps/filters")) make_path(os.path.expanduser("~/.gramps/filters"))
@ -809,6 +802,8 @@ class GrampsPreferences:
def on_propertybox_apply(self,obj): def on_propertybox_apply(self,obj):
global nameof global nameof
global display_name
global display_surname
global uselds global uselds
global autocomp global autocomp
global autosave_int global autosave_int
@ -825,7 +820,6 @@ class GrampsPreferences:
global vc_comment global vc_comment
global uncompress global uncompress
global id_edit global id_edit
# global capitalize
global index_visible global index_visible
global status_bar global status_bar
global toolbar global toolbar
@ -853,7 +847,6 @@ class GrampsPreferences:
vc_comment = self.top.get_widget("vc_comment").get_active() vc_comment = self.top.get_widget("vc_comment").get_active()
uncompress = self.top.get_widget("uncompress").get_active() uncompress = self.top.get_widget("uncompress").get_active()
id_edit = self.top.get_widget("gid_edit").get_active() id_edit = self.top.get_widget("gid_edit").get_active()
# capitalize = self.top.get_widget('capitalize').get_active()
index_visible = self.top.get_widget("show_child_id").get_active() index_visible = self.top.get_widget("show_child_id").get_active()
paper_obj = self.top.get_widget("paper_size").get_menu().get_active() paper_obj = self.top.get_widget("paper_size").get_menu().get_active()
@ -926,7 +919,6 @@ class GrampsPreferences:
set_bool("/apps/gramps/use-comment",vc_comment) set_bool("/apps/gramps/use-comment",vc_comment)
set_bool("/apps/gramps/dont-compress-xml",uncompress) set_bool("/apps/gramps/dont-compress-xml",uncompress)
set_bool("/apps/gramps/id-edit",id_edit) set_bool("/apps/gramps/id-edit",id_edit)
# set_bool("/apps/gramps/capitalize",capitalize)
set_bool("/apps/gramps/index-visible",index_visible) set_bool("/apps/gramps/index-visible",index_visible)
set_int("/apps/gramps/statusbar",status_bar) set_int("/apps/gramps/statusbar",status_bar)
set_int("/apps/gramps/toolbar",save_toolbar) set_int("/apps/gramps/toolbar",save_toolbar)
@ -970,8 +962,9 @@ class GrampsPreferences:
format_menu = self.top.get_widget("name_format").get_menu() format_menu = self.top.get_widget("name_format").get_menu()
active_name = format_menu.get_active().get_data(INDEX) active_name = format_menu.get_active().get_data(INDEX)
name_tuple = _name_format_list[active_name] nameof = _name_format_list[active_name][1]
nameof = name_tuple[1] display_name = _name_format_list[active_name][2]
display_surname = _name_format_list[active_name][3]
set_int("/apps/gramps/nameFormat",active_name) set_int("/apps/gramps/nameFormat",active_name)
format_menu = self.top.get_widget("lastnamegen").get_menu() format_menu = self.top.get_widget("lastnamegen").get_menu()

View File

@ -256,8 +256,11 @@ class PeopleView:
(m,iter) = self.id2col[id] (m,iter) = self.id2col[id]
self.parent.modify_statusbar() self.parent.modify_statusbar()
try:
model.selection.unselect_all() model.selection.unselect_all()
model.selection.select_iter(iter) model.selection.select_iter(iter)
except:
print iter
itpath = model.model.get_path(iter) itpath = model.model.get_path(iter)
col = model.tree.get_column(0) col = model.tree.get_column(0)

View File

@ -2127,6 +2127,10 @@ class GrampsDB:
self.personTable[nkey] = person.getDisplayInfo() self.personTable[nkey] = person.getDisplayInfo()
self.addSurname(person.getPrimaryName().getSurname()) self.addSurname(person.getPrimaryName().getSurname())
def rebuildPersonTable(self):
for key in self.personTable.keys():
self.personTable[key] = self.personMap[key].getDisplayInfo()
def buildPlaceDisplay(self,nkey,okey=None): def buildPlaceDisplay(self,nkey,okey=None):
if nkey != okey and okey != None: if nkey != okey and okey != None:
del self.placeTable[okey] del self.placeTable[okey]

View File

@ -160,9 +160,12 @@ class Gramps:
self.db.setResearcher(GrampsCfg.get_researcher()) self.db.setResearcher(GrampsCfg.get_researcher())
def pref_callback(self,val): def pref_callback(self,val):
self.db.rebuildPersonTable()
self.modify_statusbar() self.modify_statusbar()
self.family_view.init_interface() self.family_view.init_interface()
self.update_display(val) self.people_view.clear_person_tabs()
self.update_display(1)
self.goto_active_person()
self.toolbar.set_style(GrampsCfg.toolbar) self.toolbar.set_style(GrampsCfg.toolbar)
def init_interface(self): def init_interface(self):