mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
remove priorities
This commit is contained in:
parent
ae84ce1450
commit
c47e931a53
6 changed files with 6 additions and 92 deletions
|
@ -33,7 +33,7 @@ CARD_MODIFIED = 7
|
||||||
CARD_INTERVAL = 8
|
CARD_INTERVAL = 8
|
||||||
CARD_EASE = 9
|
CARD_EASE = 9
|
||||||
CARD_NO = 10
|
CARD_NO = 10
|
||||||
CARD_PRIORITY = 11
|
CARD_TYPE = 11
|
||||||
CARD_TAGS = 12
|
CARD_TAGS = 12
|
||||||
CARD_FACTCREATED = 13
|
CARD_FACTCREATED = 13
|
||||||
CARD_FIRSTANSWERED = 14
|
CARD_FIRSTANSWERED = 14
|
||||||
|
@ -191,7 +191,7 @@ where cards.factId = facts.id """
|
||||||
try:
|
try:
|
||||||
self.cards[index.row()] = self.deck.s.first("""
|
self.cards[index.row()] = self.deck.s.first("""
|
||||||
select id, question, answer, combinedDue, reps, factId, created, modified,
|
select id, question, answer, combinedDue, reps, factId, created, modified,
|
||||||
interval, factor, noCount, priority, (select tags from facts where
|
interval, factor, noCount, type, (select tags from facts where
|
||||||
facts.id = cards.factId), (select created from facts where
|
facts.id = cards.factId), (select created from facts where
|
||||||
facts.id = cards.factId), firstAnswered from cards where id = :id""",
|
facts.id = cards.factId), firstAnswered from cards where id = :id""",
|
||||||
id=self.cards[index.row()][0])
|
id=self.cards[index.row()][0])
|
||||||
|
@ -322,7 +322,7 @@ class StatusDelegate(QItemDelegate):
|
||||||
if len(self.model.cards[index.row()]) == 1:
|
if len(self.model.cards[index.row()]) == 1:
|
||||||
self.model.updateCard(index)
|
self.model.updateCard(index)
|
||||||
row = self.model.cards[index.row()]
|
row = self.model.cards[index.row()]
|
||||||
if row[CARD_PRIORITY] == -3:
|
if row[CARD_TYPE] < 0:
|
||||||
# custom render
|
# custom render
|
||||||
if index.row() % 2 == 0:
|
if index.row() % 2 == 0:
|
||||||
brush = QBrush(QColor(COLOUR_SUSPENDED1))
|
brush = QBrush(QColor(COLOUR_SUSPENDED1))
|
||||||
|
@ -974,7 +974,6 @@ where id in %s""" % ids2str(sf))
|
||||||
if c % 50 == 0:
|
if c % 50 == 0:
|
||||||
self.deck.updateProgress()
|
self.deck.updateProgress()
|
||||||
self.deck.flushMod()
|
self.deck.flushMod()
|
||||||
self.deck.updatePriorities(ids)
|
|
||||||
self.deck.finishProgress()
|
self.deck.finishProgress()
|
||||||
self.parent.setProgressParent(None)
|
self.parent.setProgressParent(None)
|
||||||
self.deck.setUndoEnd(n)
|
self.deck.setUndoEnd(n)
|
||||||
|
|
|
@ -39,10 +39,6 @@ class DeckProperties(QDialog):
|
||||||
else:
|
else:
|
||||||
self.dialog.doSync.setCheckState(Qt.Unchecked)
|
self.dialog.doSync.setCheckState(Qt.Unchecked)
|
||||||
self.dialog.mediaURL.setText(self.d.getVar("mediaURL") or "")
|
self.dialog.mediaURL.setText(self.d.getVar("mediaURL") or "")
|
||||||
# priorities
|
|
||||||
self.dialog.highPriority.setText(self.d.highPriority)
|
|
||||||
self.dialog.medPriority.setText(self.d.medPriority)
|
|
||||||
self.dialog.lowPriority.setText(self.d.lowPriority)
|
|
||||||
# latex
|
# latex
|
||||||
self.dialog.latexHeader.setText(self.d.getVar("latexPre"))
|
self.dialog.latexHeader.setText(self.d.getVar("latexPre"))
|
||||||
self.dialog.latexFooter.setText(self.d.getVar("latexPost"))
|
self.dialog.latexFooter.setText(self.d.getVar("latexPost"))
|
||||||
|
@ -232,20 +228,8 @@ class DeckProperties(QDialog):
|
||||||
self.dialog.collapse.isChecked() and 1 or 0)
|
self.dialog.collapse.isChecked() and 1 or 0)
|
||||||
if self.dialog.perDay.isChecked() != self.d.getBool("perDay"):
|
if self.dialog.perDay.isChecked() != self.d.getBool("perDay"):
|
||||||
self.d.setVar('perDay', self.dialog.perDay.isChecked())
|
self.d.setVar('perDay', self.dialog.perDay.isChecked())
|
||||||
self.updateField(self.d,
|
|
||||||
"highPriority",
|
|
||||||
unicode(self.dialog.highPriority.text()))
|
|
||||||
self.updateField(self.d,
|
|
||||||
"medPriority",
|
|
||||||
unicode(self.dialog.medPriority.text()))
|
|
||||||
self.updateField(self.d,
|
|
||||||
"lowPriority",
|
|
||||||
unicode(self.dialog.lowPriority.text()))
|
|
||||||
prioritiesChanged = was != self.d.modified
|
|
||||||
# mark deck dirty and close
|
# mark deck dirty and close
|
||||||
if self.origMod != self.d.modified:
|
if self.origMod != self.d.modified:
|
||||||
if prioritiesChanged:
|
|
||||||
self.d.updateAllPriorities()
|
|
||||||
ankiqt.mw.deck.updateCutoff()
|
ankiqt.mw.deck.updateCutoff()
|
||||||
ankiqt.mw.reset()
|
ankiqt.mw.reset()
|
||||||
self.d.setUndoEnd(n)
|
self.d.setUndoEnd(n)
|
||||||
|
|
|
@ -585,7 +585,6 @@ class FactEditor(object):
|
||||||
if old != self.fact.tags:
|
if old != self.fact.tags:
|
||||||
self.deck.s.flush()
|
self.deck.s.flush()
|
||||||
self.deck.updateFactTags([self.fact.id])
|
self.deck.updateFactTags([self.fact.id])
|
||||||
self.deck.updatePriorities([c.id for c in self.fact.cards])
|
|
||||||
self.fact.setModified(textChanged=True, deck=self.deck)
|
self.fact.setModified(textChanged=True, deck=self.deck)
|
||||||
self.deck.flushMod()
|
self.deck.flushMod()
|
||||||
if self.resetOnEdit:
|
if self.resetOnEdit:
|
||||||
|
|
|
@ -307,11 +307,9 @@ Please do not file a bug report with Anki.<br>""")
|
||||||
self.views = self.viewsBackup
|
self.views = self.viewsBackup
|
||||||
self.viewsBackup = None
|
self.viewsBackup = None
|
||||||
|
|
||||||
def reset(self, count=True, priorities=False, runHooks=True):
|
def reset(self, runHooks=True):
|
||||||
if self.deck:
|
if self.deck:
|
||||||
self.deck.refreshSession()
|
self.deck.refreshSession()
|
||||||
if priorities:
|
|
||||||
self.deck.updateAllPriorities()
|
|
||||||
self.deck.reset()
|
self.deck.reset()
|
||||||
if runHooks:
|
if runHooks:
|
||||||
runHook("guiReset")
|
runHook("guiReset")
|
||||||
|
@ -518,7 +516,7 @@ Please do not file a bug report with Anki.<br>""")
|
||||||
% stripHTML(stripSounds(self.currentCard.question)).\
|
% stripHTML(stripSounds(self.currentCard.question)).\
|
||||||
replace("\n", " ")[0:30])
|
replace("\n", " ")[0:30])
|
||||||
if isLeech and self.deck.s.scalar(
|
if isLeech and self.deck.s.scalar(
|
||||||
"select 1 from cards where id = :id and priority < 1", id=cardId):
|
"select 1 from cards where id = :id and type < 0", id=cardId):
|
||||||
txt += _(" It has been suspended.")
|
txt += _(" It has been suspended.")
|
||||||
self.setNotice(txt)
|
self.setNotice(txt)
|
||||||
|
|
||||||
|
|
|
@ -30,69 +30,6 @@
|
||||||
<string>Basic</string>
|
<string>Basic</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QGridLayout" name="gridLayout_6">
|
<layout class="QGridLayout" name="gridLayout_6">
|
||||||
<item row="5" column="0">
|
|
||||||
<widget class="QLabel" name="label_16">
|
|
||||||
<property name="text">
|
|
||||||
<string><b>Priorities</b></string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="0">
|
|
||||||
<layout class="QGridLayout" name="gridLayout_4">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="label_21">
|
|
||||||
<property name="text">
|
|
||||||
<string>Very high priority</string>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QLineEdit" name="highPriority"/>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="label_17">
|
|
||||||
<property name="text">
|
|
||||||
<string>High priority</string>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QLineEdit" name="medPriority"/>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="label_24">
|
|
||||||
<property name="text">
|
|
||||||
<string>Low priority</string>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QLineEdit" name="lowPriority"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="7" column="0">
|
|
||||||
<spacer name="verticalSpacer_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="label_14">
|
<widget class="QLabel" name="label_14">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -794,9 +731,6 @@
|
||||||
<tabstop>modelsAdd</tabstop>
|
<tabstop>modelsAdd</tabstop>
|
||||||
<tabstop>modelsEdit</tabstop>
|
<tabstop>modelsEdit</tabstop>
|
||||||
<tabstop>modelsDelete</tabstop>
|
<tabstop>modelsDelete</tabstop>
|
||||||
<tabstop>highPriority</tabstop>
|
|
||||||
<tabstop>medPriority</tabstop>
|
|
||||||
<tabstop>lowPriority</tabstop>
|
|
||||||
<tabstop>buttonBox</tabstop>
|
<tabstop>buttonBox</tabstop>
|
||||||
<tabstop>latexHeader</tabstop>
|
<tabstop>latexHeader</tabstop>
|
||||||
<tabstop>latexFooter</tabstop>
|
<tabstop>latexFooter</tabstop>
|
||||||
|
|
|
@ -3366,7 +3366,7 @@
|
||||||
<string>&Deck Properties...</string>
|
<string>&Deck Properties...</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="statusTip">
|
<property name="statusTip">
|
||||||
<string>Customize syncing, scheduling, priorities and models</string>
|
<string>Customize models, syncing and scheduling</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionImport">
|
<action name="actionImport">
|
||||||
|
|
Loading…
Reference in a new issue