mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 07:22:23 -04:00
default # of backups to 20, make a config option
This commit is contained in:
parent
227435d462
commit
dbd2ee1f13
2 changed files with 7 additions and 0 deletions
|
@ -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):
|
||||
|
|
|
@ -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']
|
||||
|
|
Loading…
Reference in a new issue