|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2006 - 2009 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing the Corba configuration page. |
|
8 """ |
|
9 |
|
10 from PyQt4.QtCore import QDir, pyqtSlot |
|
11 from PyQt4.QtGui import QFileDialog |
|
12 |
|
13 from E4Gui.E4Completers import E4FileCompleter |
|
14 |
|
15 from ConfigurationPageBase import ConfigurationPageBase |
|
16 from Ui_CorbaPage import Ui_CorbaPage |
|
17 |
|
18 import Preferences |
|
19 import Utilities |
|
20 |
|
21 class CorbaPage(ConfigurationPageBase, Ui_CorbaPage): |
|
22 """ |
|
23 Class implementing the Corba configuration page. |
|
24 """ |
|
25 def __init__(self): |
|
26 """ |
|
27 Constructor |
|
28 """ |
|
29 ConfigurationPageBase.__init__(self) |
|
30 self.setupUi(self) |
|
31 self.setObjectName("CorbaPage") |
|
32 |
|
33 self.idlCompleter = E4FileCompleter(self.idlEdit) |
|
34 |
|
35 # set initial values |
|
36 self.idlEdit.setText(Preferences.getCorba("omniidl")) |
|
37 |
|
38 def save(self): |
|
39 """ |
|
40 Public slot to save the Corba configuration. |
|
41 """ |
|
42 Preferences.setCorba("omniidl", self.idlEdit.text()) |
|
43 |
|
44 @pyqtSlot() |
|
45 def on_idlButton_clicked(self): |
|
46 """ |
|
47 Private slot to handle the IDL compiler selection. |
|
48 """ |
|
49 file = QFileDialog.getOpenFileName(\ |
|
50 self, |
|
51 self.trUtf8("Select IDL compiler"), |
|
52 self.idlEdit.text(), |
|
53 "") |
|
54 |
|
55 if file: |
|
56 self.idlEdit.setText(Utilities.toNativeSeparators(file)) |
|
57 |
|
58 def create(dlg): |
|
59 """ |
|
60 Module function to create the configuration page. |
|
61 |
|
62 @param dlg reference to the configuration dialog |
|
63 """ |
|
64 page = CorbaPage() |
|
65 return page |