Preferences/ConfigurationPages/DebuggerGeneralPage.py

changeset 945
8cd4d08fa9f6
parent 791
9ec2ac20e54e
child 1112
8a7d1b9d18db
equal deleted inserted replaced
944:1b59c4ba121e 945:8cd4d08fa9f6
20 from .ConfigurationPageBase import ConfigurationPageBase 20 from .ConfigurationPageBase import ConfigurationPageBase
21 from .Ui_DebuggerGeneralPage import Ui_DebuggerGeneralPage 21 from .Ui_DebuggerGeneralPage import Ui_DebuggerGeneralPage
22 22
23 import Preferences 23 import Preferences
24 import Utilities 24 import Utilities
25
25 26
26 class DebuggerGeneralPage(ConfigurationPageBase, Ui_DebuggerGeneralPage): 27 class DebuggerGeneralPage(ConfigurationPageBase, Ui_DebuggerGeneralPage):
27 """ 28 """
28 Class implementing the Debugger General configuration page. 29 Class implementing the Debugger General configuration page.
29 """ 30 """
63 if len(addressEntries) > 0: 64 if len(addressEntries) > 0:
64 for addressEntry in addressEntries: 65 for addressEntry in addressEntries:
65 if ":" in addressEntry.ip().toString() and not socket.has_ipv6: 66 if ":" in addressEntry.ip().toString() and not socket.has_ipv6:
66 continue # IPv6 not supported by Python 67 continue # IPv6 not supported by Python
67 interfaces.append("{0} ({1})"\ 68 interfaces.append("{0} ({1})"\
68 .format(networkInterface.name(), 69 .format(networkInterface.name(),
69 addressEntry.ip().toString())) 70 addressEntry.ip().toString()))
70 self.interfacesCombo.addItems(interfaces) 71 self.interfacesCombo.addItems(interfaces)
71 interface = Preferences.getDebugger("NetworkInterface") 72 interface = Preferences.getDebugger("NetworkInterface")
72 if not socket.has_ipv6: 73 if not socket.has_ipv6:
73 # IPv6 not supported by Python 74 # IPv6 not supported by Python
135 136
136 def save(self): 137 def save(self):
137 """ 138 """
138 Public slot to save the Debugger General (1) configuration. 139 Public slot to save the Debugger General (1) configuration.
139 """ 140 """
140 Preferences.setDebugger("RemoteDbgEnabled", 141 Preferences.setDebugger("RemoteDbgEnabled",
141 self.remoteCheckBox.isChecked()) 142 self.remoteCheckBox.isChecked())
142 Preferences.setDebugger("RemoteHost", 143 Preferences.setDebugger("RemoteHost",
143 self.hostLineEdit.text()) 144 self.hostLineEdit.text())
144 Preferences.setDebugger("RemoteExecution", 145 Preferences.setDebugger("RemoteExecution",
145 self.execLineEdit.text()) 146 self.execLineEdit.text())
146 147
147 Preferences.setDebugger("PassiveDbgEnabled", 148 Preferences.setDebugger("PassiveDbgEnabled",
148 self.passiveDbgCheckBox.isChecked()) 149 self.passiveDbgCheckBox.isChecked())
149 Preferences.setDebugger("PassiveDbgPort", 150 Preferences.setDebugger("PassiveDbgPort",
150 self.passiveDbgPortSpinBox.value()) 151 self.passiveDbgPortSpinBox.value())
151 Preferences.setDebugger("PassiveDbgType", 152 Preferences.setDebugger("PassiveDbgType",
152 self.passiveDbgBackendCombo.currentText()) 153 self.passiveDbgBackendCombo.currentText())
153 154
154 if self.allInterfacesButton.isChecked(): 155 if self.allInterfacesButton.isChecked():
155 Preferences.setDebugger("NetworkInterface", "all") 156 Preferences.setDebugger("NetworkInterface", "all")
156 elif self.all6InterfacesButton.isChecked(): 157 elif self.all6InterfacesButton.isChecked():
166 allowedHosts = [] 167 allowedHosts = []
167 for row in range(self.allowedHostsList.count()): 168 for row in range(self.allowedHostsList.count()):
168 allowedHosts.append(self.allowedHostsList.item(row).text()) 169 allowedHosts.append(self.allowedHostsList.item(row).text())
169 Preferences.setDebugger("AllowedHosts", allowedHosts) 170 Preferences.setDebugger("AllowedHosts", allowedHosts)
170 171
171 Preferences.setDebugger("DebugEnvironmentReplace", 172 Preferences.setDebugger("DebugEnvironmentReplace",
172 self.debugEnvironReplaceCheckBox.isChecked()) 173 self.debugEnvironReplaceCheckBox.isChecked())
173 Preferences.setDebugger("DebugEnvironment", 174 Preferences.setDebugger("DebugEnvironment",
174 self.debugEnvironEdit.text()) 175 self.debugEnvironEdit.text())
175 Preferences.setDebugger("AutomaticReset", 176 Preferences.setDebugger("AutomaticReset",
176 self.automaticResetCheckBox.isChecked()) 177 self.automaticResetCheckBox.isChecked())
177 Preferences.setDebugger("Autosave", 178 Preferences.setDebugger("Autosave",
178 self.debugAutoSaveScriptsCheckBox.isChecked()) 179 self.debugAutoSaveScriptsCheckBox.isChecked())
179 Preferences.setDebugger("ConsoleDbgEnabled", 180 Preferences.setDebugger("ConsoleDbgEnabled",
180 self.consoleDbgCheckBox.isChecked()) 181 self.consoleDbgCheckBox.isChecked())
181 Preferences.setDebugger("ConsoleDbgCommand", 182 Preferences.setDebugger("ConsoleDbgCommand",
182 self.consoleDbgEdit.text()) 183 self.consoleDbgEdit.text())
183 Preferences.setDebugger("PathTranslation", 184 Preferences.setDebugger("PathTranslation",
184 self.dbgPathTranslationCheckBox.isChecked()) 185 self.dbgPathTranslationCheckBox.isChecked())
185 Preferences.setDebugger("PathTranslationRemote", 186 Preferences.setDebugger("PathTranslationRemote",
186 self.dbgTranslationRemoteEdit.text()) 187 self.dbgTranslationRemoteEdit.text())
187 Preferences.setDebugger("PathTranslationLocal", 188 Preferences.setDebugger("PathTranslationLocal",
188 self.dbgTranslationLocalEdit.text()) 189 self.dbgTranslationLocalEdit.text())
252 self.trUtf8("Edit allowed host"), 253 self.trUtf8("Edit allowed host"),
253 self.trUtf8("""<p>The entered address <b>{0}</b> is not""" 254 self.trUtf8("""<p>The entered address <b>{0}</b> is not"""
254 """ a valid IP v4 or IP v6 address. Aborting...</p>""")\ 255 """ a valid IP v4 or IP v6 address. Aborting...</p>""")\
255 .format(allowedHost)) 256 .format(allowedHost))
256 257
258
257 def create(dlg): 259 def create(dlg):
258 """ 260 """
259 Module function to create the configuration page. 261 Module function to create the configuration page.
260 262
261 @param dlg reference to the configuration dialog 263 @param dlg reference to the configuration dialog

eric ide

mercurial