* src/gramps_main.py: Really fix start-up view when family

view style is the default. Clean up the use of views.
(post_load): Select the person with the alphabetically lowest ID
to be active if no home person is set. Fixes 793127.
(goto_active_person): Create alpha page if it does not exist.
* src/FamilyView.py (init_interface): Do not connect handlers to
events if they already exist;
(set_widgets): Set correct page before hiding the old one. Fixes
resizing issue on applying preferences after changing Family View
layout.


svn: r2087
This commit is contained in:
Alex Roitman 2003-09-03 04:57:36 +00:00
parent 3b3e0a29f6
commit 8f88ab5b6b
3 changed files with 39 additions and 18 deletions

View File

@ -1,12 +1,20 @@
2003-09-02 Alex Roitman <shura@alex.neuro.umn.edu>
* src/gramps_main.py: Really fix start-up view when family
view style is the default. Clean up the use of views.
(post_load): Select the person with the alphabetically lowest ID
to be active if no home person is set. Fixes 793127.
(goto_active_person): Create alpha page if it does not exist.
* src/FamilyView.py (init_interface): Do not connect handlers to
events if they already exist;
(set_widgets): Set correct page before hiding the old one. Fixes
resizing issue on applying preferences after changing Family View
layout.
2003-09-02 Don Allingham <dallingham@users.sourceforge.net> 2003-09-02 Don Allingham <dallingham@users.sourceforge.net>
* src/po/Makefile.am: convert .po files to unicode before * src/po/Makefile.am: convert .po files to unicode before
running through msgfmt running through msgfmt
* src/revision.glade: make the open dialog box a bit bigger * src/revision.glade: make the open dialog box a bit bigger
2003-09-02 Alex Roitman <shura@alex.neuro.umn.edu>
* src/gramps_main.py: Really fix start-up view when family
view style is the default. Clean up the use of views.
2003-09-02 Tim Waugh <twaugh@redhat.com> 2003-09-02 Tim Waugh <twaugh@redhat.com>
* src/plugins/GraphViz.py: Fixed typo. * src/plugins/GraphViz.py: Fixed typo.
* src/gramps_main.py: Fixed start-up view when family view style * src/gramps_main.py: Fixed start-up view when family view style

View File

@ -70,8 +70,6 @@ class FamilyView:
def set_widgets(self,val): def set_widgets(self,val):
if (val): if (val):
self.parent.views.get_nth_page(1).hide()
self.parent.views.get_nth_page(2).show()
self.ap_data = self.top.get_widget('ap_data2') self.ap_data = self.top.get_widget('ap_data2')
self.swap_btn = self.top.get_widget('swap_btn2') self.swap_btn = self.top.get_widget('swap_btn2')
self.ap_parents = self.top.get_widget('ap_parents2') self.ap_parents = self.top.get_widget('ap_parents2')
@ -91,9 +89,11 @@ class FamilyView:
self.top.get_widget('select_child2').connect('clicked',self.select_child_clicked) self.top.get_widget('select_child2').connect('clicked',self.select_child_clicked)
self.top.get_widget('ap_parents_btn2').connect('clicked',self.ap_parents_clicked) self.top.get_widget('ap_parents_btn2').connect('clicked',self.ap_parents_clicked)
self.top.get_widget('sp_parents_btn2').connect('clicked',self.sp_parents_clicked) self.top.get_widget('sp_parents_btn2').connect('clicked',self.sp_parents_clicked)
self.parent.views.get_nth_page(2).show_all()
if self.parent.views.get_current_page() == 1:
self.parent.views.set_current_page(2)
self.parent.views.get_nth_page(1).hide()
else: else:
self.parent.views.get_nth_page(1).show()
self.parent.views.get_nth_page(2).hide()
self.ap_data = self.top.get_widget('ap_data') self.ap_data = self.top.get_widget('ap_data')
self.swap_btn = self.top.get_widget('swap_spouse_btn') self.swap_btn = self.top.get_widget('swap_spouse_btn')
self.ap_parents = self.top.get_widget('ap_parents') self.ap_parents = self.top.get_widget('ap_parents')
@ -113,6 +113,10 @@ class FamilyView:
self.top.get_widget('select_child').connect('clicked',self.select_child_clicked) self.top.get_widget('select_child').connect('clicked',self.select_child_clicked)
self.top.get_widget('ap_parents_btn').connect('clicked',self.ap_parents_clicked) self.top.get_widget('ap_parents_btn').connect('clicked',self.ap_parents_clicked)
self.top.get_widget('sp_parents_btn').connect('clicked',self.sp_parents_clicked) self.top.get_widget('sp_parents_btn').connect('clicked',self.sp_parents_clicked)
self.parent.views.get_nth_page(1).show_all()
if self.parent.views.get_current_page() == 2:
self.parent.views.set_current_page(1)
self.parent.views.get_nth_page(2).hide()
def init_interface(self): def init_interface(self):
fv = GrampsCfg.familyview fv = GrampsCfg.familyview
@ -146,6 +150,7 @@ class FamilyView:
self.spouse_model = gtk.ListStore(gobject.TYPE_STRING) self.spouse_model = gtk.ListStore(gobject.TYPE_STRING)
self.spouse_list.set_model(self.spouse_model) self.spouse_list.set_model(self.spouse_model)
self.spouse_selection = self.spouse_list.get_selection() self.spouse_selection = self.spouse_list.get_selection()
if not already_init:
self.spouse_selection.connect('changed',self.spouse_changed) self.spouse_selection.connect('changed',self.spouse_changed)
self.spouse_list.connect('button-press-event',self.edit_relationship) self.spouse_list.connect('button-press-event',self.edit_relationship)
@ -167,6 +172,7 @@ class FamilyView:
self.child_selection = self.child_list.get_selection() self.child_selection = self.child_list.get_selection()
if not already_init:
self.child_list.connect('button-press-event',self.on_child_list_button_press) self.child_list.connect('button-press-event',self.on_child_list_button_press)
self.swap_btn.connect('clicked',self.spouse_swap) self.swap_btn.connect('clicked',self.spouse_swap)

View File

@ -1631,6 +1631,8 @@ class Gramps:
pg = pg[0] pg = pg[0]
else: else:
pg = '' pg = ''
if not self.alpha_page.has_key(pg):
self.create_new_panel(pg)
model = self.alpha_page[pg] model = self.alpha_page[pg]
iter = None iter = None
@ -2051,6 +2053,11 @@ class Gramps:
self.statusbar.set_progress_percentage(1.0) self.statusbar.set_progress_percentage(1.0)
person = self.db.getDefaultPerson() person = self.db.getDefaultPerson()
if not person:
the_ids = self.db.getPersonMap().keys()
if the_ids:
the_ids.sort()
person = self.db.getPerson(the_ids[0])
self.change_active_person(person) self.change_active_person(person)
self.full_update() self.full_update()