From 95caa4eb7f2f63da56e75c3c1a64de493c194884 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Fri, 20 Feb 2004 01:31:04 +0000 Subject: [PATCH] Another bit svn: r2877 --- src/UrlEdit.py | 35 ++++++++++++++++++++++++++++------- src/dialog.glade | 13 +++++++++---- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/src/UrlEdit.py b/src/UrlEdit.py index dc550ea15..69b592c78 100644 --- a/src/UrlEdit.py +++ b/src/UrlEdit.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2003 Donald N. Allingham +# Copyright (C) 2000-2004 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 @@ -71,21 +71,42 @@ class UrlEditor: self.top.signal_autoconnect({ "on_help_url_clicked" : self.on_help_clicked, + "on_ok_url_clicked" : self.on_url_edit_ok_clicked, + "on_cancel_url_clicked" : self.close, + "on_url_edit_delete_event" : self.on_delete_event, }) if parent_window: self.window.set_transient_for(parent_window) - self.val = self.window.run() - if self.val == gtk.RESPONSE_OK: - self.on_url_edit_ok_clicked() + self.parent.child_windows.append(self) + self.add_itself_to_menu() + self.window.show() + + def on_delete_event(self,obj,b): + self.remove_itself_from_menu() + + def close(self,obj): + self.remove_itself_from_menu() self.window.destroy() + def add_itself_to_menu(self): + label = _('Internet Address Editor') + self.parent_menu_item = gtk.MenuItem(label) + self.parent_menu_item.connect("activate",self.present) + self.parent_menu_item.show() + self.parent.menu.append(self.parent_menu_item) + + def remove_itself_from_menu(self): + self.parent_menu_item.destroy() + + def present(self,obj): + self.window.present() + 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_url_edit_ok_clicked(self): + def on_url_edit_ok_clicked(self,obj): des = unicode(self.des.get_text()) addr = unicode(self.addr.get_text()) priv = self.priv.get_active() @@ -96,6 +117,7 @@ class UrlEditor: self.update_url(des,addr,priv) self.callback(self.url) + self.close(obj) def update_url(self,des,addr,priv): if self.url.get_path() != addr: @@ -109,4 +131,3 @@ class UrlEditor: if self.url.get_privacy() != priv: self.url.set_privacy(priv) self.parent.lists_changed = 1 - diff --git a/src/dialog.glade b/src/dialog.glade index a750eb3ae..a0a3de2f0 100644 --- a/src/dialog.glade +++ b/src/dialog.glade @@ -1006,6 +1006,7 @@ False gramps.png False + @@ -1027,6 +1028,7 @@ True GTK_RELIEF_NORMAL -6 + @@ -1040,6 +1042,7 @@ True GTK_RELIEF_NORMAL -5 + @@ -2087,6 +2090,7 @@ False gramps.png False + @@ -2108,7 +2112,7 @@ True GTK_RELIEF_NORMAL -6 - + @@ -2123,7 +2127,7 @@ True GTK_RELIEF_NORMAL -5 - + @@ -2981,6 +2985,7 @@ False gramps.png False + @@ -3002,7 +3007,7 @@ True GTK_RELIEF_NORMAL -6 - + @@ -3017,7 +3022,7 @@ True GTK_RELIEF_NORMAL -5 - +