From 9489883bc80db000585b1ae3eb5208a567611a7c Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Thu, 27 Nov 2003 18:01:20 +0000 Subject: [PATCH] * src/AttrEdit.py: Add warning when a new attribute type is added to the database * src/EventEdit.py: Add warning when a new event type is added to the database svn: r2396 --- src/AttrEdit.py | 9 +++++++++ src/EventEdit.py | 11 ++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/AttrEdit.py b/src/AttrEdit.py index 4b1de02b4..b6925c94b 100644 --- a/src/AttrEdit.py +++ b/src/AttrEdit.py @@ -46,6 +46,7 @@ import Utils import Sources import AutoComp import RelLib +from QuestionDialog import WarningDialog from gettext import gettext as _ @@ -82,6 +83,7 @@ class AttributeEditor: self.sources_label = self.top.get_widget("sourcesAttr") self.notes_label = self.top.get_widget("noteAttr") self.callback = callback + self.alist = list self.window = self.top.get_widget("attr_edit") @@ -151,6 +153,13 @@ class AttributeEditor: note = buf.get_text(buf.get_start_iter(),buf.get_end_iter(),gtk.FALSE) priv = self.priv.get_active() + if not type in self.alist: + WarningDialog(_('New attribute type created'), + _('The "%s" attribute type has been added to this database.\n' + 'It will now appear in the attribute menus for this database') % type) + self.alist.append(type) + self.alist.sort() + if self.attrib == None: self.attrib = RelLib.Attribute() self.parent.alist.append(self.attrib) diff --git a/src/EventEdit.py b/src/EventEdit.py index 8b176b305..1bf9d39df 100644 --- a/src/EventEdit.py +++ b/src/EventEdit.py @@ -66,6 +66,7 @@ class EventEditor: self.callback = cb self.plist = [] self.pmap = {} + self.elist = list for key in self.parent.db.getPlaceKeys(): p = self.parent.db.getPlaceDisplay(key) @@ -156,9 +157,6 @@ class EventEditor: self.place_field.set_text(def_placename) self.date_check = DateEdit(self.date_field,self.top.get_widget("date_stat")) -# if not read_only: -# self.name_field.select_region(0, -1) - self.top.signal_autoconnect({ "on_add_src_clicked" : self.add_source, "on_del_src_clicked" : self.del_source, @@ -234,6 +232,13 @@ class EventEditor: edesc = self.descr_field.get_text() epriv = self.priv.get_active() + if not ename in self.elist: + WarningDialog(_('New event type created'), + _('The "%s" event type has been added to this database.\n' + 'It will now appear in the event menus for this database') % ename) + self.elist.append(ename) + self.elist.sort() + if self.event == None: self.event = RelLib.Event() self.event.setSourceRefList(self.srcreflist)