show traceback on deck load, use my documents on win32

This commit is contained in:
Damien Elmes 2009-01-05 07:09:50 +09:00
parent 375b33302e
commit 3d994b6359

View file

@ -496,9 +496,8 @@ Possible reasons:
- directory is read only - directory is read only
- deck was created with Anki < 0.9 - deck was created with Anki < 0.9
To upgrade an old deck, download Anki 0.9.8.7. To upgrade an old deck, download Anki 0.9.8.7."""))
traceback.print_exc()
Error was:\n%(f1)s\n...\n%(f2)s""") % {'f1': fmt1, 'f2': fmt2})
self.moveToState("noDeck") self.moveToState("noDeck")
return return
if uprecent: if uprecent:
@ -1759,7 +1758,9 @@ Consider backing up your media directory first."""))
def setupDocumentDir(self): def setupDocumentDir(self):
if sys.platform.startswith("win32"): 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"): elif sys.platform.startswith("darwin"):
self.documentDir = os.path.expanduser("~/Documents") self.documentDir = os.path.expanduser("~/Documents")
else: else: