* right click and copy on image works
* renamed helper fn
* separated functionality of copy and copy image
* Update CONTRIBUTORS
* snake case
* Update CONTRIBUTORS
* start of load balancer
* add configuration options; option to load balance per deck
* formatting
* clippy
* add myself to contributors
* cleanup
* cargo fmt
* copyright header on load_balancer.rs
* remove extra space
* more formatting
* python formatting
* ignore this being None
only doing this cause python has awful lambdas and can't
loop in a meaningful way without doing this
* only calculate notes on each day if we are trying to avoid siblings
* don't fuzz intervals if the load balancer is enabled
* force generator to eval so this actually happens
* load balance instead of fuzzing, rather than in addition to
* use builtin fuzz_bounds rather than reinvent something new
* print some debug info on how its load balancing
* clippy
* more accurately load balance only when we want to fuzz
* incorrectly doublechecking the presence of the load balancer
* more printfs for debugging
* avoid siblings -> disperse siblings
* load balance learning graduating intervals
* load balancer: respect min/max intervals; graduating easy should be at least +1 good
* filter out after-days under minimum interval
* this is an inclusive check
* switch load balancer to caching instead of on the fly calculation
* handle case where load balancer would balance outside of its bounds
* disable lb when unselecting it in preferences
* call load_balancer in StateContext::with_review_fuzz instead of next to
* rebuild load balancer when card queue is rebuilt
* remove now-unused configuration options
* add note option to notetype to enable/disable sibling dispersion
* add options to exclude decks from load balancing
* theres a lint checking that the link actually exists so I guess I'll add the anchor back in later?
* how did I even update this
* move load balancer to cardqueue
* remove per-deck balancing options
* improve determining whether to disperse siblings when load balancing
* don't recalculate notes on days every time
* remove debug code
* remove all configuration; load balancer enabled by default; disperse siblings if bury_reviews is set
* didn't fully remove caring about decks from load balancer sql query
* load balancer should only count cards in the same preset
* fuzz interval if its outside of load balancer's range
* also check minimum when bailing out of load balancer
* cleanup; make tests happy
* experimental weight-based load balance fuzzing
* take into account interval when weighting as it seems to help
* if theres no cards the interval weight is just 1.0
* make load balancer disableable through debug console
* remove debug prints
* typo
* remove debugging print
* explain a bit how load balancer works
* properly balance per preset
* use inclusive range rather than +1
* -1 type cast
* move type hint somewhere less ugly; fix comment typo
* Reuse existing deck list from parent function (dae)
Minor optimisation
* changed anki-logo-thin.png to version with transparent background
* Revert "changed anki-logo-thin.png to version with transparent background"
This reverts commit 4c7e826a73.
* changed anki-logo-thin.png to version with transparent background
* added name to contributors as per contribution guidelines for first PR
* fixed contributors file rather than directly modifying about file
* Configure buddy widgets for labels in the Preferences dialog
Labels are often used to describe the purpose of a different widget like a combobox, edit field or a spinbox by providing a textual name for their functionality. The relation between a label and a widget is typically expressed by placing the label next to the relevant object. In addition to this visual linking intended for human users, frameworks usually also offer semantic way to link labels with other widgets, so the relation can be noticed by programs like screenreaders, which can figure out the correct textual description for the focused widgets based on this information.
By default, labels on their own are not focusable elements, so users dependend on keyboard navigation and speech get to notice only the widget types (textbox, spinbox, etc.) while moving around without any contextual information if labels are not linked. When the linking is done, the component names get included as well.
QT provides the "buddy" property for QLabel, which creates a semantic link between the label and its buddy widget.
This commit configures the buddy properties on labels of the Anki Preferences dialog.
* Configure spinbox suffixes in Preferrences dialog
QSpinBox provides a suffix property. This property makes it possible to display a measurement unit next to the component value, which is linked to it both visually and semantically for the GUI framework without affecting the spinbox value itself. For purposes of accessibility, it's better to use this property than simply place a label next to the component, since it can be directly accessed by screenreaders and other assistive technology.
This commit configures suffix properties for spinboxes in the Anki Preferences dialog. Note: Removal of the original unit labels may have altered the UI a little bit.
* Assign buddy widgets in the ID and password retrieval dialog
Set buddy widgets of the labels in the Get ID and password for synchronization dialog.
* Fix positioning/size of text boxes
* Style the suffixes of Preferences' QSpinBoxes
Style QSpinBox suffixes (for those that have one) in the Preferences dialog by prepending them by a space character.
* 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
* 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
* 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
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.
* 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.
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
* - 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
* 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
* 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>
* 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
* 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
* 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