Commit graph

2365 commits

Author SHA1 Message Date
Damien Elmes
447bd2671c Merge pull request #1273 from hgiesel/macshortcuts
Execute Ctrl+C/V/X/A via execCommand in editor
2021-07-04 16:02:52 +10:00
Damien Elmes
289845a049 remove old Mac shortcut code completely
The shortcuts seem to work correctly without it on Qt 5.14, so this
code seems to have only been required for older Qt releases.
2021-07-04 16:00:23 +10:00
Damien Elmes
29808094c8 Merge pull request #1271 from hikaru-y/preload-images
Preload answer images
2021-07-04 15:50:55 +10:00
Damien Elmes
d0480ff529 Merge pull request #1270 from RumovZ/flag-manager
Add flag manager and hook
2021-07-04 15:45:11 +10:00
Damien Elmes
b21af06d75 stop (un)escaping media filenames
Back in the WebKit days, images with Unicode filenames would fail to
appear if they weren't percent-escaped. This no longer seems to be the
case - with this patch, images appear correctly on the Mac and Windows
platforms I tested with.

Fixes https://forums.ankiweb.net/t/anki-2-1-45-beta/10664/96
Fixes #1219
2021-07-04 15:27:29 +10:00
hikaru-y
bf93324448 Preload images to be displayed on answer side 2021-07-03 21:33:00 +09:00
Henrik Giesel
b74258f79e Satisfy qt formatter 2021-07-03 01:54:10 +02:00
Henrik Giesel
5b2290f868 Execute Ctrl+C/V/X/A through execCommand in editor (so we can customize it) 2021-07-03 01:48:49 +02:00
RumovZ
94cc0cf901 Add flag manager and hook
'FlagManager' allows cached access to the flag objects, takes care of
renaming flags and notifies GUI components with the hook
'flag_label_did_change'.
2021-07-02 11:16:10 +02:00
Henrik Giesel
db4cbfcb26 More uniform file naming
kebap-case for .ts, .scss, .html, and directories
2021-07-01 12:24:16 +02:00
Henrik Giesel
01cc9df232 Add flag icons from mdi after all
- This way, we can also use their modifier versions with little pluses/minuses
2021-07-01 01:16:50 +02:00
Henrik Giesel
d5f8a6e50c Remove multiple icons, new notetype/cardtype icons 2021-07-01 01:12:11 +02:00
Henrik Giesel
eec7eae885 Remove name_prefix from field sidebar item 2021-06-30 21:02:23 +02:00
Henrik Giesel
e1c171b819 Add missing type hint 2021-06-30 21:02:23 +02:00
Henrik Giesel
32f3c5dbe7 Replace card state and clock icon 2021-06-30 21:02:23 +02:00
Henrik Giesel
1850f24c4b Replace saved search icon 2021-06-30 21:02:23 +02:00
Henrik Giesel
5031bafb61 Add NOTETYPE_FIELD sidebar items 2021-06-30 21:02:23 +02:00
Henrik Giesel
fecceb1997 Add notetype icons 2021-06-30 21:02:23 +02:00
Henrik Giesel
5fe2519619 Add new icons for decks 2021-06-30 21:02:23 +02:00
Henrik Giesel
d9a368631f Add tag_multiple icon 2021-06-30 21:02:23 +02:00
Damien Elmes
309f5ee528 minor follow-up to #1257
No need for a separate argument, as we only want to scroll when
searching.
2021-06-29 11:53:10 +10:00
Damien Elmes
8743ccf682 Merge pull request #1257 from abdnh/sidebar-scroll-to-first-match
Scroll to first sidebar search match
2021-06-29 11:44:28 +10:00
Damien Elmes
2bada06570 use inner function instead of return value in _expand_where_necessary() 2021-06-29 11:40:59 +10:00
abdo
27313ba53d Scroll to first sidebar search match 2021-06-28 14:44:09 +03:00
RumovZ
1be1ca5911 Fix id check for today and card state items 2021-06-28 12:55:59 +02:00
Damien Elmes
c0dccee9fa Merge pull request #1252 from RumovZ/fix-tag-expand
Fix expanding/collapsing tags triggering refresh
2021-06-27 18:45:29 +10:00
Damien Elmes
f9560586cb PEP8 collection.py 2021-06-27 15:12:22 +10:00
Damien Elmes
fba156ec93 PEP8 models.py 2021-06-27 14:30:00 +10:00
Damien Elmes
3c46c9a7eb PEP8 decks.py 2021-06-27 14:02:48 +10:00
Damien Elmes
d6e3964151 PEP8 cards.py 2021-06-27 12:12:23 +10:00
Damien Elmes
d73231dbdc PEP8 notes.py
An example of how we can start migrating the codebase to PEP8:

