diff --git a/aqt/config.py b/aqt/config.py index 40183cb67..17a78c0bf 100644 --- a/aqt/config.py +++ b/aqt/config.py @@ -3,9 +3,9 @@ # User configuration handling ########################################################################## -# The majority of the config is serialized into a string, both for easy access -# and backwards compatibility. A separate table keeps track of seen decks, so -# that multiple instances can update the recent decks list. +# The majority of the config is serialized into a string, so we can access it +# easily and pickle objects like window state. A separate table keeps track of +# seen decks, so that multiple instances can update the recent decks list. import os, sys, time, random, cPickle from anki.db import DB @@ -13,19 +13,11 @@ from anki.utils import isMac defaultConf = { 'confVer': 3, - # remove? - 'colourTimes': True, - # too long? - 'deckBrowserRefreshPeriod': 3600, - 'factEditorAdvanced': False, - 'showStudyScreen': True, - 'interfaceLang': "en", 'fullSearch': False, - 'autoplaySounds': True, 'searchHistory': [], - 'checkForUpdates': True, + 'checkForUpdates': True, # ui? 'created': time.time(), 'deleteMedia': False, 'documentDir': u"", @@ -33,7 +25,6 @@ defaultConf = { 'editFontFamily': 'Arial', 'editFontSize': 12, 'editLineSize': 20, - 'editorReverseOrder': False, 'iconSize': 32, 'id': random.randrange(0, 2**63), 'lastMsg': -1, @@ -48,19 +39,13 @@ defaultConf = { 'proxyPort': 8080, 'proxyUser': '', 'recentColours': ["#000000", "#0000ff"], - 'repeatQuestionAudio': True, - 'scrollToAnswer': True, - 'showCardTimer': True, 'showProgress': True, - 'showTimer': True, 'showToolbar': True, 'centerQA': True, 'stripHTML': True, - 'studyOptionsTab': 0, 'suppressEstimates': False, 'suppressUpdate': False, 'syncDisableWhenMoved': True, - 'syncOnLoad': False, 'syncOnProgramOpen': True, 'syncPassword': "", 'syncUsername': "", @@ -148,10 +133,3 @@ create table if not exists config (conf text not null); os.mkdir(x) except: pass - - def _importOldData(self): - # compatability - def unpickleWxFont(*args): - pass - def pickleWxFont(*args): - pass diff --git a/aqt/deckbrowser.py b/aqt/deckbrowser.py index 95183718e..1dbbf30f6 100644 --- a/aqt/deckbrowser.py +++ b/aqt/deckbrowser.py @@ -27,13 +27,7 @@ class DeckBrowser(object): self.web.setKeyHandler(self._keyHandler) self._setupToolbar() # refresh or reorder - if (time.time() - self._browserLastRefreshed > - self.mw.config['deckBrowserRefreshPeriod']): - t = time.time() - self._checkDecks() - print "check decks", time.time() - t - else: - self._reorderDecks() + self._checkDecks() # show self._renderPage() diff --git a/aqt/main.py b/aqt/main.py index 97033cd33..f00b2569f 100755 --- a/aqt/main.py +++ b/aqt/main.py @@ -53,15 +53,11 @@ class AnkiQt(QMainWindow): # if self.config['syncOnProgramOpen']: # if self.syncDeck(interactive=False): # return - # load a deck? - if (args or self.config['loadLastDeck'] or - len(self.config['recentDeckPaths']) == 1): - # delay load so deck errors don't cause program to close - self.progress.timer(10, lambda a=args: \ - self.maybeLoadLastDeck(a), - False) - else: - self.moveToState("deckBrowser") + + # delay load so deck errors don't cause program to close + self.progress.timer(10, lambda a=args: \ + self.maybeLoadLastDeck(a), + False) except: showInfo("Error during startup:\n%s" % traceback.format_exc()) sys.exit(1) @@ -343,6 +339,7 @@ Debug info:\n%s""") % traceback.format_exc(), help="DeckErrors") r = self.loadDeck(path, showErrors=False) if r: return r + self.moveToState("deckBrowser") # Open recent ##########################################################################