Reverting "if add button is focused and fact is complete, add"

This commit is contained in:
Damien Elmes 2009-04-10 22:26:53 +09:00
parent 98865f8710
commit fd57313d74

View file

@ -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()