def on_merge_selected(browser: Browser) -> None: cids = browser.selectedCards() if len(cids) < 2: tooltip("At least two cards must be selected.") return browser.model.beginReset() browser.mw.checkpoint(_("Merge fields of selected cards")) merge_cards_fields(cids) browser.model.endReset() browser.mw.reset() tooltip(f"{len(cids)} cards merged.", parent=browser)
def _on_edit_window(browser: Browser) -> bool: """Launch BrowserEditCurrent instance""" cids = browser.selectedCards() if not cids or not browser.card: tooltip("No cards selected") return False elif len(cids) > 1: tooltip("Please select just one card") return False hide_browser_editor(browser) browser.external_editor = aqt.dialogs.open("BrowserEditCurrent", browser.mw, browser, browser.card) return True