From 4de023ecba010ce986af49592674b5956239d3e7 Mon Sep 17 00:00:00 2001 From: "Soren I. Bjornstad" Date: Tue, 17 Jun 2014 08:44:26 -0500 Subject: [PATCH] check that save to desktop was successful before showing message --- aqt/stats.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/aqt/stats.py b/aqt/stats.py index 93bf6601a..40f062f21 100644 --- a/aqt/stats.py +++ b/aqt/stats.py @@ -61,9 +61,14 @@ class DeckStats(QDialog): painter = QPainter(image) p.mainFrame().render(painter) 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) - showInfo(_("An image was saved to your desktop.")) def changePeriod(self, n): self.period = n