Gnumed.wxpython.gui.gmKOrganizerPlugin

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

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

     1  # -*- coding: utf-8 -*-
     2  #=====================================================
     3  # GNUmed KOrganizer link
     4  #=====================================================
     5  __author__ = "Karsten Hilbert <Karsten.Hilbert@gmx.net>"
     6  __license__ = "GPL v2 or later"
     7
     8  import os, sys
     9
    10  from Gnumed.wxpython import gmPlugin, gmDemographicsWidgets
    11  from Gnumed.pycommon import gmExceptions, gmShellAPI
    12  from Gnumed.wxpython import gmAccessPermissionWidgets
    13
    14  #======================================================================
    15 -class gmKOrganizerPlugin(gmPlugin.cNotebookPlugin):
    16          """Plugin to encapsulate a simple KOrganizer link window."""
    17
    18          tab_name = _('Appointments')
    19          required_minimum_role = 'non-clinical access'
    20
    21          @gmAccessPermissionWidgets.verify_minimum_required_role (
    22                  required_minimum_role,
    23                  activity = _('loading plugin <%s>') % tab_name,
    24                  return_value_on_failure = False,
    25                  fail_silently = False
    26          )
    27 -        def register(self):
    28                  gmPlugin.cNotebookPlugin.register(self)
    29          #-------------------------------------------------
    30          #--------------------------------------------------------
    31 -        def __init__(self):
    32                  # detect KOrganizer
    33                  found, cmd = gmShellAPI.detect_external_binary(binary = 'konsolekalendar')
    34                  if not found:
    35                          raise gmExceptions.ConstructorError('cannot detect "konsolekalendar" via [%s]' % cmd)
    36
    37                  gmPlugin.cNotebookPlugin.__init__(self)
    38          #--------------------------------------------------------
    39 -        def name(self):
    40                  return gmKOrganizerPlugin.tab_name
    41          #--------------------------------------------------------
    42 -        def GetWidget(self, parent):
    43                  self._widget = gmDemographicsWidgets.cKOrganizerSchedulePnl(parent, -1)
    44                  return self._widget
    45          #--------------------------------------------------------
    46 -        def MenuInfo(self):
    47                  return ('office', _('&Appointments'))
    48          #--------------------------------------------------------
    49 -        def can_receive_focus(self):
    50                  return True
    51  #======================================================================
    52