示例#1
0
    def __get_lab_panel(self):
        # get panel to use
        dbcfg = gmCfg.cCfgSQL()
        pk_panel = dbcfg.get2(
            option=u'horstspace.top_panel.lab_panel',
            workplace=gmPraxis.gmCurrentPraxisBranch().active_workplace,
            bias='user')
        if pk_panel is None:
            return None

        try:
            panel = gmPathLab.cTestPanel(aPK_obj=pk_panel)
        except gmExceptions.ConstructorError:
            _log.exception('cannot load configured test panel')
            panel = None
        if panel is not None:
            return panel

        _log.error(
            'Cannot load test panel [#%s] configured for patient pane (horstspace.top_panel.lab_panel).',
            pk_panel)
        gmGuiHelpers.gm_show_error(
            title=_('GNUmed startup'),
            error=_('Cannot load test panel [#%s] configured\n'
                    'for the top pane with option\n'
                    '\n'
                    ' <horstspace.top_panel.lab_panel>\n'
                    '\n'
                    'Please reconfigure.') % pk_panel)
        return None
示例#2
0
    def __init_ui(self):
        cfg = gmCfg2.gmCfgData()
        if cfg.get(option='slave'):
            self._TCTRL_patient_selector.SetEditable(0)
            self._TCTRL_patient_selector.SetToolTip(None)

        if sys.platform == 'darwin':
            _log.debug('adjusting font size on Mac for top panel parts')
            for ctrl in [
                    self._TCTRL_patient_selector, self._LBL_age,
                    self._LBL_allergies, self._TCTRL_allergies
            ]:
                curr_font = ctrl.GetFont()
                mac_font = wx.Font(curr_font.GetNativeFontInfo())
                mac_font.SetPointSize(pointSize=int(curr_font.GetPointSize() /
                                                    0.8))
                ctrl.SetFont(mac_font)

        # get panel to use
        dbcfg = gmCfg.cCfgSQL()
        pk_panel = dbcfg.get2(
            option='horstspace.top_panel.lab_panel',
            workplace=gmPraxis.gmCurrentPraxisBranch().active_workplace,
            bias='user')
        if pk_panel is None:
            self.__lab_panel = None
        else:
            self.__lab_panel = gmPathLab.cTestPanel(aPK_obj=pk_panel)
示例#3
0
文件: gmTopPanel.py 项目: sk/gnumed
	def __init_ui(self):
		cfg = gmCfg2.gmCfgData()
		if cfg.get(option = 'slave'):
			self._TCTRL_patient_selector.SetEditable(0)
			self._TCTRL_patient_selector.SetToolTip(None)

		if sys.platform == u'darwin':
			_log.debug('adjusting font size on Mac for top panel parts')
			for ctrl in [self._TCTRL_patient_selector, self._LBL_age, self._LBL_allergies, self._TCTRL_allergies]:
				curr_font = ctrl.GetFont()
				mac_font = wx.FontFromNativeInfo(curr_font.NativeFontInfo)
				mac_font.SetPointSize(pointSize = int(curr_font.GetPointSize() / 0.8))
				ctrl.SetFont(mac_font)

		# get panel to use
		dbcfg = gmCfg.cCfgSQL()
		pk_panel = dbcfg.get2 (
			option = u'horstspace.top_panel.lab_panel',
			workplace = gmPraxis.gmCurrentPraxisBranch().active_workplace,
			bias = 'user'
		)
		if pk_panel is None:
			self.__lab_panel = None
		else:
			self.__lab_panel = gmPathLab.cTestPanel(aPK_obj = pk_panel)