Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add terms and policy submenu to AnkiHub menu #1072

Merged
merged 5 commits into from
Jan 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions ankihub/gui/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def refresh_ankihub_menu() -> None:
_ankihub_login_setup(parent=menu_state.ankihub_menu)

_config_setup(parent=menu_state.ankihub_menu)
_ankihub_terms_and_policy_setup(parent=menu_state.ankihub_menu)
_ankihub_help_setup(parent=menu_state.ankihub_menu)


Expand Down Expand Up @@ -520,6 +521,29 @@ def _trigger_install_release_version():
check_and_prompt_for_updates_on_main_window()


def _ankihub_terms_and_policy_setup(parent: QMenu):
"""Set up the sub menu for terms and policy related items."""
terms_and_policy_menu = QMenu("🤝 Terms and Policy", parent)

q_terms_and_conditions_action = QAction(
"Terms && Conditions", terms_and_policy_menu
)
qconnect(
q_terms_and_conditions_action.triggered,
lambda: openLink("https://community.ankihub.net/tos"),
)
terms_and_policy_menu.addAction(q_terms_and_conditions_action)

q_privacy_policy_action = QAction("Privacy Policy", terms_and_policy_menu)
qconnect(
q_privacy_policy_action.triggered,
lambda: openLink("https://community.ankihub.net/privacy"),
)
terms_and_policy_menu.addAction(q_privacy_policy_action)

parent.addMenu(terms_and_policy_menu)


def _ankihub_logout_setup(parent: QMenu):
q_action = QAction("🔑 Sign out", aqt.mw)
qconnect(q_action.triggered, _confirm_sign_out)
Expand Down
Loading