turn local port message into a tooltip and automatically reload

Since we're automatically disabling proxies now, the main remaining
issue seems to be Windows users resuming their machine from sleep -
for some reason localhost is inaccessible during the resume process.
This commit is contained in:
Damien Elmes 2019-02-06 07:55:34 +10:00
parent 1603a5224e
commit 1e9fb6ab29

View file

@ -6,7 +6,7 @@ import sys
import math import math
from anki.hooks import runHook from anki.hooks import runHook
from aqt.qt import * from aqt.qt import *
from aqt.utils import openLink, showWarning from aqt.utils import openLink, showWarning, tooltip
from anki.utils import isMac, isWin, isLin, devMode from anki.utils import isMac, isWin, isLin, devMode
# Page for debug messages # Page for debug messages
@ -356,9 +356,9 @@ body {{ zoom: {}; {} }}
def _onHeight(self, qvar): def _onHeight(self, qvar):
if qvar is None: if qvar is None:
tooltip(_("Error connecting to local port. Retrying..."))
from aqt import mw from aqt import mw
openLink("https://anki.tenderapp.com/kb/problems/anki-must-be-able-to-connect-to-a-local-port") mw.progress.timer(2000, mw.reset, False)
mw.app.closeAllWindows()
return return
height = math.ceil(qvar*self.zoomFactor()) height = math.ceil(qvar*self.zoomFactor())