Merge pull request #32 from sobjornstad/master

Fix save image bug
This commit is contained in:
Damien Elmes 2013-06-01 18:25:51 -07:00
commit d0b31c2446

View File

@ -50,11 +50,10 @@ class DeckStats(QDialog):
name = time.strftime("-%Y-%m-%d@%H-%M-%S.png",
time.localtime(time.time()))
name = "anki-"+_("stats")+name
path = os.path.join(
QDesktopServices.storageLocation(QDesktopServices.DesktopLocation),
name)
if not os.path.exists(path):
os.mkdir(path)
desktopPath = QDesktopServices.storageLocation(QDesktopServices.DesktopLocation)
if not os.path.exists(desktopPath):
os.mkdir(desktopPath)
path = os.path.join(desktopPath, name)
p = self.form.web.page()
oldsize = p.viewportSize()
p.setViewportSize(p.mainFrame().contentsSize())