* 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
This commit is contained in:
Don Allingham 2003-11-27 18:01:20 +00:00
parent 26ca56dce3
commit 9489883bc8
2 changed files with 17 additions and 3 deletions

View File

@ -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)

View File

@ -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)