12 |
12 |
13 from PyQt6.QtCore import QCoreApplication, QUrl |
13 from PyQt6.QtCore import QCoreApplication, QUrl |
14 from PyQt6.QtNetwork import QNetworkProxy, QNetworkProxyFactory, QNetworkProxyQuery |
14 from PyQt6.QtNetwork import QNetworkProxy, QNetworkProxyFactory, QNetworkProxyQuery |
15 from PyQt6.QtWidgets import QDialog |
15 from PyQt6.QtWidgets import QDialog |
16 |
16 |
17 from eric7 import Globals, Preferences, Utilities |
17 from eric7 import Preferences, Utilities |
18 from eric7.EricWidgets import EricMessageBox |
18 from eric7.EricWidgets import EricMessageBox |
|
19 from eric7.SystemUtilities import OSUtilities |
19 |
20 |
20 |
21 |
21 def schemeFromProxyType(proxyType): |
22 def schemeFromProxyType(proxyType): |
22 """ |
23 """ |
23 Module function to determine the scheme name from the proxy type. |
24 Module function to determine the scheme name from the proxy type. |
170 |
171 |
171 # determine proxy |
172 # determine proxy |
172 if Preferences.getUI("UseSystemProxy"): |
173 if Preferences.getUI("UseSystemProxy"): |
173 proxyList = QNetworkProxyFactory.systemProxyForQuery(query) |
174 proxyList = QNetworkProxyFactory.systemProxyForQuery(query) |
174 if ( |
175 if ( |
175 not Globals.isWindowsPlatform() |
176 not OSUtilities.isWindowsPlatform() |
176 and len(proxyList) == 1 |
177 and len(proxyList) == 1 |
177 and proxyList[0].type() == QNetworkProxy.ProxyType.NoProxy |
178 and proxyList[0].type() == QNetworkProxy.ProxyType.NoProxy |
178 ): |
179 ): |
179 # try it the Python way |
180 # try it the Python way |
180 # scan the environment for variables named <scheme>_proxy |
181 # scan the environment for variables named <scheme>_proxy |