144 |
144 |
145 def save(self): |
145 def save(self): |
146 """ |
146 """ |
147 Public slot to save the Debugger General (1) configuration. |
147 Public slot to save the Debugger General (1) configuration. |
148 """ |
148 """ |
149 Preferences.setDebugger("RemoteDbgEnabled", |
149 Preferences.setDebugger( |
|
150 "RemoteDbgEnabled", |
150 self.remoteCheckBox.isChecked()) |
151 self.remoteCheckBox.isChecked()) |
151 Preferences.setDebugger("RemoteHost", |
152 Preferences.setDebugger( |
|
153 "RemoteHost", |
152 self.hostLineEdit.text()) |
154 self.hostLineEdit.text()) |
153 Preferences.setDebugger("RemoteExecution", |
155 Preferences.setDebugger( |
|
156 "RemoteExecution", |
154 self.execLineEdit.text()) |
157 self.execLineEdit.text()) |
155 |
158 |
156 Preferences.setDebugger("PassiveDbgEnabled", |
159 Preferences.setDebugger( |
|
160 "PassiveDbgEnabled", |
157 self.passiveDbgCheckBox.isChecked()) |
161 self.passiveDbgCheckBox.isChecked()) |
158 Preferences.setDebugger("PassiveDbgPort", |
162 Preferences.setDebugger( |
|
163 "PassiveDbgPort", |
159 self.passiveDbgPortSpinBox.value()) |
164 self.passiveDbgPortSpinBox.value()) |
160 Preferences.setDebugger("PassiveDbgType", |
165 Preferences.setDebugger( |
|
166 "PassiveDbgType", |
161 self.passiveDbgBackendCombo.currentText()) |
167 self.passiveDbgBackendCombo.currentText()) |
162 |
168 |
163 if self.allInterfacesButton.isChecked(): |
169 if self.allInterfacesButton.isChecked(): |
164 Preferences.setDebugger("NetworkInterface", "all") |
170 Preferences.setDebugger("NetworkInterface", "all") |
165 elif self.all6InterfacesButton.isChecked(): |
171 elif self.all6InterfacesButton.isChecked(): |
175 allowedHosts = [] |
181 allowedHosts = [] |
176 for row in range(self.allowedHostsList.count()): |
182 for row in range(self.allowedHostsList.count()): |
177 allowedHosts.append(self.allowedHostsList.item(row).text()) |
183 allowedHosts.append(self.allowedHostsList.item(row).text()) |
178 Preferences.setDebugger("AllowedHosts", allowedHosts) |
184 Preferences.setDebugger("AllowedHosts", allowedHosts) |
179 |
185 |
180 Preferences.setDebugger("DebugEnvironmentReplace", |
186 Preferences.setDebugger( |
|
187 "DebugEnvironmentReplace", |
181 self.debugEnvironReplaceCheckBox.isChecked()) |
188 self.debugEnvironReplaceCheckBox.isChecked()) |
182 Preferences.setDebugger("DebugEnvironment", |
189 Preferences.setDebugger( |
|
190 "DebugEnvironment", |
183 self.debugEnvironEdit.text()) |
191 self.debugEnvironEdit.text()) |
184 Preferences.setDebugger("AutomaticReset", |
192 Preferences.setDebugger( |
|
193 "AutomaticReset", |
185 self.automaticResetCheckBox.isChecked()) |
194 self.automaticResetCheckBox.isChecked()) |
186 Preferences.setDebugger("Autosave", |
195 Preferences.setDebugger( |
|
196 "Autosave", |
187 self.debugAutoSaveScriptsCheckBox.isChecked()) |
197 self.debugAutoSaveScriptsCheckBox.isChecked()) |
188 Preferences.setDebugger("ConsoleDbgEnabled", |
198 Preferences.setDebugger( |
|
199 "ConsoleDbgEnabled", |
189 self.consoleDbgCheckBox.isChecked()) |
200 self.consoleDbgCheckBox.isChecked()) |
190 Preferences.setDebugger("ConsoleDbgCommand", |
201 Preferences.setDebugger( |
|
202 "ConsoleDbgCommand", |
191 self.consoleDbgEdit.text()) |
203 self.consoleDbgEdit.text()) |
192 Preferences.setDebugger("PathTranslation", |
204 Preferences.setDebugger( |
|
205 "PathTranslation", |
193 self.dbgPathTranslationCheckBox.isChecked()) |
206 self.dbgPathTranslationCheckBox.isChecked()) |
194 Preferences.setDebugger("PathTranslationRemote", |
207 Preferences.setDebugger( |
|
208 "PathTranslationRemote", |
195 self.dbgTranslationRemoteEdit.text()) |
209 self.dbgTranslationRemoteEdit.text()) |
196 Preferences.setDebugger("PathTranslationLocal", |
210 Preferences.setDebugger( |
|
211 "PathTranslationLocal", |
197 self.dbgTranslationLocalEdit.text()) |
212 self.dbgTranslationLocalEdit.text()) |
198 Preferences.setDebugger("ThreeStateBreakPoints", |
213 Preferences.setDebugger( |
|
214 "ThreeStateBreakPoints", |
199 self.debugThreeStateBreakPoint.isChecked()) |
215 self.debugThreeStateBreakPoint.isChecked()) |
200 Preferences.setDebugger("SuppressClientExit", |
216 Preferences.setDebugger( |
|
217 "SuppressClientExit", |
201 self.dontShowClientExitCheckBox.isChecked()) |
218 self.dontShowClientExitCheckBox.isChecked()) |
202 Preferences.setDebugger("BreakAlways", |
219 Preferences.setDebugger( |
|
220 "BreakAlways", |
203 self.exceptionBreakCheckBox.isChecked()) |
221 self.exceptionBreakCheckBox.isChecked()) |
204 Preferences.setDebugger("AutoViewSourceCode", |
222 Preferences.setDebugger( |
|
223 "AutoViewSourceCode", |
205 self.autoViewSourcecodeCheckBox.isChecked()) |
224 self.autoViewSourcecodeCheckBox.isChecked()) |
206 |
225 |
207 def on_allowedHostsList_currentItemChanged(self, current, previous): |
226 def on_allowedHostsList_currentItemChanged(self, current, previous): |
208 """ |
227 """ |
209 Private method set the state of the edit and delete button. |
228 Private method set the state of the edit and delete button. |
227 if ok and allowedHost: |
246 if ok and allowedHost: |
228 if QHostAddress(allowedHost).protocol() in \ |
247 if QHostAddress(allowedHost).protocol() in \ |
229 [QAbstractSocket.IPv4Protocol, QAbstractSocket.IPv6Protocol]: |
248 [QAbstractSocket.IPv4Protocol, QAbstractSocket.IPv6Protocol]: |
230 self.allowedHostsList.addItem(allowedHost) |
249 self.allowedHostsList.addItem(allowedHost) |
231 else: |
250 else: |
232 E5MessageBox.critical(self, |
251 E5MessageBox.critical( |
|
252 self, |
233 self.trUtf8("Add allowed host"), |
253 self.trUtf8("Add allowed host"), |
234 self.trUtf8( |
254 self.trUtf8( |
235 """<p>The entered address <b>{0}</b> is not""" |
255 """<p>The entered address <b>{0}</b> is not""" |
236 """ a valid IP v4 or IP v6 address.""" |
256 """ a valid IP v4 or IP v6 address.""" |
237 """ Aborting...</p>""")\ |
257 """ Aborting...</p>""")\ |
259 if ok and allowedHost: |
279 if ok and allowedHost: |
260 if QHostAddress(allowedHost).protocol() in \ |
280 if QHostAddress(allowedHost).protocol() in \ |
261 [QAbstractSocket.IPv4Protocol, QAbstractSocket.IPv6Protocol]: |
281 [QAbstractSocket.IPv4Protocol, QAbstractSocket.IPv6Protocol]: |
262 self.allowedHostsList.currentItem().setText(allowedHost) |
282 self.allowedHostsList.currentItem().setText(allowedHost) |
263 else: |
283 else: |
264 E5MessageBox.critical(self, |
284 E5MessageBox.critical( |
|
285 self, |
265 self.trUtf8("Edit allowed host"), |
286 self.trUtf8("Edit allowed host"), |
266 self.trUtf8( |
287 self.trUtf8( |
267 """<p>The entered address <b>{0}</b> is not""" |
288 """<p>The entered address <b>{0}</b> is not""" |
268 """ a valid IP v4 or IP v6 address.""" |
289 """ a valid IP v4 or IP v6 address.""" |
269 """ Aborting...</p>""")\ |
290 """ Aborting...</p>""")\ |