* src/SourceView.py (button_press,on_add_clicked,on_delete_clicked,
on_edit_clicked): Pass parent window to the child dialog. * src/Sources.py (add_src_clicked): Likewise. * src/EditSource.py (__init__): Add optional parent_window argument. Make dialog modal and transient for its parent. * src/gramps.glade (sourceEditor dialog): Delete unneeded handlers for buttons. * src/QuestionDialog.py (SaveDialog,QuestionDialog,OptionDialog, ErrorDialog,WarningDialog,MissingMediaDialog): Set transient status if parent is given. * src/EventEdit.py (__init__): Make dialog modal and transient for its parent. * src/Witness.py: Make WittnessEditor dialog modal and transient for its parent. Call SelectPerson with itself as a parent. * src/SelectPerson.py (__init__): Make dialog transient for its parent. * src/imagesel.glade: Define proper responses and delete unneeded handlers for buttons. Make gtkFileEntry modal. * src/dialog.glade (all dialogs): Define proper responses for buttons. * src/EditPerson.py (on_add_aka_clicked, on_aka_update_clicked): Call NameEdit with itself as a parent; (on_add_attr_clicked, on_update_attr_clicked): Call AttributeEditor with itself as a parent; (on_add_addr_clicked,on_update_addr_clicked): Call AddressEditor with itself as a parent; (on_add_url_clicked,on_update_url_clicked): Call UrlEditor with itself as a parent; (on_name_note_clicked, on_ldsbap_note_clicked,on_ldsendow_note_clicked, on_ldsseal_note_clicked): Call NoteEditor with itself as a parent. * src/NameEdit.py (__init__): Make dialog modal and transient for its parent. * src/AttrEdit.py (__init__): Likewise. * src/AddrEdit.py (__init__): Likewise. * src/UrlEdit.py (__init__): Likewise. * src/NoteEdit.py (__init__): Likewise. svn: r2131
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000 Donald N. Allingham
|
||||
# Copyright (C) 2000-2003 Donald N. Allingham
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -46,7 +46,7 @@ from gettext import gettext as _
|
||||
|
||||
class EditSource:
|
||||
|
||||
def __init__(self,source,db,func=None):
|
||||
def __init__(self,source,db,parent_window=None,func=None):
|
||||
self.source = source
|
||||
self.db = db
|
||||
self.callback = func
|
||||
@ -61,7 +61,7 @@ class EditSource:
|
||||
_('Source Editor'))
|
||||
|
||||
plwidget = self.top_window.get_widget("iconlist")
|
||||
self.gallery = ImageSelect.Gallery(source, self.path, plwidget, db, self)
|
||||
self.gallery = ImageSelect.Gallery(source, self.path, plwidget, db, self, self.top)
|
||||
self.author = self.top_window.get_widget("author")
|
||||
self.pubinfo = self.top_window.get_widget("pubinfo")
|
||||
self.note = self.top_window.get_widget("source_note")
|
||||
@ -77,19 +77,25 @@ class EditSource:
|
||||
self.notes_buffer.set_text(source.getNote())
|
||||
|
||||
self.top_window.signal_autoconnect({
|
||||
"destroy_passed_object" : self.close,
|
||||
"on_switch_page" : self.on_switch_page,
|
||||
"on_addphoto_clicked" : self.gallery.on_add_photo_clicked,
|
||||
"on_deletephoto_clicked" : self.gallery.on_delete_photo_clicked,
|
||||
"on_edit_properties_clicked": self.gallery.popup_change_description,
|
||||
"on_sourceapply_clicked" : self.on_source_apply_clicked
|
||||
})
|
||||
|
||||
|
||||
if self.source.getId() == "":
|
||||
self.top_window.get_widget("edit_photo").set_sensitive(0)
|
||||
self.top_window.get_widget("delete_photo").set_sensitive(0)
|
||||
|
||||
if parent_window:
|
||||
self.top.set_transient_for(parent_window)
|
||||
|
||||
self.top.show()
|
||||
val = self.top.run()
|
||||
if val == gtk.RESPONSE_OK:
|
||||
self.on_source_apply_clicked()
|
||||
self.top.destroy()
|
||||
|
||||
def close(self,obj):
|
||||
self.gallery.close()
|
||||
self.top.destroy()
|
||||
@ -184,7 +190,7 @@ class EditSource:
|
||||
for p in p_list:
|
||||
self.model.add([_("Places"),p,''])
|
||||
|
||||
def on_source_apply_clicked(self,obj):
|
||||
def on_source_apply_clicked(self):
|
||||
|
||||
title = self.title.get_text()
|
||||
author = self.author.get_text()
|
||||
@ -271,6 +277,3 @@ class DelSrcQuery:
|
||||
self.delete_source(self.db.getPlace(key))
|
||||
|
||||
self.update(0)
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user