Package Gnumed :: Package wxpython :: Package gui :: Module gmProviderInboxPlugin |
[frames] | no frames]

# Source Code for Module Gnumed.wxpython.gui.gmProviderInboxPlugin

     1  # -*- coding: utf-8 -*-
     2  #=====================================================
     3  # GNUmed provider inbox plugin
     4  # later to evolve into a more complete "provider-centric hub"
     5  #=====================================================
     6  __author__ = "Karsten Hilbert <Karsten.Hilbert@gmx.net>"
     7  __license__ = "GPL"
     8
     9  from Gnumed.wxpython import gmPlugin, gmProviderInboxWidgets
    10  from Gnumed.wxpython import gmAccessPermissionWidgets
    11
    12  #======================================================================
    13 -class gmProviderInboxPlugin(gmPlugin.cNotebookPlugin):
    14          """Plugin to encapsulate the provider inbox window."""
    15
    16          tab_name = _('Inbox')
    17          required_minimum_role = 'non-clinical access'
    18
    19          @gmAccessPermissionWidgets.verify_minimum_required_role (
    20                  required_minimum_role,
    21                  activity = _('loading plugin <%s>') % tab_name,
    22                  return_value_on_failure = False,
    23                  fail_silently = False
    24          )
    25 -        def register(self):
    26                  gmPlugin.cNotebookPlugin.register(self)
    27          #-------------------------------------------------
    28          #--------------------------------------------------------
    29 -        def __init__(self):
    30                  gmPlugin.cNotebookPlugin.__init__(self)
    31          #--------------------------------------------------------
    32 -        def name(self):
    33                  return gmProviderInboxPlugin.tab_name
    34          #--------------------------------------------------------
    35 -        def GetWidget(self, parent):
    36                  self._widget = gmProviderInboxWidgets.cProviderInboxPnl(parent, -1)
    37                  return self._widget
    38          #--------------------------------------------------------
    39 -        def MenuInfo(self):
    40                  return ('office', _('Provider &inbox'))
    41          #--------------------------------------------------------
    42 -        def can_receive_focus(self):
    43                  return True
    44          #--------------------------------------------------------
    45 -        def _on_raise_by_signal(self, **kwds):
    46                  if not gmPlugin.cNotebookPlugin._on_raise_by_signal(self, **kwds):
    47                          return False
    48
    49                  try:
    50                          if kwds['filter_by_active_patient'] is True:
    51                                  self._widget.filter_by_active_patient()
    52                  except KeyError:
    53                          pass
    54
    55                  return True
    56
    57  #======================================================================
    58