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

Allow adding "ankisearch:" links in external programs. #412

Merged
merged 4 commits into from
Mar 22, 2023
Merged

Allow adding "ankisearch:" links in external programs. #412

merged 4 commits into from
Mar 22, 2023

Conversation

tatsumoto-ren
Copy link
Contributor

@tatsumoto-ren tatsumoto-ren commented Mar 21, 2023

This PR lets any external program create "ankisearch:" links. By clicking on such link, the Anki Browser opens with the specified query.

screencast-2023-Mar-21_21-31-06.mp4

This can be useful to check if you already have a certain word added to Anki.

GenjiFujimoto and others added 2 commits March 21, 2023 20:55
void AnkiConnector::ankiSearch( QString const & word )
{
QString postTemplate = QString(
"{"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can
use rawstring

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea

@xiaoyifang
Copy link
Owner

what will happen,if no anki installed and click on the ankisearch link


void AnkiConnector::ankiSearch( QString const & word )
{
QString postTemplate = R"anki({
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if anki connect is not enabled ,can return directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if anki connect is not enabled ,can return directly?

Cancel the operation if ankiconnect isn't enabled in settings? i'll look into it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added an if that returns if ankiconnect isn't enabled in settings.

@tatsumoto-ren
Copy link
Contributor Author

what will happen,if no anki installed and click on the ankisearch link

If Ankiconnect isn't running or if Anki isn't runnning, it prints "connection refused" at the bottom.

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@xiaoyifang xiaoyifang merged commit 01c661b into xiaoyifang:staged Mar 22, 2023
@tatsumoto-ren tatsumoto-ren deleted the ankisearch branch March 22, 2023 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants