def _setup_ui(self) -> None: self.setWindowModality(Qt.ApplicationModal) self.mw.garbage_collect_on_dialog_finish(self) self.setMinimumWidth(400) disable_help_button(self) restoreGeom(self, self.TITLE) addCloseShortcut(self) self.web = AnkiWebView(title=self.TITLE) self.web.setVisible(False) self.web.load_ts_page("deckoptions") layout = QVBoxLayout() layout.setContentsMargins(0, 0, 0, 0) layout.addWidget(self.web) self.setLayout(layout) deck_id = self.mw.col.decks.get_current_id() self.web.eval(f"""const $deckOptions = anki.deckOptions( document.getElementById('main'), {deck_id});""") gui_hooks.deck_options_did_load(self)
def _setup_ui(self) -> None: self.setWindowModality(Qt.ApplicationModal) self.mw.garbage_collect_on_dialog_finish(self) self.setMinimumWidth(400) disable_help_button(self) restoreGeom(self, self.TITLE) addCloseShortcut(self) self.web = AnkiWebView(title=self.TITLE) self.web.setVisible(False) self.web.load_ts_page("deck-options") layout = QVBoxLayout() layout.setContentsMargins(0, 0, 0, 0) layout.addWidget(self.web) self.setLayout(layout) self.web.eval(f"""const $deckOptions = anki.deckOptions( document.getElementById('main'), {self._deck["id"]});""") self.setWindowTitle( without_unicode_isolation( tr.actions_options_for(val=self._deck["name"]))) gui_hooks.deck_options_did_load(self)