From 46fea20985d6fcea7d721ac898d542dcbfcc3c85 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 23 May 2013 14:44:00 +0900 Subject: [PATCH] shortcut key for history button --- aqt/addcards.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/aqt/addcards.py b/aqt/addcards.py index de8a41a89..8df97ef2c 100644 --- a/aqt/addcards.py +++ b/aqt/addcards.py @@ -1,6 +1,7 @@ # Copyright: Damien Elmes # -*- coding: utf-8 -*- # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html +from anki.lang import _ from aqt.qt import * import aqt.forms @@ -8,7 +9,7 @@ from aqt.utils import saveGeom, restoreGeom, showWarning, askUser, shortcut, \ tooltip, openHelp, addCloseShortcut from anki.sound import clearAudioQueue from anki.hooks import addHook, remHook -from anki.utils import stripHTMLMedia +from anki.utils import stripHTMLMedia, isMac import aqt.editor, aqt.modelchooser, aqt.deckchooser class AddCards(QDialog): @@ -69,6 +70,12 @@ class AddCards(QDialog): # history b = bb.addButton( _("History")+ u" ▾", ar) + if isMac: + sc = "Ctrl+Shift+H" + else: + sc = "Ctrl+H" + b.setShortcut(QKeySequence(sc)) + b.setToolTip(_("Shortcut: %s") % shortcut(sc)) self.connect(b, SIGNAL("clicked()"), self.onHistory) b.setEnabled(False) self.historyButton = b