Gnumed.wxpython.gui.gmShowMedDocs

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

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

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