def prompt(name: str) -> None: new_name = getOnlyText(tr.decks_new_deck_name(), default=name) if not new_name or new_name == name: return else: rename_deck(parent=self.mw, deck_id=did, new_name=new_name).run_in_background()
def add_deck_dialog( *, parent: QWidget, default_text: str = "", ) -> Optional[CollectionOp[OpChangesWithId]]: if name := getOnlyText( tr.decks_new_deck_name(), default=default_text, parent=parent ).strip(): return add_deck(parent=parent, name=name)