From fae74522d824c21335974c8ab2c6eec14700942e Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Sun, 7 Dec 2003 04:54:40 +0000 Subject: [PATCH] * src/EditPlace.py: Pass window to LocEdit.py. Correct apply callback. * src/LocEdit.py (__init__): Make dialog modal and transient for its parent; (on_help_clicked): Add function. * src/dialog.glade: Correct response IDs. * src/places.glade: Correct response IDs. svn: r2457 --- gramps2/ChangeLog | 5 +++++ gramps2/src/EditPlace.py | 7 +++---- gramps2/src/LocEdit.py | 28 ++++++++++++++++++++-------- gramps2/src/dialog.glade | 2 -- gramps2/src/places.glade | 4 ++-- 5 files changed, 30 insertions(+), 16 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index e61f653cc..90ddfdd85 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -11,6 +11,11 @@ * FAQ, doc/gramps-manual/C/faq.xml: Add two questions. * src/plugins/WriteFtree.py (on_help_clicked): Add function. * doc/gramps.1: Update. + * src/EditPlace.py: Pass window to LocEdit.py. Correct apply callback. + * src/LocEdit.py (__init__): Make dialog modal and transient + for its parent; (on_help_clicked): Add function. + * src/dialog.glade: Correct response IDs. + * src/places.glade: Correct response IDs. 2003-12-05 Alex Roitman * src/po/ru.po: Update Russian translation for 0.98. diff --git a/gramps2/src/EditPlace.py b/gramps2/src/EditPlace.py index 5499134e8..727b20d90 100644 --- a/gramps2/src/EditPlace.py +++ b/gramps2/src/EditPlace.py @@ -271,7 +271,7 @@ class EditPlace: setf(text) Utils.modified() - def on_place_apply_clicked(self,obj): + def on_place_apply_clicked(self): note = self.note_buffer.get_text(self.note_buffer.get_start_iter(), self.note_buffer.get_end_iter(),gtk.FALSE) @@ -298,7 +298,6 @@ class EditPlace: self.update_lists() - self.close(None) if self.callback: self.callback(self.place) @@ -335,7 +334,7 @@ class EditPlace: if iter: row = store.get_path(iter) loc = self.llist[row[0]] - LocEdit.LocationEditor(self,loc) + LocEdit.LocationEditor(self,loc,self.top) def on_delete_url_clicked(self,obj): if Utils.delete_selected(obj,self.ulist): @@ -360,7 +359,7 @@ class EditPlace: def on_add_loc_clicked(self,obj): import LocEdit - LocEdit.LocationEditor(self,None) + LocEdit.LocationEditor(self,None,self.top) def on_web_list_select_row(self,obj): store,iter = obj.get_selected() diff --git a/gramps2/src/LocEdit.py b/gramps2/src/LocEdit.py index 98482a6b1..10aa8329e 100644 --- a/gramps2/src/LocEdit.py +++ b/gramps2/src/LocEdit.py @@ -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 @@ -18,6 +18,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# $Id$ + #------------------------------------------------------------------------- # # GTK/Gnome modules @@ -25,6 +27,7 @@ #------------------------------------------------------------------------- import gtk import gtk.glade +import gnome #------------------------------------------------------------------------- # @@ -44,7 +47,7 @@ from gettext import gettext as _ #------------------------------------------------------------------------- class LocationEditor: - def __init__(self,parent,location): + def __init__(self,parent,location,parent_window=None): self.parent = parent self.location = location self.top = gtk.glade.XML(const.dialogFile, "loc_edit","gramps") @@ -67,11 +70,22 @@ class LocationEditor: self.window.set_data("o",self) self.top.signal_autoconnect({ - "destroy_passed_object" : Utils.destroy_passed_object, - "on_loc_edit_ok_clicked" : self.on_location_edit_ok_clicked - }) + "on_help_loc_clicked" : self.on_help_clicked, + }) - def on_location_edit_ok_clicked(self,obj): + if parent_window: + self.window.set_transient_for(parent_window) + self.val = self.window.run() + if self.val == gtk.RESPONSE_OK: + self.on_location_edit_ok_clicked() + self.window.destroy() + + def on_help_clicked(self,obj): + """Display the relevant portion of GRAMPS manual""" + gnome.help_display('gramps-manual','gramps-edit-complete') + self.val = self.window.run() + + def on_location_edit_ok_clicked(self): self.location = self.location city = self.city.get_text() @@ -87,7 +101,6 @@ class LocationEditor: self.update_location(city,parish,county,state,country) self.parent.redraw_location_list() - Utils.destroy_passed_object(obj) def update_location(self,city,parish,county,state,country): if self.location.get_city() != city: @@ -109,4 +122,3 @@ class LocationEditor: if self.location.get_country() != country: self.location.set_country(country) self.parent.lists_changed = 1 - diff --git a/gramps2/src/dialog.glade b/gramps2/src/dialog.glade index a627b7ebe..2136a9f4d 100644 --- a/gramps2/src/dialog.glade +++ b/gramps2/src/dialog.glade @@ -1447,7 +1447,6 @@ True GTK_RELIEF_NORMAL -6 - @@ -1461,7 +1460,6 @@ True GTK_RELIEF_NORMAL -5 - diff --git a/gramps2/src/places.glade b/gramps2/src/places.glade index b72c2973a..9885ea6f5 100644 --- a/gramps2/src/places.glade +++ b/gramps2/src/places.glade @@ -37,7 +37,7 @@ gtk-cancel True GTK_RELIEF_NORMAL - 0 + -6 @@ -51,7 +51,7 @@ gtk-ok True GTK_RELIEF_NORMAL - 0 + -5