2002-10-20 19:55:16 +05:30
|
|
|
#
|
|
|
|
# Gramps - a GTK+/GNOME based genealogy program
|
|
|
|
#
|
2004-02-26 09:04:19 +05:30
|
|
|
# Copyright (C) 2000-2004 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-12-07 10:24:40 +05:30
|
|
|
# $Id$
|
|
|
|
|
2002-10-20 19:55:16 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# GTK/Gnome modules
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2003-01-12 10:52:21 +05:30
|
|
|
import gtk
|
2002-10-20 19:55:16 +05:30
|
|
|
import gtk.glade
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# gramps modules
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
import const
|
|
|
|
import Utils
|
2006-03-02 10:02:37 +05:30
|
|
|
import EditSecondary
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2006-03-02 10:02:37 +05:30
|
|
|
from GrampsWidgets import *
|
2003-08-17 07:44:33 +05:30
|
|
|
from gettext import gettext as _
|
2002-10-20 19:55:16 +05:30
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# LocationEditor class
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2006-03-02 10:02:37 +05:30
|
|
|
class LocationEditor(EditSecondary.EditSecondary):
|
2006-02-06 00:30:25 +05:30
|
|
|
|
|
|
|
def __init__(self,dbstate,uistate,track,location,callback):
|
2006-03-02 10:02:37 +05:30
|
|
|
EditSecondary.EditSecondary.__init__(self, dbstate, uistate, track,
|
|
|
|
location, callback)
|
2006-02-06 00:30:25 +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, "loc_edit","gramps")
|
2006-03-02 10:02:37 +05:30
|
|
|
self.define_top_level(self.top.get_widget("loc_edit"),
|
|
|
|
self.top.get_widget('title'),
|
|
|
|
_('Location Editor'))
|
|
|
|
|
|
|
|
def _setup_fields(self):
|
|
|
|
self.city = MonitoredEntry(
|
|
|
|
self.top.get_widget("city"),
|
|
|
|
self.obj.set_city,
|
|
|
|
self.obj.get_city,
|
|
|
|
self.db.readonly)
|
2005-12-06 12:08:09 +05:30
|
|
|
|
2006-03-02 10:02:37 +05:30
|
|
|
self.state = MonitoredEntry(
|
|
|
|
self.top.get_widget("state"),
|
|
|
|
self.obj.set_state,
|
|
|
|
self.obj.get_state,
|
|
|
|
self.db.readonly)
|
2005-12-06 12:08:09 +05:30
|
|
|
|
2006-03-02 10:02:37 +05:30
|
|
|
self.postal = MonitoredEntry(
|
|
|
|
self.top.get_widget("postal"),
|
|
|
|
self.obj.set_postal_code,
|
|
|
|
self.obj.get_postal_code,
|
|
|
|
self.db.readonly)
|
2004-02-26 09:04:19 +05:30
|
|
|
|
2006-03-02 10:02:37 +05:30
|
|
|
self.phone = MonitoredEntry(
|
|
|
|
self.top.get_widget("phone"),
|
|
|
|
self.obj.set_phone,
|
|
|
|
self.obj.get_phone,
|
|
|
|
self.db.readonly)
|
|
|
|
|
|
|
|
self.parish = MonitoredEntry(
|
|
|
|
self.top.get_widget("parish"),
|
|
|
|
self.obj.set_parish,
|
|
|
|
self.obj.get_parish,
|
|
|
|
self.db.readonly)
|
|
|
|
|
|
|
|
self.county = MonitoredEntry(
|
|
|
|
self.top.get_widget("county"),
|
|
|
|
self.obj.set_county,
|
|
|
|
self.obj.get_county,
|
|
|
|
self.db.readonly)
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2006-03-02 10:02:37 +05:30
|
|
|
self.country = MonitoredEntry(
|
|
|
|
self.top.get_widget("country"),
|
|
|
|
self.obj.set_country,
|
|
|
|
self.obj.get_country,
|
|
|
|
self.db.readonly)
|
|
|
|
|
|
|
|
def _connect_signals(self):
|
|
|
|
self.define_cancel_button(self.top.get_widget('button119'))
|
|
|
|
self.define_ok_button(self.top.get_widget('button118'),self.save)
|
|
|
|
self.define_help_button(self.top.get_widget('button128'),'gramps-edit-complete')
|
|
|
|
|
|
|
|
def save(self,*obj):
|
|
|
|
if self.callback:
|
|
|
|
self.callback(self.obj)
|
2004-02-26 09:04:19 +05:30
|
|
|
self.close(obj)
|
2002-10-20 19:55:16 +05:30
|
|
|
|