* 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:
parent
17ec8913c1
commit
e5b8cf4db3
@ -46,6 +46,7 @@ import Utils
|
|||||||
import Sources
|
import Sources
|
||||||
import AutoComp
|
import AutoComp
|
||||||
import RelLib
|
import RelLib
|
||||||
|
from QuestionDialog import WarningDialog
|
||||||
|
|
||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
|
|
||||||
@ -82,6 +83,7 @@ class AttributeEditor:
|
|||||||
self.sources_label = self.top.get_widget("sourcesAttr")
|
self.sources_label = self.top.get_widget("sourcesAttr")
|
||||||
self.notes_label = self.top.get_widget("noteAttr")
|
self.notes_label = self.top.get_widget("noteAttr")
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
|
self.alist = list
|
||||||
|
|
||||||
self.window = self.top.get_widget("attr_edit")
|
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)
|
note = buf.get_text(buf.get_start_iter(),buf.get_end_iter(),gtk.FALSE)
|
||||||
priv = self.priv.get_active()
|
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:
|
if self.attrib == None:
|
||||||
self.attrib = RelLib.Attribute()
|
self.attrib = RelLib.Attribute()
|
||||||
self.parent.alist.append(self.attrib)
|
self.parent.alist.append(self.attrib)
|
||||||
|
@ -66,6 +66,7 @@ class EventEditor:
|
|||||||
self.callback = cb
|
self.callback = cb
|
||||||
self.plist = []
|
self.plist = []
|
||||||
self.pmap = {}
|
self.pmap = {}
|
||||||
|
self.elist = list
|
||||||
|
|
||||||
for key in self.parent.db.getPlaceKeys():
|
for key in self.parent.db.getPlaceKeys():
|
||||||
p = self.parent.db.getPlaceDisplay(key)
|
p = self.parent.db.getPlaceDisplay(key)
|
||||||
@ -156,9 +157,6 @@ class EventEditor:
|
|||||||
self.place_field.set_text(def_placename)
|
self.place_field.set_text(def_placename)
|
||||||
self.date_check = DateEdit(self.date_field,self.top.get_widget("date_stat"))
|
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({
|
self.top.signal_autoconnect({
|
||||||
"on_add_src_clicked" : self.add_source,
|
"on_add_src_clicked" : self.add_source,
|
||||||
"on_del_src_clicked" : self.del_source,
|
"on_del_src_clicked" : self.del_source,
|
||||||
@ -234,6 +232,13 @@ class EventEditor:
|
|||||||
edesc = self.descr_field.get_text()
|
edesc = self.descr_field.get_text()
|
||||||
epriv = self.priv.get_active()
|
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:
|
if self.event == None:
|
||||||
self.event = RelLib.Event()
|
self.event = RelLib.Event()
|
||||||
self.event.setSourceRefList(self.srcreflist)
|
self.event.setSourceRefList(self.srcreflist)
|
||||||
|
Loading…
Reference in New Issue
Block a user