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

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

     1  """A documents tree plugin."""
     2
     3  __version__ = "$Revision: 1.78 $"
     4  __author__ = "Karsten Hilbert <Karsten.Hilbert@gmx.net>"
     5  #================================================================
     6  import os.path, sys, logging
     7
     8
     9  import wx
    10
    11
    12  from Gnumed.wxpython import gmDocumentWidgets, gmPlugin
    13  from Gnumed.wxpython import gmAccessPermissionWidgets
    14
    15
    16  _log = logging.getLogger('gm.ui')
    17  _log.info(__version__)
    18  #================================================================
    19 -class gmShowMedDocs(gmPlugin.cNotebookPlugin):
    20          """Plugin to encapsulate document tree."""
    21
    22          tab_name = _("Documents")
    23          required_minimum_role = 'full clinical access'
    24
    25          @gmAccessPermissionWidgets.verify_minimum_required_role (
    26                  required_minimum_role,
    27                  activity = _('loading plugin <%s>') % tab_name,
    28                  return_value_on_failure = False,
    29                  fail_silently = False
    30          )
    31 -        def register(self):
    32                  gmPlugin.cNotebookPlugin.register(self)
    33          #-------------------------------------------------
    34
    35 -        def name(self):
    36                  return gmShowMedDocs.tab_name
    37          #--------------------------------------------------------
    38 -        def GetWidget(self, parent):
    39                  self._widget = gmDocumentWidgets.cSelectablySortedDocTreePnl(parent, -1)
    40                  return self._widget
    41          #--------------------------------------------------------
    42 -        def MenuInfo(self):
    43                  return ('emr', _('&Documents'))
    44          #--------------------------------------------------------
    45 -        def can_receive_focus(self):
    46                  # need patient
    47                  if not self._verify_patient_avail():
    48                          return None
    49                  return 1
    50          #--------------------------------------------------------
    51 -        def _on_raise_by_signal(self, **kwds):
    52                  if not gmPlugin.cNotebookPlugin._on_raise_by_signal(self, **kwds):
    53                          return False
    54
    55                  try:
    56                          if kwds['sort_mode'] == 'review':
    57                                  self._widget._on_sort_by_review_selected(None)
    58                  except KeyError:
    59                          pass
    60
    61                  return True
    62  #================================================================
    63  # MAIN
    64  #----------------------------------------------------------------
    65  if __name__ == '__main__':
    66          pass
    67  #================================================================
    68