From 72436817a3790300f6b4621f4995c62ecfc530a8 Mon Sep 17 00:00:00 2001 From: RisingOrange Date: Wed, 15 Jan 2025 12:53:19 +0100 Subject: [PATCH] Add config button --- ankihub/gui/js_message_handling.py | 5 +++++ ankihub/gui/web/sidebar_tabs.html | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/ankihub/gui/js_message_handling.py b/ankihub/gui/js_message_handling.py index b8cfa8d4a..7c75b7184 100644 --- a/ankihub/gui/js_message_handling.py +++ b/ankihub/gui/js_message_handling.py @@ -17,6 +17,7 @@ from ..db import ankihub_db from ..settings import url_plans_page, url_view_note +from .config_dialog import get_config_dialog_manager from .operations.scheduling import suspend_notes, unsuspend_notes from .utils import show_dialog @@ -30,6 +31,7 @@ ANKIHUB_UPSELL = "ankihub_ai_upsell" COPY_TO_CLIPBOARD_PYCMD = "ankihub_copy_to_clipboard" OPEN_LINK_PYCMD = "ankihub_open_link" +OPEN_CONFIG_PYCMD = "ankihub_open_config" POST_MESSAGE_TO_ANKIHUB_JS_PATH = ( Path(__file__).parent / "web/post_message_to_ankihub_js.js" @@ -125,6 +127,9 @@ def on_button_clicked(button_index: int) -> None: openLink(url) return (True, None) + elif message == OPEN_CONFIG_PYCMD: + get_config_dialog_manager().open_config() + return (True, None) return handled diff --git a/ankihub/gui/web/sidebar_tabs.html b/ankihub/gui/web/sidebar_tabs.html index a43178639..2f1dbb1a0 100644 --- a/ankihub/gui/web/sidebar_tabs.html +++ b/ankihub/gui/web/sidebar_tabs.html @@ -162,6 +162,12 @@ d="M15.75 2.25L21 2.25C21.1989 2.25 21.3897 2.32902 21.5303 2.46967C21.671 2.61032 21.75 2.80109 21.75 3V8.25C21.75 8.66421 21.4142 9 21 9C20.5858 9 20.25 8.66421 20.25 8.25V4.81066L8.03033 17.0303C7.73744 17.3232 7.26256 17.3232 6.96967 17.0303C6.67678 16.7374 6.67678 16.2626 6.96967 15.9697L19.1893 3.75L15.75 3.75C15.3358 3.75 15 3.41421 15 3C15 2.58579 15.3358 2.25 15.75 2.25ZM5.25 6.75C4.42157 6.75 3.75 7.42157 3.75 8.25V18.75C3.75 19.5784 4.42157 20.25 5.25 20.25H15.75C16.5784 20.25 17.25 19.5784 17.25 18.75V10.5C17.25 10.0858 17.5858 9.75 18 9.75C18.4142 9.75 18.75 10.0858 18.75 10.5V18.75C18.75 20.4069 17.4069 21.75 15.75 21.75H5.25C3.59315 21.75 2.25 20.4069 2.25 18.75V8.25C2.25 6.59315 3.59315 5.25 5.25 5.25H13.5C13.9142 5.25 14.25 5.58579 14.25 6C14.25 6.41421 13.9142 6.75 13.5 6.75H5.25Z" /> +