Another bit
svn: r2877
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user