Get rid of NetworkManager._ask
This commit is contained in:
parent
a9d48753ef
commit
a6215be864
@ -197,23 +197,6 @@ class NetworkManager(QNetworkAccessManager):
|
|||||||
abort_on.append(tab.load_started)
|
abort_on.append(tab.load_started)
|
||||||
return abort_on
|
return abort_on
|
||||||
|
|
||||||
def _ask(self, title, text, mode, owner=None, default=None):
|
|
||||||
"""Ask a blocking question in the statusbar.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
title: The title to display to the user.
|
|
||||||
text: The text to display to the user.
|
|
||||||
mode: A PromptMode.
|
|
||||||
owner: An object which will abort the question if destroyed, or
|
|
||||||
None.
|
|
||||||
|
|
||||||
Return:
|
|
||||||
The answer the user gave or None if the prompt was cancelled.
|
|
||||||
"""
|
|
||||||
abort_on = self._get_abort_signals(owner)
|
|
||||||
return message.ask(title=title, text=text, mode=mode,
|
|
||||||
abort_on=abort_on, default=default)
|
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
"""Abort all running requests."""
|
"""Abort all running requests."""
|
||||||
self.setNetworkAccessible(QNetworkAccessManager.NotAccessible)
|
self.setNetworkAccessible(QNetworkAccessManager.NotAccessible)
|
||||||
@ -325,9 +308,10 @@ class NetworkManager(QNetworkAccessManager):
|
|||||||
msg = '<b>{}</b> says:<br/>{}'.format(
|
msg = '<b>{}</b> says:<br/>{}'.format(
|
||||||
html.escape(proxy.hostName()),
|
html.escape(proxy.hostName()),
|
||||||
html.escape(authenticator.realm()))
|
html.escape(authenticator.realm()))
|
||||||
answer = self._ask(
|
abort_on = self._get_abort_signals()
|
||||||
"Proxy authentication required", msg,
|
answer = message.ask(
|
||||||
mode=usertypes.PromptMode.user_pwd)
|
title="Proxy authentication required", text=msg,
|
||||||
|
mode=usertypes.PromptMode.user_pwd, abort_on=abort_on)
|
||||||
if answer is not None:
|
if answer is not None:
|
||||||
authenticator.setUser(answer.user)
|
authenticator.setUser(answer.user)
|
||||||
authenticator.setPassword(answer.password)
|
authenticator.setPassword(answer.password)
|
||||||
|
Loading…
Reference in New Issue
Block a user