diff --git a/gramps/src/Config.py b/gramps/src/Config.py index 1c1d646a5..02a47e65a 100644 --- a/gramps/src/Config.py +++ b/gramps/src/Config.py @@ -88,6 +88,7 @@ _name_format_list = [ owner = Researcher.Researcher() autoload = 0 usetabs = 0 +show_detail = 0 hide_altnames = 0 lastfile = None nameof = utils.normal_name @@ -136,6 +137,7 @@ def loadConfig(call): global autoload global owner global usetabs + global show_detail global hide_altnames global lastfile global nameof @@ -151,6 +153,7 @@ def loadConfig(call): _callback = call lastfile = gnome.config.get_string("/gramps/data/LastFile") usetabs = gnome.config.get_bool("/gramps/config/UseTabs") + show_detail = gnome.config.get_bool("/gramps/config/ShowDetail") 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") @@ -197,6 +200,8 @@ def loadConfig(call): autoload = 1 if usetabs == None: usetabs = 0 + if show_detail == None: + show_detail = 0 if status_bar == None: status_bar = 0 if hide_altnames == None: @@ -290,10 +295,12 @@ def on_propertybox_apply(obj,page): global hide_altnames global paper_preference global output_preference + global show_detail if page != -1: return + show_detail = prefsTop.get_widget("showdetail").get_active() autoload = prefsTop.get_widget("autoload").get_active() display_attr = prefsTop.get_widget("attr_display").get_active() attr_name = string.strip(prefsTop.get_widget("attr_name").get_text()) @@ -313,6 +320,7 @@ def on_propertybox_apply(obj,page): output_preference = output_obj.get_data("d") gnome.config.set_bool("/gramps/config/UseTabs",usetabs) + gnome.config.set_bool("/gramps/config/ShowDetail",show_detail) 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) @@ -445,9 +453,11 @@ def display_preferences_box(): pbox = prefsTop.get_widget("propertybox") auto = prefsTop.get_widget("autoload") tabs = prefsTop.get_widget("usetabs") + detail = prefsTop.get_widget("showdetail") display_attr_obj = prefsTop.get_widget("attr_display") display_altnames = prefsTop.get_widget("display_altnames") auto.set_active(autoload) + detail.set_active(show_detail) tabs.set_active(usetabs) display_attr_obj.set_active(display_attr) diff --git a/gramps/src/EditPerson.glade b/gramps/src/EditPerson.glade index b2d722b49..a23e56699 100644 --- a/gramps/src/EditPerson.glade +++ b/gramps/src/EditPerson.glade @@ -1200,8 +1200,8 @@ on_nameList_select_row Mon, 18 Dec 2000 22:29:26 GMT - 1 - 80 + 2 + 450,50 GTK_SELECTION_SINGLE True GTK_SHADOW_IN @@ -1218,6 +1218,19 @@ 0 0 + + + GtkLabel + CList:title + name_detail + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + @@ -1636,8 +1649,8 @@ on_eventList_select_row Fri, 01 Dec 2000 02:58:20 GMT - 3 - 162,119,80 + 4 + 125,150,200,50 GTK_SELECTION_SINGLE True GTK_SHADOW_IN @@ -1680,6 +1693,19 @@ 0 0 + + + GtkLabel + CList:title + event_details + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + @@ -1985,8 +2011,8 @@ on_attr_list_select_row Tue, 01 May 2001 17:24:40 GMT - 2 - 238,80 + 3 + 200,250,50 GTK_SELECTION_SINGLE True GTK_SHADOW_IN @@ -2016,6 +2042,19 @@ 0 0 + + + GtkLabel + CList:title + attr_details + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + @@ -2509,8 +2548,8 @@ on_address_list_select_row Wed, 23 May 2001 18:42:16 GMT - 2 - 165,80 + 3 + 150,350,50 GTK_SELECTION_SINGLE True GTK_SHADOW_IN @@ -2540,6 +2579,19 @@ 0 0 + + + GtkLabel + CList:title + address_details + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + diff --git a/gramps/src/EditPerson.py b/gramps/src/EditPerson.py index 9937f21cf..6b2475c0c 100644 --- a/gramps/src/EditPerson.py +++ b/gramps/src/EditPerson.py @@ -181,6 +181,11 @@ class EditPerson: death = person.getDeath() self.get_widget("gid").set_text(str(person.getId())) + self.event_list.set_column_visibility(3,Config.show_detail) + self.name_list.set_column_visibility(1,Config.show_detail) + self.attr_list.set_column_visibility(2,Config.show_detail) + self.address_list.set_column_visibility(2,Config.show_detail) + if Config.display_attr: self.get_widget("user_label").set_text(Config.attr_name) val = "" @@ -263,7 +268,13 @@ class EditPerson: self.name_list.clear() self.name_index = 0 + attr = "" for name in self.person.getAlternateNames(): + if Config.show_detail: + if name.getNote() != "": + attr = "N" + if name.getSourceRef(): + attr = attr + "S" self.name_list.append([name.getName()]) self.name_list.set_row_data(self.name_index,name) self.name_index = self.name_index + 1 @@ -317,8 +328,14 @@ class EditPerson: self.attr_list.clear() self.attr_index = 0 + detail = "" for attr in self.person.getAttributeList(): - self.attr_list.append([attr.getType(),attr.getValue()]) + if Config.show_detail: + if attr.getNote() != "": + detail = "N" + if attr.getSourceRef(): + detail = detail + "S" + self.attr_list.append([attr.getType(),attr.getValue(),detail]) self.attr_list.set_row_data(self.attr_index,attr) self.attr_index = self.attr_index + 1 @@ -343,11 +360,17 @@ class EditPerson: self.address_list.freeze() self.address_list.clear() + detail = "" self.address_index = 0 for address in self.person.getAddressList(): + if Config.show_detail: + if address.getNote() != "": + detail = "N" + if address.getSourceRef(): + detail = detail + "S" location = address.getCity() + " " + address.getState() + " " + \ address.getCountry() - self.address_list.append([address.getDate(),location]) + self.address_list.append([address.getDate(),location,detail]) self.address_list.set_row_data(self.address_index,address) self.address_index = self.address_index + 1 @@ -374,9 +397,15 @@ class EditPerson: self.event_list.clear() self.event_index = 0 + attr = "" for event in self.person.getEventList(): + if Config.show_detail: + if event.getNote() != "": + attr = "N" + if event.getSourceRef(): + attr = attr + "S" self.event_list.append([event.getName(),event.getQuoteDate(),\ - event.getPlace()]) + event.getPlace(),attr]) self.event_list.set_row_data(self.event_index,event) self.event_index = self.event_index + 1 diff --git a/gramps/src/Marriage.py b/gramps/src/Marriage.py index e0959444b..28ddea00e 100644 --- a/gramps/src/Marriage.py +++ b/gramps/src/Marriage.py @@ -110,6 +110,9 @@ class Marriage: self.attr_type = self.get_widget("attr_type") self.attr_value = self.get_widget("attr_value") + self.event_list.set_column_visibility(3,Config.show_detail) + self.attr_list.set_column_visibility(2,Config.show_detail) + # set initial data mevent_list = self.get_widget("marriageEvent") mevent_list.set_popdown_strings(const.marriageEvents) @@ -149,8 +152,14 @@ class Marriage: self.attr_list.clear() self.attr_index = 0 + details = "" for attr in self.family.getAttributeList(): - self.attr_list.append([attr.getType(),attr.getValue()]) + if Config.show_detail: + if attr.getNote() != "": + detail = "N" + if attr.getSourceRef(): + detail = detail + "S" + self.attr_list.append([attr.getType(),attr.getValue(),details]) self.attr_list.set_row_data(self.attr_index,attr) self.attr_index = self.attr_index + 1 @@ -175,7 +184,13 @@ class Marriage: def add_event(self,text,event): if not event: return - self.event_list.append([text,event.getQuoteDate(),event.getPlace()]) + detail = "" + if Config.show_detail: + if event.getNote() != "": + detail = "N" + if event.getSourceRef(): + detail = detail + "S" + self.event_list.append([text,event.getQuoteDate(),event.getPlace(),detail]) self.event_list.set_row_data(self.lines,event) self.lines = self.lines + 1 diff --git a/gramps/src/config.glade b/gramps/src/config.glade index 0aa8a98fd..2b30471e0 100644 --- a/gramps/src/config.glade +++ b/gramps/src/config.glade @@ -148,35 +148,6 @@ - - GtkCheckButton - display_altnames - True - - toggled - on_object_toggled - propertybox - Sun, 22 Apr 2001 21:20:17 GMT - - - False - True - - 0 - 1 - 2 - 3 - 5 - 5 - False - False - False - False - True - False - - - GtkCheckButton attr_display @@ -436,12 +407,104 @@ GtkTable table21 - 1 + 2 2 False 0 0 + + GtkFrame + frame7 + + 0 + GTK_SHADOW_ETCHED_IN + + 1 + 2 + 0 + 1 + 5 + 5 + True + True + False + False + True + True + + + + GtkVBox + vbox25 + False + 0 + + + GtkRadioButton + stat1 + True + + toggled + on_object_toggled + propertybox + Wed, 30 May 2001 02:18:01 GMT + + + True + True + status + + 0 + False + False + + + + + GtkRadioButton + stat2 + True + + toggled + on_object_toggled + propertybox + Wed, 30 May 2001 02:18:16 GMT + + + False + True + status + + 0 + False + False + + + + + GtkRadioButton + stat3 + True + + toggled + on_object_toggled + propertybox + Wed, 30 May 2001 02:18:29 GMT + + + False + True + status + + 0 + False + False + + + + + GtkFrame frame4 @@ -452,7 +515,7 @@ 0 1 0 - 1 + 2 5 5 False @@ -725,19 +788,19 @@ GtkFrame - frame7 - + frame8 + 0 GTK_SHADOW_ETCHED_IN 1 2 - 0 - 1 + 1 + 2 5 5 - True - True + False + False False False True @@ -746,24 +809,23 @@ GtkVBox - vbox25 + vbox26 False 0 - GtkRadioButton - stat1 + GtkCheckButton + display_altnames True toggled on_object_toggled propertybox - Wed, 30 May 2001 02:18:01 GMT + Sun, 22 Apr 2001 21:20:17 GMT - - True + + False True - status 0 False @@ -772,40 +834,18 @@ - GtkRadioButton - stat2 + GtkCheckButton + showdetail True toggled on_object_toggled propertybox - Wed, 30 May 2001 02:18:16 GMT + Sat, 09 Jun 2001 14:12:06 GMT - + False True - status - - 0 - False - False - - - - - GtkRadioButton - stat3 - True - - toggled - on_object_toggled - propertybox - Wed, 30 May 2001 02:18:29 GMT - - - False - True - status 0 False diff --git a/gramps/src/gramps.glade b/gramps/src/gramps.glade index a5c5e5d71..2500c05e4 100644 --- a/gramps/src/gramps.glade +++ b/gramps/src/gramps.glade @@ -1585,8 +1585,8 @@ on_child_list_button_press_event Thu, 21 Dec 2000 20:47:47 GMT - 4 - 251,80,149,100 + 5 + 210,50,200,75,50 GTK_SELECTION_SINGLE True GTK_SHADOW_IN @@ -1621,7 +1621,7 @@ GtkLabel CList:title label15 - + GTK_JUSTIFY_CENTER False 0.5 @@ -1642,6 +1642,19 @@ 0 0 + + + GtkLabel + CList:title + noteinfo + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + diff --git a/gramps/src/gramps_main.py b/gramps/src/gramps_main.py index 2bb60d5dc..85a294942 100755 --- a/gramps/src/gramps_main.py +++ b/gramps/src/gramps_main.py @@ -593,7 +593,11 @@ def marriage_edit(family): #------------------------------------------------------------------------- def full_update(): Main.get_widget(NOTEBOOK).set_show_tabs(Config.usetabs) - update_display(1) + Main.get_widget("child_list").set_column_visibility(4,Config.show_detail) + apply_filter() + load_family() + load_sources() + load_tree() #------------------------------------------------------------------------- # @@ -764,6 +768,7 @@ def read_file(filename): statusbar.set_status("") Config.save_last_file("") + full_update() statusbar.set_progress(0.0) #------------------------------------------------------------------------- @@ -1843,6 +1848,7 @@ def display_marriage(family): child_list = family.getChildList() child_list.sort(sort.by_birthdate) + attr = "" for child in child_list: status = "unknown" if child.getGender(): @@ -1855,7 +1861,24 @@ def display_marriage(family): for fam in child.getAltFamilyList(): if fam[0] == family: status = fam[1] - clist.append([Config.nameof(child),gender,birthday(child),status]) + + if Config.show_detail: + attr = "" + if child.getNote() != "": + attr = attr + "N" + if len(child.getEventList())>0: + attr = attr + "E" + if len(child.getAttributeList())>0: + attr = attr + "A" + if len(child.getFamilyList()) > 0: + for f in child.getFamilyList(): + if f.getFather() and f.getMother(): + attr = attr + "M" + break + if len(child.getPhotoList()) > 0: + attr = attr + "P" + + clist.append([Config.nameof(child),gender,birthday(child),status,attr]) clist.set_row_data(i,child) i=i+1 if i != 0: @@ -2231,7 +2254,8 @@ def main(arg): database = RelDataBase() Config.loadConfig(full_update) Main.get_widget(NOTEBOOK).set_show_tabs(Config.usetabs) - + Main.get_widget("child_list").set_column_visibility(4,Config.show_detail) + if arg != None: read_file(arg) elif Config.lastfile != None and Config.lastfile != "" and Config.autoload: diff --git a/gramps/src/marriage.glade b/gramps/src/marriage.glade index a849fcaff..d6e100a9e 100644 --- a/gramps/src/marriage.glade +++ b/gramps/src/marriage.glade @@ -493,8 +493,8 @@ on_marriageEventList_select_row Sat, 25 Nov 2000 16:53:14 GMT - 3 - 128,124,80 + 4 + 100,150,175,50 GTK_SELECTION_SINGLE True GTK_SHADOW_IN @@ -542,6 +542,19 @@ 0 0 + + + GtkLabel + CList:title + event_details + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + @@ -831,8 +844,8 @@ on_attr_list_select_row Sat, 02 Jun 2001 18:58:35 GMT - 2 - 189,80 + 3 + 200,250,50 GTK_SELECTION_SINGLE True GTK_SHADOW_IN @@ -862,6 +875,19 @@ 0 0 + + + GtkLabel + CList:title + attr_details + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + diff --git a/gramps/src/plugins/ReadGedcom.py b/gramps/src/plugins/ReadGedcom.py index 3990f18a6..251c513dd 100644 --- a/gramps/src/plugins/ReadGedcom.py +++ b/gramps/src/plugins/ReadGedcom.py @@ -545,8 +545,9 @@ class GedcomParser: else: self.parse_person_object(2) elif matches[1] == "NOTE": - if matches[2] and matches[2][0] != "@": - note = matches[1] + self.parse_continue_data(1) + print matches[2] + if not string.strip(matches[2]) or matches[2] and matches[2][0] != "@": + note = matches[2] + self.parse_continue_data(1) self.person.setNote(note) self.ignore_sub_junk(2) else: @@ -633,7 +634,7 @@ class GedcomParser: self.backup() return note elif matches[1] == "NOTE": - if matches[2] and matches[2][0] != "@": + if not string.strip(matches[2]) or matches[2] and matches[2][0] != "@": note = matches[2] + self.parse_continue_data(level+1) self.parse_note_data(level+1) else: @@ -660,7 +661,7 @@ class GedcomParser: elif matches[1] == "_PRIMARY": type = matches[1] elif matches[1] == "NOTE": - if matches[2] and matches[2][0] != "@": + if not string.strip(matches[2]) or matches[2] and matches[2][0] != "@": note = matches[2] + self.parse_continue_data(level+1) self.parse_note_data(level+1) else: @@ -786,7 +787,7 @@ class GedcomParser: elif matches[1] == "PHON": pass elif matches[1] == "NOTE": - if matches[2] and matches[2][0] != "@": + if not string.strip(matches[2]) or matches[2] and matches[2][0] != "@": note = matches[1] + self.parse_continue_data(1) self.address.setNote(note) self.ignore_sub_junk(2) @@ -920,7 +921,7 @@ class GedcomParser: event.setPlace(matches[2]) self.ignore_sub_junk(level+1) elif matches[1] == "NOTE": - if matches[2] and matches[2][0] != "@": + if not string.strip(matches[2]) or matches[2] and matches[2][0] != "@": note = matches[1] + self.parse_continue_data(1) event.setNote(note) self.ignore_sub_junk(2) @@ -957,7 +958,7 @@ class GedcomParser: elif matches[1] == "QUAY": pass elif matches[1] == "NOTE": - if matches[2] and matches[2][0] != "@": + if not string.strip(matches[2]) or matches[2] and matches[2][0] != "@": note = matches[1] + self.parse_continue_data(1) source.setComments(note) self.ignore_sub_junk(2)