check that save to desktop was successful before showing message
This commit is contained in:
parent
6771af40b1
commit
4de023ecba
@ -61,9 +61,14 @@ class DeckStats(QDialog):
|
|||||||
painter = QPainter(image)
|
painter = QPainter(image)
|
||||||
p.mainFrame().render(painter)
|
p.mainFrame().render(painter)
|
||||||
painter.end()
|
painter.end()
|
||||||
image.save(path, "png")
|
isOK = image.save(path, "png")
|
||||||
|
if isOK:
|
||||||
|
showInfo(_("An image was saved to your desktop."))
|
||||||
|
else:
|
||||||
|
showInfo(_("""\
|
||||||
|
Anki could not save the image. Please check that you have permission to write \
|
||||||
|
to your desktop."""))
|
||||||
p.setViewportSize(oldsize)
|
p.setViewportSize(oldsize)
|
||||||
showInfo(_("An image was saved to your desktop."))
|
|
||||||
|
|
||||||
def changePeriod(self, n):
|
def changePeriod(self, n):
|
||||||
self.period = n
|
self.period = n
|
||||||
|
Loading…
Reference in New Issue
Block a user