mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
fix shortcut keys for mac, update help, change some shortcuts
This commit is contained in:
parent
340a521f2f
commit
afd03844e2
3 changed files with 7 additions and 13 deletions
|
@ -43,7 +43,7 @@ class AddCards(QDialog):
|
|||
self.dialog.modelArea.setLayout(self.modelChooser)
|
||||
|
||||
def helpRequested(self):
|
||||
QDesktopServices.openUrl(QUrl(ankiqt.appWiki + "AddFacts"))
|
||||
QDesktopServices.openUrl(QUrl(ankiqt.appWiki + "AddItems"))
|
||||
|
||||
def addButtons(self):
|
||||
self.addButton = QPushButton(_("&Add"))
|
||||
|
@ -53,8 +53,6 @@ class AddCards(QDialog):
|
|||
self.addButton.setDefault(True)
|
||||
s = QShortcut(QKeySequence(_("Ctrl+Enter")), self)
|
||||
s.connect(s, SIGNAL("activated()"), self.addButton, SLOT("click()"))
|
||||
s = QShortcut(QKeySequence(_("Alt+A")), self)
|
||||
s.connect(s, SIGNAL("activated()"), self.addButton, SLOT("click()"))
|
||||
self.connect(self.addButton, SIGNAL("clicked()"), self.addCards)
|
||||
self.closeButton = QPushButton(_("Close"))
|
||||
self.dialog.buttonBox.addButton(self.closeButton,
|
||||
|
|
|
@ -550,8 +550,7 @@ class AnkiQt(QMainWindow):
|
|||
n = 1
|
||||
for file in self.config['recentDeckPaths']:
|
||||
a = QAction(self)
|
||||
if not sys.platform.startswith("darwin"):
|
||||
a.setShortcut(_("Alt+%d" % n))
|
||||
a.setShortcut(_("Ctrl+%d" % n))
|
||||
a.setText(os.path.basename(file))
|
||||
a.setStatusTip(os.path.abspath(file))
|
||||
self.connect(a, SIGNAL("triggered()"),
|
||||
|
|
|
@ -20,10 +20,10 @@ class ModelChooser(QHBoxLayout):
|
|||
self.setMargin(0)
|
||||
self.setSpacing(6)
|
||||
self.shortcuts = []
|
||||
label = QLabel(_("<b><u>M</u>odel</b>:"))
|
||||
label = QLabel(_("<b>Model</b>:"))
|
||||
self.addWidget(label)
|
||||
self.models = QComboBox()
|
||||
s = QShortcut(QKeySequence(_("Alt+M")), self.parent)
|
||||
s = QShortcut(QKeySequence(_("Ctrl+Alt+m")), self.parent)
|
||||
s.connect(s, SIGNAL("activated()"),
|
||||
lambda: self.models.showPopup())
|
||||
self.drawModels()
|
||||
|
@ -40,7 +40,7 @@ class ModelChooser(QHBoxLayout):
|
|||
self.connect(self.add, SIGNAL("clicked()"), self.onAdd)
|
||||
self.edit = QPushButton()
|
||||
self.edit.setIcon(QIcon(":/icons/edit.png"))
|
||||
self.edit.setShortcut(_("Alt+E"))
|
||||
self.edit.setShortcut(_("Ctrl+Alt+e"))
|
||||
self.edit.setToolTip(_("Edit the current model"))
|
||||
self.edit.setAutoDefault(False)
|
||||
self.addWidget(self.edit)
|
||||
|
@ -49,13 +49,10 @@ class ModelChooser(QHBoxLayout):
|
|||
self.handleCards = False
|
||||
if cards:
|
||||
self.handleCards = True
|
||||
label = QLabel(_("<b><u>C</u>ards</b>:"))
|
||||
label = QLabel(_("<b>Cards</b>:"))
|
||||
self.addWidget(label)
|
||||
self.cards = QPushButton()
|
||||
self.connect(self.cards, SIGNAL("clicked()"), self.onCardChange)
|
||||
s = QShortcut(QKeySequence(_("Alt+C")), self.parent)
|
||||
s.connect(s, SIGNAL("activated()"),
|
||||
self.onCardChange)
|
||||
self.addWidget(self.cards)
|
||||
self.drawCardModels()
|
||||
|
||||
|
@ -118,7 +115,7 @@ class ModelChooser(QHBoxLayout):
|
|||
self.cards.setText(txt)
|
||||
n = 1
|
||||
for c in m.cardModels:
|
||||
s = QShortcut(QKeySequence("Alt+%d" % n), self.parent)
|
||||
s = QShortcut(QKeySequence("Ctrl+%d" % n), self.parent)
|
||||
self.parent.connect(s, SIGNAL("activated()"),
|
||||
lambda c=c: self.toggleCard(c))
|
||||
self.shortcuts.append(s)
|
||||
|
|
Loading…
Reference in a new issue