Commit Graph

37 Commits

Author SHA1 Message Date
Luka Warren
0835129a00
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
RumovZ
9c54f85be6
Import submodules directly (#1662)
* Use submodule imports in aqt

* Use submodule imports in pylib

* More submodule imports in pylib

These required removing some direct imports to get rid of import cycles.
2022-02-13 13:40:47 +10:00
Hikaru Y
d2cbd15bbe
Fix memory leak in AnkiWebView (#1510) 2021-11-29 12:31:37 +10:00
Damien Elmes
a7812dedc0 switch to new-style PyQt scoped enums and Qt6
The enum changes should work on PyQt 5.x, and are required in PyQt 6.x.
They are not supported by the PyQt5 typings however, so we need to run
our tests with PyQt6.
2021-10-15 12:57:19 +10:00
Damien Elmes
5a094e78fa enable type checking of aqt/forms, and fix the new typing issues
Referencing an invalid translation should now break the build
2021-03-26 16:06:02 +10:00
Damien Elmes
0c338bfd53 update no-arg tr references in qt/ 2021-03-26 13:48:26 +10:00
Damien Elmes
57d7e3e2ab commit immediately when there's no active checkpoint
Reviews and operations on the backend that support undoing can now be
committed immediately, so they will not be lost in the event of a crash.

This required tweaks to a few places:

- don't set collection mtime on save() unless changes were made in
Python, as otherwise we end up accidentally clearing the backend undo
queue
- autosave() is now run on every reset()
- garbage collection now runs in a timer, instead of relying on
autosave() to be run periodically
2021-03-10 11:47:53 +10:00
Damien Elmes
88c002f4eb convert qt strings to f-strings with flynt
Also revealed an incorrect type def in editor.py that mypy wasn't
noticing before :-(
2021-02-11 10:09:06 +10:00
Damien Elmes
bb29ce88f3 minor code cleanups with pyupgrade
- pyupgrade --py38-plus --keep-runtime-typing --keep-percent-format
- third-party mpv and winpaths excluded
2021-02-11 09:43:40 +10:00
Damien Elmes
6426edb0ac more typing updates 2021-02-02 23:31:55 +10:00
Damien Elmes
a56b09b987 add a bunch of return types 2021-02-01 23:53:23 +10:00
Damien Elmes
f15715fb07 add types to various other files
Mainly automated with MonkeyType
2021-02-01 22:08:56 +10:00
Henrik Giesel
a7c8b021dd Satisfy formatter 2021-01-25 13:46:44 +01:00
Henrik Giesel
fdf4c6628f Add browserSearch bridge command 2021-01-25 13:44:19 +01:00
Damien Elmes
94064b8230 convert setWindowFlags call into helper, and fix invalid variables
"type: ignore" was masking the invalid references to self in places
like showText()
2021-01-07 14:24:49 +10:00
BlueGreenMagick
6224658c0d remove context help button 2021-01-06 22:15:48 +09:00
Damien Elmes
9e1eaacc06 Revert "Merge pull request #873 from hgiesel/otherjsdeps"
This reverts commit 62600051ae, reversing
changes made to 88553acb0d.

- Standard graphs render incorrectly on latest version - the wrong number
of days are shown, and the grid lines look wrong. Any version after 0.8.3
seems to suffer from this problem.
- Pie graphs and stack graphs don't render - they are provided in separate
files, and plot.js in previous Anki versions has them included in the one
file. To maintain compatibility with add-ons, we'd need to create a single
file as before, instead of importing multiple files.

If the above issues are fixed I'd be happy to merge this in again, but
as the old graphs are on the way out, it's probably not worth the effort.
2020-12-30 14:13:52 +10:00
Henrik Giesel
ec9b4aa273 Use new version of plotting library in stats.py 2020-12-29 12:13:25 +01:00
Henrik Giesel
98407c3fea Avoid building jquery to its own directory 2020-12-28 14:18:07 +01:00
Henrik Giesel
37dcdcc4c0 Rename references from vendor/jquery.js to vendor/jquery/jquery.min.js 2020-12-28 13:16:12 +01:00
Damien Elmes
ffa26fe4bc fix remaining _() references; remove unused imports 2020-11-18 12:43:46 +10:00
Damien Elmes
aea0a6fcc6 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
fd854630ff add load_ts_page() & avoid duplicate call 2020-09-01 10:24:38 +10:00
Damien Elmes
e5685254c6 reimplement congrats screen in Rust+Typescript 2020-09-01 10:24:38 +10:00
Damien Elmes
5520163bf7 apply standard zoom and background to graphs; prevent FOUC 2020-09-01 10:24:38 +10:00
Glutanimate
b89811bfba Add a couple of hooks to trigger add-on actions before showing stats 2020-07-16 21:48:46 +02:00
Damien Elmes
40f270c386 shift+click on the graphs button to access old graphs for now 2020-06-30 20:07:46 +10:00
Damien Elmes
101deb002b graphs now work in night mode 2020-06-30 16:23:46 +10:00
Damien Elmes
52cd9fc4b8 plug new graphs code into GUI
Still some work to do. Feedback welcome!
2020-06-29 15:53:56 +10:00
Damien Elmes
a8ad4abf37 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
2a0d40e15d stats area grouping box fix
https://anki.tenderapp.com/discussions/beta-testing/1928-cosmetic-issue
2020-05-08 16:03:29 +10:00
Damien Elmes
eec3fcf87a use qconnect everywhere, and fix some typing issues
a step towards check_untyped_defs in aqt, but there's still 100+
issues to resolve
2020-05-04 13:23:08 +10: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
Glutanimate
df2a7b06ef Refactor web view title setting and add titles to all web views
Simplifies debugging web views
2020-02-12 21:03:11 +01:00
Damien Elmes
91326ec6d9 only apply padding fix to stats screen
It was breaking the display of dialogs like the filtered deck screen
2020-02-02 13:07:24 +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