mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 00:36:38 -04:00
checkmark on flags in browser
This commit is contained in:
parent
8ac5cc8dff
commit
4acce5f96b
2 changed files with 26 additions and 0 deletions
|
@ -654,6 +654,7 @@ class Browser(QMainWindow):
|
||||||
self.focusTo = None
|
self.focusTo = None
|
||||||
self.editor.card = self.card
|
self.editor.card = self.card
|
||||||
self.singleCard = True
|
self.singleCard = True
|
||||||
|
self._updateFlagsMenu()
|
||||||
runHook("browser.rowChanged", self)
|
runHook("browser.rowChanged", self)
|
||||||
self._renderPreview(True)
|
self._renderPreview(True)
|
||||||
|
|
||||||
|
@ -1561,6 +1562,19 @@ update cards set usn=?, mod=?, did=? where id in """ + scids,
|
||||||
self.col.setUserFlag(n, self.selectedCards())
|
self.col.setUserFlag(n, self.selectedCards())
|
||||||
self.model.reset()
|
self.model.reset()
|
||||||
|
|
||||||
|
def _updateFlagsMenu(self):
|
||||||
|
flag = self.card and self.card.userFlag()
|
||||||
|
flag = flag or 0
|
||||||
|
|
||||||
|
f = self.form
|
||||||
|
flagActions = [f.actionRed_Flag,
|
||||||
|
f.actionOrange_Flag,
|
||||||
|
f.actionGreen_Flag,
|
||||||
|
f.actionBlue_Flag]
|
||||||
|
|
||||||
|
for c, act in enumerate(flagActions):
|
||||||
|
act.setChecked(flag == c+1)
|
||||||
|
|
||||||
def onMark(self, mark=None):
|
def onMark(self, mark=None):
|
||||||
if mark is None:
|
if mark is None:
|
||||||
mark = not self.isMarked()
|
mark = not self.isMarked()
|
||||||
|
|
|
@ -526,6 +526,9 @@
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionRed_Flag">
|
<action name="actionRed_Flag">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Red Flag</string>
|
<string>Red Flag</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -534,6 +537,9 @@
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionOrange_Flag">
|
<action name="actionOrange_Flag">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Orange Flag</string>
|
<string>Orange Flag</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -542,6 +548,9 @@
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionGreen_Flag">
|
<action name="actionGreen_Flag">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Green Flag</string>
|
<string>Green Flag</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -550,6 +559,9 @@
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionBlue_Flag">
|
<action name="actionBlue_Flag">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Blue Flag</string>
|
<string>Blue Flag</string>
|
||||||
</property>
|
</property>
|
||||||
|
|
Loading…
Reference in a new issue