remove priorities

This commit is contained in:
Damien Elmes 2011-02-11 07:15:03 +09:00
parent ae84ce1450
commit c47e931a53
6 changed files with 6 additions and 92 deletions

View file

@ -33,7 +33,7 @@ CARD_MODIFIED = 7
CARD_INTERVAL = 8
CARD_EASE = 9
CARD_NO = 10
CARD_PRIORITY = 11
CARD_TYPE = 11
CARD_TAGS = 12
CARD_FACTCREATED = 13
CARD_FIRSTANSWERED = 14
@ -191,7 +191,7 @@ where cards.factId = facts.id """
try:
self.cards[index.row()] = self.deck.s.first("""
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), firstAnswered from cards where id = :id""",
id=self.cards[index.row()][0])
@ -322,7 +322,7 @@ class StatusDelegate(QItemDelegate):
if len(self.model.cards[index.row()]) == 1:
self.model.updateCard(index)
row = self.model.cards[index.row()]
if row[CARD_PRIORITY] == -3:
if row[CARD_TYPE] < 0:
# custom render
if index.row() % 2 == 0:
brush = QBrush(QColor(COLOUR_SUSPENDED1))
@ -974,7 +974,6 @@ where id in %s""" % ids2str(sf))
if c % 50 == 0:
self.deck.updateProgress()
self.deck.flushMod()
self.deck.updatePriorities(ids)
self.deck.finishProgress()
self.parent.setProgressParent(None)
self.deck.setUndoEnd(n)

View file

@ -39,10 +39,6 @@ class DeckProperties(QDialog):
else:
self.dialog.doSync.setCheckState(Qt.Unchecked)
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
self.dialog.latexHeader.setText(self.d.getVar("latexPre"))
self.dialog.latexFooter.setText(self.d.getVar("latexPost"))
@ -232,20 +228,8 @@ class DeckProperties(QDialog):
self.dialog.collapse.isChecked() and 1 or 0)
if self.dialog.perDay.isChecked() != self.d.getBool("perDay"):
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
if self.origMod != self.d.modified:
if prioritiesChanged:
self.d.updateAllPriorities()
ankiqt.mw.deck.updateCutoff()
ankiqt.mw.reset()
self.d.setUndoEnd(n)

View file

@ -585,7 +585,6 @@ class FactEditor(object):
if old != self.fact.tags:
self.deck.s.flush()
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.deck.flushMod()
if self.resetOnEdit:

View file

@ -307,11 +307,9 @@ Please do not file a bug report with Anki.<br>""")
self.views = self.viewsBackup
self.viewsBackup = None
def reset(self, count=True, priorities=False, runHooks=True):
def reset(self, runHooks=True):
if self.deck:
self.deck.refreshSession()
if priorities:
self.deck.updateAllPriorities()
self.deck.reset()
if runHooks:
runHook("guiReset")
@ -518,7 +516,7 @@ Please do not file a bug report with Anki.<br>""")
% stripHTML(stripSounds(self.currentCard.question)).\
replace("\n", " ")[0:30])
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.")
self.setNotice(txt)

View file

@ -30,69 +30,6 @@
<string>Basic</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_6">
<item row="5" column="0">
<widget class="QLabel" name="label_16">
<property name="text">
<string>&lt;b&gt;Priorities&lt;/b&gt;</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">
<widget class="QLabel" name="label_14">
<property name="text">
@ -794,9 +731,6 @@
<tabstop>modelsAdd</tabstop>
<tabstop>modelsEdit</tabstop>
<tabstop>modelsDelete</tabstop>
<tabstop>highPriority</tabstop>
<tabstop>medPriority</tabstop>
<tabstop>lowPriority</tabstop>
<tabstop>buttonBox</tabstop>
<tabstop>latexHeader</tabstop>
<tabstop>latexFooter</tabstop>

View file

@ -3366,7 +3366,7 @@
<string>&amp;Deck Properties...</string>
</property>
<property name="statusTip">
<string>Customize syncing, scheduling, priorities and models</string>
<string>Customize models, syncing and scheduling</string>
</property>
</action>
<action name="actionImport">