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

View file

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

View file

@ -37,8 +37,6 @@ class Overview(object):
self._linkHandler("cram") self._linkHandler("cram")
elif txt == "d": elif txt == "d":
self._linkHandler("list") self._linkHandler("list")
elif txt == "g":
self._linkHandler("chgrp")
else: else:
return return
return True return True
@ -49,14 +47,14 @@ class Overview(object):
self.mw.deck.reset() self.mw.deck.reset()
self.mw.moveToState("review") self.mw.moveToState("review")
elif url == "cram": elif url == "cram":
self.mw.deck.cramGroups(self.mw.deck.qconf['groups']) self.mw.deck.cramGroups()
self.mw.moveToState("review") self.mw.moveToState("review")
elif url == "opts": elif url == "opts":
self.mw.onStudyOptions() self.mw.onStudyOptions()
elif url == "list": elif url == "list":
self.mw.close() self.mw.close()
elif url == "chgrp": elif url == "chgrp":
self.changeGroups() self.mw.onGroups()
# HTML # HTML
############################################################ ############################################################
@ -172,10 +170,3 @@ $(function () {
if not self.mw.config['showToolbar']: if not self.mw.config['showToolbar']:
return return
self.mw.form.toolBar.show() 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="separator"/>
<addaction name="menuAdvanced"/> <addaction name="menuAdvanced"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="separator"/>
</widget> </widget>
<widget class="QMenu" name="menu_Settings"> <widget class="QMenu" name="menu_Settings">
<property name="title"> <property name="title">
@ -149,6 +148,7 @@
<addaction name="separator"/> <addaction name="separator"/>
</widget> </widget>
<addaction name="actionOverview"/> <addaction name="actionOverview"/>
<addaction name="actionGroups"/>
<addaction name="actionStudyOptions"/> <addaction name="actionStudyOptions"/>
<addaction name="actionDeckProperties"/> <addaction name="actionDeckProperties"/>
<addaction name="separator"/> <addaction name="separator"/>
@ -270,7 +270,7 @@
<string>Synchronize with Anki Online</string> <string>Synchronize with Anki Online</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Shift+Y</string> <string>Ctrl+S</string>
</property> </property>
</action> </action>
<action name="actionAddcards"> <action name="actionAddcards">
@ -285,7 +285,7 @@
<string/> <string/>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+D</string> <string>A</string>
</property> </property>
</action> </action>
<action name="actionEditdeck"> <action name="actionEditdeck">
@ -300,7 +300,7 @@
<string/> <string/>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+F</string> <string>B</string>
</property> </property>
</action> </action>
<action name="actionPreferences"> <action name="actionPreferences">
@ -329,8 +329,8 @@
<property name="text"> <property name="text">
<string>&amp;Deck Statistics</string> <string>&amp;Deck Statistics</string>
</property> </property>
<property name="statusTip"> <property name="shortcut">
<string>Show some textual statistics about your deck</string> <string>Shift+D</string>
</property> </property>
</action> </action>
<action name="actionAbout"> <action name="actionAbout">
@ -356,6 +356,9 @@
<property name="statusTip"> <property name="statusTip">
<string>Show statistics about the current card and last card</string> <string>Show statistics about the current card and last card</string>
</property> </property>
<property name="shortcut">
<string>Shift+C</string>
</property>
</action> </action>
<action name="actionDeckProperties"> <action name="actionDeckProperties">
<property name="icon"> <property name="icon">
@ -380,6 +383,9 @@
<property name="statusTip"> <property name="statusTip">
<string>Import cards into the current deck</string> <string>Import cards into the current deck</string>
</property> </property>
<property name="shortcut">
<string>Ctrl+I</string>
</property>
</action> </action>
<action name="actionGraphs"> <action name="actionGraphs">
<property name="icon"> <property name="icon">
@ -392,6 +398,9 @@
<property name="statusTip"> <property name="statusTip">
<string/> <string/>
</property> </property>
<property name="shortcut">
<string>Shift+G</string>
</property>
</action> </action>
<action name="actionExport"> <action name="actionExport">
<property name="icon"> <property name="icon">
@ -404,6 +413,9 @@
<property name="statusTip"> <property name="statusTip">
<string>Save cards in a new deck or text file for sharing with others</string> <string>Save cards in a new deck or text file for sharing with others</string>
</property> </property>
<property name="shortcut">
<string>Ctrl+T</string>
</property>
</action> </action>
<action name="actionMarkCard"> <action name="actionMarkCard">
<property name="checkable"> <property name="checkable">
@ -522,7 +534,7 @@
<string/> <string/>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+E</string> <string>E</string>
</property> </property>
</action> </action>
<action name="actionDelete"> <action name="actionDelete">
@ -649,7 +661,7 @@
<string>Card Layout...</string> <string>Card Layout...</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>F2</string> <string>L</string>
</property> </property>
</action> </action>
<action name="actionLocalizeMedia"> <action name="actionLocalizeMedia">
@ -669,6 +681,14 @@
<string>O</string> <string>O</string>
</property> </property>
</action> </action>
<action name="actionGroups">
<property name="text">
<string>Groups...</string>
</property>
<property name="shortcut">
<string>G</string>
</property>
</action>
</widget> </widget>
<resources> <resources>
<include location="icons.qrc"/> <include location="icons.qrc"/>