tweak shortcuts; remove study/cram buttons from group screen

This commit is contained in:
Damien Elmes 2011-03-29 17:49:22 +09:00
parent a70d7be25b
commit 7283aba0dd
4 changed files with 39 additions and 31 deletions

View file

@ -53,9 +53,6 @@ class GroupManager(QDialog):
b = box.addButton(name, type)
b.connect(b, SIGNAL("clicked()"), func)
return b
# exits
b = button(_("&Study"), self.onStudy, QDialogButtonBox.AcceptRole)
button(_("&Cram"), self.onCram, QDialogButtonBox.AcceptRole)
# selection
button(_("Select &All"), self.onSelectAll).setShortcut("a")
button(_("Select &None"), self.onSelectNone).setShortcut("n")
@ -66,14 +63,6 @@ class GroupManager(QDialog):
SIGNAL("helpRequested()"),
lambda: aqt.openHelp("GroupManager"))
def onStudy(self):
self.mw.deck.reset()
self.mw.moveToState("review")
def onCram(self):
self.mw.deck.cramGroups(self.mw.deck.qconf['groups'])
self.mw.moveToState("review")
def onSelectAll(self):
for i in self.items:
i.setCheckState(COLCHECK, Qt.Checked)
@ -151,7 +140,10 @@ class GroupManager(QDialog):
if len(gids) == self.gidCount:
# all enabled is same as empty
gids = []
self.mw.deck.qconf['groups'] = gids
if gids != self.mw.deck.qconf['groups']:
self.mw.deck.qconf['groups'] = gids
self.mw.deck.reset()
self.mw.moveToState("review")
QDialog.accept(self)
def _makeItems(self, grps):

View file

@ -642,6 +642,10 @@ Debug info:\n%s""") % traceback.format_exc(), help="DeckErrors")
def onOverview(self):
self.moveToState("overview")
def onGroups(self):
from aqt.groupman import GroupManager
g = GroupManager(self)
def onCardStats(self):
self.cardStats.show()
@ -774,6 +778,7 @@ Please give your deck a name:"""))
self.connect(m.actionLocalizeMedia, s, self.onLocalizeMedia)
self.connect(m.actionStudyOptions, s, self.onStudyOptions)
self.connect(m.actionOverview, s, self.onOverview)
self.connect(m.actionGroups, s, self.onGroups)
self.connect(m.actionDonate, s, self.onDonate)
self.connect(m.actionBuryFact, s, self.onBuryFact)

View file

@ -37,8 +37,6 @@ class Overview(object):
self._linkHandler("cram")
elif txt == "d":
self._linkHandler("list")
elif txt == "g":
self._linkHandler("chgrp")
else:
return
return True
@ -49,14 +47,14 @@ class Overview(object):
self.mw.deck.reset()
self.mw.moveToState("review")
elif url == "cram":
self.mw.deck.cramGroups(self.mw.deck.qconf['groups'])
self.mw.deck.cramGroups()
self.mw.moveToState("review")
elif url == "opts":
self.mw.onStudyOptions()
elif url == "list":
self.mw.close()
elif url == "chgrp":
self.changeGroups()
self.mw.onGroups()
# HTML
############################################################
@ -172,10 +170,3 @@ $(function () {
if not self.mw.config['showToolbar']:
return
self.mw.form.toolBar.show()
# Group changing
##########################################################################
def changeGroups(self):
from aqt.groupman import GroupManager
g = GroupManager(self.mw)

View file

@ -121,7 +121,6 @@
<addaction name="separator"/>
<addaction name="menuAdvanced"/>
<addaction name="separator"/>
<addaction name="separator"/>
</widget>
<widget class="QMenu" name="menu_Settings">
<property name="title">
@ -149,6 +148,7 @@
<addaction name="separator"/>
</widget>
<addaction name="actionOverview"/>
<addaction name="actionGroups"/>
<addaction name="actionStudyOptions"/>
<addaction name="actionDeckProperties"/>
<addaction name="separator"/>
@ -270,7 +270,7 @@
<string>Synchronize with Anki Online</string>
</property>
<property name="shortcut">
<string>Ctrl+Shift+Y</string>
<string>Ctrl+S</string>
</property>
</action>
<action name="actionAddcards">
@ -285,7 +285,7 @@
<string/>
</property>
<property name="shortcut">
<string>Ctrl+D</string>
<string>A</string>
</property>
</action>
<action name="actionEditdeck">
@ -300,7 +300,7 @@
<string/>
</property>
<property name="shortcut">
<string>Ctrl+F</string>
<string>B</string>
</property>
</action>
<action name="actionPreferences">
@ -329,8 +329,8 @@
<property name="text">
<string>&amp;Deck Statistics</string>
</property>
<property name="statusTip">
<string>Show some textual statistics about your deck</string>
<property name="shortcut">
<string>Shift+D</string>
</property>
</action>
<action name="actionAbout">
@ -356,6 +356,9 @@
<property name="statusTip">
<string>Show statistics about the current card and last card</string>
</property>
<property name="shortcut">
<string>Shift+C</string>
</property>
</action>
<action name="actionDeckProperties">
<property name="icon">
@ -380,6 +383,9 @@
<property name="statusTip">
<string>Import cards into the current deck</string>
</property>
<property name="shortcut">
<string>Ctrl+I</string>
</property>
</action>
<action name="actionGraphs">
<property name="icon">
@ -392,6 +398,9 @@
<property name="statusTip">
<string/>
</property>
<property name="shortcut">
<string>Shift+G</string>
</property>
</action>
<action name="actionExport">
<property name="icon">
@ -404,6 +413,9 @@
<property name="statusTip">
<string>Save cards in a new deck or text file for sharing with others</string>
</property>
<property name="shortcut">
<string>Ctrl+T</string>
</property>
</action>
<action name="actionMarkCard">
<property name="checkable">
@ -522,7 +534,7 @@
<string/>
</property>
<property name="shortcut">
<string>Ctrl+E</string>
<string>E</string>
</property>
</action>
<action name="actionDelete">
@ -649,7 +661,7 @@
<string>Card Layout...</string>
</property>
<property name="shortcut">
<string>F2</string>
<string>L</string>
</property>
</action>
<action name="actionLocalizeMedia">
@ -669,6 +681,14 @@
<string>O</string>
</property>
</action>
<action name="actionGroups">
<property name="text">
<string>Groups...</string>
</property>
<property name="shortcut">
<string>G</string>
</property>
</action>
</widget>
<resources>
<include location="icons.qrc"/>