Add a default for SSL questions
This commit is contained in:
parent
20716c137c
commit
653ca9799d
@ -207,7 +207,7 @@ class NetworkManager(QNetworkAccessManager):
|
|||||||
self.setCache(cache)
|
self.setCache(cache)
|
||||||
cache.setParent(app)
|
cache.setParent(app)
|
||||||
|
|
||||||
def _ask(self, title, text, mode, owner=None):
|
def _ask(self, title, text, mode, owner=None, default=None):
|
||||||
"""Ask a blocking question in the statusbar.
|
"""Ask a blocking question in the statusbar.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -232,7 +232,7 @@ class NetworkManager(QNetworkAccessManager):
|
|||||||
abort_on.append(tab.load_started)
|
abort_on.append(tab.load_started)
|
||||||
|
|
||||||
return message.ask(win_id=self._win_id, title=title, text=text,
|
return message.ask(win_id=self._win_id, title=title, text=text,
|
||||||
mode=mode, abort_on=abort_on)
|
mode=mode, abort_on=abort_on, default=default)
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
"""Abort all running requests."""
|
"""Abort all running requests."""
|
||||||
@ -281,7 +281,8 @@ class NetworkManager(QNetworkAccessManager):
|
|||||||
if ssl_strict == 'ask':
|
if ssl_strict == 'ask':
|
||||||
err_string = '\n'.join('- ' + err.errorString() for err in errors)
|
err_string = '\n'.join('- ' + err.errorString() for err in errors)
|
||||||
answer = self._ask('SSL errors - continue?', err_string,
|
answer = self._ask('SSL errors - continue?', err_string,
|
||||||
mode=usertypes.PromptMode.yesno, owner=reply)
|
mode=usertypes.PromptMode.yesno, owner=reply,
|
||||||
|
default=False)
|
||||||
log.webview.debug("Asked for SSL errors, answer {}".format(answer))
|
log.webview.debug("Asked for SSL errors, answer {}".format(answer))
|
||||||
if answer:
|
if answer:
|
||||||
reply.ignoreSslErrors()
|
reply.ignoreSslErrors()
|
||||||
|
Loading…
Reference in New Issue
Block a user