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

Field history more features #102

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Arthur-Milchior
Copy link
Contributor

First commit allows to use «history» in browser and edit field. In those case, it does not restrict the search to the current deck. This has been requested recently on reddit (which is currently broken, thus I can't link)

Second commit allows to define in add-on configuration some predefined values. So you can put directly one of those values in the field. Requested in same reddit post

@glutanimate
Copy link
Owner

Thanks, Arthur! I will take a look at these over the weekend.

@glutanimate glutanimate self-assigned this Jul 11, 2019
@glutanimate glutanimate added the enhancement New feature or request label Jul 11, 2019
@omega3
Copy link

omega3 commented Dec 21, 2019

Any chances this feature will be accepted?
Please.

Here is above mentioned request:
https://www.reddit.com/r/Anki/comments/c4pvaf/addon_request_predefined_field_values_to_choose/

Copy link
Owner

@glutanimate glutanimate left a comment

Choose a reason for hiding this comment

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

Thanks again for taking the time to contribute, Arthur, and sorry for taking ages to respond! I left a few notes on some parts of the code.

Having tested your changes for a bit, I can see their use, but I also feel like they would be better suited for a separate add-on. Since the predefined fields option is using a separate hotkey anyway, and I don't see much potential for conflicts otherwise, how would you feel about just forking field history and publishing your own version for choosing from a set of predefined values? I think that would make it easier for both of us to focus on one specific area of functionality and maintain that going forward.

License: GNU AGPLv3 or later <https://www.gnu.org/licenses/agpl.html>
"""

# Do not modify the following line
from __future__ import unicode_literals
from anki import version as anki_version
anki21 = anki_version.startswith("2.1.")
from .config import getConfig
Copy link
Owner

Choose a reason for hiding this comment

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

I think you meant to file the changes for browser refresh as a separate PR?

@@ -0,0 +1,15 @@
{
"limit search to deck": true,
Copy link
Owner

Choose a reason for hiding this comment

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

Although I can see the advantage of including spaces in config keys for readability, I still prefer going old school json and using camelCase config keys (whitespace in keys always makes me nervous. might just be because I started programming with bash...)

@@ -37,15 +38,16 @@

from anki import version
ANKI21 = version.startswith("2.1")
from .config import getConfig
Copy link
Owner

Choose a reason for hiding this comment

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

This currently throws an error because config.py is using getUserOption

@Arthur-Milchior
Copy link
Contributor Author

As you now know extremely well, I've no problem forking an add-on and uploading it.
I'll need to take a look at it to be able to answer in more details. I currently can't actually remember the code well enough to see whether I believe it'll interfere or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants