Commit graph

10216 commits

Author SHA1 Message Date
Damien Elmes
cab8121a86 Update translations 2023-05-18 18:08:56 +10:00
Ren Tatsumoto
ff9997b058 Allow the user to configure answer keys (#2502)
* add methods that allow the user to configure answer keys

* allow editing answer buttons in preferences

* import optional

* Give the layout referenced in code a clearer name (dae)

* Update placeholder text and make it translatable (dae)

The other items in the preferences screen don't have tooltips, so
placeholder text may be easier for the user to discover than a tooltip.
2023-05-18 17:47:51 +10:00
Martin Grottenthaler
9db5f577da Implement non elevated installer (#2497)
* changed install location and elevation

* change registry keys to HKCU
change context to current user

* filetype associations non elevated

* added an "upgrade" from elevated to non elevated

* added comment to clarify bug

* removed commented out registry entries

* Update CONTRIBUTORS

add mgrottenthaler to contributors

* change upgrade routine to manual uninstall

* added suggestion
2023-05-18 17:06:38 +10:00
Hikaru Y
7829a245b0 Upgrade Svelte (#2506)
* Bump Svelte version

* Ignore Svelte a11y warnings
2023-05-18 17:04:58 +10:00
Damien Elmes
b906e63f8e Hack around color setting failure in Qt6.5
Closes #2505
2023-05-18 16:36:16 +10:00
Damien Elmes
c068b98452 Add the ability to search for custom data properties
Closes #2491
2023-05-18 15:54:01 +10:00
Damien Elmes
f962c19cfa Fix inability to import csv when path contains single quote
https://forums.ankiweb.net/t/windows-10-2-1-62-qt6-blank-import-window/30231
2023-05-18 11:50:34 +10:00
Damien Elmes
39a28d75f1 Fix broken media importing in non-legacy apkg path
- Ensure our unit tests cover the non-legacy path, and check file
contents and not just existence.
- Pass `compressed` into copy_and_ensure_sha1_set(). We can't just
test for self.sha1.is_none(), as that fails in the case where an existing
media file was found in the legacy path.

https://forums.ankiweb.net/t/anki-media-file-corruption-when-exporting-png-files/30315
2023-05-18 11:33:01 +10:00
Damien Elmes
d5792db475 Add a .with_desktop_media_paths() helper 2023-05-18 11:02:02 +10:00
Damien Elmes
e204222016 Display a more informative message when attempting media op without folder 2023-05-18 10:48:25 +10:00
Damien Elmes
e576baac6d Store separate state/geometry for each Qt minor version
Quite a few users have been experiencing crashes recently that were
resolved by resetting their window positions/states. I presume this is
related to Qt updates, as there have been previous instances where old
state caused glitchy behaviour or crashes after a Qt upgrade.

The browser headers are now also reset when resetting window positions
in the preferences.
2023-05-18 10:04:30 +10:00
Damien Elmes
35ea6b8282 Remove offset workaround in restoreGeom()
Way back in Qt4, there was an issue where (some?) windows would open
at a different location to where they were previously open. I've tested
the primary windows in Qt 5.14 on macOS, and the issue no longer seems
to exist, so this code is no longer useful.

The qtmajor > 5 check was a mistake introduced in 98a161cec624bbb7e58f57c869741b349d96cc9f;
it was intended to limit the code to Qt 5.

A quick grep of an add-on snapshot indicates there are no add-ons that
were using the offset param, so it has been removed.
2023-05-18 10:04:30 +10:00
Austin S
f920602e71 Fix null error on window resizing (#2501)
* Fix null error on window resizing

* Be more specific in type cast (dae)
2023-05-17 16:52:38 +10:00
Damien Elmes
7402a6b3d0 Don't disable animations on card templates when reduce motion is on
We may wish to revisit this decision in the future, once we no longer
enable reduce motion by default to prevent the toolbar redraw bugs.

Closes #2499
2023-05-17 16:45:57 +10:00
Damien Elmes
fd0c4ab496 Show an error pop-up when csv import screen fails to load
https://forums.ankiweb.net/t/windows-10-2-1-62-qt6-blank-import-window/30231
2023-05-15 15:32:38 +10:00
Damien Elmes
6614457759 Add fractional scaling workaround 2023-05-15 14:34:01 +10:00
Damien Elmes
48bf9babd0 Update translations 2023-05-15 13:51:10 +10:00
Damien Elmes
18c8c7ad02 Bump version 2023-05-15 13:50:55 +10:00
Damien Elmes
6f176f342c Allow anki-console.bat to be run from any folder
https://github.com/ankitects/anki-manual/pull/137
2023-05-12 16:58:58 +10:00
Damien Elmes
63fb62d3e6 Rerun eslint rules when tsconfig changes 2023-05-11 15:13:49 +10:00
Damien Elmes
92192049c0 Add some missing tooltips
https://forums.ankiweb.net/t/two-editor-buttons-do-not-have-tooltips/30203
2023-05-11 15:10:27 +10:00
Damien Elmes
4b90fd94a8 Add es2019.string back to tsconfig
Our eslint tests were breaking, as it appears that later years do not
include APIs added in previous years, like trimStart()
2023-05-11 15:10:27 +10:00
Damien Elmes
9ec4bcbfd2 Log mpv invocation failure for debugging
https://forums.ankiweb.net/t/i-received-this-error-while-reviewing-a-deck-with-cards-that-had-video-mp4/30105
2023-05-11 14:47:23 +10:00
Hikaru Y
2431bfc3ea Fix custom font preloading sometimes not working (#2493)
It didn't work if both a reference to an external style sheet and
a description of a custom font are present in a style element.
2023-05-11 14:10:29 +10:00
Damien Elmes
635048414c Fix a panic when user sets a huge learning step 2023-05-11 09:10:22 +10:00
Damien Elmes
e6547bb9ab Automatically fetch win32 audio tools in .\run.bat 2023-05-11 09:10:22 +10:00
Hikaru Y
9a7a5a3574 Refactor CSS/image preloading; implement custom font preloading (#2356)
* Refactor CSS preloading

- Rename css.ts to preload.ts
- Rename type/function names
- Automatically remove style/link element on load/error event

* Refactor image preloading

- Reuse template element
- Change timeout value from 100ms to 200ms, as it often takes more than
  100ms to load even a single small image on a low-spec machine
- Refactor preloadAnswerImages():
  - Use 'new Image()' instead of <link rel=preload>
  - Stop calculating images that only appear on the answer side as
    cached images are resolved immediately

* Update tsconfig.json

es2020.string -> String.matchAll()
es2018.regexp -> RegExprMatchArray.groups

* Implement custom font preloading

Font files for some languages such as Chinese and Japanese can be as
large as 20MB, so we set the timeout value to 800ms for font preloading.
2023-05-10 13:26:02 +10:00
Damien Elmes
f1f1015d5a Fix unreadable bootstrap buttons when hovering
Closes #2297
2023-05-09 17:04:12 +10:00
Damien Elmes
47a8154c3a Update translations 2023-05-09 16:45:27 +10:00
XeR
912ad0d374 Fix sync client ignoring directories (#2490)
* Fix sync client ignoring directories

Current implementation of the sync client does not properly send requests to a
self-hosted sync server if the URL has directories.

If the self-hosted sync URL is `https://example.org/foo/bar/`, Anki is expected
to send requests to `https://example.org/foo/bar/sync/hostKey`. Instead, it will
discard the directories and wrongly send requests to
`https://example.org/sync/hostKey`.

Fixes: 1e6686f ("Fix panic with invalid sync server URL with port")

* Add XeR to contributors
2023-05-08 11:40:57 +10:00
Ren Tatsumoto
f54b3053d5 Enchance reviewer with new settings (#2489)
* add grading shortcuts

* add a new setting: grade with space

* new key: u for undo

* run ./ninja format

* rename property

* rename translation

* run ./ninja format
2023-05-08 11:04:18 +10:00
Matthias Metelka
3312ce03a9 Prevent skewing of resized images in editor (#2488)
* Unset inline size when shrinking images

to prevent skewing (https://forums.ankiweb.net/t/is-there-a-way-to-prevent-the-squish-skew-of-the-image-in-the-browser-editor/29925)

* Unset inline width/height for all images when shrinking is enabled
2023-05-05 19:16:06 +10:00
Damien Elmes
1d8c1f2c6d Stop printing dbus errors to the terminal
Even at every 5 minutes, it can be noisy.
2023-05-02 17:53:19 +10:00
Damien Elmes
809d43fba6 Update fcitx plugin
Closes #2487
2023-05-02 15:57:24 +10:00
Damien Elmes
3b8e875177 Update flask for security update
CVE-2023-30861

It doesn't look like it affects us.
2023-05-02 14:43:04 +10:00
Damien Elmes
20e47e2982 Fix CFBundleExecutable
https://forums.ankiweb.net/t/macos-version-of-anki-including-parent-dir-with-cfbundleexecutable-value/29900
2023-05-02 14:20:55 +10:00
Damien Elmes
97201add77 Mention that checkout path should not include spaces 2023-05-01 15:39:03 +10:00
Damien Elmes
2c8800d5bf Bump version 2023-05-01 12:26:37 +10:00
Damien Elmes
a174a04893 Update translations 2023-05-01 11:47:30 +10:00
Damien Elmes
da139071e6 Avoid firing click event in floatables when user drags the mouse
Alternative approach at fixing #2484
2023-05-01 11:44:24 +10:00
Damien Elmes
7f794f32fb Revert "Prevent MathJax editor from closing unexpectedly when selecting text (#2484)"
This broke mouse selection of dropdowns, as code that set closeOnInsideClick never
got a click signal as the floating area is closed before the click fires.

https://forums.ankiweb.net/t/anki-2-1-62-beta-release-candidate/29302/21

This reverts commit 389852ac17.
2023-05-01 11:17:09 +10:00
Damien Elmes
6bc07006f8 Update translations 2023-04-28 11:58:27 +10:00
Hikaru Y
389852ac17 Prevent MathJax editor from closing unexpectedly when selecting text (#2484)
* Prevent MathJax editor from closing unexpectedly when selecting text

* Revert "Prevent MathJax editor from closing unexpectedly when selecting text"

This reverts commit b43d33a6de.

* Prevent floating/overlay element from closing when selecting text

Apply suggestions from code review.

Use a 'mousedown' event instead of a 'click' event so that releasing
the mouse button at the end of a text selection operation when the
pointer is outside a floating/overlay element does not close it.

Co-authored-by: Damien Elmes <dae@users.noreply.github.com>

---------

Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
2023-04-28 11:39:50 +10:00
Damien Elmes
191e11a1f2 Improve import messaging when notetype has changed (#2483)
* Fix file extension not being appended on export

Regressed in #2427

* Improve import messaging when notetype has changed

- If the local notes are up to date, we don't need to warn about the
changed notetype, as no updates are required.
- Make it clearer that a changed notetype only affects updates.

Will update the docs as well.
2023-04-28 11:39:18 +10:00
Ren Tatsumoto
577e87878c Add a hook that allows to edit a note before it is added. (#2481)
* add note_will_be_added hook

* attempt to fix Tests.buildkite/linux/entrypoint

* attempt to fix Tests.buildkite/linux/entrypoint

* apply patch
2023-04-27 15:34:33 +10:00
Damien Elmes
55b95c580b Bump pyqt6-sip version 2023-04-27 11:43:01 +10:00
Damien Elmes
76380131a1 Add new pyqt6.5 checksums
Because the version number was not changed, this was breaking new installs.

https://www.riverbankcomputing.com/pipermail/pyqt/2023-April/045257.html
2023-04-26 22:07:59 +10:00
Damien Elmes
dd9cd6a514 Tweak unit test to reduce likelihood of flake under heavy load
https://buildkite.com/ankitects/anki-ci/builds/5698#0187bd42-c032-4078-909d-035a57892e0e
2023-04-26 21:38:04 +10:00
Damien Elmes
d611709cb7 Fix a few more cases where missing profile keys would lead to an error 2023-04-26 21:10:24 +10:00
Damien Elmes
6be2dce06f Use correct default values for missing keys 2023-04-26 19:11:48 +10:00