示例#1
0
    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)
示例#2
0
    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)
示例#3
0
 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)
示例#4
0
 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()
示例#5
0
 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)
示例#6
0
 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)
示例#8
0
文件: clayout.py 项目: solarmist/anki
 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)
示例#9
0
文件: utils.py 项目: solarmist/anki
 def onReject():
     if geomKey:
         saveGeom(diag, geomKey)
     QDialog.reject(diag)
示例#10
0
 def reject(self):
     saveGeom(self, self.name)
     aqt.dialogs.markClosed("DeckStats")
     QDialog.reject(self)
示例#11
0
 def reject(self):
     QDialog.reject(self)
示例#12
0
 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)
示例#14
0
 def reject(self):
     saveGeom(self, "TagDialogExtended")
     QDialog.reject(self)
示例#15
0
 def reject(self):
     self.tags = ""
     QDialog.reject(self)
示例#16
0
文件: utils.py 项目: solarmist/anki
 def reject(self):
     return QDialog.reject(self)
示例#17
0
 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)
示例#19
0
 def reject(self):
     saveGeom(self, "318752047__add_hyperlink")
     QDialog.reject(self)
示例#20
0
 def reject(self):
     self.modelChooser.cleanup()
     self.deck.cleanup()
     remHook("currentModelChanged", self.modelChanged)
     QDialog.reject(self)
示例#21
0
文件: addons.py 项目: solarmist/anki
 def reject(self):
     saveGeom(self, "addons")
     return QDialog.reject(self)
示例#22
0
 def reject(self):
     saveGeom(self, "html_cleaner_conf_window")
     aqt.dialogs.markClosed("html_cleaner_config")
     QDialog.reject(self)
示例#23
0
文件: about.py 项目: solarmist/anki
 def reject(self):
     aqt.dialogs.markClosed("About")
     QDialog.reject(self)
 def reject(self):
     saveGeom(self, "BSMH")
     QDialog.reject(self)
示例#25
0
 def reject(self):
     saveGeom(self, self.geomKey)
     remHook('reset', self.onReset)
     QDialog.reject(self)