give webkit enough time to load the image

This commit is contained in:
Damien Elmes 2012-10-23 20:45:54 +09:00
parent a436e5cd7a
commit 0a1e523b24

View file

@ -52,6 +52,10 @@ class DeckStats(QDialog):
def browser(self):
# dump to a temporary file
self.refresh(background=True)
# give webkit a second to load the background image
self.mw.progress.timer(200, self._browser, False)
def _browser(self):
name = time.strftime("-%Y-%m-%d@%H-%M-%S.png",
time.localtime(time.time()))
name = "anki-"+_("stats")+name