Commit graph

44 commits

Author SHA1 Message Date
Damien Elmes
b02badb224 update multi-line _() references 2020-11-18 11:32:22 +10:00
Damien Elmes
686b640e11 update some qt ngettext references 2020-11-18 09:22:27 +10:00
Damien Elmes
2feddb3d70 update temporary val="%s" references to standard ftl 2020-11-17 22:00:44 +10:00
Damien Elmes
066b1498ae merge bulk of qt/ - designer files still to do 2020-11-17 17:42:43 +10:00
Damien Elmes
ce3b08ac58 initial Bazel conversion
Running and testing should be working on the three platforms, but
there's still a fair bit that needs to be done:

- Wheel building + testing in a venv still needs to be implemented.
- Python requirements still need to be compiled with piptool and pinned;
need to compile on all platforms then merge
- Cargo deps in cargo/ and rslib/ need to be cleaned up, and ideally
unified into one place
- Currently using rustls to work around openssl compilation issues
on Linux, but this will break corporate proxies with custom SSL
authorities; need to conditionally use openssl or use
https://github.com/seanmonstar/reqwest/pull/1058
- Makefiles and docs still need cleaning up
- It may make sense to reparent ts/* to the top level, as we don't
nest the other modules under a specific language.
- rspy and pylib must always be updated in lock-step, so merging
rspy into pylib as a private module would simplify things.
- Merging desktop-ftl and mobile-ftl into the core ftl would make
managing and updating translations easier.
- Obsolete scripts need removing.
- And probably more.
2020-11-01 14:26:58 +10:00
Damien Elmes
2cc4fad19a fix import shortcut
https://forums.ankiweb.net/t/anki-2-1-34-35-beta/3569/21
2020-09-27 11:57:12 +10:00
Damien Elmes
366c5c4774 log manual reschedule, but ignore the log entry in the stats 2020-09-02 17:56:23 +10:00
Damien Elmes
8729edffbb update to latest black 2020-08-31 13:29:28 +10:00
Damien Elmes
fd45d7e2ae fix misaligned deck heading in RTL languages
https://forums.ankiweb.net/t/anki-2-1-29-beta/1220/2?u=dae
2020-07-22 11:00:39 +10:00
Damien Elmes
4d9d51a2af lint fixes 2020-06-02 17:58:14 +10:00
Damien Elmes
d7a2e78c0b change sync label to indicate sync state
- blue for normal sync, red for full sync required
- refactor status fetching code so we don't hold a collection lock
during the network request, which slows things down
- fix sync spinner restarting when returning to deck list
2020-06-02 13:23:01 +10:00
Damien Elmes
b552dfb986 add "immediate" progress back
on ops which we know are going to take time, it makes the interface
look more responsive to pop up the progress more quickly
2020-06-01 13:57:10 +10:00
Damien Elmes
e9fea26d1c use keyword args for calls with more than one argument 2020-05-24 09:12:47 +10:00
Damien Elmes
7eff75f5f3 hook expected an int, not a str 2020-05-22 11:27:40 +10:00
Damien Elmes
7676748e6c fix deletion of decks; allow deleting cards from default
https://anki.tenderapp.com/discussions/beta-testing/1967-2126-189-g7384df8f-crash-at-note-types-fields-save#comment_48353232
2020-05-22 11:24:56 +10:00
Damien Elmes
d31f2d8c23 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
f76b82d8ae add find_deck_in_tree() 2020-05-16 13:05:20 +10:00
Damien Elmes
c60229779c 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
6c3157a028 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
7ef72aba04 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
a1b1b7e428 fix deck_browser_did_render hook 2020-04-09 13:40:19 +10:00
Damien Elmes
cf8be89330 imports 2020-03-14 22:10:27 +10:00
Damien Elmes
81e472fdd1 drop the deck count warning 2020-03-14 19:41:33 +10:00
Damien Elmes
93c2e04267 FString -> TR 2020-02-27 12:25:19 +10:00
Damien Elmes
0d1a30c6d8 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
7d4d713c49 remove unused import 2020-02-21 19:58:54 +10:00
Damien Elmes
3a83d9844a add studied_today(), move to statistics.ftl 2020-02-21 18:01:15 +10:00
Damien Elmes
0a562c2eac 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
803b0432f1 Bundle individual section hooks together into one
Uses new dataclass 'DeckBrowserContent'
2020-02-17 16:26:21 +01:00
Damien Elmes
fd01cac4d7 split "Due" into three different contexts for translators 2020-02-17 14:41:01 +10:00
Glutanimate
c3c31d1454 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
28a394a074 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
d7836e3af8 Add webview_will_set_content hook & update supporting code accordingly 2020-02-12 22:00:13 +01:00
Damien Elmes
fc40182335 pass instance to webview_did_receive_js_message instead of string 2020-02-09 08:59:29 +10:00
Arthur Milchior
0d23f5dafb Allow to change main window when overview/deckbrowser is shown 2020-02-08 08:09:12 -08:00
Damien Elmes
d13e6cb29e 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
35435a130e 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
4f9c9e1770 add a webview_did_receive_js_message hook 2020-01-22 11:06:12 +10:00
Damien Elmes
263a04c887 update qt/ to use the new API 2020-01-20 20:10:38 +10:00
Damien Elmes
20db4ab2f3 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
b22dc71810 more tweaks for readability/consistency 2020-01-15 17:45:35 +10:00
Damien Elmes
8bad40152d remove _hook/_filter suffix 2020-01-15 16:53:24 +10:00
Damien Elmes
aa0300af90 migrate most of the remaining runHook() calls 2020-01-15 12:46:53 +10:00
Damien Elmes
2a00e0a6b0 tweaking the folder names again
hopefully that's the last of it
2020-01-03 07:48:38 +10:00
Renamed from anki-qt/aqt/deckbrowser.py (Browse further)