mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
more browser stuff
This commit is contained in:
parent
77dd9eea14
commit
ad523113cc
2 changed files with 16 additions and 150 deletions
|
@ -271,7 +271,12 @@ class StatusDelegate(QItemDelegate):
|
|||
self.model = model
|
||||
|
||||
def paint(self, painter, option, index):
|
||||
c = self.model.getCard(index)
|
||||
try:
|
||||
c = self.model.getCard(index)
|
||||
except:
|
||||
# in the the middle of a reset; return nothing so this row is not
|
||||
# rendered until we have a chance to reset the model
|
||||
return
|
||||
if c.queue < 0:
|
||||
# custom render
|
||||
if index.row() % 2 == 0:
|
||||
|
@ -342,16 +347,10 @@ class Browser(QMainWindow):
|
|||
def setupMenus(self):
|
||||
# actions
|
||||
c = self.connect; f = self.form; s = SIGNAL("triggered()")
|
||||
c(f.actionAddItems, s, self.mw.onAddCard)
|
||||
c(f.actionDeleteNotes, s, self.deleteNotes)
|
||||
c(f.actionAddTag, s, self.addTags)
|
||||
c(f.actionDeleteTag, s, self.deleteTags)
|
||||
c(f.actionReposition, s, self.reposition)
|
||||
c(f.actionReschedule, s, self.reschedule)
|
||||
c(f.actionCram, s, self.cram)
|
||||
c(f.actionChangeModel, s, self.onChangeModel)
|
||||
c(f.actionToggleSuspend, SIGNAL("triggered(bool)"), self.onSuspend)
|
||||
c(f.actionToggleMark, SIGNAL("triggered(bool)"), self.onMark)
|
||||
# edit
|
||||
c(f.actionOptions, s, self.onOptions)
|
||||
c(f.actionUndo, s, self.mw.onUndo)
|
||||
|
@ -365,7 +364,6 @@ class Browser(QMainWindow):
|
|||
c(f.actionFind, s, self.onFind)
|
||||
c(f.actionNote, s, self.onNote)
|
||||
c(f.actionTags, s, self.onTags)
|
||||
c(f.actionSort, s, self.onSort)
|
||||
c(f.actionCardList, s, self.onCardList)
|
||||
# help
|
||||
c(f.actionGuide, s, self.onHelp)
|
||||
|
@ -1231,9 +1229,6 @@ select fm.id, fm.name from fieldmodels fm""")
|
|||
def onTags(self):
|
||||
self.form.tree.setFocus()
|
||||
|
||||
def onSort(self):
|
||||
self.form.sortBox.setFocus()
|
||||
|
||||
def onCardList(self):
|
||||
self.form.tableView.setFocus()
|
||||
|
||||
|
|
|
@ -216,19 +216,19 @@
|
|||
</property>
|
||||
<addaction name="actionUndo"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionReschedule"/>
|
||||
<addaction name="actionReposition"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionChangeModel"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionSelectAll"/>
|
||||
<addaction name="actionSelectNotes"/>
|
||||
<addaction name="actionInvertSelection"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionOptions"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuCards">
|
||||
<property name="title">
|
||||
<string>Cards</string>
|
||||
</property>
|
||||
<addaction name="actionReposition"/>
|
||||
<addaction name="actionReschedule"/>
|
||||
<addaction name="actionFindDuplicates"/>
|
||||
<addaction name="actionFindReplace"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionOptions"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuJump">
|
||||
<property name="title">
|
||||
|
@ -248,47 +248,14 @@
|
|||
</property>
|
||||
<addaction name="actionGuide"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuNotes">
|
||||
<property name="title">
|
||||
<string>Notes</string>
|
||||
</property>
|
||||
<addaction name="actionAddItems"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionFindReplace"/>
|
||||
<addaction name="actionFindDuplicates"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionChangeModel"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionDeleteNotes"/>
|
||||
</widget>
|
||||
<addaction name="menuCards"/>
|
||||
<addaction name="menuNotes"/>
|
||||
<addaction name="menuEdit"/>
|
||||
<addaction name="menuJump"/>
|
||||
<addaction name="menu_Help"/>
|
||||
</widget>
|
||||
<action name="actionAddTag">
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<normaloff>:/icons/Anki_Add_Tag.png</normaloff>:/icons/Anki_Add_Tag.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Add Tags...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDeleteTag">
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<normaloff>:/icons/Anki_Del_Tag.png</normaloff>:/icons/Anki_Del_Tag.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Delete Tags...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionReschedule">
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<normaloff>:/icons/edit-undo.png</normaloff>:/icons/edit-undo.png</iconset>
|
||||
<normaloff>:/icons/view-pim-calendar.png</normaloff>:/icons/view-pim-calendar.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Reschedule...</string>
|
||||
|
@ -308,15 +275,6 @@
|
|||
<string>&Undo</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionRedo">
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<normaloff>:/icons/edit-redo.png</normaloff>:/icons/edit-redo.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Redo</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionInvertSelection">
|
||||
<property name="text">
|
||||
<string>&Invert Selection</string>
|
||||
|
@ -388,7 +346,7 @@
|
|||
<normaloff>:/icons/system-software-update.png</normaloff>:/icons/system-software-update.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Change &Model...</string>
|
||||
<string>Change Fact Type...</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+Shift+M</string>
|
||||
|
@ -428,24 +386,6 @@
|
|||
<string>Browser Options...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSuspend">
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<normaloff>:/icons/media-playback-pause.png</normaloff>:/icons/media-playback-pause.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Suspend Cards</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionUnsuspend">
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<normaloff>:/icons/media-playback-start2.png</normaloff>:/icons/media-playback-start2.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Unsuspend Cards</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionTags">
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
|
@ -458,54 +398,6 @@
|
|||
<string>Ctrl+T</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSort">
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<normaloff>:/icons/view-sort-ascending.png</normaloff>:/icons/view-sort-ascending.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Sort</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+Shift+S</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionAddItems">
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<normaloff>:/icons/list-add.png</normaloff>:/icons/list-add.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add...</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+D</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionToggleSuspend">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<normaloff>:/icons/media-playback-pause.png</normaloff>:/icons/media-playback-pause.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Toggle Suspend</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionToggleMark">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<normaloff>:/icons/rating.png</normaloff>:/icons/rating.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Toggle Mark</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCardList">
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
|
@ -527,18 +419,6 @@
|
|||
<string>Find &Duplicates...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSetDeck">
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<normaloff>:/icons/stock_group.png</normaloff>:/icons/stock_group.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Move to Deck...</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+G</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionReposition">
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
|
@ -548,15 +428,6 @@
|
|||
<string>Reposition...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDeleteNotes">
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<normaloff>:/icons/editdelete.png</normaloff>:/icons/editdelete.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="icons.qrc"/>
|
||||
|
|
Loading…
Reference in a new issue