Commit graph

9376 commits

Author SHA1 Message Date
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
Damien Elmes
2b261cf363 Add Daniel to about screen
As always, anyone who has contributed and is missing, please let me
know, or send through a PR.
2022-03-30 13:49:07 +10:00
Damien Elmes
bae752b3c6 Don't attempt to localize numbers in SpinBoxFloat
Issue report: 
https://forums.ankiweb.net/t/anki-2-1-50-beta-6-release-candidate/18181/71

Localization was added in #1566. It works fine in the Qt5 build, but
the Qt6 build appears broken. This appears to be a change in Chromium,
and the latest Chrome has the same issue. Whether it's a legitimate bug
on their end, a deliberate change in behaviour, or we're doing something
wrong, I do not know.
2022-03-29 14:45:18 +10:00
Damien Elmes
448bc724e4 Update translations 2022-03-29 10:53:45 +10:00
RumovZ
3c9d998109 Fix SearchBuilder (#1754)
* Fix missing search grouping

* Fix SearchBuilder::or_join

* Unify search concatenations
2022-03-29 10:53:02 +10:00
Henrik Giesel
bbd45ebc10 Allow using keyup with registerShortcut (#1755) 2022-03-29 09:28:44 +10:00
RumovZ
39a1c5c229 Card type error (#1749)
* TemplateSaveError -> CardTypeError

* Don't show success tooltip if export fails

* Attach help page to error

Show help link if export fails due to card type error.

* Add type (dae)

* Add shared show_exception() (dae)

- Use a shared routine for printing standard backend errors, so that
we can take advantage of the help links in eg. the card layout screen
as well.
- The truthiness check on help in showInfo() would have ignored the
enum 0 value.
- Close the exporting dialog on a documented failure as well

* Fix local variable help_page
2022-03-28 22:17:50 +10:00
RumovZ
df2aa048e0 Add Deleted error and disable all bad browser rows (#1742)
* Add Deleted error and disable all bad browser rows

* Avoid error when opening the browse screen to a card with a missing note (dae)

* In cards mode, a missing note is NotFound, not Deleted (dae)

So we distinguish between referential integrity error, and explicit
deletion.

* Remove redundant try block
2022-03-28 19:06:19 +10:00
Damien Elmes
c59ce479e9 Update translations 2022-03-28 18:54:40 +10:00
Damien Elmes
8b7bd08a0d Stop directing users to the old add-ons support site 2022-03-28 18:54:18 +10:00