2002-10-20 19:55:16 +05:30
|
|
|
#
|
|
|
|
# Gramps - a GTK+/GNOME based genealogy program
|
|
|
|
#
|
2006-04-24 03:48:01 +05:30
|
|
|
# Copyright (C) 2000-2006 Donald N. Allingham
|
2002-10-20 19:55:16 +05:30
|
|
|
#
|
|
|
|
# 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
|
|
|
|
#
|
|
|
|
|
2003-11-19 07:59:41 +05:30
|
|
|
# $Id$
|
|
|
|
|
2005-05-11 19:34:47 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# python modules
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2006-04-07 03:32:46 +05:30
|
|
|
from gettext import gettext as _
|
2005-12-06 12:08:09 +05:30
|
|
|
from cgi import escape
|
2005-05-11 19:34:47 +05:30
|
|
|
|
2002-10-20 19:55:16 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# GTK/Gnome modules
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
import gtk.glade
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# gramps modules
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
import const
|
|
|
|
import Utils
|
2006-03-04 12:04:48 +05:30
|
|
|
from _EditSecondary import EditSecondary
|
2006-03-02 10:02:37 +05:30
|
|
|
|
2006-02-22 10:03:34 +05:30
|
|
|
from GrampsWidgets import *
|
2002-10-20 19:55:16 +05:30
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
2006-03-03 09:59:02 +05:30
|
|
|
# EditUrl class
|
2002-10-20 19:55:16 +05:30
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2006-03-04 12:04:48 +05:30
|
|
|
class EditUrl(EditSecondary):
|
2005-12-24 05:39:04 +05:30
|
|
|
|
|
|
|
def __init__(self, dbstate, uistate, track, name, url, callback):
|
|
|
|
|
2006-03-04 12:04:48 +05:30
|
|
|
EditSecondary.__init__(self, dbstate, uistate, track,
|
|
|
|
url, callback)
|
2005-12-24 05:39:04 +05:30
|
|
|
|
2006-03-02 10:02:37 +05:30
|
|
|
def _local_init(self):
|
2006-01-17 10:33:30 +05:30
|
|
|
self.top = gtk.glade.XML(const.gladeFile, "url_edit","gramps")
|
2006-02-02 03:27:11 +05:30
|
|
|
|
2006-04-24 03:48:01 +05:30
|
|
|
self.set_window(self.top.get_widget("url_edit"),
|
|
|
|
self.top.get_widget("title"),
|
|
|
|
_('Internet Address Editor'))
|
2003-06-03 08:24:56 +05:30
|
|
|
|
2006-02-22 10:03:34 +05:30
|
|
|
def _connect_signals(self):
|
2006-03-02 10:02:37 +05:30
|
|
|
self.define_cancel_button(self.top.get_widget('button125'))
|
|
|
|
self.define_ok_button(self.top.get_widget('button124'),self.save)
|
|
|
|
self.define_help_button(self.top.get_widget('button130'),'gramps-edit_complete')
|
2006-02-22 10:03:34 +05:30
|
|
|
|
|
|
|
def _setup_fields(self):
|
|
|
|
self.des = MonitoredEntry(
|
2006-04-19 09:27:10 +05:30
|
|
|
self.top.get_widget("url_des"),
|
|
|
|
self.obj.set_description,
|
|
|
|
self.obj.get_description,
|
|
|
|
self.db.readonly)
|
2006-02-22 10:03:34 +05:30
|
|
|
|
|
|
|
self.addr = MonitoredEntry(
|
2006-04-19 09:27:10 +05:30
|
|
|
self.top.get_widget("url_addr"),
|
|
|
|
self.obj.set_path,
|
|
|
|
self.obj.get_path,
|
|
|
|
self.db.readonly)
|
2006-02-22 10:03:34 +05:30
|
|
|
|
|
|
|
self.priv = PrivacyButton(self.top.get_widget("priv"),
|
2006-03-02 10:02:37 +05:30
|
|
|
self.obj, self.db.readonly)
|
2006-02-22 10:03:34 +05:30
|
|
|
|
2006-04-19 09:27:10 +05:30
|
|
|
self.type_sel = MonitoredDataType(
|
|
|
|
self.top.get_widget("type"),
|
|
|
|
self.obj.set_type,
|
|
|
|
self.obj.get_type,
|
|
|
|
)
|
2006-02-22 10:03:34 +05:30
|
|
|
|
2005-12-24 05:39:04 +05:30
|
|
|
def build_menu_names(self,obj):
|
2006-03-02 10:02:37 +05:30
|
|
|
etitle =_('Internet Address Editor')
|
|
|
|
return (etitle, etitle)
|
2003-11-19 07:59:41 +05:30
|
|
|
|
2006-03-02 10:02:37 +05:30
|
|
|
def save(self,*obj):
|
|
|
|
self.callback(self.obj)
|
|
|
|
self.close_window()
|
2002-10-20 19:55:16 +05:30
|
|
|
|