diff --git a/ankiqt/config.py b/ankiqt/config.py index 5e1e1c882..153c55772 100644 --- a/ankiqt/config.py +++ b/ankiqt/config.py @@ -90,6 +90,7 @@ class Config(dict): 'showProgress': True, 'recentColours': ["#000000", "#0000ff"], 'preventEditUntilAnswer': False, + 'numBackups': 20, } for (k,v) in fields.items(): if not self.has_key(k): diff --git a/ankiqt/ui/main.py b/ankiqt/ui/main.py index f0b863233..d1b6a7e50 100644 --- a/ankiqt/ui/main.py +++ b/ankiqt/ui/main.py @@ -59,6 +59,7 @@ class AnkiQt(QMainWindow): self.setupAnchors() self.setupToolbar() self.setupProgressInfo() + self.setupBackups() if self.config['mainWindowState']: self.restoreGeometry(self.config['mainWindowGeom']) self.restoreState(self.config['mainWindowState']) @@ -2443,5 +2444,10 @@ Consider backing up your media directory first.""")) ########################################################################## def setupMisc(self): + # if they've just upgraded, set created time based on deck age if time.time() - self.config['created'] < 60 and self.deck: self.config['created'] = self.deck.created + + def setupBackups(self): + # set backups + anki.deck.numBackups = self.config['numBackups']