12 |
12 |
13 from PyQt6.QtCore import QUrl, QCoreApplication |
13 from PyQt6.QtCore import QUrl, QCoreApplication |
14 from PyQt6.QtWidgets import QDialog |
14 from PyQt6.QtWidgets import QDialog |
15 from PyQt6.QtNetwork import QNetworkProxyFactory, QNetworkProxy, QNetworkProxyQuery |
15 from PyQt6.QtNetwork import QNetworkProxyFactory, QNetworkProxy, QNetworkProxyQuery |
16 |
16 |
17 from EricWidgets import EricMessageBox |
17 from eric7.EricWidgets import EricMessageBox |
18 |
18 |
19 import Preferences |
19 from eric7 import Globals, Preferences, Utilities |
20 import Globals |
|
21 import Utilities |
|
22 |
20 |
23 |
21 |
24 def schemeFromProxyType(proxyType): |
22 def schemeFromProxyType(proxyType): |
25 """ |
23 """ |
26 Module function to determine the scheme name from the proxy type. |
24 Module function to determine the scheme name from the proxy type. |
49 """ |
47 """ |
50 info = QCoreApplication.translate( |
48 info = QCoreApplication.translate( |
51 "EricNetworkProxyFactory", "<b>Connect to proxy '{0}' using:</b>" |
49 "EricNetworkProxyFactory", "<b>Connect to proxy '{0}' using:</b>" |
52 ).format(Utilities.html_encode(proxy.hostName())) |
50 ).format(Utilities.html_encode(proxy.hostName())) |
53 |
51 |
54 from UI.AuthenticationDialog import AuthenticationDialog |
52 from eric7.UI.AuthenticationDialog import AuthenticationDialog |
55 |
53 |
56 dlg = AuthenticationDialog(info, proxy.user(), True) |
54 dlg = AuthenticationDialog(info, proxy.user(), True) |
57 dlg.setData(proxy.user(), proxy.password()) |
55 dlg.setData(proxy.user(), proxy.password()) |
58 if dlg.exec() == QDialog.DialogCode.Accepted: |
56 if dlg.exec() == QDialog.DialogCode.Accepted: |
59 username, password = dlg.getData() |
57 username, password = dlg.getData() |