mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
add shortcuts for filter/sort, fix bug in hiding separators
This commit is contained in:
parent
41b98051b8
commit
aa4621c66c
4 changed files with 40 additions and 1 deletions
|
@ -394,10 +394,10 @@ class EditDeck(QMainWindow):
|
|||
icon = QIcon(":/icons/" + icon)
|
||||
for t in sortedtags:
|
||||
self.dialog.tagList.addItem(icon, t.replace("_", " "))
|
||||
alltags.append(None)
|
||||
if sortedtags:
|
||||
self.dialog.tagList.insertSeparator(
|
||||
self.dialog.tagList.count())
|
||||
alltags.append(None)
|
||||
# fact tags
|
||||
alluser = sorted(self.deck.allTags())
|
||||
for tag in alltags:
|
||||
|
@ -623,6 +623,8 @@ class EditDeck(QMainWindow):
|
|||
self.connect(self.dialog.actionNextCard, SIGNAL("triggered()"), self.onNextCard)
|
||||
self.connect(self.dialog.actionFind, SIGNAL("triggered()"), self.onFind)
|
||||
self.connect(self.dialog.actionFact, SIGNAL("triggered()"), self.onFact)
|
||||
self.connect(self.dialog.actionTags, SIGNAL("triggered()"), self.onTags)
|
||||
self.connect(self.dialog.actionSort, SIGNAL("triggered()"), self.onSort)
|
||||
# help
|
||||
self.connect(self.dialog.actionGuide, SIGNAL("triggered()"), self.onHelp)
|
||||
runHook('editor.setupMenus', self)
|
||||
|
@ -1054,6 +1056,12 @@ where id in %s""" % ids2str(sf))
|
|||
def onFact(self):
|
||||
self.editor.focusFirst()
|
||||
|
||||
def onTags(self):
|
||||
self.dialog.tagList.setFocus()
|
||||
|
||||
def onSort(self):
|
||||
self.dialog.sortBox.setFocus()
|
||||
|
||||
# Help
|
||||
######################################################################
|
||||
|
||||
|
|
|
@ -209,12 +209,15 @@
|
|||
<string>&Go</string>
|
||||
</property>
|
||||
<addaction name="actionFind" />
|
||||
<addaction name="actionTags" />
|
||||
<addaction name="actionSort" />
|
||||
<addaction name="actionFact" />
|
||||
<addaction name="separator" />
|
||||
<addaction name="actionFirstCard" />
|
||||
<addaction name="actionPreviousCard" />
|
||||
<addaction name="actionNextCard" />
|
||||
<addaction name="actionLastCard" />
|
||||
<addaction name="separator" />
|
||||
</widget>
|
||||
<widget class="QMenu" name="menu_Help" >
|
||||
<property name="title" >
|
||||
|
@ -391,6 +394,9 @@
|
|||
<property name="text" >
|
||||
<string>&Guide...</string>
|
||||
</property>
|
||||
<property name="shortcut" >
|
||||
<string>F1</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionChangeModel" >
|
||||
<property name="icon" >
|
||||
|
@ -443,6 +449,30 @@
|
|||
<string>&Unsuspend</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionTags" >
|
||||
<property name="icon" >
|
||||
<iconset resource="../icons.qrc" >
|
||||
<normaloff>:/icons/anki-tag.png</normaloff>:/icons/anki-tag.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Fil&ters</string>
|
||||
</property>
|
||||
<property name="shortcut" >
|
||||
<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>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../icons.qrc" />
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<RCC>
|
||||
<qresource prefix="/" >
|
||||
<file>icons/view-sort-ascending.png</file>
|
||||
<file>icons/media-playback-start2.png</file>
|
||||
<file>icons/anki-logo-thin.png</file>
|
||||
<file>icons/anki-logo.png</file>
|
||||
|
|
BIN
icons/view-sort-ascending.png
Normal file
BIN
icons/view-sort-ascending.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Loading…
Reference in a new issue