mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
background colour, reduce default spacing to a minute, tweak finished msg
This commit is contained in:
parent
275d962cb4
commit
479f38fab2
2 changed files with 22 additions and 9 deletions
25
anki/deck.py
25
anki/deck.py
|
@ -50,7 +50,7 @@ decksTable = Table(
|
||||||
Column('created', Float, nullable=False, default=time.time),
|
Column('created', Float, nullable=False, default=time.time),
|
||||||
Column('modified', Float, nullable=False, default=time.time),
|
Column('modified', Float, nullable=False, default=time.time),
|
||||||
Column('description', UnicodeText, nullable=False, default=u""),
|
Column('description', UnicodeText, nullable=False, default=u""),
|
||||||
Column('version', Integer, nullable=False, default=23),
|
Column('version', Integer, nullable=False, default=24),
|
||||||
Column('currentModelId', Integer, ForeignKey("models.id")),
|
Column('currentModelId', Integer, ForeignKey("models.id")),
|
||||||
# syncing
|
# syncing
|
||||||
Column('syncName', UnicodeText),
|
Column('syncName', UnicodeText),
|
||||||
|
@ -633,14 +633,16 @@ type = 0 and isDue = 1 and combinedDue <= :now""", now=time.time())
|
||||||
newCardsTomorrow = min(self.newCount, self.newCardsPerDay)
|
newCardsTomorrow = min(self.newCount, self.newCardsPerDay)
|
||||||
cards = self.cardsDueBy(time.time() + 86400)
|
cards = self.cardsDueBy(time.time() + 86400)
|
||||||
msg = _('''\
|
msg = _('''\
|
||||||
|
<style>b { color: #00f; }</style>
|
||||||
At the same time tomorrow:<br><br>
|
At the same time tomorrow:<br><br>
|
||||||
%(wait)s<br>
|
%(spc)s%(wait)s<br>
|
||||||
%(new)s''') % {
|
%(spc)s%(new)s''') % {
|
||||||
'new': ngettext("There will be <b>%d</b> new card waiting for review.",
|
'new': ngettext("There will be <b>%d new</b> card.",
|
||||||
"There will be <b>%d</b> new cards waiting for review.",
|
"There will be <b>%d new</b> cards.",
|
||||||
newCardsTomorrow) % newCardsTomorrow,
|
newCardsTomorrow) % newCardsTomorrow,
|
||||||
'wait': ngettext("There will be <b>%s</b> card waiting.",
|
'wait': ngettext("There will be <b>%s review</b>.",
|
||||||
"There will be <b>%s</b> cards waiting.", cards) % cards,
|
"There will be <b>%s reviews</b>.", cards) % cards,
|
||||||
|
'spc': ' ' * 5,
|
||||||
}
|
}
|
||||||
if next - time.time() > 86400 and not newCardsTomorrow:
|
if next - time.time() > 86400 and not newCardsTomorrow:
|
||||||
msg = (_("The next card will be shown in <b>%s</b>.") %
|
msg = (_("The next card will be shown in <b>%s</b>.") %
|
||||||
|
@ -1206,7 +1208,11 @@ questionAlign from cardModels""")])
|
||||||
css += "".join([_genCSS("#cma", row) for row in self.s.all("""
|
css += "".join([_genCSS("#cma", row) for row in self.s.all("""
|
||||||
select id, answerFontFamily, answerFontSize, answerFontColour,
|
select id, answerFontFamily, answerFontSize, answerFontColour,
|
||||||
answerAlign from cardModels""")])
|
answerAlign from cardModels""")])
|
||||||
|
css += "".join([".cmb%s {background:%s;}\n" %
|
||||||
|
(hexifyID(row[0]), row[1]) for row in self.s.all("""
|
||||||
|
select id, lastFontColour from cardModels""")])
|
||||||
self.css = css
|
self.css = css
|
||||||
|
#print css
|
||||||
return css
|
return css
|
||||||
|
|
||||||
def copyModel(self, oldModel):
|
def copyModel(self, oldModel):
|
||||||
|
@ -2381,6 +2387,11 @@ where interval < 1""")
|
||||||
pass
|
pass
|
||||||
deck.version = 23
|
deck.version = 23
|
||||||
deck.s.commit()
|
deck.s.commit()
|
||||||
|
if deck.version < 24:
|
||||||
|
deck.s.statement(
|
||||||
|
"update cardModels set lastFontColour = '#ffffff'")
|
||||||
|
deck.version = 24
|
||||||
|
deck.s.commit()
|
||||||
return deck
|
return deck
|
||||||
_upgradeDeck = staticmethod(_upgradeDeck)
|
_upgradeDeck = staticmethod(_upgradeDeck)
|
||||||
|
|
||||||
|
|
|
@ -96,9 +96,11 @@ cardModelsTable = Table(
|
||||||
Column('answerFontSize', Integer, default=20),
|
Column('answerFontSize', Integer, default=20),
|
||||||
Column('answerFontColour', String(7), default=u"#000000"),
|
Column('answerFontColour', String(7), default=u"#000000"),
|
||||||
Column('answerAlign', Integer, default=0),
|
Column('answerAlign', Integer, default=0),
|
||||||
|
# not used
|
||||||
Column('lastFontFamily', UnicodeText, default=u"Arial"),
|
Column('lastFontFamily', UnicodeText, default=u"Arial"),
|
||||||
Column('lastFontSize', Integer, default=20),
|
Column('lastFontSize', Integer, default=20),
|
||||||
Column('lastFontColour', String(7), default=u"#000000"),
|
# used as background colour
|
||||||
|
Column('lastFontColour', String(7), default=u"#FFFFFF"),
|
||||||
Column('editQuestionFontFamily', UnicodeText, default=None),
|
Column('editQuestionFontFamily', UnicodeText, default=None),
|
||||||
Column('editQuestionFontSize', Integer, default=None),
|
Column('editQuestionFontSize', Integer, default=None),
|
||||||
Column('editAnswerFontFamily', UnicodeText, default=None),
|
Column('editAnswerFontFamily', UnicodeText, default=None),
|
||||||
|
@ -166,7 +168,7 @@ modelsTable = Table(
|
||||||
Column('description', UnicodeText, nullable=False, default=u""), # obsolete
|
Column('description', UnicodeText, nullable=False, default=u""), # obsolete
|
||||||
Column('features', UnicodeText, nullable=False, default=u""), # obsolete
|
Column('features', UnicodeText, nullable=False, default=u""), # obsolete
|
||||||
Column('spacing', Float, nullable=False, default=0.1),
|
Column('spacing', Float, nullable=False, default=0.1),
|
||||||
Column('initialSpacing', Float, nullable=False, default=600),
|
Column('initialSpacing', Float, nullable=False, default=60),
|
||||||
Column('source', Integer, nullable=False, default=0))
|
Column('source', Integer, nullable=False, default=0))
|
||||||
|
|
||||||
class Model(object):
|
class Model(object):
|
||||||
|
|
Loading…
Reference in a new issue