10 from PyQt4.QtCore import pyqtSlot |
10 from PyQt4.QtCore import pyqtSlot |
11 |
11 |
12 from E5Gui.E5Completers import E5DirCompleter |
12 from E5Gui.E5Completers import E5DirCompleter |
13 from E5Gui import E5FileDialog |
13 from E5Gui import E5FileDialog |
14 |
14 |
15 from Preferences.ConfigurationPages.ConfigurationPageBase import ConfigurationPageBase |
15 from Preferences.ConfigurationPages.ConfigurationPageBase import \ |
|
16 ConfigurationPageBase |
16 from .Ui_PyramidPage import Ui_PyramidPage |
17 from .Ui_PyramidPage import Ui_PyramidPage |
17 |
18 |
18 import Utilities |
19 import Utilities |
19 |
20 |
20 from Globals import isWindowsPlatform, isMacPlatform |
21 from Globals import isWindowsPlatform, isMacPlatform |
84 |
85 |
85 def save(self): |
86 def save(self): |
86 """ |
87 """ |
87 Public slot to save the Pyramid configuration. |
88 Public slot to save the Pyramid configuration. |
88 """ |
89 """ |
89 self.__plugin.setPreferences("ConsoleCommand", |
90 self.__plugin.setPreferences( |
90 self.consoleCommandCombo.currentText()) |
91 "ConsoleCommand", self.consoleCommandCombo.currentText()) |
91 |
92 |
92 self.__plugin.setPreferences("VirtualEnvironmentPy2", |
93 self.__plugin.setPreferences( |
93 self.virtualEnvPy2Edit.text()) |
94 "VirtualEnvironmentPy2", self.virtualEnvPy2Edit.text()) |
94 self.__plugin.setPreferences("VirtualEnvironmentPy3", |
95 self.__plugin.setPreferences( |
95 self.virtualEnvPy3Edit.text()) |
96 "VirtualEnvironmentPy3", self.virtualEnvPy3Edit.text()) |
96 |
97 |
97 self.__plugin.setPreferences("Python2ConsoleType", |
98 self.__plugin.setPreferences( |
|
99 "Python2ConsoleType", |
98 self.py2ShellCombo.itemData(self.py2ShellCombo.currentIndex())) |
100 self.py2ShellCombo.itemData(self.py2ShellCombo.currentIndex())) |
99 self.__plugin.setPreferences("Python3ConsoleType", |
101 self.__plugin.setPreferences( |
|
102 "Python3ConsoleType", |
100 self.py3ShellCombo.itemData(self.py3ShellCombo.currentIndex())) |
103 self.py3ShellCombo.itemData(self.py3ShellCombo.currentIndex())) |
101 |
104 |
102 self.__plugin.setPreferences("PyramidDocUrl", |
105 self.__plugin.setPreferences( |
103 self.urlEdit.text()) |
106 "PyramidDocUrl", self.urlEdit.text()) |
104 |
107 |
105 self.__plugin.setPreferences("TranslationsEditor", |
108 self.__plugin.setPreferences( |
106 self.translationsEdit.text()) |
109 "TranslationsEditor", self.translationsEdit.text()) |
107 |
110 |
108 @pyqtSlot() |
111 @pyqtSlot() |
109 def on_virtualEnvPy3Button_clicked(self): |
112 def on_virtualEnvPy3Button_clicked(self): |
110 """ |
113 """ |
111 Private slot to select the virtual environment for Python 3 via a |
114 Private slot to select the virtual environment for Python 3 via a |
119 self.trUtf8("Select Virtual Environment for Python 3"), |
122 self.trUtf8("Select Virtual Environment for Python 3"), |
120 vDir, |
123 vDir, |
121 E5FileDialog.Options(E5FileDialog.Option(0))) |
124 E5FileDialog.Options(E5FileDialog.Option(0))) |
122 |
125 |
123 if virtualEnv: |
126 if virtualEnv: |
124 self.virtualEnvPy3Edit.setText(Utilities.toNativeSeparators(virtualEnv)) |
127 self.virtualEnvPy3Edit.setText(Utilities.toNativeSeparators( |
|
128 virtualEnv)) |
125 |
129 |
126 @pyqtSlot() |
130 @pyqtSlot() |
127 def on_virtualEnvPy2Button_clicked(self): |
131 def on_virtualEnvPy2Button_clicked(self): |
128 """ |
132 """ |
129 Private slot to select the virtual environment for Python 2 via a |
133 Private slot to select the virtual environment for Python 2 via a |
137 self.trUtf8("Select Virtual Environment for Python 2"), |
141 self.trUtf8("Select Virtual Environment for Python 2"), |
138 vDir, |
142 vDir, |
139 E5FileDialog.Options(E5FileDialog.Option(0))) |
143 E5FileDialog.Options(E5FileDialog.Option(0))) |
140 |
144 |
141 if virtualEnv: |
145 if virtualEnv: |
142 self.virtualEnvPy2Edit.setText(Utilities.toNativeSeparators(virtualEnv)) |
146 self.virtualEnvPy2Edit.setText(Utilities.toNativeSeparators( |
|
147 virtualEnv)) |
143 |
148 |
144 @pyqtSlot() |
149 @pyqtSlot() |
145 def on_translationsButton_clicked(self): |
150 def on_translationsButton_clicked(self): |
146 """ |
151 """ |
147 Private slot to select the translations editor via a file selection dialog. |
152 Private slot to select the translations editor via a file selection |
|
153 dialog. |
148 """ |
154 """ |
149 editor = E5FileDialog.getOpenFileName( |
155 editor = E5FileDialog.getOpenFileName( |
150 self, |
156 self, |
151 self.trUtf8("Translations Editor"), |
157 self.trUtf8("Translations Editor"), |
152 self.translationsEdit.text(), |
158 self.translationsEdit.text(), |