7 Module implementing the Corba configuration page. |
7 Module implementing the Corba configuration page. |
8 """ |
8 """ |
9 |
9 |
10 from __future__ import unicode_literals |
10 from __future__ import unicode_literals |
11 |
11 |
12 from PyQt5.QtCore import pyqtSlot |
12 from E5Gui.E5PathPicker import E5PathPickerModes |
13 |
|
14 from E5Gui.E5Completers import E5FileCompleter |
|
15 from E5Gui import E5FileDialog |
|
16 |
13 |
17 from .ConfigurationPageBase import ConfigurationPageBase |
14 from .ConfigurationPageBase import ConfigurationPageBase |
18 from .Ui_CorbaPage import Ui_CorbaPage |
15 from .Ui_CorbaPage import Ui_CorbaPage |
19 |
16 |
20 import Preferences |
17 import Preferences |
21 import Utilities |
|
22 import UI.PixmapCache |
|
23 |
18 |
24 |
19 |
25 class CorbaPage(ConfigurationPageBase, Ui_CorbaPage): |
20 class CorbaPage(ConfigurationPageBase, Ui_CorbaPage): |
26 """ |
21 """ |
27 Class implementing the Corba configuration page. |
22 Class implementing the Corba configuration page. |
32 """ |
27 """ |
33 super(CorbaPage, self).__init__() |
28 super(CorbaPage, self).__init__() |
34 self.setupUi(self) |
29 self.setupUi(self) |
35 self.setObjectName("CorbaPage") |
30 self.setObjectName("CorbaPage") |
36 |
31 |
37 self.idlButton.setIcon(UI.PixmapCache.getIcon("open.png")) |
32 self.idlPicker.setMode(E5PathPickerModes.OpenFileMode) |
38 |
33 self.idlPicker.setToolTip(self.tr( |
39 self.idlCompleter = E5FileCompleter(self.idlEdit) |
34 "Press to select the IDL compiler via a file selection dialog.")) |
40 |
35 |
41 # set initial values |
36 # set initial values |
42 self.idlEdit.setText(Preferences.getCorba("omniidl")) |
37 self.idlPicker.setText(Preferences.getCorba("omniidl")) |
43 |
38 |
44 def save(self): |
39 def save(self): |
45 """ |
40 """ |
46 Public slot to save the Corba configuration. |
41 Public slot to save the Corba configuration. |
47 """ |
42 """ |
48 Preferences.setCorba("omniidl", self.idlEdit.text()) |
43 Preferences.setCorba("omniidl", self.idlPicker.text()) |
49 |
|
50 @pyqtSlot() |
|
51 def on_idlButton_clicked(self): |
|
52 """ |
|
53 Private slot to handle the IDL compiler selection. |
|
54 """ |
|
55 file = E5FileDialog.getOpenFileName( |
|
56 self, |
|
57 self.tr("Select IDL compiler"), |
|
58 self.idlEdit.text(), |
|
59 "") |
|
60 |
|
61 if file: |
|
62 self.idlEdit.setText(Utilities.toNativeSeparators(file)) |
|
63 |
44 |
64 |
45 |
65 def create(dlg): |
46 def create(dlg): |
66 """ |
47 """ |
67 Module function to create the configuration page. |
48 Module function to create the configuration page. |