if profile fails to load, revert back to profile manager

This commit is contained in:
Damien Elmes 2012-09-22 12:46:48 +09:00
parent fd1116938c
commit cec679e059

View file

@ -249,7 +249,14 @@ To import into a password protected profile, please open the profile before atte
def loadCollection(self): def loadCollection(self):
self.hideSchemaMsg = True self.hideSchemaMsg = True
try:
self.col = Collection(self.pm.collectionPath()) self.col = Collection(self.pm.collectionPath())
except:
# move back to profile manager
showWarning("""\
Your collection is corrupt. Please see the manual for \
how to restore from a backup.""")
return self.unloadProfile()
self.hideSchemaMsg = False self.hideSchemaMsg = False
self.progress.setupDB(self.col.db) self.progress.setupDB(self.col.db)
self.moveToState("deckBrowser") self.moveToState("deckBrowser")