1# -*- coding: utf-8 -*-
2
3# Copyright (c) 2006 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
4#
5
6"""
7Module implementing the Corba configuration page.
8"""
9
10from E5Gui.E5PathPicker import E5PathPickerModes
11
12from .ConfigurationPageBase import ConfigurationPageBase
13from .Ui_CorbaPage import Ui_CorbaPage
14
15import Preferences
16
17
18class CorbaPage(ConfigurationPageBase, Ui_CorbaPage):
19    """
20    Class implementing the Corba configuration page.
21    """
22    def __init__(self):
23        """
24        Constructor
25        """
26        super().__init__()
27        self.setupUi(self)
28        self.setObjectName("CorbaPage")
29
30        self.idlPicker.setMode(E5PathPickerModes.OpenFileMode)
31        self.idlPicker.setToolTip(self.tr(
32            "Press to select the IDL compiler via a file selection dialog."))
33
34        # set initial values
35        self.idlPicker.setText(Preferences.getCorba("omniidl"))
36
37    def save(self):
38        """
39        Public slot to save the Corba configuration.
40        """
41        Preferences.setCorba("omniidl", self.idlPicker.text())
42
43
44def create(dlg):
45    """
46    Module function to create the configuration page.
47
48    @param dlg reference to the configuration dialog
49    @return reference to the instantiated page (ConfigurationPageBase)
50    """
51    page = CorbaPage()
52    return page
53