Add return values

This commit is contained in:
Henrik Giesel 2019-05-04 23:24:13 +02:00
parent 08109dafbd
commit db602ebe9a

View File

@ -977,6 +977,8 @@ class AnkiConnect:
aqt.dialogs.open(windowName, self.window()) aqt.dialogs.open(windowName, self.window())
addCards.setAndFocusNote(editor.note) addCards.setAndFocusNote(editor.note)
return ankiNote.id
elif note is not None: elif note is not None:
currentWindow = aqt.dialogs._dialogs['AddCards'][1] currentWindow = aqt.dialogs._dialogs['AddCards'][1]
@ -1011,10 +1013,14 @@ class AnkiConnect:
else: else:
openNewWindow() openNewWindow()
return aqt.dialogs._dialogs['AddCards'][1].editor.note.id
else: else:
addCards = aqt.dialogs.open('AddCards', self.window()) addCards = aqt.dialogs.open('AddCards', self.window())
addCards.activateWindow() addCards.activateWindow()
return addCards.editor.note.id
@util.api() @util.api()
def guiReviewActive(self): def guiReviewActive(self):
return self.reviewer().card is not None and self.window().state == 'review' return self.reviewer().card is not None and self.window().state == 'review'