Add main participant to title

svn: r14214
This commit is contained in:
Nick Hall 2010-02-04 19:04:35 +00:00
parent daab6a464d
commit 829705de76

View File

@ -51,6 +51,7 @@ from displaytabs import (SourceEmbedList, NoteTab, GalleryTab,
EventBackRefList, AttrEmbedList) EventBackRefList, AttrEmbedList)
from gui.widgets import (MonitoredEntry, PrivacyButton, from gui.widgets import (MonitoredEntry, PrivacyButton,
MonitoredDataType, MonitoredDate) MonitoredDataType, MonitoredDate)
from Utils import get_participant_from_event
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -82,10 +83,15 @@ class EditEvent(EditPrimary):
return gen.lib.Event() return gen.lib.Event()
def get_menu_title(self): def get_menu_title(self):
if self.obj.get_handle(): handle = self.obj.get_handle()
event_name = self.obj.get_description() if handle:
if not event_name: who = get_participant_from_event(self.db, handle)
event_name = str(self.obj.get_type()) desc = self.obj.get_description()
event_name = self.obj.get_type()
if desc:
event_name = '%s - %s' % (event_name, desc)
if who:
event_name = '%s - %s' % (event_name, who)
dialog_title = _('Event: %s') % event_name dialog_title = _('Event: %s') % event_name
else: else:
dialog_title = _('New Event') dialog_title = _('New Event')