allow better string translation of no active object

svn: r14367
This commit is contained in:
Benny Malengier 2010-02-14 16:55:06 +00:00
parent 9d175ab99e
commit 7394015a76
3 changed files with 22 additions and 9 deletions

View File

@ -312,6 +312,18 @@ class DisplayState(gen.utils.Callback):
'filter-name-changed' : (str, unicode, unicode),
'nameformat-changed' : None,
}
#nav_type to message
NAV2MES = {
'Person': _("No active person"),
'Family': _("No active family"),
'Event': _("No active event"),
'Place': _("No active place"),
'Source': _("No active source"),
'Repository': _("No active repository"),
'Media': _("No active media"),
'Note': _("No active note"),
}
def __init__(self, window, status, progress, warnbtn, uimanager,
progress_monitor, viewmanager=None):
@ -488,8 +500,7 @@ class DisplayState(gen.utils.Callback):
name = '%s (%s)' % (name, msg.strip())
if not name:
name = _('No active %(navigation_type)s') % {"navigation_type":
_(nav_type.lower())}
name = self.NAV2MES[nav_type]
self.status.push(self.status_id, name)
process_pending_events()

View File

@ -94,6 +94,15 @@ class NavigationView(PageView):
self.uistate.register(self.navigation_type(), self.nav_group)
def navigation_type(self):
"""
Indictates the navigation type. Navigation type can be the string
name of any of the primary Objects. A History object will be
created for it, see DisplayState.History
"""
return None
def define_actions(self):
"""
Define menu actions.

View File

@ -157,13 +157,6 @@ class PageView(DbGUIElement):
class.
"""
raise NotImplementedError
def navigation_type(self):
"""
Indictates the navigation type. Currently, we only support navigation
for views that are Person centric.
"""
return None
def ui_definition(self):
"""