From afd03844e23a1a1cb78393287a260ccf57c887c5 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 14 Nov 2008 15:46:41 +0900 Subject: [PATCH] fix shortcut keys for mac, update help, change some shortcuts --- ankiqt/ui/addcards.py | 4 +--- ankiqt/ui/main.py | 3 +-- ankiqt/ui/modelchooser.py | 13 +++++-------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/ankiqt/ui/addcards.py b/ankiqt/ui/addcards.py index 20c99f88d..ba7668d31 100644 --- a/ankiqt/ui/addcards.py +++ b/ankiqt/ui/addcards.py @@ -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, diff --git a/ankiqt/ui/main.py b/ankiqt/ui/main.py index bd6d754c1..57fdfd0ed 100644 --- a/ankiqt/ui/main.py +++ b/ankiqt/ui/main.py @@ -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()"), diff --git a/ankiqt/ui/modelchooser.py b/ankiqt/ui/modelchooser.py index 757e3ead3..654cf1e1f 100644 --- a/ankiqt/ui/modelchooser.py +++ b/ankiqt/ui/modelchooser.py @@ -20,10 +20,10 @@ class ModelChooser(QHBoxLayout): self.setMargin(0) self.setSpacing(6) self.shortcuts = [] - label = QLabel(_("Model:")) + label = QLabel(_("Model:")) 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(_("Cards:")) + label = QLabel(_("Cards:")) 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)