Damien Elmes
9baa8530d5
move deck/notetype update hooks to gui
...
We need to migrate away from firing hooks in libanki, since libanki
methods may be running on a background thread, and hook consumers
typically expect the code to run in the main thread. We could document
it, but it would frequently be forgotten about, and could lead to
crashes.
https://anki.tenderapp.com/discussions/ankidesktop/41748-qobject-cannot-create-children-for-a-parent-that-is-in-a-different-thread-when-hitting-the-save-button-on-clayoutpy-window
2020-05-22 10:47:14 +10:00
Damien Elmes
8eada2b57d
add find_deck_in_tree()
2020-05-16 13:05:20 +10:00
Damien Elmes
f2086fc2e3
switch to new deck tree in deck browser
...
Saves us having to look up collapsed/filtered as we render, and gives
us type completion.
2020-05-16 10:52:14 +10:00
Damien Elmes
75d3eebafe
drop usage of nameMap in deckbrowser
...
It was unnecessary, and being called multiple times as we recursed
downwards, slowing things down.
2020-05-16 10:02:08 +10:00
Damien Elmes
238441f2d9
use the backend for the deck due tree
...
- approx 3x faster on a large test deck
- counts are no longer capped to 1000 in the tree
2020-05-12 21:13:33 +10:00
Damien Elmes
eff1b39e9f
fix deck_browser_did_render hook
2020-04-09 13:40:19 +10:00
Damien Elmes
e7452300a2
imports
2020-03-14 22:10:27 +10:00
Damien Elmes
522ee8fca7
drop the deck count warning
2020-03-14 19:41:33 +10:00
Damien Elmes
0c49431719
FString -> TR
2020-02-27 12:25:19 +10:00
Damien Elmes
4430c67069
rework Fluent handling
...
- all .ftl files for a language are concatenated into a single file
at build time
- all languages are included in the binary
- external ftl files placed in the ftl folder can override the
built-in definitions
- constants are automatically generated for each string key
- dropped the separate StringsGroup enum
2020-02-23 13:22:50 +10:00
Damien Elmes
42939fe0e4
remove unused import
2020-02-21 19:58:54 +10:00
Damien Elmes
49fe080636
add studied_today(), move to statistics.ftl
2020-02-21 18:01:15 +10:00
Damien Elmes
c5156a0f6b
Merge pull request #449 from glutanimate/html-content-section-hooks
...
Add hooks for modifying HTML body sections in the deck browser and overview screens
2020-02-18 08:20:01 +10:00
Glutanimate
8ff1a2e770
Bundle individual section hooks together into one
...
Uses new dataclass 'DeckBrowserContent'
2020-02-17 16:26:21 +01:00
Damien Elmes
1524e7dcac
split "Due" into three different contexts for translators
2020-02-17 14:41:01 +10:00
Glutanimate
d02de28f21
Add deck_browser_will_render_section hook
...
Allows add-on authors to specifcally target and modify individual
sections of the deck browser HTML body at string composition time.
2020-02-16 19:29:01 +01:00
Glutanimate
0e5dea4c9f
Assume that web assets without a specified subpath are under /_anki
...
Maintains compatibility with existing add-ons
2020-02-15 15:03:43 +01:00
Glutanimate
bbd667b0ff
Add webview_will_set_content hook & update supporting code accordingly
2020-02-12 22:00:13 +01:00
Damien Elmes
7fcb6b5672
pass instance to webview_did_receive_js_message instead of string
2020-02-09 08:59:29 +10:00
Arthur Milchior
75a8ef832b
Allow to change main window when overview/deckbrowser is shown
2020-02-08 08:09:12 -08:00
Damien Elmes
b8ad45c4e4
redraw top toolbar when deck list refreshed
...
Just a hack that allows users to click on Decks to adjust the colour
after a macOS theme change.
2020-01-31 13:31:31 +10:00
Damien Elmes
7dcbc7efec
basic night mode support
...
Forces the Fusion theme when running night mode, so we don't need
to work around platform themes that don't respond to the defined
palette.
Feedback/suggestions on the chosen colours welcome - _vars.scss is the
file to change if you want to experiment with adjustments.
2020-01-23 17:27:07 +10:00
Damien Elmes
d54f719558
add a webview_did_receive_js_message hook
2020-01-22 11:06:12 +10:00
Damien Elmes
02ec3f149c
update qt/ to use the new API
2020-01-20 20:10:38 +10:00
Damien Elmes
8310cb7a0e
add qconnect helper and some type hints
...
The type hints allow mypy to check the gui_hook calls, revealing a
bunch of places that are broken as they expect no arguments like the
legacy hooks.
To make mypy happy about PyQt's signal.connect(func), a qconnect()
helper has been added.
2020-01-16 07:41:23 +10:00
Damien Elmes
b09e7e8247
more tweaks for readability/consistency
2020-01-15 17:45:35 +10:00
Damien Elmes
cab572b63c
remove _hook/_filter suffix
2020-01-15 16:53:24 +10:00
Damien Elmes
660685375f
migrate most of the remaining runHook() calls
2020-01-15 12:46:53 +10:00
Damien Elmes
5876866565
tweaking the folder names again
...
hopefully that's the last of it
2020-01-03 07:48:38 +10:00