From 7394015a767e4b90d10dabf5bf47eb2a38c7af43 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Sun, 14 Feb 2010 16:55:06 +0000 Subject: [PATCH] allow better string translation of no active object svn: r14367 --- src/DisplayState.py | 15 +++++++++++++-- src/gui/views/navigationview.py | 9 +++++++++ src/gui/views/pageview.py | 7 ------- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/DisplayState.py b/src/DisplayState.py index 30f436913..adfc99115 100644 --- a/src/DisplayState.py +++ b/src/DisplayState.py @@ -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() diff --git a/src/gui/views/navigationview.py b/src/gui/views/navigationview.py index 647bab88a..68e4e754c 100644 --- a/src/gui/views/navigationview.py +++ b/src/gui/views/navigationview.py @@ -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. diff --git a/src/gui/views/pageview.py b/src/gui/views/pageview.py index 028496987..95124c534 100644 --- a/src/gui/views/pageview.py +++ b/src/gui/views/pageview.py @@ -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): """