13 from PyQt6.QtCore import pyqtSlot, Qt, QAbstractItemModel, QModelIndex |
13 from PyQt6.QtCore import pyqtSlot, Qt, QAbstractItemModel, QModelIndex |
14 from PyQt6.QtGui import QBrush, QColor |
14 from PyQt6.QtGui import QBrush, QColor |
15 from PyQt6.QtWidgets import QLineEdit, QInputDialog |
15 from PyQt6.QtWidgets import QLineEdit, QInputDialog |
16 from PyQt6.QtNetwork import QNetworkInterface, QAbstractSocket, QHostAddress |
16 from PyQt6.QtNetwork import QNetworkInterface, QAbstractSocket, QHostAddress |
17 |
17 |
18 from E5Gui.E5Application import e5App |
18 from E5Gui.EricApplication import ericApp |
19 from E5Gui.E5Completers import E5FileCompleter, E5DirCompleter |
19 from E5Gui.EricCompleters import EricFileCompleter, EricDirCompleter |
20 from E5Gui import E5MessageBox |
20 from E5Gui import EricMessageBox |
21 |
21 |
22 from .ConfigurationPageBase import ConfigurationPageBase |
22 from .ConfigurationPageBase import ConfigurationPageBase |
23 from .Ui_DebuggerGeneralPage import Ui_DebuggerGeneralPage |
23 from .Ui_DebuggerGeneralPage import Ui_DebuggerGeneralPage |
24 |
24 |
25 import Preferences |
25 import Preferences |
42 if t: |
42 if t: |
43 t += Utilities.getPercentReplacementHelp() |
43 t += Utilities.getPercentReplacementHelp() |
44 self.execLineEdit.setWhatsThis(t) |
44 self.execLineEdit.setWhatsThis(t) |
45 |
45 |
46 try: |
46 try: |
47 backends = e5App().getObject("DebugServer").getSupportedLanguages() |
47 backends = ericApp().getObject("DebugServer").getSupportedLanguages() |
48 for backend in sorted(backends): |
48 for backend in sorted(backends): |
49 self.passiveDbgBackendCombo.addItem(backend) |
49 self.passiveDbgBackendCombo.addItem(backend) |
50 except KeyError: |
50 except KeyError: |
51 self.passiveDbgGroup.setEnabled(False) |
51 self.passiveDbgGroup.setEnabled(False) |
52 |
52 |
53 t = self.consoleDbgEdit.whatsThis() |
53 t = self.consoleDbgEdit.whatsThis() |
54 if t: |
54 if t: |
55 t += Utilities.getPercentReplacementHelp() |
55 t += Utilities.getPercentReplacementHelp() |
56 self.consoleDbgEdit.setWhatsThis(t) |
56 self.consoleDbgEdit.setWhatsThis(t) |
57 |
57 |
58 self.consoleDbgCompleter = E5FileCompleter(self.consoleDbgEdit) |
58 self.consoleDbgCompleter = EricFileCompleter(self.consoleDbgEdit) |
59 self.dbgTranslationLocalCompleter = E5DirCompleter( |
59 self.dbgTranslationLocalCompleter = EricDirCompleter( |
60 self.dbgTranslationLocalEdit) |
60 self.dbgTranslationLocalEdit) |
61 |
61 |
62 # set initial values |
62 # set initial values |
63 interfaces = [] |
63 interfaces = [] |
64 networkInterfaces = QNetworkInterface.allInterfaces() |
64 networkInterfaces = QNetworkInterface.allInterfaces() |
278 QAbstractSocket.NetworkLayerProtocol.IPv4Protocol, |
278 QAbstractSocket.NetworkLayerProtocol.IPv4Protocol, |
279 QAbstractSocket.NetworkLayerProtocol.IPv6Protocol |
279 QAbstractSocket.NetworkLayerProtocol.IPv6Protocol |
280 ]: |
280 ]: |
281 self.allowedHostsList.addItem(allowedHost) |
281 self.allowedHostsList.addItem(allowedHost) |
282 else: |
282 else: |
283 E5MessageBox.critical( |
283 EricMessageBox.critical( |
284 self, |
284 self, |
285 self.tr("Add allowed host"), |
285 self.tr("Add allowed host"), |
286 self.tr( |
286 self.tr( |
287 """<p>The entered address <b>{0}</b> is not""" |
287 """<p>The entered address <b>{0}</b> is not""" |
288 """ a valid IP v4 or IP v6 address.""" |
288 """ a valid IP v4 or IP v6 address.""" |
313 QAbstractSocket.NetworkLayerProtocol.IPv4Protocol, |
313 QAbstractSocket.NetworkLayerProtocol.IPv4Protocol, |
314 QAbstractSocket.NetworkLayerProtocol.IPv6Protocol |
314 QAbstractSocket.NetworkLayerProtocol.IPv6Protocol |
315 ]: |
315 ]: |
316 self.allowedHostsList.currentItem().setText(allowedHost) |
316 self.allowedHostsList.currentItem().setText(allowedHost) |
317 else: |
317 else: |
318 E5MessageBox.critical( |
318 EricMessageBox.critical( |
319 self, |
319 self, |
320 self.tr("Edit allowed host"), |
320 self.tr("Edit allowed host"), |
321 self.tr( |
321 self.tr( |
322 """<p>The entered address <b>{0}</b> is not""" |
322 """<p>The entered address <b>{0}</b> is not""" |
323 """ a valid IP v4 or IP v6 address.""" |
323 """ a valid IP v4 or IP v6 address.""" |