def cleanup_and_close(self): gui_hooks.editor_did_load_note.remove(self.editor_did_load_note) gui_hooks.operation_did_execute.remove(self.on_operation_did_execute) self.editor.cleanup() saveGeom(self, self.dialog_geometry_tag) aqt.dialogs.markClosed(self.dialog_registry_tag) QDialog.reject(self)
def reject(self) -> None: if self._close_when_done and self._syncer.is_syncing(): # closing while syncing on close starts an abort self._on_abort() return aqt.dialogs.markClosed("sync_log") QDialog.reject(self)
def reject(self): self.saveField() if self.oldSortField != self.model['sortf']: self.mw.progress.start() self.mw.col.updateFieldCache(self.mm.nids(self.model)) self.mw.progress.finish() self.mm.save(self.model) self.mw.reset() QDialog.reject(self)
def closeEvent(self, event): ok = askUser("Close and discard changes?") if ok: event.ignore() saveGeom(self, "1043915942_CmDialog") self.web = None QDialog.reject(self) else: event.ignore()
def _reject(self): remHook('reset', self.onReset) remHook('currentModelChanged', self.onModelChange) clearAudioQueue() self.removeTempNote(self.editor.note) self.editor.cleanup() self.modelChooser.cleanup() self.deckChooser.cleanup() self.mw.maybeReset() saveGeom(self, "add") aqt.dialogs.markClosed("AddCards") QDialog.reject(self)
def _saveAndClose(self): remHook("reset", self.onReset) r = self.mw.reviewer try: r.card.load() except: # card was removed by clayout pass else: self.mw.reviewer.cardQueue.append(self.mw.reviewer.card) self.editor.cleanup() self.mw.moveToState("review") saveGeom(self, "editcurrent") aqt.dialogs.markClosed("EditCurrent") QDialog.reject(self)
def accept(self): sel = self.dialog.list_categories.currentItem().text() if sel in ["Backcolor (inline)", "style (inline)"]: if not askUser(inlinewarning): return if sel in [ "class (other)", "Backcolor (via class)", "Forecolor (via class)", "font size (via class)", "class (other), wrapped in div" ]: if not askUser(classeswarning): return a = gui_dialog(self, sel=sel, config=None) if a.exec_(): self.newsetting = a.newsetting self.newsetting['Category'] = sel QDialog.accept(self) else: QDialog.reject(self)
def reject(self): self.cancelPreviewTimer() clearAudioQueue() if self.addMode: # remove the filler fields we added for name in self.emptyFields: self.note[name] = "" self.mw.col.db.execute("delete from notes where id = ?", self.note.id) self.mm.save(self.model, templates=True) self.mw.reset() saveGeom(self, "CardLayout") self.pform.frontWeb = None self.pform.backWeb = None return QDialog.reject(self)
def onReject(): if geomKey: saveGeom(diag, geomKey) QDialog.reject(diag)
def reject(self): saveGeom(self, self.name) aqt.dialogs.markClosed("DeckStats") QDialog.reject(self)
def reject(self): QDialog.reject(self)
def _on_edit_button(self): note = self.mw.col.getNote(self.card().nid) d = EditNoteWindowFromThisLinkAddon(self.mw, note) d.show() QDialog.reject(self)
def onReject(self): QDialog.reject(self)
def reject(self): saveGeom(self, "TagDialogExtended") QDialog.reject(self)
def reject(self): self.tags = "" QDialog.reject(self)
def reject(self): return QDialog.reject(self)
def reject(self): ok = askUser("Close and discard changes?") if ok: saveGeom(self, "1043915942_CmDialog") self.web = None QDialog.reject(self)
def reject(self): saveGeom(self, "TT/TIFP") QDialog.reject(self)
def reject(self): saveGeom(self, "318752047__add_hyperlink") QDialog.reject(self)
def reject(self): self.modelChooser.cleanup() self.deck.cleanup() remHook("currentModelChanged", self.modelChanged) QDialog.reject(self)
def reject(self): saveGeom(self, "addons") return QDialog.reject(self)
def reject(self): saveGeom(self, "html_cleaner_conf_window") aqt.dialogs.markClosed("html_cleaner_config") QDialog.reject(self)
def reject(self): aqt.dialogs.markClosed("About") QDialog.reject(self)
def reject(self): saveGeom(self, "BSMH") QDialog.reject(self)
def reject(self): saveGeom(self, self.geomKey) remHook('reset', self.onReset) QDialog.reject(self)