11 |
11 |
12 from PyQt4.QtCore import pyqtSlot |
12 from PyQt4.QtCore import pyqtSlot |
13 |
13 |
14 from E5Gui import E5FileDialog |
14 from E5Gui import E5FileDialog |
15 |
15 |
16 from Preferences.ConfigurationPages.ConfigurationPageBase import ConfigurationPageBase |
16 from Preferences.ConfigurationPages.ConfigurationPageBase import \ |
|
17 ConfigurationPageBase |
17 from .Ui_DjangoPage import Ui_DjangoPage |
18 from .Ui_DjangoPage import Ui_DjangoPage |
18 |
19 |
19 from Globals import isWindowsPlatform, isMacPlatform |
20 from Globals import isWindowsPlatform, isMacPlatform |
20 |
21 |
21 import Utilities |
22 import Utilities |
97 |
98 |
98 def save(self): |
99 def save(self): |
99 """ |
100 """ |
100 Public slot to save the Django configuration. |
101 Public slot to save the Django configuration. |
101 """ |
102 """ |
102 self.__plugin.setPreferences("ConsoleCommand", |
103 self.__plugin.setPreferences( |
|
104 "ConsoleCommand", |
103 self.consoleCommandCombo.currentText()) |
105 self.consoleCommandCombo.currentText()) |
104 self.__plugin.setPreferences("ConsoleCommandNoClose", |
106 self.__plugin.setPreferences( |
|
107 "ConsoleCommandNoClose", |
105 self.consoleCommandNoCloseCombo.currentText()) |
108 self.consoleCommandNoCloseCombo.currentText()) |
106 |
109 |
107 self.__plugin.setPreferences("ServerAddress", |
110 self.__plugin.setPreferences( |
108 self.serverAddressEdit.text()) |
111 "ServerAddress", self.serverAddressEdit.text()) |
109 self.__plugin.setPreferences("UseIPv6", |
112 self.__plugin.setPreferences( |
110 self.ipv6CheckBox.isChecked()) |
113 "UseIPv6", self.ipv6CheckBox.isChecked()) |
111 |
114 |
112 self.__plugin.setPreferences("RecentNumberApps", |
115 self.__plugin.setPreferences( |
113 self.appsRecentSpinBox.value()) |
116 "RecentNumberApps", self.appsRecentSpinBox.value()) |
114 |
117 |
115 self.__plugin.setPreferences("VirtualEnvironmentPy2", |
118 self.__plugin.setPreferences( |
116 self.virtualEnvPy2Edit.text()) |
119 "VirtualEnvironmentPy2", self.virtualEnvPy2Edit.text()) |
117 self.__plugin.setPreferences("UsePlainPythonPy2", |
120 self.__plugin.setPreferences( |
118 self.plainPython2CheckBox.isChecked()) |
121 "UsePlainPythonPy2", self.plainPython2CheckBox.isChecked()) |
119 |
122 |
120 self.__plugin.setPreferences("VirtualEnvironmentPy3", |
123 self.__plugin.setPreferences( |
121 self.virtualEnvPy3Edit.text()) |
124 "VirtualEnvironmentPy3", self.virtualEnvPy3Edit.text()) |
122 self.__plugin.setPreferences("UsePlainPythonPy3", |
125 self.__plugin.setPreferences( |
123 self.plainPython3CheckBox.isChecked()) |
126 "UsePlainPythonPy3", self.plainPython3CheckBox.isChecked()) |
124 |
127 |
125 self.__plugin.setPreferences("TranslationsEditor", |
128 self.__plugin.setPreferences( |
126 self.translationsEdit.text()) |
129 "TranslationsEditor", self.translationsEdit.text()) |
127 |
130 |
128 @pyqtSlot() |
131 @pyqtSlot() |
129 def on_virtualEnvPy3Button_clicked(self): |
132 def on_virtualEnvPy3Button_clicked(self): |
130 """ |
133 """ |
131 Private slot to select the virtual environment for Python 3 via a |
134 Private slot to select the virtual environment for Python 3 via a |
139 self.trUtf8("Select Virtual Environment for Python 3"), |
142 self.trUtf8("Select Virtual Environment for Python 3"), |
140 vDir, |
143 vDir, |
141 E5FileDialog.Options(E5FileDialog.Option(0))) |
144 E5FileDialog.Options(E5FileDialog.Option(0))) |
142 |
145 |
143 if virtualEnv: |
146 if virtualEnv: |
144 self.virtualEnvPy3Edit.setText(Utilities.toNativeSeparators(virtualEnv)) |
147 self.virtualEnvPy3Edit.setText( |
|
148 Utilities.toNativeSeparators(virtualEnv)) |
145 |
149 |
146 @pyqtSlot() |
150 @pyqtSlot() |
147 def on_virtualEnvPy2Button_clicked(self): |
151 def on_virtualEnvPy2Button_clicked(self): |
148 """ |
152 """ |
149 Private slot to select the virtual environment for Python 2 via a |
153 Private slot to select the virtual environment for Python 2 via a |
157 self.trUtf8("Select Virtual Environment for Python 2"), |
161 self.trUtf8("Select Virtual Environment for Python 2"), |
158 vDir, |
162 vDir, |
159 E5FileDialog.Options(E5FileDialog.Option(0))) |
163 E5FileDialog.Options(E5FileDialog.Option(0))) |
160 |
164 |
161 if virtualEnv: |
165 if virtualEnv: |
162 self.virtualEnvPy2Edit.setText(Utilities.toNativeSeparators(virtualEnv)) |
166 self.virtualEnvPy2Edit.setText( |
|
167 Utilities.toNativeSeparators(virtualEnv)) |
163 |
168 |
164 @pyqtSlot() |
169 @pyqtSlot() |
165 def on_translationsButton_clicked(self): |
170 def on_translationsButton_clicked(self): |
166 """ |
171 """ |
167 Private slot to select the translations editor via a file selection dialog. |
172 Private slot to select the translations editor via a file selection |
|
173 dialog. |
168 """ |
174 """ |
169 editor = E5FileDialog.getOpenFileName( |
175 editor = E5FileDialog.getOpenFileName( |
170 self, |
176 self, |
171 self.trUtf8("Translations Editor"), |
177 self.trUtf8("Translations Editor"), |
172 self.translationsEdit.text(), |
178 self.translationsEdit.text(), |