2002-10-20 14:25:16 +00:00
|
|
|
#
|
|
|
|
# Gramps - a GTK+/GNOME based genealogy program
|
|
|
|
#
|
2006-02-28 19:54:35 +00:00
|
|
|
# Copyright (C) 2000-2006 Donald N. Allingham
|
2002-10-20 14:25:16 +00:00
|
|
|
#
|
|
|
|
# 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
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
#
|
|
|
|
|
* src/gramps_main.py (tool_callback): Typo.
* src/QuestionDialog.py: Use gramps icon.
* src/plugins/EventCmp.py: HIG; single instance; help.
* src/plugins/eventcmp.glade: HIG; help.
* src/plugins/Desbrowser.py: HIG, help, rebuild model after edit.
* src/plugins/desbrowse.glade: help, info label.
* src/plugins/PatchNames.py: HIG, help, single instance.
* src/plugins/patchnames.glade: HIG, help.
* src/plugins/Merge.py: HIG, help, single instance.
* src/plugins/merge.glade: HIG, help.
* src/plugins/ChangeNames.py: HIG, help, single instance.
svn: r4230
2005-03-24 06:22:25 +00:00
|
|
|
# $Id$
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Standard python modules
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2006-04-06 22:02:46 +00:00
|
|
|
from gettext import gettext as _
|
* src/gramps_main.py (tool_callback): Typo.
* src/QuestionDialog.py: Use gramps icon.
* src/plugins/EventCmp.py: HIG; single instance; help.
* src/plugins/eventcmp.glade: HIG; help.
* src/plugins/Desbrowser.py: HIG, help, rebuild model after edit.
* src/plugins/desbrowse.glade: help, info label.
* src/plugins/PatchNames.py: HIG, help, single instance.
* src/plugins/patchnames.glade: HIG, help.
* src/plugins/Merge.py: HIG, help, single instance.
* src/plugins/merge.glade: HIG, help.
* src/plugins/ChangeNames.py: HIG, help, single instance.
svn: r4230
2005-03-24 06:22:25 +00:00
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# GNOME/GTK+ modules
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2002-10-20 14:25:16 +00:00
|
|
|
import gtk
|
* src/gramps_main.py (tool_callback): Typo.
* src/QuestionDialog.py: Use gramps icon.
* src/plugins/EventCmp.py: HIG; single instance; help.
* src/plugins/eventcmp.glade: HIG; help.
* src/plugins/Desbrowser.py: HIG, help, rebuild model after edit.
* src/plugins/desbrowse.glade: help, info label.
* src/plugins/PatchNames.py: HIG, help, single instance.
* src/plugins/patchnames.glade: HIG, help.
* src/plugins/Merge.py: HIG, help, single instance.
* src/plugins/merge.glade: HIG, help.
* src/plugins/ChangeNames.py: HIG, help, single instance.
svn: r4230
2005-03-24 06:22:25 +00:00
|
|
|
from gtk.gdk import pixbuf_new_from_file
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Gramps modules
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2003-02-24 04:51:57 +00:00
|
|
|
import const
|
2006-03-03 00:10:52 +00:00
|
|
|
import Config
|
2003-02-24 04:51:57 +00:00
|
|
|
|
2005-12-06 06:38:09 +00:00
|
|
|
try:
|
|
|
|
ICON = pixbuf_new_from_file(const.icon)
|
|
|
|
except:
|
2006-05-01 21:11:26 +00:00
|
|
|
ICON = None
|
2002-10-20 14:25:16 +00:00
|
|
|
|
2003-02-24 04:51:57 +00:00
|
|
|
class SaveDialog:
|
* 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
2003-09-15 04:11:30 +00:00
|
|
|
def __init__(self,msg1,msg2,task1,task2,parent=None):
|
2006-01-17 05:03:30 +00:00
|
|
|
self.xml = gtk.glade.XML(const.gladeFile,"savedialog","gramps")
|
2003-02-24 04:51:57 +00:00
|
|
|
self.top = self.xml.get_widget('savedialog')
|
* src/gramps_main.py (tool_callback): Typo.
* src/QuestionDialog.py: Use gramps icon.
* src/plugins/EventCmp.py: HIG; single instance; help.
* src/plugins/eventcmp.glade: HIG; help.
* src/plugins/Desbrowser.py: HIG, help, rebuild model after edit.
* src/plugins/desbrowse.glade: help, info label.
* src/plugins/PatchNames.py: HIG, help, single instance.
* src/plugins/patchnames.glade: HIG, help.
* src/plugins/Merge.py: HIG, help, single instance.
* src/plugins/merge.glade: HIG, help.
* src/plugins/ChangeNames.py: HIG, help, single instance.
svn: r4230
2005-03-24 06:22:25 +00:00
|
|
|
self.top.set_icon(ICON)
|
2006-11-09 11:38:18 +00:00
|
|
|
self.top.set_title("%s - GRAMPS" % msg1)
|
|
|
|
|
2004-11-11 04:28:40 +00:00
|
|
|
self.dontask = self.xml.get_widget('dontask')
|
2002-10-20 14:25:16 +00:00
|
|
|
self.task1 = task1
|
2003-02-24 04:51:57 +00:00
|
|
|
self.task2 = task2
|
|
|
|
|
|
|
|
label1 = self.xml.get_widget('label1')
|
|
|
|
label1.set_text('<span weight="bold" size="larger">%s</span>' % msg1)
|
2005-02-24 00:25:34 +00:00
|
|
|
label1.set_use_markup(True)
|
2003-02-24 04:51:57 +00:00
|
|
|
|
|
|
|
label2 = self.xml.get_widget('label2')
|
|
|
|
label2.set_text(msg2)
|
2005-02-24 00:25:34 +00:00
|
|
|
label2.set_use_markup(True)
|
2003-04-04 05:48:25 +00:00
|
|
|
self.top.show()
|
* 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
2003-09-15 04:11:30 +00:00
|
|
|
if parent:
|
|
|
|
self.top.set_transient_for(parent)
|
2003-02-24 04:51:57 +00:00
|
|
|
response = self.top.run()
|
|
|
|
if response == gtk.RESPONSE_NO:
|
2002-10-20 14:25:16 +00:00
|
|
|
self.task1()
|
2003-02-24 04:51:57 +00:00
|
|
|
elif response == gtk.RESPONSE_YES:
|
|
|
|
self.task2()
|
2004-11-11 04:28:40 +00:00
|
|
|
|
2006-04-24 21:04:01 +00:00
|
|
|
Config.set(Config.DONT_ASK,self.dontask.get_active())
|
2002-10-20 14:25:16 +00:00
|
|
|
self.top.destroy()
|
|
|
|
|
2003-02-24 04:51:57 +00:00
|
|
|
class QuestionDialog:
|
* 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
2003-09-15 04:11:30 +00:00
|
|
|
def __init__(self,msg1,msg2,label,task,parent=None):
|
2006-01-17 05:03:30 +00:00
|
|
|
self.xml = gtk.glade.XML(const.gladeFile,"questiondialog","gramps")
|
2003-02-24 04:51:57 +00:00
|
|
|
self.top = self.xml.get_widget('questiondialog')
|
* src/gramps_main.py (tool_callback): Typo.
* src/QuestionDialog.py: Use gramps icon.
* src/plugins/EventCmp.py: HIG; single instance; help.
* src/plugins/eventcmp.glade: HIG; help.
* src/plugins/Desbrowser.py: HIG, help, rebuild model after edit.
* src/plugins/desbrowse.glade: help, info label.
* src/plugins/PatchNames.py: HIG, help, single instance.
* src/plugins/patchnames.glade: HIG, help.
* src/plugins/Merge.py: HIG, help, single instance.
* src/plugins/merge.glade: HIG, help.
* src/plugins/ChangeNames.py: HIG, help, single instance.
svn: r4230
2005-03-24 06:22:25 +00:00
|
|
|
self.top.set_icon(ICON)
|
2006-11-09 11:38:18 +00:00
|
|
|
self.top.set_title("%s - GRAMPS" % msg1)
|
2003-02-24 04:51:57 +00:00
|
|
|
|
|
|
|
label1 = self.xml.get_widget('label1')
|
|
|
|
label1.set_text('<span weight="bold" size="larger">%s</span>' % msg1)
|
2005-02-24 00:25:34 +00:00
|
|
|
label1.set_use_markup(True)
|
2003-02-24 04:51:57 +00:00
|
|
|
|
|
|
|
label2 = self.xml.get_widget('label2')
|
|
|
|
label2.set_text(msg2)
|
2005-02-24 00:25:34 +00:00
|
|
|
label2.set_use_markup(True)
|
2003-02-24 04:51:57 +00:00
|
|
|
|
|
|
|
self.xml.get_widget('okbutton').set_label(label)
|
|
|
|
|
2003-04-04 05:48:25 +00:00
|
|
|
self.top.show()
|
* 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
2003-09-15 04:11:30 +00:00
|
|
|
if parent:
|
|
|
|
self.top.set_transient_for(parent)
|
2003-02-24 04:51:57 +00:00
|
|
|
response = self.top.run()
|
2007-01-21 00:16:08 +00:00
|
|
|
self.top.destroy()
|
2003-02-24 04:51:57 +00:00
|
|
|
if response == gtk.RESPONSE_ACCEPT:
|
|
|
|
task()
|
|
|
|
|
2004-09-30 18:32:56 +00:00
|
|
|
class QuestionDialog2:
|
|
|
|
def __init__(self,msg1,msg2,label_msg1,label_msg2,parent=None):
|
2006-01-17 05:03:30 +00:00
|
|
|
self.xml = gtk.glade.XML(const.gladeFile,"questiondialog","gramps")
|
2004-09-30 18:32:56 +00:00
|
|
|
self.top = self.xml.get_widget('questiondialog')
|
* src/gramps_main.py (tool_callback): Typo.
* src/QuestionDialog.py: Use gramps icon.
* src/plugins/EventCmp.py: HIG; single instance; help.
* src/plugins/eventcmp.glade: HIG; help.
* src/plugins/Desbrowser.py: HIG, help, rebuild model after edit.
* src/plugins/desbrowse.glade: help, info label.
* src/plugins/PatchNames.py: HIG, help, single instance.
* src/plugins/patchnames.glade: HIG, help.
* src/plugins/Merge.py: HIG, help, single instance.
* src/plugins/merge.glade: HIG, help.
* src/plugins/ChangeNames.py: HIG, help, single instance.
svn: r4230
2005-03-24 06:22:25 +00:00
|
|
|
self.top.set_icon(ICON)
|
2006-11-09 11:38:18 +00:00
|
|
|
self.top.set_title("%s - GRAMPS" % msg1)
|
2004-09-30 18:32:56 +00:00
|
|
|
|
|
|
|
label1 = self.xml.get_widget('label1')
|
|
|
|
label1.set_text('<span weight="bold" size="larger">%s</span>' % msg1)
|
2005-02-24 00:25:34 +00:00
|
|
|
label1.set_use_markup(True)
|
2004-09-30 18:32:56 +00:00
|
|
|
|
|
|
|
label2 = self.xml.get_widget('label2')
|
|
|
|
label2.set_text(msg2)
|
2005-02-24 00:25:34 +00:00
|
|
|
label2.set_use_markup(True)
|
2004-09-30 18:32:56 +00:00
|
|
|
|
|
|
|
self.xml.get_widget('okbutton').set_label(label_msg1)
|
2006-05-12 18:46:26 +00:00
|
|
|
self.xml.get_widget('okbutton').set_use_underline(True)
|
2004-09-30 18:32:56 +00:00
|
|
|
self.xml.get_widget('no').set_label(label_msg2)
|
2006-05-12 18:46:26 +00:00
|
|
|
self.xml.get_widget('no').set_use_underline(True)
|
2004-09-30 18:32:56 +00:00
|
|
|
self.top.show()
|
|
|
|
if parent:
|
|
|
|
self.top.set_transient_for(parent)
|
|
|
|
|
|
|
|
def run(self):
|
|
|
|
response = self.top.run()
|
|
|
|
self.top.destroy()
|
|
|
|
return (response == gtk.RESPONSE_ACCEPT)
|
|
|
|
|
2003-02-24 04:51:57 +00:00
|
|
|
class OptionDialog:
|
* 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
2003-09-15 04:11:30 +00:00
|
|
|
def __init__(self,msg1,msg2,btnmsg1,task1,btnmsg2,task2,parent=None):
|
2006-01-17 05:03:30 +00:00
|
|
|
self.xml = gtk.glade.XML(const.gladeFile,"optiondialog","gramps")
|
2003-02-24 04:51:57 +00:00
|
|
|
self.top = self.xml.get_widget('optiondialog')
|
* src/gramps_main.py (tool_callback): Typo.
* src/QuestionDialog.py: Use gramps icon.
* src/plugins/EventCmp.py: HIG; single instance; help.
* src/plugins/eventcmp.glade: HIG; help.
* src/plugins/Desbrowser.py: HIG, help, rebuild model after edit.
* src/plugins/desbrowse.glade: help, info label.
* src/plugins/PatchNames.py: HIG, help, single instance.
* src/plugins/patchnames.glade: HIG, help.
* src/plugins/Merge.py: HIG, help, single instance.
* src/plugins/merge.glade: HIG, help.
* src/plugins/ChangeNames.py: HIG, help, single instance.
svn: r4230
2005-03-24 06:22:25 +00:00
|
|
|
self.top.set_icon(ICON)
|
2006-11-09 11:38:18 +00:00
|
|
|
self.top.set_title("%s - GRAMPS" % msg1)
|
2003-02-24 04:51:57 +00:00
|
|
|
|
|
|
|
label1 = self.xml.get_widget('label1')
|
|
|
|
label1.set_text('<span weight="bold" size="larger">%s</span>' % msg1)
|
2005-02-24 00:25:34 +00:00
|
|
|
label1.set_use_markup(True)
|
2003-02-24 04:51:57 +00:00
|
|
|
|
|
|
|
label2 = self.xml.get_widget('label2')
|
|
|
|
label2.set_text(msg2)
|
2005-02-24 00:25:34 +00:00
|
|
|
label2.set_use_markup(True)
|
2003-02-24 04:51:57 +00:00
|
|
|
|
2003-02-27 00:29:37 +00:00
|
|
|
self.xml.get_widget('option1').set_label(btnmsg1)
|
|
|
|
self.xml.get_widget('option2').set_label(btnmsg2)
|
2003-04-04 05:48:25 +00:00
|
|
|
self.top.show()
|
* 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
2003-09-15 04:11:30 +00:00
|
|
|
if parent:
|
|
|
|
self.top.set_transient_for(parent)
|
2003-04-18 04:15:42 +00:00
|
|
|
self.response = self.top.run()
|
|
|
|
if self.response == gtk.RESPONSE_NO:
|
2003-02-27 00:29:37 +00:00
|
|
|
if task1:
|
|
|
|
task1()
|
2003-02-24 04:51:57 +00:00
|
|
|
else:
|
2003-04-18 04:15:42 +00:00
|
|
|
if task2:
|
|
|
|
task2()
|
2002-10-20 14:25:16 +00:00
|
|
|
self.top.destroy()
|
2002-10-21 01:18:07 +00:00
|
|
|
|
2003-04-18 04:15:42 +00:00
|
|
|
def get_response(self):
|
|
|
|
return self.response
|
|
|
|
|
2006-03-29 22:51:27 +00:00
|
|
|
class ErrorDialog(gtk.MessageDialog):
|
* 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
2003-09-15 04:11:30 +00:00
|
|
|
def __init__(self,msg1,msg2="",parent=None):
|
2002-10-21 01:18:07 +00:00
|
|
|
|
2006-03-29 22:51:27 +00:00
|
|
|
gtk.MessageDialog.__init__(self, parent,
|
|
|
|
flags=gtk.DIALOG_MODAL,
|
|
|
|
type=gtk.MESSAGE_ERROR,
|
|
|
|
buttons=gtk.BUTTONS_CLOSE)
|
|
|
|
self.set_markup('<span weight="bold" size="larger">%s</span>' % msg1)
|
|
|
|
self.format_secondary_text(msg2)
|
|
|
|
self.set_icon(ICON)
|
2006-11-09 11:38:18 +00:00
|
|
|
self.set_title("%s - GRAMPS" % msg1)
|
2006-03-29 22:51:27 +00:00
|
|
|
self.show()
|
|
|
|
self.run()
|
|
|
|
self.destroy()
|
|
|
|
|
2006-12-11 04:10:46 +00:00
|
|
|
class RunDatabaseRepair(ErrorDialog):
|
|
|
|
def __init__(self, msg, parent=None):
|
|
|
|
ErrorDialog.__init__(
|
|
|
|
self,
|
|
|
|
_('Error detected in database'),
|
|
|
|
_('GRAMPS has detected an error in the database. This can '
|
|
|
|
'usually be resolved by running the "Check and Repair Database" '
|
|
|
|
'tool.\n\nIf this problem continues to exist after running this '
|
|
|
|
'tool, please file a bug report at '
|
|
|
|
'http://bugs.gramps-project.org\n\n') + str(msg))
|
|
|
|
|
2006-03-29 22:51:27 +00:00
|
|
|
class WarningDialog(gtk.MessageDialog):
|
* 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
2003-09-15 04:11:30 +00:00
|
|
|
def __init__(self,msg1,msg2="",parent=None):
|
2002-11-04 04:05:47 +00:00
|
|
|
|
2006-03-29 22:51:27 +00:00
|
|
|
gtk.MessageDialog.__init__(self, parent,
|
|
|
|
flags=gtk.DIALOG_MODAL,
|
|
|
|
type=gtk.MESSAGE_WARNING,
|
|
|
|
buttons=gtk.BUTTONS_CLOSE)
|
|
|
|
self.set_markup('<span weight="bold" size="larger">%s</span>' % msg1)
|
2006-04-30 01:25:56 +00:00
|
|
|
self.format_secondary_markup(msg2)
|
2006-03-29 22:51:27 +00:00
|
|
|
self.set_icon(ICON)
|
2006-11-09 11:38:18 +00:00
|
|
|
self.set_title("%s - GRAMPS" % msg1)
|
2006-03-29 22:51:27 +00:00
|
|
|
self.show()
|
|
|
|
self.run()
|
|
|
|
self.destroy()
|
|
|
|
|
|
|
|
class OkDialog(gtk.MessageDialog):
|
* 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
2003-09-15 04:11:30 +00:00
|
|
|
def __init__(self,msg1,msg2="",parent=None):
|
2003-03-19 04:27:34 +00:00
|
|
|
|
2006-03-29 22:51:27 +00:00
|
|
|
gtk.MessageDialog.__init__(self, parent,
|
|
|
|
flags=gtk.DIALOG_MODAL,
|
|
|
|
type=gtk.MESSAGE_INFO,
|
|
|
|
buttons=gtk.BUTTONS_CLOSE)
|
|
|
|
self.set_markup('<span weight="bold" size="larger">%s</span>' % msg1)
|
|
|
|
self.format_secondary_text(msg2)
|
|
|
|
self.set_icon(ICON)
|
2006-11-09 11:38:18 +00:00
|
|
|
self.set_title("%s - GRAMPS" % msg1)
|
2006-03-29 22:51:27 +00:00
|
|
|
self.show()
|
|
|
|
self.run()
|
|
|
|
self.destroy()
|
2003-03-19 04:27:34 +00:00
|
|
|
|
2003-05-13 03:35:39 +00:00
|
|
|
class MissingMediaDialog:
|
* 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
2003-09-15 04:11:30 +00:00
|
|
|
def __init__(self,msg1,msg2,task1,task2,task3,parent=None):
|
2006-01-17 05:03:30 +00:00
|
|
|
self.xml = gtk.glade.XML(const.gladeFile,"missmediadialog","gramps")
|
2003-05-13 03:35:39 +00:00
|
|
|
self.top = self.xml.get_widget('missmediadialog')
|
* src/gramps_main.py (tool_callback): Typo.
* src/QuestionDialog.py: Use gramps icon.
* src/plugins/EventCmp.py: HIG; single instance; help.
* src/plugins/eventcmp.glade: HIG; help.
* src/plugins/Desbrowser.py: HIG, help, rebuild model after edit.
* src/plugins/desbrowse.glade: help, info label.
* src/plugins/PatchNames.py: HIG, help, single instance.
* src/plugins/patchnames.glade: HIG, help.
* src/plugins/Merge.py: HIG, help, single instance.
* src/plugins/merge.glade: HIG, help.
* src/plugins/ChangeNames.py: HIG, help, single instance.
svn: r4230
2005-03-24 06:22:25 +00:00
|
|
|
self.top.set_icon(ICON)
|
2006-11-09 11:38:18 +00:00
|
|
|
self.top.set_title("%s - GRAMPS" % msg1)
|
2006-02-28 19:54:35 +00:00
|
|
|
|
2003-05-13 03:35:39 +00:00
|
|
|
self.task1 = task1
|
|
|
|
self.task2 = task2
|
|
|
|
self.task3 = task3
|
2002-10-20 14:25:16 +00:00
|
|
|
|
2003-05-13 03:35:39 +00:00
|
|
|
label1 = self.xml.get_widget('label4')
|
|
|
|
label1.set_text('<span weight="bold" size="larger">%s</span>' % msg1)
|
2005-02-24 00:25:34 +00:00
|
|
|
label1.set_use_markup(True)
|
2003-05-13 03:35:39 +00:00
|
|
|
|
|
|
|
label2 = self.xml.get_widget('label3')
|
|
|
|
label2.set_text(msg2)
|
2005-02-24 00:25:34 +00:00
|
|
|
label2.set_use_markup(True)
|
2003-05-13 03:35:39 +00:00
|
|
|
|
2004-01-17 06:51:49 +00:00
|
|
|
check_button = self.xml.get_widget('use_always')
|
|
|
|
|
2003-05-13 03:35:39 +00:00
|
|
|
self.top.show()
|
* 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
2003-09-15 04:11:30 +00:00
|
|
|
if parent:
|
|
|
|
self.top.set_transient_for(parent)
|
2006-02-28 19:54:35 +00:00
|
|
|
self.top.connect('delete_event',self.warn)
|
|
|
|
response = gtk.RESPONSE_DELETE_EVENT
|
|
|
|
|
|
|
|
# Need some magic here, because an attempt to close the dialog
|
|
|
|
# with the X button not only emits the 'delete_event' signal
|
|
|
|
# but also exits with the RESPONSE_DELETE_EVENT
|
|
|
|
while response == gtk.RESPONSE_DELETE_EVENT:
|
|
|
|
response = self.top.run()
|
|
|
|
|
2003-05-13 03:35:39 +00:00
|
|
|
if response == 1:
|
|
|
|
self.task1()
|
|
|
|
elif response == 2:
|
|
|
|
self.task2()
|
|
|
|
elif response == 3:
|
|
|
|
self.task3()
|
2004-01-17 06:51:49 +00:00
|
|
|
if check_button.get_active():
|
|
|
|
self.default_action = response
|
|
|
|
else:
|
|
|
|
self.default_action = 0
|
2003-05-13 03:35:39 +00:00
|
|
|
self.top.destroy()
|
2006-02-28 19:54:35 +00:00
|
|
|
|
|
|
|
def warn(self,obj,obj2):
|
|
|
|
WarningDialog(
|
|
|
|
_("Attempt to force closing the dialog"),
|
|
|
|
_("Please do not force closing this important dialog.\n"
|
|
|
|
"Instead select one of the available options"),
|
|
|
|
self.top)
|
|
|
|
return True
|
2006-05-08 01:15:19 +00:00
|
|
|
|
2006-09-24 04:37:59 +00:00
|
|
|
class MessageHideDialog:
|
|
|
|
|
2006-05-08 01:15:19 +00:00
|
|
|
def __init__(self, title, message, key, parent=None):
|
|
|
|
|
2006-09-25 02:19:58 +00:00
|
|
|
glade_xml = gtk.glade.XML(const.gladeFile, "hide_dialog", "gramps")
|
|
|
|
top = glade_xml.get_widget('hide_dialog')
|
2006-11-09 11:38:18 +00:00
|
|
|
top.set_icon(ICON)
|
|
|
|
top.set_title("%s - GRAMPS" % title)
|
|
|
|
|
2006-09-25 02:19:58 +00:00
|
|
|
dont_show = glade_xml.get_widget('dont_show')
|
2006-09-26 04:08:41 +00:00
|
|
|
dont_show.set_active(Config.get(key))
|
2006-09-25 02:19:58 +00:00
|
|
|
title_label = glade_xml.get_widget('title')
|
|
|
|
title_label.set_text(
|
|
|
|
'<span size="larger" weight="bold">%s</span>' % title)
|
|
|
|
title_label.set_use_markup(True)
|
|
|
|
|
|
|
|
glade_xml.get_widget('message').set_text(message)
|
|
|
|
|
|
|
|
dont_show.connect('toggled',self.update_checkbox, key)
|
|
|
|
top.run()
|
|
|
|
top.destroy()
|
2006-05-08 01:15:19 +00:00
|
|
|
|
|
|
|
def update_checkbox(self, obj, constant):
|
|
|
|
Config.set(constant, obj.get_active())
|
2006-09-26 02:07:03 +00:00
|
|
|
Config.sync()
|