add hidden option to disable repeating of audio in question

This commit is contained in:
Damien Elmes 2010-01-26 01:50:45 +09:00
parent ea76ddc9f3
commit b3e0b302ff
2 changed files with 52 additions and 50 deletions

View file

@ -41,66 +41,67 @@ class Config(dict):
def defaults(self): def defaults(self):
fields = { fields = {
'iconSize': 32,
'syncOnLoad': True,
'syncOnClose': True,
'syncInMsgBox': False,
'checkForUpdates': True,
'interfaceLang': "",
'syncUsername': "",
'syncPassword': "",
'showFontPreview': False,
'showToolbar': True,
'recentDeckPaths': [],
'saveAfterAnswer': True,
'saveAfterAnswerNum': 10,
'saveAfterAdding': True,
'saveAfterAddingNum': 1,
'saveOnClose': True,
'mainWindowGeom': None,
'mainWindowState': None,
'suppressUpdate': False,
'suppressEstimates': False,
'showLastCardInterval': False,
'showLastCardContent': False,
'showTrayIcon': False,
'showTimer': True,
'simpleToolbar': True,
'scrollToAnswer': True,
'qaDivider': True,
'splitQA': True,
'sortIndex': 0,
'addZeroSpace': False, 'addZeroSpace': False,
'alternativeTheme': False, 'alternativeTheme': False,
'showStudyScreen': True, 'checkForUpdates': True,
'showStudyOptions': False,
'showStudyStats': True,
'showCardTimer': True,
'standaloneWindows': True,
'extraNewCards': 5,
'randomizeOnCram': True,
'created': time.time(), 'created': time.time(),
'id': genID(), 'deckBrowserNameLength': 30,
'editorReverseOrder': False, 'deckBrowserOrder': 0,
'deckBrowserRefreshPeriod': 3600,
'deleteMedia': False,
'editFontFamily': 'Arial', 'editFontFamily': 'Arial',
'editFontSize': 12, 'editFontSize': 12,
'editLineSize': 20, 'editLineSize': 20,
'editorReverseOrder': False,
'extraNewCards': 5,
'factEditorAdvanced': False, 'factEditorAdvanced': False,
'typeAnswerFontSize': 20, 'forceLTR': False,
'showProgress': True, 'iconSize': 32,
'recentColours': ["#000000", "#0000ff"], 'id': genID(),
'preventEditUntilAnswer': False, 'interfaceLang': "",
'loadLastDeck': False,
'mainWindowGeom': None,
'mainWindowState': None,
'numBackups': 30, 'numBackups': 30,
'preventEditUntilAnswer': False,
'proxyHost': '', 'proxyHost': '',
'proxyPass': '',
'proxyPort': 8080, 'proxyPort': 8080,
'proxyUser': '', 'proxyUser': '',
'proxyPass': '', 'qaDivider': True,
'loadLastDeck': False, 'randomizeOnCram': True,
'deckBrowserRefreshPeriod': 3600, 'recentColours': ["#000000", "#0000ff"],
'deckBrowserOrder': 0, 'recentDeckPaths': [],
'deckBrowserNameLength': 30, 'repeatQuestionAudio': True,
'deleteMedia': False, 'saveAfterAdding': True,
'forceLTR': False, 'saveAfterAddingNum': 1,
'saveAfterAnswer': True,
'saveAfterAnswerNum': 10,
'saveOnClose': True,
'scrollToAnswer': True,
'showCardTimer': True,
'showFontPreview': False,
'showLastCardContent': False,
'showLastCardInterval': False,
'showProgress': True,
'showStudyOptions': False,
'showStudyScreen': True,
'showStudyStats': True,
'showTimer': True,
'showToolbar': True,
'showTrayIcon': False,
'simpleToolbar': True,
'sortIndex': 0,
'splitQA': True,
'standaloneWindows': True,
'suppressEstimates': False,
'suppressUpdate': False,
'syncInMsgBox': False,
'syncOnClose': True,
'syncOnLoad': True,
'syncPassword': "",
'syncUsername': "",
'typeAnswerFontSize': 20,
} }
for (k,v) in fields.items(): for (k,v) in fields.items():
if not self.has_key(k): if not self.has_key(k):

View file

@ -2556,7 +2556,8 @@ it to your friends.
def onRepeatAudio(self): def onRepeatAudio(self):
clearAudioQueue() clearAudioQueue()
if (not self.currentCard.cardModel.questionInAnswer if (not self.currentCard.cardModel.questionInAnswer
or self.state == "showQuestion"): or self.state == "showQuestion") and \
self.config['repeatQuestionAudio']:
playFromText(self.currentCard.question) playFromText(self.currentCard.question)
if self.state != "showQuestion": if self.state != "showQuestion":
playFromText(self.currentCard.answer) playFromText(self.currentCard.answer)