* src/ChooseParents.py (ModifyParents.__init__): Make the dialog modal
and a transient for its parent; (ModifyParents.on_help_clicked): Add function; (ChooseParents.__init__): Make the dialog modal and a transient for its parent; (ChooseParents.on_help_clicked): Add function. * src/FamilyView.py: Pass the window to the ChooseParents classes. svn: r2349
This commit is contained in:
@ -18,6 +18,8 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# $Id$
|
||||
|
||||
"""
|
||||
ChooseParents interface allows users to select the paretns of an
|
||||
individual.
|
||||
@ -39,6 +41,7 @@ from gettext import gettext as _
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import gtk.glade
|
||||
import gnome
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -63,7 +66,7 @@ class ChooseParents:
|
||||
Displays the Choose Parents dialog box, allowing the parents
|
||||
to be edited.
|
||||
"""
|
||||
def __init__(self,db,person,family,family_update,full_update):
|
||||
def __init__(self,db,person,family,family_update,full_update,parent_window=None):
|
||||
"""
|
||||
Creates a ChoosePerson dialog box.
|
||||
|
||||
@ -136,14 +139,25 @@ class ChooseParents:
|
||||
self.redrawm()
|
||||
|
||||
self.glade.signal_autoconnect({
|
||||
"on_save_parents_clicked" : self.save_parents_clicked,
|
||||
"on_add_parent_clicked" : self.add_parent_clicked,
|
||||
"on_prel_changed" : self.parent_relation_changed,
|
||||
"on_showallf_toggled" : self.showallf_toggled,
|
||||
"on_showallm_toggled" : self.showallm_toggled,
|
||||
"destroy_passed_object" : Utils.destroy_passed_object
|
||||
"on_help_familyDialog_clicked" : self.on_help_clicked,
|
||||
})
|
||||
|
||||
if parent_window:
|
||||
self.top.set_transient_for(parent_window)
|
||||
self.val = self.top.run()
|
||||
if self.val == gtk.RESPONSE_OK:
|
||||
self.save_parents_clicked()
|
||||
self.top.destroy()
|
||||
|
||||
def on_help_clicked(self,obj):
|
||||
"""Display the relevant portion of GRAMPS manual"""
|
||||
gnome.help_display('gramps-manual','gramps-spec-par')
|
||||
self.val = self.top.run()
|
||||
|
||||
def redrawf(self):
|
||||
"""Redraws the potential father list"""
|
||||
|
||||
@ -369,7 +383,7 @@ class ChooseParents:
|
||||
self.mmodel.find(mother.getId())
|
||||
self.mmodel.center_selected()
|
||||
|
||||
def save_parents_clicked(self,obj):
|
||||
def save_parents_clicked(self):
|
||||
"""
|
||||
Called with the OK button nis pressed. Saves the selected people as parents
|
||||
of the main perosn.
|
||||
@ -409,7 +423,6 @@ class ChooseParents:
|
||||
else:
|
||||
self.family = None
|
||||
|
||||
Utils.destroy_passed_object(obj)
|
||||
if self.family:
|
||||
self.family.setRelationship(self.type)
|
||||
self.change_family_type(self.family,mother_rel,father_rel)
|
||||
@ -477,7 +490,7 @@ class ChooseParents:
|
||||
|
||||
|
||||
class ModifyParents:
|
||||
def __init__(self,db,person,family,family_update,full_update):
|
||||
def __init__(self,db,person,family,family_update,full_update,parent_window=None):
|
||||
"""
|
||||
Creates a ChoosePerson dialog box.
|
||||
|
||||
@ -519,8 +532,7 @@ class ModifyParents:
|
||||
self.father_rel.set_text(self.orig_frel)
|
||||
|
||||
self.glade.signal_autoconnect({
|
||||
"on_save_parents_clicked" : self.save_parents_clicked,
|
||||
"destroy_passed_object" : self.quit,
|
||||
"on_parents_help_clicked" : self.on_help_clicked,
|
||||
})
|
||||
|
||||
self.title.set_use_markup(gtk.TRUE)
|
||||
@ -554,13 +566,20 @@ class ModifyParents:
|
||||
else:
|
||||
self.pref.set_active(0)
|
||||
|
||||
self.top.show()
|
||||
|
||||
|
||||
def quit(self,obj):
|
||||
if parent_window:
|
||||
self.top.set_transient_for(parent_window)
|
||||
self.val = self.top.run()
|
||||
if self.val == gtk.RESPONSE_OK:
|
||||
self.save_parents_clicked()
|
||||
self.top.destroy()
|
||||
|
||||
def save_parents_clicked(self,obj):
|
||||
|
||||
|
||||
def on_help_clicked(self,obj):
|
||||
"""Display the relevant portion of GRAMPS manual"""
|
||||
gnome.help_display('gramps-manual','gramps-spec-par')
|
||||
self.val = self.top.run()
|
||||
|
||||
def save_parents_clicked(self):
|
||||
"""
|
||||
Called with the OK button nis pressed. Saves the selected people as parents
|
||||
of the main perosn.
|
||||
@ -569,7 +588,6 @@ class ModifyParents:
|
||||
father_rel = const.childRelations[self.father_rel.get_text()]
|
||||
mod = 0
|
||||
|
||||
Utils.destroy_passed_object(self.top)
|
||||
if mother_rel != self.orig_mrel or father_rel != self.orig_frel:
|
||||
self.person.removeAltFamily(self.family)
|
||||
self.person.addAltFamily(self.family,mother_rel,father_rel)
|
||||
|
Reference in New Issue
Block a user