Added new signal to database: home-person-changed, which is emitted when the default person is set
svn: r11534
This commit is contained in:
parent
b51cf87d8e
commit
983f6d3e71
@ -164,7 +164,8 @@ class GrampsDbBase(Callback):
|
|||||||
'note-rebuild' : None,
|
'note-rebuild' : None,
|
||||||
'long-op-start' : (object, ),
|
'long-op-start' : (object, ),
|
||||||
'long-op-heartbeat' : None,
|
'long-op-heartbeat' : None,
|
||||||
'long-op-end' : None
|
'long-op-end' : None,
|
||||||
|
'home-person-changed': None,
|
||||||
}
|
}
|
||||||
|
|
||||||
# If this is True logging will be turned on.
|
# If this is True logging will be turned on.
|
||||||
@ -1924,6 +1925,7 @@ class GrampsDbBase(Callback):
|
|||||||
"""Set the default Person to the passed instance."""
|
"""Set the default Person to the passed instance."""
|
||||||
if (self.metadata is not None) and (not self.readonly):
|
if (self.metadata is not None) and (not self.readonly):
|
||||||
self.metadata['default'] = str(handle)
|
self.metadata['default'] = str(handle)
|
||||||
|
self.emit('home-person-changed')
|
||||||
|
|
||||||
def get_default_person(self):
|
def get_default_person(self):
|
||||||
"""Return the default Person of the database."""
|
"""Return the default Person of the database."""
|
||||||
|
@ -393,6 +393,7 @@ class GrampsDBDir(GrampsDbBase, UpdateCallback):
|
|||||||
the_txn = self.env.txn_begin()
|
the_txn = self.env.txn_begin()
|
||||||
self.metadata.put('default', str(handle), txn=the_txn)
|
self.metadata.put('default', str(handle), txn=the_txn)
|
||||||
the_txn.commit()
|
the_txn.commit()
|
||||||
|
self.emit('home-person-changed')
|
||||||
|
|
||||||
def get_default_person(self):
|
def get_default_person(self):
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user