From 3d994b6359c45336976f0cc6aeabed5ed83bf068 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 5 Jan 2009 07:09:50 +0900 Subject: [PATCH] show traceback on deck load, use my documents on win32 --- ankiqt/ui/main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ankiqt/ui/main.py b/ankiqt/ui/main.py index 56c13c1ed..db985326f 100644 --- a/ankiqt/ui/main.py +++ b/ankiqt/ui/main.py @@ -496,9 +496,8 @@ Possible reasons: - directory is read only - deck was created with Anki < 0.9 -To upgrade an old deck, download Anki 0.9.8.7. - -Error was:\n%(f1)s\n...\n%(f2)s""") % {'f1': fmt1, 'f2': fmt2}) +To upgrade an old deck, download Anki 0.9.8.7.""")) + traceback.print_exc() self.moveToState("noDeck") return if uprecent: @@ -1759,7 +1758,9 @@ Consider backing up your media directory first.""")) def setupDocumentDir(self): if sys.platform.startswith("win32"): - raise "nyi" + s = QSettings(QSettings.UserScope, "Microsoft", "Windows") + s.beginGroup("CurrentVersion/Explorer/Shell Folders") + self.documentDir = unicode(s.value("Personal").toString()) elif sys.platform.startswith("darwin"): self.documentDir = os.path.expanduser("~/Documents") else: