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
Henrik Giesel
43171c02af
Allow inclusion of external icons into aqt/forms/icons
...
+ Replace old tag icon with mdi tag and tag-off icon
2021-06-16 17:19:21 +10:00
Henrik Giesel
8fd024c020
Make Browser root nodes use "_*" uniformly
2021-06-16 17:19:21 +10:00
Damien Elmes
521a158406
update to latest mypy
...
mypy's move to external types-* packages is a PITA, as it requires them
to be installed in site-packages, and provides no way to specify a custom
site-packages folder, necessitating extra scripts to mock the
site-packages path, and copy+rename the stub packages into a separate
folder.
2021-06-16 16:04:59 +10:00
RumovZ
be54c4352a
Merge cloze hint divs into one
2021-06-15 08:43:18 +02:00
RumovZ
9ae6df9b88
Make missing cloze a warning again
2021-06-15 08:43:00 +02:00
Thore
9a4e248317
Add hook to onDelete in AddonsDialog ( #1232 )
...
* add hook
* add me to CONTRIBUTORS
* adjust hook to comments
* Update CONTRIBUTORS
2021-06-15 10:01:29 +10:00
RumovZ
f11b39c817
Fix filtered deck from browser
...
https://forums.ankiweb.net/t/anki-2-1-45-beta/10664/14
2021-06-13 08:59:23 +02:00
RumovZ
3572f0a0c6
Add editor hints for cloze errors
2021-06-12 17:35:40 +02:00
RumovZ
46ee710a06
Check for out-of-place/missing clozes when adding
2021-06-12 10:05:42 +02:00
Damien Elmes
4c9c1d4ebf
prevent cmd+c in webview with empty selection from crashing on macOS
...
https://forums.ankiweb.net/t/command-c-on-crashes-anki-2-1-41-on-mac/10684
2021-06-11 19:58:20 +10:00
Damien Elmes
fca3c08541
Merge pull request #1224 from kelciour/mpv-playlist-fix
...
Keep the internal mpv playlist from growing on
2021-06-10 22:28:24 +10:00
Damien Elmes
153e1e8d41
new change notetype implementation for the frontend
...
- changes can now be undone
- the same field can now be mapped to multiple target fields, allowing
fields to be cloned
- the old Qt dialog has been removed
- the old col.models.change() API calls the new code, to avoid
breaking existing consumers. It requires the field map to always
be passed in, but that appears to have been the common case.
- closes #1175
2021-06-10 22:19:24 +10:00
kelciour
5ff2b69c0d
keep the internal mpv playlist from growing on
...
https://forums.ankiweb.net/t/audio-tracks-get-clipped-at-the-end/10289/5
2021-06-10 11:28:57 +03:00
Damien Elmes
e589edf6fd
when focusing current card, position at top
...
trying out the changes mentioned on
https://github.com/ankitects/anki/pull/1222#discussion_r648051997
2021-06-09 21:01:29 +10:00
Damien Elmes
379317cfe0
ensure current card centered even if it was already visible
...
Otherwise if a user reviews a card while keeping Browse open, the
card may not be centered if it was already in view.
2021-06-08 16:22:56 +10:00
Damien Elmes
0cd7aee339
add card info action to reviewer; move note actions together
2021-06-08 14:23:23 +10:00
Damien Elmes
94ef3102d1
don't wait before scrolling to current card
...
https://github.com/ankitects/anki/pull/1222#discussion_r647017566
2021-06-08 12:54:05 +10:00
Damien Elmes
e65eca102e
fix preferences screen indiscriminately triggering queue rebuild
2021-06-08 12:11:31 +10:00
Damien Elmes
aaba9a777a
fix note changes triggering a queue rebuild
2021-06-08 12:09:35 +10:00
Damien Elmes
c63e3ed72d
Merge pull request #1222 from RumovZ/browser-card
...
Change handling of browser's card parameter
2021-06-08 09:32:43 +10:00
Damien Elmes
e2bc97f098
Merge pull request #1221 from kelciour/audio-pause-fix
...
Audio pause fix
2021-06-08 09:23:11 +10:00
RumovZ
b09d71c2ec
Change handling of browser's card parameter
...
If a search is provided execute it, else search for current deck.
Then try to select and scroll to the provided card.
2021-06-07 16:42:17 +02:00
kelciour
fb36ebea82
use 'cycle' command to toggle pause
2021-06-07 01:54:07 +03:00
kelciour
723981d1a9
workaround for audio tracks get clipped at the end
2021-06-07 01:45:59 +03:00
kelciour
8152d3fb25
fix audio is paused unusual
...
closes #1164
2021-06-07 01:09:44 +03:00
Damien Elmes
998a3c0f7f
add Rescheduled to Today section of sidebar
...
https://forums.ankiweb.net/t/anki-2-1-45-alpha/10061/105
2021-06-05 12:55:07 +10:00
Damien Elmes
c608c64658
fix CSV import ignoring selected deck
...
This is a stop-gap - once the importing code is refactored, we
should pass in the desired deck directly.
https://forums.ankiweb.net/t/anki-2-1-45-alpha/10061/102
2021-06-04 20:37:45 +10:00
Damien Elmes
8b584e3f7c
Merge pull request #1218 from cherryblossom000/help-links
...
fix documentation links
2021-06-04 15:44:16 +10:00
Damien Elmes
fb0eaf8e8e
another workaround for timeboxing issue
2021-06-04 15:25:30 +10:00
Damien Elmes
52195cbc5a
remove 'flag ' prefix from flag names
2021-06-04 15:03:17 +10:00
cherryblossom
462da55fd5
fix documentation links
2021-06-03 16:51:03 +10:00
Damien Elmes
f0bb3fabba
make sure install.sh is run from the correct folder
...
https://forums.ankiweb.net/t/upgrade-doesnt-work-free-disk-space-is-written-full/10500/2
2021-06-03 10:50:32 +10:00
Damien Elmes
bb94ded8ba
catch all recording errors; mention permission
...
https://forums.ankiweb.net/t/i-have-an-error-when-i-try-to-record-of-audio/10483
2021-06-02 12:20:40 +10:00
Damien Elmes
d38f57cf3c
Merge pull request #1213 from RumovZ/new-flags
...
Add pink, turquoise and purple flags
2021-06-02 11:22:26 +10:00
Damien Elmes
512dfd59cd
limit custom study to 100 tags
...
The hard limit from sqlite may be larger, but things slow down as more
tags are selected.
https://forums.ankiweb.net/t/unable-to-create-custom-test/10467
There are a number of things that could be improved here:
- we should show a live count so users are aware of the limit
- we should be filling in the parent tags when they're not explicitly
listed on a card
- we should reconsider disabling the 'tags to include' by default
It may make sense to defer these changes until we can move this screen
into Svelte/handle the processing in the backend.
2021-06-02 11:15:39 +10:00
Damien Elmes
c80e852ada
prevent error storm when browser table encounters panic
2021-06-02 11:15:39 +10:00
Damien Elmes
e025fe3b43
close Anki after a panic occurs
...
Once the mutex has been poisoned the app is unusable, and users were
struggling to close it. This also ensures we'll receive the original
error report, instead of the follow-up poison errors that don't tell us
what caused the issue.
https://forums.ankiweb.net/t/error-message-keeps-popping-up/10494
2021-06-02 11:15:39 +10:00
RumovZ
9e43c91a62
Tweak flag colors
2021-06-01 18:14:54 +02:00
RumovZ
d6d712c4a7
Rename violet to pink
2021-06-01 18:14:43 +02:00
Damien Elmes
b52ac3883e
Merge pull request #1209 from RumovZ/drop-saved-search
...
Drag & drop for saved search
2021-06-01 17:50:55 +10:00
Damien Elmes
45cbc82f26
fix incorrect platform specifier
...
It should have been isLin, but we don't even need to check it -
the env var alone should suffice.
2021-06-01 17:41:15 +10:00
Damien Elmes
66a6c70bda
try to fall back to xcb if wayland forced on packaged build
...
https://forums.ankiweb.net/t/anki-doesnt-start-under-wayland-linux/10409/5
2021-06-01 17:38:35 +10:00
Damien Elmes
3786329625
handle ctrl+numpad enter on Windows
...
https://forums.ankiweb.net/t/ctrl-enter-with-the-number-pad-doesnt-work/10323/5
2021-06-01 16:25:12 +10:00
Damien Elmes
ea60b73275
fix timebox causing crash
...
When a modal was created with another window as its parent, the other
window was being returned, when it was the current window that we
actually wanted. This caused nextCard() to be called again when it
presented the timebox modal, leading to a stack overflow.
https://forums.ankiweb.net/t/anki-2-1-45-alpha/10061/71
2021-06-01 15:35:18 +10:00
Damien Elmes
5ca77f6934
require reposition to start at 0; cap maximum
...
https://forums.ankiweb.net/t/unable-to-reposition-cards-to-negative-start-position/10370/2
2021-06-01 10:09:24 +10:00
RumovZ
9e56a4421b
Add violet, turquoise and purple flags
2021-05-31 12:03:30 +02:00
Damien Elmes
0b6beaa1da
remove deck protobuf from frontend
...
Like the previous change, avoid exposing the protobuf as a public API
for now. It requires more thought, and is probably better done with
either extra helper accessors like decks.name(), or via a native class.
2021-05-31 16:31:06 +10:00
RumovZ
fb9cbf9816
Make a new item the current item after refresh
2021-05-30 10:46:59 +02:00
RumovZ
bf0dbeb5f0
Skip saving search if it already exists
2021-05-30 10:11:40 +02:00
RumovZ
a989b4e8e9
Enable drop to create saved search
2021-05-30 09:30:22 +02:00
Damien Elmes
c0020da00d
Merge pull request #1206 from RumovZ/fix-sidebar
...
Fix some sidebar issues
2021-05-29 10:33:52 +10:00
Damien Elmes
8730e98778
Merge pull request #1200 from RumovZ/template-checks
...
Template checks
2021-05-29 10:28:06 +10:00
RumovZ
0297a698e8
Fix renaming of unused tag
...
Unused tags can't be renamed, but since the CollectionOp returns success
in any case, the provisionally renamed sidebar item needs to be reset.
2021-05-28 19:18:21 +02:00
RumovZ
f443058209
Prevent sidebar toolbar from folding
...
If there is little space, Qt replaces some tools of the toolbar with an
expandable menu indicated by an arrow. But this arrow is invisible in
night mode.
2021-05-28 18:09:44 +02:00
RumovZ
99bc3c698f
Fix restoring current sidebar element for cards
2021-05-28 17:46:46 +02:00
Damien Elmes
85c5860426
remove sticky setting from fields dialog
...
https://forums.ankiweb.net/t/anki-2-1-45-alpha/10061/60
2021-05-28 18:33:29 +10:00
Damien Elmes
be707ea5e8
make update all toggle clearer
...
https://forums.ankiweb.net/t/anki-2-1-45-alpha/10061/59
+ remove background color; it did not look good in dark mode
2021-05-28 18:33:28 +10:00
Damien Elmes
ceb2813d5d
avoid bumping mtime when nothing has changed
...
+ update sync indicator after every op
+ skip mtime bump on undo/redo
2021-05-28 11:09:16 +10:00
RumovZ
d55f41669c
Use implicit failure handling and self as parent
2021-05-27 16:51:03 +02:00
Damien Elmes
b0bde454ff
add v3 scheduler to prefs screen
2021-05-27 23:09:49 +10:00
Damien Elmes
3ac06ea949
remove 'update later' button
2021-05-27 22:42:21 +10:00
Damien Elmes
de5e393b66
fix remembered tags not being applied to next added note
...
https://forums.ankiweb.net/t/anki-2-1-45-alpha/10061/56
2021-05-27 13:18:34 +10:00
Damien Elmes
6f198d73ef
ask user to confirm which deck they want when opening options in reviewer
...
Also fixes https://forums.ankiweb.net/t/anki-2-1-45-alpha/10061/57
2021-05-27 13:15:28 +10:00
Damien Elmes
4a575dbe0a
hook up some missing translations in deck options screen
2021-05-26 14:41:18 +10:00
Damien Elmes
52a98ce0ce
change get_queued_cards() to no longer return congrats info
2021-05-26 12:59:45 +10:00
Damien Elmes
3489257f41
update ts deps
...
- prettier's formatting has changed, so files needed to be reformatted
- dart is spitting out deprecation warnings like:
254 │ 2: $spacer / 2,
│ ^^^^^^^^^^^
╵
bazel-out/darwin-fastbuild/bin/ts/sass/bootstrap/_variables.scss 254:6 @import
ts/sass/button_mixins.scss 2:9 @use
ts/components/ColorPicker.svelte 2:5 root stylesheet
DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.
Recommendation: math.div($grid-gutter-width, 2)
2021-05-26 09:37:40 +10:00
RumovZ
6f5100c60e
Handle failure in CardLayout/accept()
2021-05-25 20:58:43 +02:00
Damien Elmes
4a0758b34f
always start in first sidebar mode
...
I didn't notice anyone objecting; let's see how this is received.
https://forums.ankiweb.net/t/anki-2-1-45-alpha/10061/35
2021-05-24 14:51:21 +10:00
Damien Elmes
1f7118a8e3
config updates by the frontend now skip undo by default
2021-05-24 14:50:46 +10:00
Damien Elmes
8a796ee3c3
Merge pull request #1188 from RumovZ/switch-color-2
...
Change switch color depending on state
2021-05-24 11:42:54 +10:00
Damien Elmes
f35b471dca
make switch more legible in dark mode
2021-05-24 11:31:56 +10:00
Damien Elmes
380317d701
Merge pull request #1186 from RumovZ/ctx-actions
...
Update context action states after card op
2021-05-24 10:49:23 +10:00
RumovZ
fb8194d82a
Remove browser.oneModelNotes()
2021-05-22 19:12:03 +02:00
RumovZ
fa81437ad6
Check notetype count in browser.onChangeModel()
2021-05-22 19:11:06 +02:00
RumovZ
0d90ac7d0f
Change switch color depending on state
...
Make knob overlap path.
2021-05-22 10:01:15 +02:00
RumovZ
bb829feeac
Update context action states after card op
2021-05-22 08:35:47 +02:00
Damien Elmes
8378ecc2d9
Merge pull request #1185 from RumovZ/scrolling
...
Scroll pixels instead of columns horizontally
2021-05-22 10:59:09 +10:00
Damien Elmes
ae68f649ff
improve type answer legibility
...
https://forums.ankiweb.net/t/accessibility-suggestion-correct-answer-text-contrast-in-dark-mode/10105
There's probably more that could be done here, but that can probably
wait for #1068
2021-05-22 10:31:29 +10:00
Damien Elmes
80d32dc7c8
fix find&replace searching in incorrect field
2021-05-22 10:12:14 +10:00
RumovZ
c6d95a8e3d
Scroll pixels instead of columns horizontally
2021-05-21 18:59:53 +02:00
Damien Elmes
5427668303
expose undoable config changes to frontend; refresh sidebar
...
The browser header handling still needs updating
2021-05-21 17:50:41 +10:00
Damien Elmes
ba727735bd
report changed cards when changing deck/flag
...
+ fix repeated flag shortcut not toggling
2021-05-21 16:03:05 +10:00
Damien Elmes
489138b098
add night mode styling to type-in-the-answer box
...
https://forums.ankiweb.net/t/night-mode-does-not-affect-input-tags/10116
2021-05-20 19:14:12 +10:00
RumovZ
71dd8edabd
Move flags into separate module
2021-05-20 10:26:18 +02:00
Damien Elmes
dd49dc1f33
fix error when opening and closing editor rapidly
2021-05-20 15:32:28 +10:00
Damien Elmes
4fc701eb1b
fix fields/cards font size & too-large toolbar on high DPI Windows
...
- enable default_css on editor again, so that the html element
is set to the system font size. If this is bringing in unwanted styling,
maybe we can come up with a different solution that just adjusts the
fonts
- make toolbar size relative to html font size, instead of hard-coding
it
2021-05-20 13:15:17 +10:00
Damien Elmes
abda7f9290
Merge pull request #1178 from RumovZ/flag-labels
...
Custom labels for flags
2021-05-20 11:59:55 +10:00
RumovZ
58243fad52
Remove redundant pylint exception
2021-05-19 19:44:49 +02:00
RumovZ
c0125e9ebd
Prefer looping over flags over exhaustive listing
2021-05-19 19:26:39 +02:00
RumovZ
8b09336505
Use custom flag labels in reviewer
2021-05-19 19:18:49 +02:00
RumovZ
1c3134e9c2
Use dataclass instead of tuple for loaded flags
2021-05-19 19:17:43 +02:00
abdo
9b7b32b2cb
Strip Unicode isolation characters from title
2021-05-19 18:21:57 +03:00
Damien Elmes
5c9f483cdc
move deck name into window title; v-center sticky bar
2021-05-19 19:34:15 +10:00
Damien Elmes
818fe75721
simplify previous patch
...
The default 1 rem is fine, but we need to apply the default font size
to the html element instead of the body for the definition of rem to
update.
Fixes #1174
2021-05-19 19:06:20 +10:00
RumovZ
316beb6f63
Use custom flag labels for browser actions
2021-05-19 11:00:02 +02:00
RumovZ
9ebdb84512
Make sidebar flags renamable
2021-05-19 10:04:40 +02:00
Damien Elmes
60ef1c35eb
show note about old options screen if any add-ons are installed
2021-05-19 16:20:25 +10:00
Damien Elmes
112d31f277
use literal for ease type
2021-05-19 16:05:12 +10:00
Damien Elmes
0767754ca6
enable redo support
...
Also:
- fix issues where the Undo action in the Browse screen was not
consistent with the main window. The existing hook signature has been
changed; from a snapshot of the add-on code from a few months ago, it
was not a hook that was being used by anyone.
- change the undo shortcut in the Browse window to match the main
window. It was different because undoing a change in the editing area
could accidentally trigger an undo of an operation, but the damage is
limited now that (most) operations can be redone. If it still proves to
be a problem, perhaps we should just always swallow ctrl+z when an
editing field is focused.
2021-05-19 15:18:39 +10:00
RumovZ
f220165c0f
Fix black workaround for format calls
2021-05-18 22:19:09 +02:00
Damien Elmes
f4ddf90399
Merge pull request #1170 from RumovZ/fix-columns
...
Fix column issues
2021-05-18 09:24:15 +10:00
Damien Elmes
4a18f1841f
fix detection of shift key at startup
...
Our regular helper doesn't appear to work during startup.
2021-05-18 09:21:02 +10:00
Damien Elmes
c267a1d0e1
PreviewDialog was missing from top level browser module
2021-05-18 09:10:28 +10:00
RumovZ
0ef8a2e802
Set column sizes and indicator after state change
2021-05-17 20:13:45 +02:00
RumovZ
58a18eb261
Block events when restoring headers
...
Restoring headers after switching states was triggering
_on_column_toggled(), leading to unexpected results.
2021-05-17 20:07:52 +02:00
RumovZ
6f12d48ad5
Make failed sort column change a no-op
...
The previous behaviour when a non-sortable column was clicked was to
trigger the sorting routine, which was usually a no-op, but would
reorder rows if the configured sort column was hidden.
2021-05-17 18:33:59 +02:00
Damien Elmes
5bd3884a71
support card state mutator in test scheduler
...
Documentation to come
2021-05-17 16:59:02 +10:00
Damien Elmes
19071fce7c
experiment with learning count on deck list
2021-05-16 20:23:39 +10:00
Damien Elmes
a42648a418
fix test scheduler undo + implement look-ahead
...
Instead of using a separate undo queue, the code now defers checking for
newly-due learning cards until the answering stage, and logs the updated
cutoff time as an undoable change, so that any newly-due learning cards
won't appear instead of a new/review card that was just undone.
Queue redo now uses a similar approach to undo, instead of rebuilding the
queues.
2021-05-14 22:16:53 +10:00
Damien Elmes
78b431cbf1
work around Windows issue on latest Black
...
Thanks Rumo!
552a53495e
2021-05-13 20:15:51 +10:00
Damien Elmes
9f49dca545
re-enable leech notification for test scheduler
2021-05-13 15:51:02 +10:00
Damien Elmes
5f7590c4b4
expose new sorting options in test scheduler options; move things around
2021-05-13 15:23:16 +10:00
Damien Elmes
7e324a6ec0
use new API for test scheduler
...
Avoids duplicate work, and is a step towards allowing the next
states to be modified by third-party code.
Also:
- fixed incorrect underlined count, due to reviews being labeled as
learning cards
- fixed reviewer not refreshing when undoing a test review, by splitting
up backend queue rebuilding from frontend reviewer refresh
- moved answering into a CollectionOp
2021-05-11 13:06:03 +10:00
Damien Elmes
5e44a34f20
expose step counter and undone op changes in hook
2021-05-08 17:51:36 +10:00
Damien Elmes
d6eeab3722
remove some unnecessary checkpoints
2021-05-08 17:04:05 +10:00
Damien Elmes
2e312eb13d
update find_duplicates to use QueryOp/CollectionOp
2021-05-08 16:58:18 +10:00
Damien Elmes
db415b08e4
move query_op into operations/, and add the ability to show progress
2021-05-08 16:35:43 +10:00
Damien Elmes
34c26a8b1c
split browser dialogs into separate files
2021-05-08 15:08:45 +10:00
Damien Elmes
d8cea1385c
the find_and_replace alias is not required
...
Was only added recently, so nothing should depend on it yet.
2021-05-08 14:34:57 +10:00
Damien Elmes
9c51aa5a64
move "find duplicates" into separate file
...
As far as I'm aware, no add-ons were extending that screen, so I've
dropped the old context object and the export in browser/__init__.py
2021-05-08 14:33:43 +10:00
Damien Elmes
6dd78b0ea5
Merge pull request #1159 from hgiesel/newapproach
...
Prefer idiomatic Svelte features over dynamic components
2021-05-08 11:35:31 +10:00
Henrik Giesel
755b39b59e
Check for id when inserting dynamic elements
...
* I'm not sure it behaved, if there were multiple elements
inserted by different add-ons into the same container
2021-05-07 16:50:17 +02:00
Henrik Giesel
840191d358
Use json.dumps instead of backticks in editor.py
2021-05-07 14:22:06 +02:00
Damien Elmes
26e9fba1f7
update docstrings for latest black
2021-05-07 18:12:56 +10:00
Damien Elmes
4242d82adf
fix find&replace
2021-05-07 14:02:40 +10:00
Henrik Giesel
8c32691d30
Fix Preview Button after changing from f-string to normal string
2021-05-07 02:12:37 +02:00
Henrik Giesel
bb2fb8e9f5
Fix ButtonDropdown
2021-05-07 02:04:44 +02:00
Henrik Giesel
95b6b386dc
Only initialize extension apis if necessary
2021-05-07 02:04:44 +02:00
Henrik Giesel
d92a0c44c7
Add lefttopbtns as AddonButtons
2021-05-07 02:04:44 +02:00
Henrik Giesel
dd99524ae0
Enable setting of PreviewButton and hiding of cloze button again
2021-05-07 02:04:42 +02:00
Henrik Giesel
a51eb42e7b
Simplify structure of EditorToolbar and ButtonGroup in editor HTML file
2021-05-07 02:03:55 +02:00
Damien Elmes
83aa43d97b
remove AnkiDroid timezone confirmation
...
By the time this update reaches stable, AnkiDroid 2.15 should already
be out.
2021-05-06 19:05:15 +10:00
Damien Elmes
b0e59df5a8
fix dmypy action
2021-05-05 15:54:41 +10:00
Damien Elmes
1802066afe
support undo for (renamed) unbury_deck() action
2021-04-30 20:03:20 +10:00
Damien Elmes
e468daa060
undoing of notetype templates
2021-04-30 17:30:48 +10:00
Damien Elmes
e161b9049a
undoing of notetype fields
...
- fix stale cache issue
- update add cards screen in response to op changes
2021-04-30 17:15:59 +10:00
Damien Elmes
3049eaf47c
notetype rename+options undo
2021-04-30 16:09:44 +10:00
Damien Elmes
46bcfa00fd
notetype removal undoable
2021-04-30 16:01:47 +10:00
Damien Elmes
8a9796ee5a
update GUI to allow notetype addition undo
...
- backend now updates current notetype as part of addition
- frontend no longer implicitly adds, so we can assign a new name and
add in a single operation
2021-04-30 15:58:08 +10:00
RumovZ
8e0298120d
Add separate no_arg_trigger decorator
2021-04-26 08:46:08 +02:00
Damien Elmes
532840bbfc
Merge pull request #1154 from RumovZ/fix-skip-dec
...
Fix skip_if_selection_is_empty() for triggers
2021-04-26 09:21:42 +10:00
RumovZ
7ac84a38d6
Remove some unnecessary lambdas
2021-04-25 19:51:57 +02:00
RumovZ
4b91c2b9f1
Fix skip_if_selection_is_empty() for triggers
...
It seems to be enough if one decorator calls pyqtSlot(), but to avoid
problems in the future, let's have all decorators do that.
2021-04-25 19:50:56 +02:00
Henrik Giesel
b0988e43e1
Move EditorToolbar API into EditorToolbar.svelte
2021-04-25 19:15:00 +02:00
Henrik Giesel
a21a4d330b
Initialize editor toolbar via function, not web component
2021-04-25 18:32:01 +02:00
Damien Elmes
68a4f4bade
Merge pull request #1151 from RumovZ/no-sel-dec
...
Fix some problems with browser actions while selection is empty
2021-04-25 20:48:40 +10:00
Damien Elmes
1a6c5f594d
enable the new deck options by default
...
- The old options are still available with a shift+click
- Translations still need updating
- See d8ca46e6e9 for some examples
of extending the screen in an add-on
2021-04-25 19:58:58 +10:00
Damien Elmes
f3b344a571
fix error when user cancels out of set due date/reposition
2021-04-25 19:33:25 +10:00
Damien Elmes
d8ca46e6e9
experimental support for extending add-ons screen with Svelte
2021-04-25 19:33:18 +10:00
Damien Elmes
fdb814cbcd
deckconfig->deckoptions
2021-04-25 19:02:30 +10:00
RumovZ
f898f5507c
Skip some browser methods if selection is empty
...
This was handled inconsistently before:
* Select Notes would throw a search error.
* Set Due Date would throw an exception.
* Dialogs with no effect would open.
* No-ops would be pushed to the undo queue.
2021-04-25 08:47:15 +02:00
RumovZ
8f37234373
Add dec to make methods no-op if no selection
2021-04-25 08:36:22 +02:00
Damien Elmes
d5c1f19521
basic support for add-ons in new deck config screen
...
- expose the data as a writable store
- currently only supports raw HTML; example to come
- fix changes not marking a deck config as modified
- the data is currently packed into the deckconfig object, but we
may move these to a separate store in the collection config in the
future, like is done with decks/notetypes
2021-04-24 11:08:01 +10:00
Henrik Giesel
79b16c1a96
Remove unused import
2021-04-24 01:32:02 +02:00
Henrik Giesel
a2ff598637
Remove addcards toolbar again for now
2021-04-24 00:10:45 +02:00
Henrik Giesel
9346e007c9
Add mostly working addcards topbar
2021-04-24 00:00:32 +02:00
Henrik Giesel
da230fbb24
Add simple version of Chooser buttons
2021-04-23 21:25:44 +02:00
Henrik Giesel
01b53a6be8
Make update algorithm in editor-toolbar/index.ts recursive
2021-04-23 20:50:09 +02:00
Henrik Giesel
e66edd3887
Reduce typing overhead in ts/editor-toolbar/index.ts and export buttonGroup
2021-04-23 19:05:43 +02:00
Henrik Giesel
aebaaf1a70
Add IterableToolbarItem interface for easier typing
2021-04-23 18:53:52 +02:00
Henrik Giesel
9e952e428e
Use rawButton in browser.py
2021-04-23 17:34:42 +02:00
Henrik Giesel
59f0a2dd70
Make dynamicComponents usable for addons, rather than the components directly
...
rawButton({ html: ... })
instead of
{ component: RawButton, html: ... }
2021-04-23 16:43:36 +02:00
Damien Elmes
ca74b25481
Merge pull request #1146 from hgiesel/shortcuts
...
Shortcut API for Editor
2021-04-23 09:44:01 +10:00
Damien Elmes
973463cb96
split deck description into separate screen linked from overview
2021-04-22 21:03:16 +10:00
Henrik Giesel
7ab5f736df
Move other buttons to WithShortcut
2021-04-22 03:25:31 +02:00
Damien Elmes
a7ef410615
hook new deck config screen up behind an env var
2021-04-22 10:59:16 +10:00
Henrik Giesel
b0ddae0f6c
Add first shortcuts for bold, italic, underline, removeFormat
2021-04-22 02:37:04 +02:00
Henrik Giesel
93136030e9
Include editor-toolbar as a library in editor
2021-04-20 13:44:44 +02:00
Henrik Giesel
ece4f75592
Generalize inListItem to getAnchorElement
2021-04-20 13:44:43 +02:00
Damien Elmes
04f0adb847
fix Find Dupes activation
2021-04-20 21:13:21 +10:00
Damien Elmes
48fc9251bd
implement deck config saving on JS end
2021-04-20 19:50:05 +10:00
Damien Elmes
c5cecabdd4
include sourcemaps for pages/* in dev builds
2021-04-20 17:33:46 +10:00
RumovZ
eb9fbb9c0f
Add sidebar filter "first review today"
2021-04-18 13:27:10 +02:00
Damien Elmes
1f0ff0f22d
add schema change prompt to removal, tweak return struct
2021-04-18 17:33:12 +10:00
Damien Elmes
e168612d01
Merge pull request #1130 from glutanimate/add-deckchooser-to-addcards-legacy-api
...
Add AddCards.deckChooser property for legacy add-on support
2021-04-16 11:58:34 +10:00
Damien Elmes
e1915696e9
support overriding listening IP during dev
2021-04-16 10:23:13 +10:00
Glutanimate
87dc766bca
Add AddCards.deckChooser property for legacy access
2021-04-15 18:18:25 +02:00
Henrik Giesel
ff8cfd1c3e
Add type to add_preview_shortcut
2021-04-15 15:50:29 +02:00
Henrik Giesel
1a04ca32fe
Add Latex formatting options to menu
...
* Format shortcuts in monospace font and increase padding a little bit
2021-04-15 15:20:37 +02:00
Henrik Giesel
277d0af336
Add Preview shortcut for browser
2021-04-15 13:09:51 +02:00
Henrik Giesel
f5687f5aec
Add support for Preview button in Browser
2021-04-15 13:09:50 +02:00
Henrik Giesel
fa6ac2b27b
Add RawButton and hook old python hooks up to it
2021-04-15 13:09:50 +02:00
Henrik Giesel
d1374d4b58
Show/Hide Cloze button depending on whether cloze type
2021-04-15 13:09:50 +02:00
Henrik Giesel
cfb9376e5e
Fix some code quality issues
2021-04-15 13:09:49 +02:00
Henrik Giesel
b002994d30
Add labels and titles to all buttons
2021-04-15 13:09:49 +02:00
Henrik Giesel
ef9eb38d26
Utilize enableButtons disableButtons from Svelte component
2021-04-15 13:09:49 +02:00
Henrik Giesel
c06d500f0c
Include icons directly in ts lib
2021-04-15 13:09:49 +02:00
Henrik Giesel
e175c9348e
First implementation
2021-04-15 13:09:48 +02:00
Henrik Giesel
e1da2d0e01
Add ts/editor-toolbar
2021-04-15 13:09:48 +02:00
RumovZ
f35110a0eb
Fix ChangeModel combos being cleared after setup()
2021-04-14 23:01:40 +02:00
Damien Elmes
04fa13b968
add a shortcut to speed up local ts dev
...
@hgiesel if you're not already doing something like this, you might
find this useful
2021-04-14 23:21:33 +10:00
Damien Elmes
57a1651113
deck config prototype work in progress
...
Still in the early stages, and not hooked up yet.
2021-04-14 22:33:10 +10:00
Damien Elmes
2629240272
Merge pull request #1127 from Arthur-Milchior/factorize_current_search
...
NF: factorize browser.current_search
2021-04-14 19:16:59 +10:00
Damien Elmes
656b0dd289
fix formatting in dmypy.py
2021-04-14 19:11:01 +10:00
Arthur Milchior
ad9adee26a
NF: factorize browser.current_search
...
I was looking at search code and find out that's already slightly more clear/short even if NF
2021-04-14 10:55:41 +02:00
Damien Elmes
cd4326c77e
run prettier on some sass files
2021-04-14 18:22:33 +10:00
Damien Elmes
2a43d42323
run black/isort on Python scripts
2021-04-14 18:22:02 +10:00
Damien Elmes
e35b2f68ac
add an updated script to run mypy as a daemon
...
Sadly doesn't work on Windows
2021-04-14 18:10:38 +10:00
Damien Elmes
ec6a2f7e2a
Merge pull request #1124 from hgiesel/dropjquerypy2
...
Remove jQuery from remaining qt/aqt files
2021-04-14 12:43:11 +10:00
Damien Elmes
4afc197b88
Merge pull request #1123 from hgiesel/reviewerbottomdropjquery
...
Remove jQuery reviewer-bottom.ts and overview.ts
2021-04-14 12:35:39 +10:00
Damien Elmes
73fa01ad0a
Merge pull request #1122 from hgiesel/webviewcss2
...
Prefer SASS over including files
2021-04-14 11:55:19 +10:00
Damien Elmes
5af7604e83
add missing type annotation
2021-04-14 11:28:40 +10:00
Damien Elmes
8277ad6686
Merge pull request #1121 from RumovZ/move-sidebar
...
More for the browser folder
2021-04-14 11:25:15 +10:00
Damien Elmes
7ac4a196e6
add contributor
2021-04-14 11:03:17 +10:00
Henrik Giesel
cc668d10d3
Replace jQuery in webview.py
2021-04-13 21:32:53 +02:00
Henrik Giesel
d2a5d9e246
Satisfy formatter
2021-04-13 20:29:59 +02:00
Henrik Giesel
ba2975409d
Remvoe jQuery from deckbrowser.py
...
It's not quite clear why jQuery was necessary here?
2021-04-13 20:26:06 +02:00
Henrik Giesel
31899c5826
Remove jquery from reviewer.py
...
- we no longer actually need to focus the default ease button
2021-04-13 20:11:18 +02:00
Henrik Giesel
7d39d77b87
Remove jQuery from toolbar.py
2021-04-13 19:59:00 +02:00
Henrik Giesel
10c7d4bf34
Remove jquery from browser.py
2021-04-13 19:54:45 +02:00
Henrik Giesel
56c2af1fd3
Satisfy formatter
2021-04-13 19:47:03 +02:00
Henrik Giesel
19903986f9
Move compile_sass.bzl to /ts + Remove core.css from data/web (unused?)
2021-04-13 19:47:03 +02:00
Henrik Giesel
5bcb2f080f
Declare dependencies in data/web/css
2021-04-13 19:47:03 +02:00
Henrik Giesel
630ee9c6bb
Use graphs-base and congrats-base
2021-04-13 19:47:03 +02:00
Henrik Giesel
8efbcddbb4
Do not include webview.css for editor
2021-04-13 19:47:03 +02:00
Henrik Giesel
b14dc3f7cb
Move card_counts and split off fusion_vars
2021-04-13 19:47:03 +02:00
Henrik Giesel
3eb02f6254
Add option not include default css in stdHtml
2021-04-13 19:47:03 +02:00
Henrik Giesel
8797ab5a20
Purge jQuery from reviewer-bottom
2021-04-13 19:41:04 +02:00
Henrik Giesel
4134041686
Remove overview.ts
2021-04-13 19:38:57 +02:00
Damien Elmes
fe41d780b5
Merge pull request #1119 from hgiesel/reviewerdropjquery
...
Remove last jQuery from reviewer.ts / Remove fadeTime
2021-04-13 23:12:13 +10:00
Henrik Giesel
f2b23ee8bd
Add setInnerHTML as a Replacement for $.html
2021-04-13 13:32:50 +02:00
RumovZ
f62cfc15c2
Move previewer.py into browser folder
2021-04-13 11:38:35 +02:00
RumovZ
38621d0fac
Declare all legacy pathnames in browser init
2021-04-13 11:30:32 +02:00
RumovZ
e37dc6c68c
Move find_and_replace.py into browser/dialogs
2021-04-13 11:21:36 +02:00
RumovZ
12d3084e46
Refactor sidebar.py into browser folder
2021-04-13 11:05:49 +02:00
Damien Elmes
1f475a1709
add missing copyright headers to *.ts
2021-04-13 18:57:08 +10:00
Damien Elmes
926fc2e492
add missing copyright headers to *.py
2021-04-13 18:45:35 +10:00
Henrik Giesel
bf119d2c9a
Remove display:none from mark and flag, and preset hidden attribute instead
2021-04-13 01:00:09 +02:00
Henrik Giesel
8f08bb3d0b
Make imageLoaded adhere to its function signature
2021-04-13 00:42:09 +02:00
Henrik Giesel
dc61a6f547
Remove jQuery from mark and flag in reviewer.ts
2021-04-13 00:37:58 +02:00
Henrik Giesel
99f2ca0b99
Remove jQuery from _updateQA
2021-04-13 00:22:00 +02:00
RumovZ
a1e8746efd
Refactor browser and table into folders
2021-04-12 09:50:44 +02:00
Damien Elmes
19d9492380
handle missing default sort column in notes view
...
Switching to notes mode was throwing:
File "/Users/dae/Work/code/dtop/bazel-copy/runanki.runfiles/net_ankiweb_anki/qt/aqt/browser.py", line 449, in on_table_state_changed
self.table.toggle_state(checked, self._lastSearchTxt)
File "/Users/dae/Work/code/dtop/bazel-copy/runanki.runfiles/net_ankiweb_anki/qt/aqt/table.py", line 206, in toggle_state
self._state = self._model.toggle_state(
File "/Users/dae/Work/code/dtop/bazel-copy/runanki.runfiles/net_ankiweb_anki/qt/aqt/table.py", line 996, in toggle_state
self.search(context)
File "/Users/dae/Work/code/dtop/bazel-copy/runanki.runfiles/net_ankiweb_anki/qt/aqt/table.py", line 1005, in search
context.order = self.columns[self._state.sort_column]
2021-04-12 16:02:51 +10:00
RumovZ
b33e81c215
Save separate browser mode headers
2021-04-11 12:28:11 +02:00
RumovZ
d58af0dd95
Merge branch 'master' into backend-columns
2021-04-11 11:18:15 +02:00
RumovZ
dadeaa75b7
Add browser_did_fetch_columns hook and some doc
2021-04-11 10:27:43 +02:00
RumovZ
a6f5a52fc1
Resolve config sort in table model
2021-04-10 11:33:59 +02:00
RumovZ
dd4f08a90f
Rename column label fields
2021-04-10 09:14:20 +02:00
RumovZ
e28f2320b8
Unify state columns
...
* Remove duplicate backend columns
* Remove duplicate column routines
* Move columns on frontend from state to model
* Generate available columns from Colum enum
* Add second column label for notes mode
2021-04-08 23:48:24 +02:00
RumovZ
0ff193cd5d
Add enum for column sorting
2021-04-08 11:40:24 +02:00
RumovZ
47eeb5da14
Add enum for column alignment
2021-04-08 11:28:29 +02:00
RumovZ
d7e0da3786
Remove Column class and use pb class instead
2021-04-08 11:17:25 +02:00
Damien Elmes
43105d62cf
i18n tts error message
2021-04-08 09:35:19 +10:00
Damien Elmes
2eec071b22
fix '\\' being converted to single backslash
...
Appears the default changed in 3.x
https://github.com/mathjax/MathJax/issues/2532
https://forums.ankiweb.net/t/double-backslashes-in-text-of-notes-are-turned-into-single-backslashes-on-display/9048
2021-04-07 21:50:33 +10:00
RumovZ
b59a7c72a1
Save key for unsupported add-on columns
2021-04-06 23:02:58 +02:00
RumovZ
3c84749973
Use backend column objects on frontend
2021-04-06 19:47:03 +02:00
RumovZ
460e79ba73
Change notes mode shortcut
2021-04-06 16:48:35 +02:00
Damien Elmes
ae7a327cae
current deck change is now undoable
...
- make sure we set flag in changes when config var changed
- move current deck get/set into backend
- set_config() now returns a bool indicating whether a change was
made, so other operations can be gated off it
- active decks generation is deferred until sched.reset()
2021-04-06 21:52:06 +10:00
RumovZ
49ebf1a9ae
Fix get_item_from_card_id()
2021-04-06 12:06:08 +02:00
RumovZ
dec8fd6181
Tweak new browsing strings
2021-04-06 11:41:18 +02:00
Damien Elmes
a8af070f9a
update find&replace, and remove perform_op()
2021-04-06 17:07:38 +10:00
Damien Elmes
1b81653e0e
update scheduling ops
...
- migrate to CollectionOp()
- return actual change count when suspending/burying
- add helper to convert vec to vec of newtype
2021-04-06 16:38:42 +10:00
Damien Elmes
783e0ec224
update note ops
...
remove_note() now returns the count of removed cards, allowing us
to unify the tooltip between browser and review screen
I've left the old translation in - we'll need to write a script at
one point that gathers all references to translations in the code,
and shows ones that are unused.
2021-04-06 14:56:36 +10:00
Damien Elmes
3669e948c4
migrate more ops to CollectionOp
2021-04-06 14:36:13 +10:00
Damien Elmes
f030fdbfa4
it seems mypy ignores the generic class bound if it's a type alias
2021-04-06 14:14:55 +10:00
Damien Elmes
45636877f4
start migrating perform_op() into builder in separate file
...
By passing back the builder to the calling code to run, we don't need
to plumb extra arguments like success= and handler= through each
operation, and the ability to override the default tooltip behaviour
comes free on all operations
2021-04-06 12:47:55 +10:00
Damien Elmes
427424c660
shift keep-current-selection logic into sidebar's refresh()
...
By calling refresh() manually after performing an op, we were refreshing
twice, and the selection was being lost when changes were made outside
of the sidebar.
Also drop the after_hooks arg to perform_op(), since nothing is using
it now.
2021-04-06 11:18:13 +10:00
Damien Elmes
c3b0fb35b7
more perform_op() tweaks
...
- pass the handler directly
- reviewer special-cases for flags and notes are now applied at
call site
- drop the kind attribute on OpChanges which is not needed
2021-04-06 10:14:11 +10:00
Damien Elmes
7666d1fc22
fix error when opening browser during review while notes mode active
2021-04-05 21:57:06 +10:00
Damien Elmes
1613f2edd4
fix row cache issues
...
I think this may have accidentally been changed in the refactoring.
If we discard self._rows, it will result in the entire table flashing
"..." until the new data is available. Instead, we leave the cached
rows alone, and just update the cutoff point, so we can serve stale
content (avoiding any visible redraw) until the new data is available.
I've updated search() to reset the rows there, so we free up memory
on a new search.
2021-04-05 14:42:04 +10:00
Damien Elmes
3ab53c77c7
add booleans for various screens to OpChanges
...
The backend knows exactly which op has executed, and it saves us having
to re-implement this logic on each client.
Fixes the browser table refreshing when toggling decks.
2021-04-05 14:28:56 +10:00
Damien Elmes
12c1a570ac
allow ops to pass metadata into perform_op()
...
Instances can pass handled_by=self to more easily ignore events they
initiate.
Fixes ugly refresh when expanding/collapsing decks, but we're still
refreshing the card/notes area unnecessarily in that case.
2021-04-05 13:43:09 +10:00
Damien Elmes
18ba5554ca
undo support for tag collapse; expand->collapse for consistency w/ decks
2021-04-05 11:47:12 +10:00
Damien Elmes
dc5b900056
add routine to set deck collapse state
...
Updating a deck via protobuf is now exposed on the backend, but not
currently on the frontend - I suspect we'll be better off writing
separate routines for the actions we need instead, and we get a better
undo description for free.
This is currently causing an ugly redraw in the browse screen, which
will need fixing.
2021-04-05 11:19:04 +10:00
Damien Elmes
282ae2285a
expose read-only access to new deck objects
2021-04-04 20:39:56 +10:00
Damien Elmes
65a2db34df
ensure page is shown when setHtml() called
...
https://forums.ankiweb.net/t/looked-into-the-bug-when-pressing-e-and-r-together-in-filtered-deck/8951
2021-04-03 16:59:23 +10:00
Damien Elmes
a9e40622e5
move operations into submodule
2021-04-03 16:26:10 +10:00
Damien Elmes
cb9d5b9f28
simplify errors
...
- use a flat enum instead of oneof messages, most of which were empty
- tidy up the Python side
2021-04-03 16:06:46 +10:00
Damien Elmes
d7237be205
use perform_op() for undo()
...
Instead of manually updating the UI after undoing, we just rely
on the same change notification infrastructure regular operations
use.
2021-04-03 14:38:49 +10:00
Damien Elmes
b2bfd940e7
move filtered deck labels to backend
...
- use strum to generate an iterator for the protobuf enum so we don't
forget to add new labels if extending in the future
- no add-ons appear to be using dynOrderLabels(), so it has been removed
@RumovZ perhaps a similar approach might work for listing the available
browser columns as well?
2021-04-01 23:53:38 +10:00
Damien Elmes
f41d6edeca
Merge pull request #1108 from RumovZ/more-columns
...
Even more browser fixes and features
2021-04-01 15:59:06 +10:00
Damien Elmes
81ad087d56
Merge pull request #1106 from abdnh/fix-deprwarn
...
Fix deprecated implicit conversion from float to int using __int__()
2021-04-01 15:14:49 +10:00
Damien Elmes
1eed560ada
tweak the wording of some of the tag ops
2021-04-01 15:12:13 +10:00
RumovZ
3e87a28232
Add shortcut and tooltip to switch
2021-03-31 18:53:36 +02:00
RumovZ
9d7c977283
Delay switch animation
...
If the switch triggers heavy GUI action, like a lot of paint()s, the
concurrently running switch animation may look choppy.
A small timer makes these events execute first and the animation will
run smoothly afterwards when the event queue has been drained.
2021-03-31 12:13:09 +02:00
RumovZ
dd997b20af
Make toggle actions checkable
2021-03-31 10:05:44 +02:00
RumovZ
b041f1db26
Change switch knob colour
2021-03-31 09:16:25 +02:00
RumovZ
6233a125fc
Add note interval column
2021-03-30 23:44:35 +02:00
abdo
7b45c08860
Fix deprecated implicit conversion from float to int using __int__()
2021-03-31 00:32:20 +03:00
RumovZ
0c1d4d66fc
Fix previewer not changing card
2021-03-30 22:06:58 +02:00
RumovZ
ca87a6fc45
Add note due column
2021-03-30 21:39:15 +02:00
RumovZ
880e6dc651
Add browser column enum for backend
2021-03-30 11:59:52 +02:00
Damien Elmes
76b5a79fe1
Merge pull request #1103 from abdnh/win-openfolder
...
Fix ResourceWarning in openFolder() on Windows
2021-03-30 19:28:12 +10:00
Damien Elmes
34195e1233
Merge pull request #1102 from RumovZ/more-browser
...
More browser fixes and features
2021-03-30 19:27:55 +10:00
RumovZ
34d3d24003
Add note lapses column
2021-03-29 16:06:15 +02:00
RumovZ
1eb1747365
Add note reps column
2021-03-29 15:52:02 +02:00
RumovZ
20d3569e72
Make note state equate to False as on backend
2021-03-29 15:51:34 +02:00
RumovZ
98288ff1cc
Add switch for browser states
2021-03-29 12:24:24 +02:00
RumovZ
f5cf5c0079
Implement custom qt button Switch
2021-03-29 12:19:48 +02:00
RumovZ
72ddbebf97
Fix browser_did_fetch_row hook
2021-03-29 12:16:50 +02:00
RumovZ
8f76b482bb
Remove fixme for card_ids legacy support
2021-03-29 12:07:24 +02:00
RumovZ
f7f20d7630
Explain use of deprecated decorator
2021-03-29 12:04:14 +02:00
RumovZ
54cf724188
Flag deleted rows as inactive
2021-03-29 11:55:28 +02:00
RumovZ
6c3d930ec0
Fix state toggling when current is deleted
2021-03-29 11:54:35 +02:00
Damien Elmes
16dd1364ef
fix 'lame missing' message not being shown
...
https://forums.ankiweb.net/t/cant-use-voice-recorder/8753
2021-03-29 19:52:30 +10:00
RumovZ
bd3d210fa2
Fix issues with scrolling row into view
...
1) Check whether full row height is in viewport instead of just the
top left corner.
2) Add timer before scrolling to current row so editor will already
be set up.
2021-03-29 11:40:18 +02:00
RumovZ
dd434d9093
Stop abusing qt accel string
2021-03-29 11:18:10 +02:00
Damien Elmes
432f950a5e
Merge pull request #1095 from hgiesel/svgloader2
...
Use svg-loader to load svgs directly into ts packages
2021-03-29 17:56:48 +10:00
Damien Elmes
1228cbbe68
fix an unused import
2021-03-29 17:26:20 +10:00
Damien Elmes
097244b7b3
fix default note column headers
2021-03-29 17:22:39 +10:00
Damien Elmes
7323866a88
rename BrowserCardState
...
Use a more verbose name, and use 'note' rather than 'card', so we
can rely on the default of False
2021-03-29 17:12:45 +10:00
Damien Elmes
d8de053e64
Item -> ItemId
2021-03-29 16:52:41 +10:00
Damien Elmes
3d11e74774
List->Sequence in a bunch of table/browser methods
...
Most code doesn't require a list specifically, and build a list
is an extra step.
2021-03-29 16:48:33 +10:00
RumovZ
1f79a8766d
squash merge browser refactor
...
Closes #1100
2021-03-29 16:14:54 +10:00
abdo
472acd30e5
Fix ResourceWarning in openFolder() on Windows
...
subprocess.Popen emits ResourceWarning in the destructor if the status of the process was not read.
Fix by using subprocess.run() instead, which takes care of that.
Using run() is also recommended for simple cases like this in the docs.
2021-03-29 09:09:20 +03:00
Henrik Giesel
9d64508bd1
Remove bootstrap-icons from css folder
2021-03-28 16:14:52 +02:00
Damien Elmes
08b5f86e3d
fix 'strip formatting' option being inverted
2021-03-28 19:41:15 +10:00
Damien Elmes
d793c30526
switch NoteType to Notetype
...
When used as a variable, we were typically calling it a 'notetype', not
a 'note type'.
2021-03-27 22:03:19 +10:00
Damien Elmes
b251843da6
add Dict suffix to Dict aliases in models.py
2021-03-27 21:46:49 +10:00
Damien Elmes
6b72aaf8c2
ID -> Id in protobuf and Python
...
follow-up to a90d5aa359
2021-03-27 21:38:20 +10:00
Damien Elmes
4676d2f3b1
drop the legacy enum from rslib, and pass separate module/message idx
2021-03-27 11:56:31 +10:00
Damien Elmes
0006a385e1
allow js to request specific i18n modules
...
Brings the payload on the congrats page with a non-English language
down from about 150k to 15k
2021-03-26 21:43:36 +10:00
Damien Elmes
d7bef83f98
add types to some more Fluent variables
2021-03-26 16:52:54 +10:00
Damien Elmes
afdca58e31
declare variables with some common names as int instead of a union
2021-03-26 16:33:53 +10:00
Damien Elmes
1c0f7274f4
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
f0b65bfa4b
symlink forms/*.py in for the benefit of editor completions
2021-03-26 15:33:30 +10:00
Damien Elmes
aaf09a19d8
update TR references in .ui files
...
We're not benefiting from type checking yet, as mypy and pylint currently
ignore the generated files
2021-03-26 15:03:51 +10:00
Damien Elmes
9be367d5ff
update remaining TR references in .py files
2021-03-26 14:49:55 +10:00
Damien Elmes
3d0e5248aa
update TR references that crossed multiple lines
2021-03-26 14:38:15 +10:00
Damien Elmes
5d164bea7f
update TR references that contain arguments
2021-03-26 14:21:04 +10:00
Damien Elmes
1df14f7c9c
update no-arg tr references in qt/
2021-03-26 13:48:26 +10:00
Damien Elmes
dec406691d
switch the Importers global to a callable for i18n
...
I18n is not set up at init time, so the strings can't be generated
at import.
@kelciour you have a few importing add-ons, so wanted to give you a
heads-up. The importing code is likely to change more in
future months, but for now this should be the only change
2021-03-26 13:28:21 +10:00
Damien Elmes
bd59e41f73
update some no-arg TR constants
2021-03-26 12:37:18 +10:00
Damien Elmes
ede095ef71
Merge branch 'int_type' into main
2021-03-26 11:38:34 +10:00
Damien Elmes
bfcf86e21a
fix incorrect constant naming
2021-03-26 11:29:07 +10:00
Damien Elmes
c03e2db3de
fix incorrect camelCase
2021-03-26 11:28:51 +10:00
Damien Elmes
ef66b1aa1d
fix broken string
2021-03-26 11:27:22 +10:00
Arthur Milchior
f8e8113c90
NF: NoteTypeID type
2021-03-26 11:14:08 +10:00
Arthur Milchior
ea3b55a3a4
NF: DeckID type
2021-03-26 11:14:08 +10:00
Arthur Milchior
f50ba44f05
NF: default_deck_id as a constant
...
Otherwise it's not clear what this 1 represents
2021-03-26 11:14:08 +10:00
Arthur Milchior
375ac6ea91
NF: currentDeckID factorize odid or did
2021-03-26 11:14:08 +10:00
Arthur Milchior
13710c1357
NF: CardID type
2021-03-26 11:14:08 +10:00
Arthur Milchior
575c1d32ec
NF: NoteID type
2021-03-26 11:14:08 +10:00
Damien Elmes
82f4e65d0f
Merge pull request #1090 from glutanimate/filtered-deck-dialog-hooks
...
Add hooks to the filtered deck dialog
2021-03-26 10:28:23 +10:00
Damien Elmes
0c63a7c8c4
rework translation handling
...
Instead of generating a fluent.proto file with a giant enum, create
a .json file representing the translations that downstream consumers
can use for code generation.
This enables the generation of a separate method for each translation,
with a docstring that shows the actual text, and any required arguments
listed in the function signature.
The codebase is still using the old enum for now; updating it will need
to come in future commits, and the old enum will need to be kept
around, as add-ons are referencing it.
Other changes:
- move translation code into a separate crate
- store the translations on a per-file/module basis, which will allow
us to avoid sending 1000+ strings on each JS page load in the future
- drop the undocumented support for external .ftl files, that we weren't
using
- duplicate strings in translation files are now checked for at build
time
- fix i18n test failing when run outside Bazel
- drop slog dependency in i18n module
2021-03-26 09:41:32 +10:00
Glutanimate
63120e3461
Run isort
2021-03-25 04:46:22 +01:00
Glutanimate
5be90e1a61
Supply deck ID in hook, so that add-ons may update deck config dict
...
(for newly created filtered decks where the deck ID is not yet set
in the FilteredDeckForUpdate object)
2021-03-25 02:33:15 +01:00
Glutanimate
9548b2c3f1
Fix (?) operation output type hint
2021-03-25 02:28:58 +01:00
Glutanimate
92a8b9c1c0
Add three filtered deck dialog hooks
...
Similar to deckconf hooks
2021-03-25 02:28:01 +01:00
Damien Elmes
46dc212207
move markdown dep into pylib
2021-03-24 22:19:14 +10:00
Damien Elmes
be9e46a9ea
rework filtered deck screen & search errors
...
- Filtered deck creation now happens as an atomic operation, and is
undoable.
- The logic for initial search text, normalizing searches and so on
has been pushed into the backend.
- Use protobuf to pass the filtered deck to the updated dialog, so
we don't need to deal with untyped JSON.
- Change the "revise your search?" prompt to be a simple info box -
user has access to cancel and build buttons, and doesn't need a separate
prompt. Tweak the wording so the 'show excluded' button should be more
obvious.
- Filtered decks have a time appended to them instead of a number,
primarily because it's easier to implement. No objections going back to
the old behaviour if someone wants to contribute a clean patch.
The standard de-duplication will happen if two decks are created in the
same minute with the same name.
- Tweak the default sort order, and start with two searches. The UI
will still hide the second search by default, but by starting with two,
the frontend doesn't need logic for creating the starting text.
- Search errors now have their own error type, instead of using
InvalidInput, as that was intended mainly for bad API calls. The markdown
conversion is done when the error is converted from the backend, allowing
errors to printed as a string without any special handling by the calling
code.
TODO: when building a new filtered deck, update_active() is clobbering
the undo log when the overview is refreshed
2021-03-24 22:04:35 +10:00
Damien Elmes
53f8e06172
rename&simplify the deck/config type aliases
...
- QueueConfig is only used by the scheduler
- DeckConfig was being used in places that Config should have been used
- Add "Dict" to the name so that the bare name is free for use with a
stronger type.
2021-03-24 16:29:02 +10:00
Damien Elmes
6dc98b8010
dyndeckconf -> filtered_deck
2021-03-24 13:17:12 +10:00
Damien Elmes
d80ed5ff3b
support undo of filtered deck build/empty
2021-03-24 12:56:06 +10:00
RumovZ
d8bfbd8a82
Add context action 'Update with Current Search'
2021-03-23 11:20:46 +01:00
Damien Elmes
53d4a42d22
tweak AbortAddonImport docstring
2021-03-23 19:31:24 +10:00
Damien Elmes
7ef09375a6
Merge pull request #1086 from glutanimate/abort-addon-import-exception
...
Add an exception that allows add-ons to abort early
2021-03-23 19:28:13 +10:00
Damien Elmes
c90ab022c9
add hook to modify browser row content
2021-03-23 19:13:52 +10:00
Damien Elmes
3f03b5f06a
only declare rows deleted if they're the result of a NotFound error
...
If it's some other error like the DB suddenly becoming accessible,
we don't want to scare the user into thinking their data was deleted,
and we want to know what the error was without popping up tens of
message boxes for each row.
2021-03-23 19:04:15 +10:00
Damien Elmes
2bffcba345
Merge pull request #1082 from RumovZ/backend-rows
...
Backend rows
2021-03-23 18:31:42 +10:00
Glutanimate
1adc4ae908
Add an exception that allows add-ons to abort early
2021-03-22 14:53:04 +01:00