Add proxy authentication
This commit is contained in:
parent
77eb7d621a
commit
d4c90b4a60
@ -368,6 +368,8 @@ class QuteBrowser(QApplication):
|
|||||||
tabs.currentChanged.connect(self.mainwindow.update_inspector)
|
tabs.currentChanged.connect(self.mainwindow.update_inspector)
|
||||||
self.networkmanager.authenticationRequired.connect(
|
self.networkmanager.authenticationRequired.connect(
|
||||||
status.on_authentication_required)
|
status.on_authentication_required)
|
||||||
|
self.networkmanager.proxyAuthenticationRequired.connect(
|
||||||
|
status.on_proxy_authentication_required)
|
||||||
|
|
||||||
# status bar
|
# status bar
|
||||||
self.modeman.entered.connect(status.on_mode_entered)
|
self.modeman.entered.connect(status.on_mode_entered)
|
||||||
|
@ -329,6 +329,19 @@ class StatusBar(QWidget):
|
|||||||
authenticator.setUser(user)
|
authenticator.setUser(user)
|
||||||
authenticator.setPassword(password)
|
authenticator.setPassword(password)
|
||||||
|
|
||||||
|
@pyqtSlot('QNetworkProxy', 'QAuthenticator')
|
||||||
|
def on_proxy_authentication_required(self, proxy, authenticator):
|
||||||
|
q = Question()
|
||||||
|
q.mode = PromptMode.user_pwd
|
||||||
|
q.text = "Proxy username ({}):".format(authenticator.realm())
|
||||||
|
self.prompt.question = q
|
||||||
|
answer = self.prompt.exec_()
|
||||||
|
if answer is not None:
|
||||||
|
user, password = answer
|
||||||
|
logging.debug("user: {} / pwd: {}".format(user, password))
|
||||||
|
authenticator.setUser(user)
|
||||||
|
authenticator.setPassword(password)
|
||||||
|
|
||||||
def resizeEvent(self, e):
|
def resizeEvent(self, e):
|
||||||
"""Extend resizeEvent of QWidget to emit a resized signal afterwards.
|
"""Extend resizeEvent of QWidget to emit a resized signal afterwards.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user