allow better string translation of no active object
svn: r14367
This commit is contained in:
parent
9d175ab99e
commit
7394015a76
@ -313,6 +313,18 @@ class DisplayState(gen.utils.Callback):
|
||||
'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()
|
||||
|
@ -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.
|
||||
|
@ -158,13 +158,6 @@ class PageView(DbGUIElement):
|
||||
"""
|
||||
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):
|
||||
"""
|
||||
returns the XML UI definition for the UIManager
|
||||
|
Loading…
Reference in New Issue
Block a user