gramps/src/Editors/_EditLocation.py

120 lines
3.8 KiB
Python
Raw Normal View History

2002-10-20 19:55:16 +05:30
#
# Gramps - a GTK+/GNOME based genealogy program
#
# 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 $
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
import Config
2006-03-04 12:04:48 +05:30
from _EditSecondary import EditSecondary
2002-10-20 19:55:16 +05:30
from GrampsWidgets import *
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):
WIDTH_KEY = Config.LOCATION_WIDTH
HEIGHT_KEY = Config.LOCATION_HEIGHT
def __init__(self,dbstate,uistate,track,location,callback):
2006-03-04 12:04:48 +05:30
EditSecondary.__init__(self, dbstate, uistate, track,
location, callback)
def _local_init(self):
self.top = gtk.glade.XML(const.GLADE_FILE, "loc_edit","gramps")
self.set_window(self.top.get_widget("loc_edit"), None,
_('Location Editor'))
def _setup_fields(self):
self.street = MonitoredEntry(
2006-09-23 Don Allingham <don@gramps-project.org> * src/images/sources.svg: new icon * src/images/reports.svg: new icon * src/images/tools.svg: new icon * src/images/events.svg: new icon * src/images/place.svg: new icon * src/images/tools.svg: new icon * src/ViewManager.py: use new icons * src/gramps_main.py: register new icons 2006-09-22 Don Allingham <don@gramps-project.org> * src/GrampsDb/_GrampsGEDDB.py: support for disabling transactions * src/GrampsDb/_GrampsXMLDB.py: support for disabling transactions * src/GrampsDb/_GrampsBSDDB.py: support for disabling transactions * src/GrampsDb/_GrampsDbBase.py: support for disabling transactions * src/GrampsDb/_ReadGedcom.py: check for IO Eror * src/ViewManager.py: display message if a portability problem is detected * src/QuestionDialog.py: Add Warning dialog that can be disabled * src/DbLoader.py: Detect missing database problem * src/ArgHandler.py: support for disabling transactions * src/GrampsCfg.py: new config keys for transactions * src/Config/_GrampsConfigKeys.py: new config keys for transactions 2006-09-17 Don Allingham <don@gramps-project.org> * src/ViewManager.py: handle missing database on autoload (#447) * src/ArgHandler.py: handle missing database on autoload (#447) * src/DbLoader.py: handle missing database on autoload (#447) * src/Makefile.am: remove uninstalled packages from makefile * src/GrampsDb/_ReadXML.py: place vs. address changes * src/GrampsDb/_WriteXML.py: place vs. address changes * src/GrampsDb/_EditPlace.py: place vs. address changes * src/Editors/_EditPlace.py: place vs. address changes * src/Editors/_EditLocation.py: place vs. address changes * src/RelLib/_Address.py: place vs. address changes * src/RelLib/_LocationBase.py: place vs. address changes * src/RelLib/_Location.py: place vs. address changes * src/DisplayTabs/_LocationModel.py: place vs. address changes * src/DisplayTabs/_LocationEmbedList.py: place vs. address changes * src/glade/gramps.glade: place vs. address changes svn: r7325
2006-09-24 10:07:59 +05:30
self.top.get_widget("street"),
self.obj.set_street,
self.obj.get_street,
self.db.readonly)
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
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
self.postal = MonitoredEntry(
self.top.get_widget("postal"),
self.obj.set_postal_code,
self.obj.get_postal_code,
self.db.readonly)
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
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