- enable invalid-name at the top
- use bazel run pylib:pylint to identify names that need renaming
- use PyCharm or similar to rename the functions/variables
- in the cases where the conversion is not just snake_case, use
.register_deprecated_aliases()

+ removed the __repr__() definition, it dumps all the note content
and obscures the error message
2021-06-26 11:38:59 +10:00
Damien Elmes
5e41eb7565 add a helper so we can get semi-automatic camelCase conversion 2021-06-26 11:33:35 +10:00
Damien Elmes
5d106a4c93 Merge pull request #1254 from RumovZ/sidebar-menu-hook
Add hook "browser_sidebar_will_show_context_menu"
2021-06-26 08:42:59 +10:00
Damien Elmes
f9dd95254b revert to % format string to avoid breaking add-on
partially reverts 3572f0a0c6

https://forums.ankiweb.net/t/anki-2-1-45-beta/10664/50
2021-06-26 08:39:16 +10:00
Damien Elmes
3670a291a9 fix error when user confirms adding cloze to basic type 2021-06-26 08:35:24 +10:00
RumovZ
5cc2932fcb Add hook "browser_sidebar_will_show_context_menu" 2021-06-25 17:01:17 +02:00
RumovZ
7a82ea01b8 Fix expanding/collapsing tags triggering refresh 2021-06-24 17:27:53 +02:00
hikaru-y
95a8d140e4 Set background-color of body to var(--window-bg)
required to emulate day mode in clayout
if background-color is not set in .card styling
2021-06-24 23:47:14 +09:00
hikaru-y
2ed9f69cd7 Toggle night-mode class of documentElement when action triggered 2021-06-24 23:47:06 +09:00
hikaru-y
754e7c753d Set --window-bg of day/night mode to proper colors
including the following changes:
- rename "_getWindowColor" to "get_window_bg_color" to follow PEP8
- add "night_mode" argument to "get_window_bg_color"
- make it possible to get the correct colors regardless of the current theme
2021-06-24 23:46:48 +09:00
hikaru-y
3eb4321087 Store default palette before "fusion" QStyle is applied
Once a QStyle different from the system default is applied, the system default palette can no longer be retrieved with standardPalette().
2021-06-24 23:46:11 +09:00
Damien Elmes
cadf499216 fix pin toggle causing saved tags to get lost 2021-06-24 20:16:21 +10:00
Damien Elmes
efd6d47a05 v3 scheduler: experimental -> beta 2021-06-24 14:46:09 +10:00
Damien Elmes
66aa225965 don't wait for images before revealing
Currently there's a nasty blink when revealing the answer if the answer
has images on it, as the entire card is hidden, and not shown again until
the images have loaded. This patch removes the wait, so text should appear
more quickly, but it will mean the images may pop in.

We still wait for images before scrolling, to avoid a scroll to the wrong
location.

There's plenty of scope to improve this further - preloading images,
rendering MathJax in advance, etc, but those changes will need to wait
for now. #1120 has some related discussion.
2021-06-24 12:22:25 +10:00
Damien Elmes
4ffca62afe allow customization of default search text
https://forums.ankiweb.net/t/whats-the-default-search-when-browsing-now-also-how-do-i-choose-to-browse-current-deck/8922
2021-06-24 11:24:30 +10:00
Damien Elmes
f4111fca00 drop crash.log support
I don't recall it ever helping to resolve a bug, and presumably we can
still use it in the future via the PYTHONFAULTHANDLER env var if
necessary.
2021-06-24 10:08:31 +10:00
Henrik Giesel
b08b4ef2c8 Call update_notetype_legacy after toggling sticky 2021-06-21 15:48:22 +02:00
Damien Elmes
d89c538c48 in/out -> request/response
The saved characters weren't worth the increased difficulty when
reading, and the fact that we were deviating from protobuf norms.
2021-06-20 15:49:20 +10:00
Damien Elmes
532ac8b511 Merge pull request #1230 from RumovZ/fields-check
Check for misplaced or missing clozes when adding and in the editor
2021-06-17 21:26:16 +10:00
Damien Elmes
4e7e45e3cf show correct card count when removing multiple templates
https://forums.ankiweb.net/t/error-in-card-type-deletion/10868
2021-06-17 15:51:21 +10:00