mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 07:52:24 -04:00
Reverting "if add button is focused and fact is complete, add"
This commit is contained in:
parent
98865f8710
commit
fd57313d74
1 changed files with 1 additions and 12 deletions
|
@ -55,7 +55,7 @@ class AddCards(QDialog):
|
|||
QDesktopServices.openUrl(QUrl(ankiqt.appWiki + "AddItems"))
|
||||
|
||||
def addButtons(self):
|
||||
self.addButton = FocusButton(_("Add"))
|
||||
self.addButton = QPushButton(_("Add"))
|
||||
self.dialog.buttonBox.addButton(self.addButton,
|
||||
QDialogButtonBox.ActionRole)
|
||||
self.addButton.setShortcut(_("Ctrl+Return"))
|
||||
|
@ -66,7 +66,6 @@ class AddCards(QDialog):
|
|||
s = QShortcut(QKeySequence(_("Ctrl+Enter")), self)
|
||||
s.connect(s, SIGNAL("activated()"), self.addButton, SLOT("click()"))
|
||||
self.connect(self.addButton, SIGNAL("clicked()"), self.addCards)
|
||||
self.connect(self.addButton, SIGNAL("tabIn"), self.maybeAddCards)
|
||||
self.closeButton = QPushButton(_("Close"))
|
||||
self.closeButton.setAutoDefault(False)
|
||||
self.dialog.buttonBox.addButton(self.closeButton,
|
||||
|
@ -104,16 +103,6 @@ class AddCards(QDialog):
|
|||
self.editor.setFact(fact, check=True)
|
||||
self.setTabOrder(self.editor.tags, self.addButton)
|
||||
|
||||
def maybeAddCards(self):
|
||||
self.editor.saveFieldsNow()
|
||||
fact = self.editor.fact
|
||||
try:
|
||||
fact.assertValid()
|
||||
fact.assertUnique(self.parent.deck.s)
|
||||
except FactInvalidError:
|
||||
return
|
||||
self.addCards()
|
||||
|
||||
def addCards(self):
|
||||
# make sure updated
|
||||
self.editor.saveFieldsNow()
|
||||
|
|
Loading…
Reference in a new issue