Commit graph

9385 commits

Author SHA1 Message Date
Damien Elmes
b3d05ef940 Add workaround for unwanted CF_HTML header when pasting on Windows
Fixes #1751 for now; hopefully we can roll this change back once 6.3.1
is out in 3-4 weeks.
2022-04-20 17:23:11 +10:00
Damien Elmes
c801d78949 Add workaround to ensure internal pastes flagged on Windows/Qt6
Fixes #1793
2022-04-20 17:05:24 +10:00
Damien Elmes
88e09e78c5 Bump version 2022-04-20 16:40:49 +10:00
Damien Elmes
7cf318e290 Default to X11 on Qt6 builds as well
Qt6 no longer appears to require QT_QPA_PLATFORM to be set.

https://forums.ankiweb.net/t/blury-interface-with-gnome-wayland-and-fractional-scaling/19196/4
2022-04-20 14:41:01 +10:00
Henrik Giesel
aff1bae9e5 Add some component comment (#1779)
* Add a component comment for NoteEditor

* Move comments above component template

* EditorField -> EditingArea
2022-04-19 17:20:26 +10:00
Damien Elmes
38871af0fa Load page script after body created (#1802)
document.body must exist by the time the top level Svelte component
initializes.

https://forums.ankiweb.net/t/2-1-50-editor-wont-show-when-addons-load-many-js-files/19036
2022-04-19 17:16:56 +10:00
Damien Elmes
3aa3594be2 Close browser before full sync or colpkg import/export
Closes #1797
2022-04-19 17:10:34 +10:00
Damien Elmes
97eb54ec77 Switch strong/em back to b/i
In the absence of strong arguments either way, and given the fact that
strong/em has broken a few (perhaps rare) use-cases, reverting seems
prudent. But happy to revisit this again in the future if someone has
a convincing argument for why we should be doing it differently.

Closes #1807
2022-04-19 16:28:44 +10:00
Henrik Giesel
3d429020b0 Fix resetting of formatting modes when pressing modifer or dead keys (#1811)
* Fix shift removing bold formatting

* Remove input handler on selection change

We listened to "non-input events" mostly to catch events that
change the selection (like Ctrl-a, or arrow keys) anyway
2022-04-19 16:08:32 +10:00
Luka Warren
ef7ee0951b Fix issue #1114 by scrolling the user to the top of the page (#1810)
* Scroll stats to top when exporting (#1114)

It's obviously a bit of a "hacky" solution, since it's slightly jarring for users to scroll down, click export, then find themselves all the way at the top again, but it's somewhat less confusing than wondering why your PDF is broken :-)

* Clarified comment in stats.py (#1114)

* Apply scrolling fix to new stats screen, not legacy stats (dae)

Also wait for JS callback before saving the PDF, as JS is executed
asynchronously.
2022-04-19 15:39:32 +10:00
Damien Elmes
b4cd2a3dab Fix compatibility with older macOS versions
https://forums.ankiweb.net/t/anki-2-1-50-qt5-wont-open/19091
2022-04-15 17:35:05 +10:00
Damien Elmes
511ba5ebe4 Add back support for custom mountpoint in card stats
The move to separate .html files broke our legacy card stats routine.

Related: 1c5077ab45
2022-04-15 15:30:05 +10:00
Damien Elmes
106c067a7a Fix copying text to external apps when running on Gnome
Mutter seems to get confused if we mutate the keyboard in dataChanged().

Closes #1799
2022-04-15 12:09:56 +10:00
RumovZ
117eafb6ee Store last position when scheduling as review (#1800) 2022-04-14 18:53:58 +10:00
RumovZ
13112465a7 Fix selector index after programatic search (#1796) 2022-04-14 18:46:40 +10:00
Damien Elmes
64d6be3ae2 Fix illegible calendar buttons in dark mode on Mac/Linux
https://forums.ankiweb.net/t/macos-apple-silicon-2-1-50-dark-mode-statistics-heatmap-buttons-dont-have-icons/18951

This button code is in need of a cleanup.
2022-04-13 13:53:45 +10:00
Damien Elmes
509c2f8f31 Sort field change without field change should mark schema modified
Closes #1789
2022-04-10 08:52:55 +10:00
Damien Elmes
100e0d65b3 Add mock stdout/stderr for console=False case on Windows
PyInstaller provided a NulWriter when running in GUI mode, but stdout/
stderr now default to None with PyOxidizer.

Fixes #1786
2022-04-09 16:48:32 +10:00
Abdo
19e2909a54 Allow passing args to anki-console.bat (#1785) 2022-04-09 14:40:26 +10:00
roxgib
b5e51cc2b0 Add minimumContentsLength property to templatesBox (#1781)
Addresses #1777 by adding the `minimumContentsLength` property to the comboBox, which causes the size policy to not require expanding beyond that amount while still expanding if the user stretches the window manually.

Note that users who were previously experiencing large window widths due to the previous behaviour might see the same size again due the geometry being restored.
2022-04-09 13:55:03 +10:00
Aristotelis
266370de07 Fix a number of bugs with add-on conflict resolution (#1780)
* Always enable manually installed add-ons

Ensures that manually installed add-ons are enabled after the installation, even if previously disabled.

Prevents scenarios where users could end up with no active add-on build (e.g. when switching between stable add-on builds distributed via AnkiWeb and betas distributed via GitHub).

* Improve type annotations

* Also enable disabled AnkiWeb add-ons upon interactive installation

Applies to add-ons that users actively install via their AnkiWeb ID. Updates are exempt, preserving whatever status add-ons were in.

* Prevent disabled add-ons from triggering conflicts

* Fix download_addons() not passing on force_enable argument (dae)
2022-04-09 13:51:59 +10:00
Henrik Giesel
1d565837e2 Speed up editor by lazily loading CodeMirror - Second try (#1776)
* Revert "Revert "Speed up editor by lazily loading CodeMirror (#1766)""

This reverts commit bb420f9cd2.

* Pass in options via action update + Make access to editor optional
2022-04-09 13:25:54 +10:00
RumovZ
1a1b5a1eaa Implicitly group when joining searches (#1759)
* Implicitly group when joining searches

* Allow joining search types directly

* Test search joining

* Add comment for future selves (dae)

* Add one more assert that shows nested grouping (dae)

* Join user searches without grouping again

* Flatten a few clauses in custom study (dae)
2022-04-09 13:22:27 +10:00
Abdo
ba279bd384 Add relative overdueness to review order (#1757)
* Add relative overdueness to review order

* Add test for relative overdue
2022-04-09 13:20:09 +10:00
Damien Elmes
0707cf27fb Update translations 2022-04-09 13:08:35 +10:00
Damien Elmes
ab1a531dd9 Garbage-collect unused FTL strings
Two strings related to scheduler upgrade have been manually excluded,
as we may be able to reuse them for a future V3 update.
2022-04-09 12:39:50 +10:00
Damien Elmes
7f8bc82669 Don't store used FTL keys in git
In hindsight, we don't really need to keep the lists stored in git, as
they're easy enough to generate, and GC runs are infrequent.
2022-04-09 12:38:54 +10:00
Damien Elmes
f8f06a9aa8 Bump version 2022-04-09 11:43:27 +10:00
Damien Elmes
3b711e3b91 Update translations 2022-04-06 11:51:49 +10:00
Damien Elmes
b435129b53 Tweaks to video driver handling
- Use a separate `gldriver6` file for configuring Qt6 so we don't
pick up old settings, or cause problems when switching back and forth.
- Default to OpenGL/auto instead of software, as that was what we
were using throughout the beta period.
- Try to detect driver failure on startup. Untested.
- Hide the selector in the preferences again, as if Anki is unable
to automatically switch drivers, the user could change the setting
and then not be able to get back into Anki.
2022-04-06 11:35:49 +10:00
Damien Elmes
bb420f9cd2 Revert "Speed up editor by lazily loading CodeMirror (#1766)"
This reverts commit 5d3a423b21.

This caused a regression that needs looking into:
https://github.com/ankitects/anki/issues/1775
2022-04-06 11:08:32 +10:00
Damien Elmes
d63906ac64 Update translations 2022-04-05 11:23:07 +10:00
Damien Elmes
9a7adda48c Match editor background to widget background in day mode 2022-04-05 10:55:25 +10:00
Damien Elmes
b9ea704f99 Fix invisible tag input in Qt5 (thanks to Hikaru)
Closes #1768
2022-04-05 09:53:36 +10:00
RumovZ
9c52e66309 Template order (#1769)
* Improve new card sort order tooltip

* Use card type instead of template in deck config

* Card type ordinal → card type number
2022-04-04 09:50:36 +10:00
Damien Elmes
6399421bbb Expose video driver settings on Qt6, sans ANGLE 2022-04-03 19:57:58 +10:00
Henrik Giesel
5d3a423b21 Speed up editor by lazily loading CodeMirror (#1766) 2022-04-03 19:00:20 +10:00
Damien Elmes
b8551a2d26 Add link to Wayland issues page 2022-04-03 16:50:00 +10:00
Damien Elmes
fa146849fd Colpkg import now marks collection as modified
Addresses a corner case where a backup is imported into an
unchanged collection, resulting in the sync indicator showing a full
sync is required, which doesn't go away as syncing thinks no changes
are required.

An alternative way to solve this would be to reverse the order of checks
in the syncing code. It would have the advantage of retaining the
modification time of the backup, but any action like clicking on a deck
would cause it to be updated anyway, so I'm not sure that buys us much.
2022-04-03 16:07:39 +10:00
Damien Elmes
b5a2155111 Call browser show hook prior to initiating search
https://github.com/ankipalace/advanced-browser/issues/141
2022-04-02 21:42:49 +10:00
Damien Elmes
53727380b5 Don't rely on frontend to cap time taken in v3 2022-04-02 20:06:23 +10:00
Henrik Giesel
b7c3145619 Fix HighlightColorButton setting last text color (#1765) 2022-04-02 14:58:32 +10:00
Henrik Giesel
1695d3f8b0 Set caret inside chemical expression in Mathjax (#1763) 2022-03-31 23:39:49 +10:00
Damien Elmes
09eb3cec36 Update translations 2022-03-31 14:48:08 +10:00
Damien Elmes
e2d54bc8f2 Tweak cloze deletion labels 2022-03-31 14:47:51 +10:00
RumovZ
8ea9da36bd Also restore/keep position of new cards (#1760)
* Also restore/keep position of new cards

* Refactor Card::last_position()
2022-03-31 14:31:13 +10:00
Damien Elmes
5254d541e1 Handle gaps in media in colpkg imports
Our old Python code was also skipping numbers when it encountered a
directory, leading to a colpkg that couldn't be imported with our new
code.
2022-03-31 13:32:38 +10:00
Henrik Giesel
3747dbaee4 Add extra button group for cloze commands (#1756)
* First attempt at adding a directory for icons under //ts

* Fix image import

* Fix import order

* Add cloze button group

* Fix issue with toolbar.toolbar dynamically slottable

* Change tooltip for repeating cloze deletion

* Fix repeat cloze button not working on macOS (dae)
2022-03-31 13:30:00 +10:00
Henrik Giesel
611d173b54 Fix infinite update loop in editor with invalid input HTML (#1761)
* Use async function in PlainTextInput

* Clean up PlainTextInput

* Refactor logic from {Rich,Plain}TextInput into own files

* Remove prohibited tags on content.subscribe which also parses the html
2022-03-31 11:17:13 +10:00
Damien Elmes
c9c0cb6a14 Fix "repeat cloze" shortcut regression
Closes #1748 again.
2022-03-30 14:52:16 +10:00