Don't emit signal to change active person if that is already the active person

svn: r12498
This commit is contained in:
Doug Blank 2009-04-30 04:40:20 +00:00
parent 890138b294
commit f18040a0d0

View File

@ -53,12 +53,16 @@ class DbState(Callback):
Change the active person and emits a signal to notify those who
are interested.
"""
previous_active_person = self.active
self.active = person
if person:
try:
self.emit('active-changed', (person.handle, ))
except:
self.emit('active-changed', ("", ))
if previous_active_person and previous_active_person.handle == person.handle:
pass # don't change to same!
else:
try:
self.emit('active-changed', (person.handle, ))
except:
self.emit('active-changed', ("", ))
def change_active_handle(self, handle):
"""