Commit Graph

191 Commits

Author SHA1 Message Date
James Elmore
930c97b1c7
Fix Renaming note fields not updating custom browser appearance (#3245)
* Added methods to parse browser templates

* Added method to get parsed browser templates

* Make field rename check browser templates for field updates

* Update tests

* Updated CONTRIBUTORS

* Formatting

* Refactored cloze field logic for question template into closure

* Refactored cloze field logic for answer template into closure
2024-06-24 08:39:56 +01:00
Alexander Bocken
4fb2efb8aa
fix sveltekit respecting yarn env var (#3226)
* fix sveltekit respecting yarn env var

* adding myself to CONTRIBUTORS
2024-06-07 23:01:40 +01:00
Xidorn Quan
f7b93a5012 Add StartupWMClass for anki.desktop
This ensures that the system can correctly assign the windows of Anki to the desktop launcher item, e.g. in Ubuntu's dock.

Update CONTRIBUTORS
2024-06-01 14:58:47 +07:00
Richard Romero Jr
81de39768c
Fixes shift click selection after programmatic selection in most cases, Issue #2469 (#3213)
* Fixes shift click selection after programmatic selection in most cases

* Attempting to resolve checks

* Adding comment for _move_current setCurrentIndex

* Update qt/aqt/browser/table/table.py (dae)
2024-06-01 08:54:44 +01:00
Voczi
9e3a34f17f
Add support for custom certificates (#3203)
* Add support for custom certificates

* Update lints

* Update licenses

* Changes after feedback

* More changes
2024-05-24 10:57:54 +01:00
Damien Elmes
4a55f69e48 Revert "Use SplashScreen flag for all aqt tooltips (#3194)"
This reverts commit e50a768e44.

This appears to have caused a regression with keyboard shortcuts

https://forums.ankiweb.net/t/anki-24-06-release-candidate/44926/14
2024-05-22 17:06:37 +07:00
Voczi
e50a768e44
Use SplashScreen flag for all aqt tooltips (#3194)
* Set custom tooltip flag as SplashScreen

Prevents tooltip from showing when parent is out of focus

* Update CONTRIBUTORS
2024-05-15 13:13:53 +01:00
Pedro Schreiber
074becc0ce
Add keyboard shortcuts for empty cards and toggle mask on image occlusion (#3136)
* Add keyboard shortcuts for empty cards and toggle mask on image occlusion

- add shortcut for empty cards
- add shortcut for toggle mask
- set tooltips with shortcuts

use unused shortcut for empty cards

* remove unnecessary shortcut added in main.py

* change empty cards shortcut and try to fix CI error in CONTRIBUTORS

* change shortcut for empty cards for universal support
2024-04-25 17:19:38 +10:00
Loudwig
d8f2782c26
Feature Show Reminder before answer (#3064) (#3119)
* Feature Question Action Show Reminder (#3064)

Added a option in the deck config that allow the user to choose in
Autoupdate mode between showing a reminder or revealing the card.
Also added my name to the contributors

* Update ftl/core/deck-config.ftl
2024-04-13 08:39:50 +01:00
Wu Yi-Wei
31439e325d
Add Margins on the Buttons on the About Page (#3137)
* Add Margins on the Buttons on the About Page

* Fix contributors

* Fix format
2024-04-12 05:21:26 +01:00
Escape0707
97efd49cd8
Ignore exception raised by pip_system_certs not found (#3114)
This dependency usually doesn't benefit Linux distros with requests library configured to use system certificate already. And is not packaged by most distros. Making it optional will make most Linux users' installation much easier.
2024-04-05 13:12:06 +01:00
jthulhu
3cd8c5700b
Corrected minor non-idiomatic snippet of code (#3108)
* Corrected minor non-idiomaticity.

* Added to CONTRIBUTORS.
2024-04-01 11:34:23 +01:00
Antoine Q
32c129656e
Improve timer interval display (#3096) (#3100)
* Improve update interval of timer display

Timer calculation frequency increased and aligned with new card apparition.

* Update CONTRIBUTORS

* Update timer interval to 0.333 sec

* Restore timer to 1 sec

- Restoring timer to 1sec value as it is not necessary to increase the frequency.

- Adding a time update directy after new card is displayed so that the timer display immediatly restarts to 0.
2024-03-31 07:49:16 +01:00
ijqq
22559929f9
Replace deprecated method chrono::NaiveDateTime::timestamp_millis (#3097)
* Replace deprecated method `chrono::NaiveDateTime::timestamp_millis`

* Update CONTRIBUTORS
2024-03-28 08:30:02 +00:00
laalsaas
798d9df4de
sync-server: add option to store hashed passwords (#3083) 2024-03-26 07:39:57 +00:00
vasll
eee02d5e8c
Refactored "Forget" to "Reset" (#3078) (#3088)
The respective *.ftl file keys `actions-forget-card` and `qt-accel-forget` will keep the same name to prevent having to force a retranslation for other languages, only the string value was changed
2024-03-24 07:41:56 +00:00
Pedro Schreiber
6ff42155ad
Display deck names when deleting (#3058)
* -  update remove decks function to return names of all deleted decks
- update protobuf message to display deck names
- update python files to receive message in the frontend.
- add message template to ftl

* update CONTRIBUTORS

* format

* refactor: move up deck names concatenation to tooltip api call
to fix type expectations

* restore core behavior and get deck name from view

* fix type specs

* remove new type and use str instead
restore incorrectly removed lines
2024-03-13 12:29:06 +07:00
Kai Knoblich
057733d02e
qt/aqt/__init__.py: Skip GL library workaround for FreeBSD (#3071)
* qt/aqt/__init__.py: Skip GL library workaround for FreeBSD

The workaround to load explicitly "libGL.so.1" isn't required for
FreeBSD and leads to segmentation faults if used in environments that
have nVidia drivers loaded.

See also FreeBSD bug 270778 for further details. [1]

[1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270778

* Update CONTRIBUTORS
2024-03-12 15:50:21 +07:00
arbyste
04fe3655e2
Adding a note to the import options to indicate that leech and marked tags will be removed if disabled (#3067)
* Adding a note to the import options to indicate that leech and marked tags will be removed if not enabled.

* Adding my details to CONTRIBUTORS
2024-03-11 15:45:28 +07:00
Foxy_null
6ac60f8032
Added new translator name (#3060)
* Add my name to about.py

* Add my name to CONTRIBUTORS
2024-03-08 12:55:16 +00:00
Jean Khawand
a694889bca
🐬Containerize anki-sync-server (#3036)
* 🐬Containerize anki-sync-server

* rename directory to syncserver

* update contributors

* fix format

* format README

* - make ANKI_VERSION mandatory
- remove SYNC_USERS and stick unique vars
- update doc

* update doc

* update doc

* - remove hardcoded ANKI_VERSION arg
- update readme
2024-03-01 15:15:02 +07:00
Han Yeong-woo
9ba527afa2
Improve typing deck_due_tree() (#3003)
* Improve typing `deck_due_tree()`

* Add me to CONTRIBUTORS
2024-02-12 15:56:29 +10:00
cav71
f4a8f7d9c7
Add support for python logging (#2969)
* adds log module

* enable logging in the app

* adds a getLogger method to AddonManager

* change log level depending on ANKIDEV

* fix undefined module variable

* - fix addons log file path
- remove a breakpoint leftover

set the addons log files under pm.addonFolder()/NNNNNN/user_files/logs/NNNNNN.log

* fix path bug

* move log closing handling into AddonManager deleteAddon/backupUserFiles methods

* logging module level import
fix undefined variable in backupUserFiles

* pretty format log records

* move MediaServer log into logging

* update CONTRIBUTORS

* documentation cleanup

* capture warnings into log messages
fix waitress verbosity

* remove record_factory function

* add get_logger method alias to getLogger in AddonManager
switch to TimedRotatingFileHandler handler
fix minor typo

* set main log level to DEBUG if ANKIDEV is not 0 (or unset)
added two new methods to AddonManager addon_get_logger/addon_toggle_log_level

* add new find_logger_output to AddonManager

* move logs under pm.base

* change log output

* update addonmanager getlogger

* Format imports

* Refactor logging set-up slightly and tweak docstring

* Remove obsolete log closing statements

As logs are no longer stored in user_files, we do not need to close their handlers

* Refactor and try to simplify log module

* Remove demo code

* Refactor and update add-on manager logging API

* Simplify writing unit tests for add-ons that use logging

Loggers are likely to be also employed in non UI code, so it seems like a good idea to decouple them from requiring a running Anki instance to work (thus freeing add-on authors from the need to mock Anki APIs in their tests).

* Fix arguments and drop obsolete inline instructions

Lets add a section on logging to the add-on docs instead

* Drop unnecessary import

* Supply logging basicConfig force option by default

Until we change the module import order and thus ensure that `log` is always evaluated before third-party dependencies have a chance to initialize the root logger, `force` is non-optional.

* Fix formatting and type errors

* Restore mediasrv type ignore comments

* Add note on prefix API stability

* Consistently use addon_from_module in new code

* Use logFolder rather than profileFolder

* Adjust method name for PEP8

* Change loggerDict access path, satisfying pylint

* Drop unused import and use lazy % formatting

* lint fix

* refactor .log_folder -> .addon_logs
store anki.log under logdir

* Fix method name (dae)

* Disable file-based logging in the backend (dae)

I have never found this useful, and it logs nothing by default, so
creating/opening the file is a waste. Removing it also ensures that
addon_logs() is solely used for add-ons.

---------

Co-authored-by: Glutanimate <5459332+glutanimate@users.noreply.github.com>
2024-02-11 16:41:50 +10:00
Lucas Scharenbroch
146a3d936e
Fix corner rounding of alignment buttons in editor (#2989)
* Fix corner rounding of alignment buttons in editor

* Fix formatting

* Fix cascading button-rounding issues
2024-02-07 13:11:14 +10:00
Kai Knoblich
54b1cc5689
Honor NINJA_STATUS if already set (#2984)
* Honor NINJA_STATUS if already set

Allow build environments at downstream to use their own configured
NINJA_STATUS if set.

* Update CONTRIBUTORS
2024-02-01 14:56:14 +10:00
Kai Knoblich
42cc2c913c
Add support for offline builds (#2963)
* CONTRIBUTORS: Add myself to the contributors list

* Add support for offline builds

Downloading files during build time is a non-starter for FreeBSD ports
(and presumably for other *BSD ports and some Linux distros as well).

In order to still be able to build Anki successfully, two new
environment variables have been added that can be set accordingly:

* NO_VENV: If set, the Python system environment is used instead of
  a venv. This is necessary if there are no usable Python wheels for a
  platform, e.g. PyQt6.

* OFFLINE_BUILD: If set, the git repository synchronization (translation
  files, build hash, etc.) is skipped.

To successfully build Anki offline, following conditions must be met:

1. All required dependencies (node, Python, rust, yarn, etc.) must be
   present in the build environment.

2. The offline repositories for the translation files must be
   copied/linked to ftl/qt-repo and ftl/core-repo.

3. The Python pseudo venv needs to be setup:

   $ mkdir out/pyenv/bin
   $ ln -s /path/to/python out/pyenv/bin/python
   $ ln -s /path/to/protoc-gen-mypy out/pyenv/bin/protoc-gen-mypy

4. Create the offline cache for yarn and use its own environment
   variable YARN_CACHE_FOLDER to it:

   YARN_CACHE_FOLDER=/path/to/the/yarn/cache
   $ /path/to/yarn install --ignore-scripts

5. Build Anki:

   $ /path/to/cargo build --package runner --release --verbose --verbose
   $ OFFLINE_BUILD=1 \
     NO_VENV=1 \
     ${WRKSRC}/out/rust/release/runner build wheels
2024-01-31 09:13:46 +10:00
Pedro Lameiras
5849fc6f64
Make image occlusion's option buttons tabbable (#2966)
* Make image occlusion's option buttons tabbable

* Added myself to contributors

* Removed two-way binding
2024-01-29 12:49:28 +10:00
Harvey R
e116a53b70
Americanize "synchronisation" (#2935)
* Americanize "synchronisation"

* Update CONTRIBUTORS

* Add name to CONTRIBUTORS

* Americanize "synchronisation"

* Revert change

* Revert change to key name
2024-01-23 14:06:52 +10:00
Viktor Ricci
f544bdd041
Allow > inside HTML attributes (#2918)
* Allow > inside HTML attributes

* Don't add unnecessary (?:...) to HTML_MEDIA_TAGS
2024-01-01 14:09:30 +10:00
msisovic
7f976aaa56
Fix macOS clipboard issues (#2900)
* Added double-check of clipboard change when pasting.

* Added comment explaining changes, updated CONTRIBUTORS and about.py
2023-12-22 14:18:19 +10:00
Akash Reddy
a5bdb28849
Fix Mathjax can only be pasted once (#2869)
* Fix mathjax can be pasted only once

* Update about.py

* Update CONTRIBUTORS

* fix formatting
2023-12-05 10:01:25 +10:00
Shawn M Moore
f447f89d07
Remember endpoint we authenticated against in returned SyncAuth (#2864)
* Include endpoint we authed against in response

* Add self to contributors
2023-12-04 15:05:29 +10:00
gustavosmendes1
1bca45176a
Added contributors and edit about (#2855) 2023-11-30 10:15:05 +10:00
antecrescent
42145e8312
Update licensing information (#2850)
* Add myself to CONTRIBUTORS
2023-11-27 11:35:51 +10:00
Akash Reddy
9fd25a87ec
Fix switching of add & history buttons when selecting IO notetype (#2833)
* Fix switching of add & history buttons when selecting IO notetype

* Update CONTRIBUTORS
2023-11-20 16:36:25 +10:00
Ben Olson
7bcb57b89e
Resolve a11y for tag options buttons (#2787)
* resolve TagAddButton a11y
better comments to document tagindex reasoning

* resolved a11y for TagsSelectedButton
allow focus to TagsSelectedButton with Shift+Tab and Enter or Space to show popover

* safely ignore a11y warning as container for interactables is not itself interactable

* Update CONTRIBUTORS

* quick fix syntax

* quick fix syntax

* quick fix syntax

* quick fix syntax

* resolved a11y in accordance with ARIA APG Disclure pattern

* resolved a11y
ideally should replace with  with
a11y-click-events-have-key-events is explicitly ignored as the alternative (adding ) seems more clunky

* resolved SpinBox a11y
cannot focus on these buttons, so no key event handling needed (keyboard editting already possible by just typing in the field)
widget already properly follows ARIA APG Spinbutton pattern

* cleanup

* onEnterOrSpace() function implemented as discussed in #2787 and #2564

* quick syntax and such changes
2023-11-14 11:40:04 +10:00
Kieran Black
46890fbbaa
fix: refresh model list when legacy addon adds notetype (#2825)
* refresh model list when legacy addon adds notetype

When legacy addons add note types, they automatically add the note type to the collection models. When this was detected, the dialog box presenting the list of models was not being updated due to an early return in the code. This commit adds a list refresh along this path of execution to ensure the gui is updated with the newly added model.

* add trailing space to name in CONTRIBUTORS
2023-11-13 10:36:21 +10:00
snowtimeglass
b3da6f117b
Change tooltip strings for image occlusion center alignments (#2815)
- Fix the swapping of the strings

- Change the strings to make the meanings clearer

- Incidentally, add a name to CONTRIBUTORS
2023-11-09 12:02:51 +10:00
virinci
6e5edd94e0
Fix Linux install script CWD check (#2775) 2023-10-26 11:22:56 +10:00
Gustaf-C
4b6aadfe62
Tweak browser column labels to card type, note type (#2751)
* Tweak browser column labels to card type, note type

* Apply suggestions from code review
2023-10-20 12:46:09 +10:00
user1823
4c17a6964e
Rename Analyze to Evaluate in FSRS Deck Options (#2741)
* Update deck-config.ftl

* Update FsrsOptions.svelte

* Update CONTRIBUTORS
2023-10-17 09:53:24 +10:00
chandraiyengar
b35a11ffd6
Add profile name in profile deletion confirmation message (#2722)
* Add profile name in profile deletion confirmation message

* Update contributors

* leave old translation and add new one
2023-10-12 13:34:52 +10:00
virinci
d261d1e467
Fix ModuleNotFoundError: No module named 'distutils' (#2723) 2023-10-11 14:12:18 +10:00
Carlo Quick M.Ed
8d6b1e43bb
Updated README (#2718)
* Update README.md

* Update CONTRIBUTORS

* Removed unnecessary elements to README.md
2023-10-11 14:11:07 +10:00
Dominique Martinet
c555a9cf7a
Update rust-csv (#2703)
Upstream rust-csv 1.3.0 includes our patch and can be used instead of
the ankitects repo.

This fixes `cargo vendor`
2023-10-04 13:21:47 +10:00
Jarrett Ye
05499297e0
Fix first_rating_count & learn_cost (#2688)
* fix first_rating_count & learn_cost

* Update CONTRIBUTORS

* cargo clippy --fix

* cargo fmt
2023-09-27 18:31:40 +10:00
Michael Eliachevitch
2491b93ea6
More sensible lower FSRS progress indicator precision (#2684)
It's very helpful having a sub-permille precision in a progress
indicator, percent-precision or at most a tenth of a percent should be
sufficient for any indicator.

But in particular the compute-retention progress has 10 steps, i.e. the progress
increases in 10%-intervals (10%, 20%, ...), it *cannot* have sub-decimal
progress-percentages, see 2d5b19b494/src/optimal_retention.rs (L365-L368). So there integer percents should be
enough, everything else is misleading.

The compute-weights progress is currently (as of beta-2) not showing up at all.
Maybe if the bug is fixed it can show sub-percent percentages, so for know I changed that
to 0.1% precision. But I think integer percentages should be fine here as well,
so upon request I can fix that.

Also see my comment on this problem in https://forums.ankiweb.net/t/anki-23-10-beta/34912/39.
2023-09-26 14:01:05 +10:00
Sam Waechter
e7bf248a62
Fix unable to save field dialog if certain fields are deleted (#2663)
* Fix unable to save field dialog if certain fields are deleted

Implemented solution suggested in issue #2556

* Fix unable to save field dialog if certain fields are deleted

fixed code formating

* Fix unable to save field dialog if certain fields are deleted

Made new functions to check referencelessness.  Added unit test.
2023-09-18 14:33:56 +10:00
Damien Elmes
5004cd332b
Integrate FSRS into Anki (#2654)
* Pack FSRS data into card.data

* Update FSRS card data when preset or weights change

+ Show FSRS stats in card stats

* Show a warning when there's a limited review history

* Add some translations; tweak UI

* Fix default requested retention

* Add browser columns, fix calculation of R

* Property searches

eg prop:d>0.1

* Integrate FSRS into reviewer

* Warn about long learning steps

* Hide minimum interval when FSRS is on

* Don't apply interval multiplier to FSRS intervals

* Expose memory state to Python

* Don't set memory state on new cards

* Port Jarret's new tests; add some helpers to make tests more compact

https://github.com/open-spaced-repetition/fsrs-rs/pull/64

* Fix learning cards not being given memory state

* Require update to v3 scheduler

* Don't exclude single learning step when calculating memory state

* Use relearning step when learning steps unavailable

* Update docstring

* fix single_card_revlog_to_items (#2656)

* not need check the review_kind for unique_dates

* add email address to CONTRIBUTORS

* fix last first learn & keep early review

* cargo fmt

* cargo clippy --fix

* Add Jarrett to about screen

* Fix fsrs_memory_state being initialized to default in get_card()

* Set initial memory state on graduate

* Update to latest FSRS

* Fix experiment.log being empty

* Fix broken colpkg imports

Introduced by "Update FSRS card data when preset or weights change"

* Update memory state during (re)learning; use FSRS for graduating intervals

* Reset memory state when cards are manually rescheduled as new

* Add difficulty graph; hide eases when FSRS enabled

* Add retrievability graph

* Derive memory_state from revlog when it's missing and shouldn't be

---------

Co-authored-by: Jarrett Ye <jarrett.ye@outlook.com>
2023-09-16 16:09:26 +10:00
platynowy
23823d3135
added Translator (#2653)
* added Translator

added myself to the list (translated Anki, AnkiMobile and Anki Manual to Polish

* Update CONTRIBUTORS
2023-09-12 14:13:08 +10:00