Exemplo n.º 1
0
 def __init__(self, mw: aqt.AnkiQt, deck: dict) -> None:
     QDialog.__init__(self, mw)
     self.mw = mw
     self.deck = deck
     self.childDids = [
         d[1] for d in self.mw.col.decks.children(self.deck["id"])
     ]
     self._origNewOrder = None
     self.form = aqt.forms.dconf.Ui_Dialog()
     self.form.setupUi(self)
     gui_hooks.deck_conf_did_setup_ui_form(self)
     self.mw.checkpoint(tr.actions_options())
     self.setupCombos()
     self.setupConfs()
     self.setWindowModality(Qt.WindowModal)
     qconnect(self.form.buttonBox.helpRequested,
              lambda: openHelp(HelpPage.DECK_OPTIONS))
     qconnect(self.form.confOpts.clicked, self.confOpts)
     qconnect(
         self.form.buttonBox.button(
             QDialogButtonBox.RestoreDefaults).clicked,
         self.onRestore,
     )
     self.setWindowTitle(
         without_unicode_isolation(
             tr.actions_options_for(val=self.deck["name"])))
     disable_help_button(self)
     # qt doesn't size properly with altered fonts otherwise
     restoreGeom(self, "deckconf", adjustSize=True)
     gui_hooks.deck_conf_will_show(self)
     self.show()
     self.exec_()
     saveGeom(self, "deckconf")
Exemplo n.º 2
0
 def __init__(self, mw: aqt.AnkiQt, deck: Dict):
     QDialog.__init__(self, mw)
     self.mw = mw
     self.deck = deck
     self.childDids = [
         d[1] for d in self.mw.col.decks.children(self.deck["id"])
     ]
     self._origNewOrder = None
     self.form = aqt.forms.dconf.Ui_Dialog()
     self.form.setupUi(self)
     gui_hooks.deck_conf_did_setup_ui_form(self)
     self.mw.checkpoint(_("Options"))
     self.setupCombos()
     self.setupConfs()
     self.setWindowModality(Qt.WindowModal)
     qconnect(self.form.buttonBox.helpRequested,
              lambda: openHelp("deckoptions"))
     qconnect(self.form.confOpts.clicked, self.confOpts)
     qconnect(
         self.form.buttonBox.button(
             QDialogButtonBox.RestoreDefaults).clicked,
         self.onRestore,
     )
     self.setWindowTitle(_("Options for %s") % self.deck["name"])
     # qt doesn't size properly with altered fonts otherwise
     restoreGeom(self, "deckconf", adjustSize=True)
     gui_hooks.deck_conf_will_show(self)
     self.show()
     self.exec_()
     saveGeom(self, "deckconf")