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
|
|
|
|
#
|
|
|
|
|
2006-03-03 06:13:32 +05:30
|
|
|
# $Id: LocEdit.py 6051 2006-03-03 00:38:41Z dallingham $
|
2003-12-07 10:24:40 +05:30
|
|
|
|
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
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# gramps modules
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
import const
|
2006-11-26 10:09:34 +05:30
|
|
|
import Config
|
2006-03-04 12:04:48 +05:30
|
|
|
from _EditSecondary import EditSecondary
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2006-03-02 10:02:37 +05:30
|
|
|
from GrampsWidgets import *
|
2006-04-07 03:32:46 +05:30
|
|
|
from gettext import gettext as _
|
2002-10-20 19:55:16 +05:30
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# LocationEditor class
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2006-03-04 12:04:48 +05:30
|
|
|
class EditLocation(EditSecondary):
|
2006-02-06 00:30:25 +05:30
|
|
|
|
2006-11-26 10:09:34 +05:30
|
|
|
WIDTH_KEY = Config.LOCATION_WIDTH
|
|
|
|
HEIGHT_KEY = Config.LOCATION_HEIGHT
|
|
|
|
|
2006-02-06 00:30:25 +05:30
|
|
|
def __init__(self,dbstate,uistate,track,location,callback):
|
2006-03-04 12:04:48 +05:30
|
|
|
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-11-26 10:09:34 +05:30
|
|
|
self.set_window(self.top.get_widget("loc_edit"), None,
|
2006-04-24 03:48:01 +05:30
|
|
|
_('Location Editor'))
|
2006-03-02 10:02:37 +05:30
|
|
|
|
|
|
|
def _setup_fields(self):
|
2006-09-24 10:07:59 +05:30
|
|
|
self.city = MonitoredEntry(
|
|
|
|
self.top.get_widget("street"),
|
|
|
|
self.obj.set_street,
|
|
|
|
self.obj.get_street,
|
|
|
|
self.db.readonly)
|
|
|
|
|
2006-03-02 10:02:37 +05:30
|
|
|
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)
|
2006-04-22 08:53:57 +05:30
|
|
|
self.close()
|
2002-10-20 19:55:16 +05:30
|
|
|
|