BlueGreenMagick
ce512014f2
do nothing if dropPos == idx
...
since such move won't change the field position
and when trying to move the field below itself
may lead to it being moved below the next field
2020-05-26 18:59:53 +09:00
BlueGreenMagick
6f3ebafc46
fix drag drop field repositioning
2020-05-26 18:27:38 +09:00
BlueGreenMagick
8f4469d5e9
add evt type for contextMenuEvent method
2020-05-26 17:12:39 +09:00
BlueGreenMagick
99663be358
add typehint for eventFilter method
2020-05-26 17:08:55 +09:00
Damien Elmes
f9f07a7d55
allow hook to modify search text
2020-05-25 16:54:57 +10:00
Damien Elmes
6b05272ed4
Merge pull request #633 from hgiesel/dconf_hooks
...
Add three deck config hooks
2020-05-24 09:53:22 +10:00
Damien Elmes
38508c3ad7
use keyword args for calls with more than one argument
2020-05-24 09:12:47 +10:00
Damien Elmes
89dde3aeb0
migrate the remaining methods
2020-05-24 08:36:50 +10:00
Henrik Giesel
788a3eeced
Satisfy black reformatter
2020-05-23 11:14:52 +02:00
Damien Elmes
081a61a438
more methods
2020-05-23 14:01:36 +10:00
Henrik Giesel
2074ffcf51
Add three deck config hooks
...
- gui_hooks.deck_conf_did_add_config
- gui_hooks.deck_conf_will_remove_config
- gui_hooks.deck_conf_will_rename_config
2020-05-22 21:24:05 +02:00
Damien Elmes
175afa9fee
migrate more methods to service
2020-05-22 22:09:33 +10:00
Damien Elmes
6144317736
hook expected an int, not a str
2020-05-22 11:27:40 +10:00
Damien Elmes
cecf363c38
fix custom study not saving
2020-05-22 11:25:11 +10:00
Damien Elmes
0bf4fe400a
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
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
16eceb5260
show 'changes saved' in parent window
2020-05-22 10:43:41 +10:00
Damien Elmes
9358c78bad
show message when search fails
2020-05-22 10:43:28 +10:00
Damien Elmes
a4efd9910e
monospace font in clayout
2020-05-22 09:58:20 +10:00
Damien Elmes
a3ac96443b
use context manager in retrieveURL
2020-05-21 10:58:42 +10:00
Damien Elmes
d5d5ca9c3d
clearer variable names in retrieveURL
2020-05-21 09:22:34 +10:00
evandrocoan
b388c43454
Fixed HttpClient session not being closed
2020-05-20 19:20:41 -03:00
Damien Elmes
300fba156e
fix shortcut keys in clayout
2020-05-21 07:51:35 +10:00
Damien Elmes
e2bb5cd14a
update missed storage._Collection references
2020-05-20 19:45:46 +10:00
Damien Elmes
50fdf9b03d
storage->collection
2020-05-20 17:58:28 +10:00
Damien Elmes
c49c378296
move storage logic into collection.py; fix export bug
...
https://anki.tenderapp.com/discussions/ankidesktop/41495-using-file-export-closes-the-collection-on-mwcoldb-if-the-browser-window-is-open
2020-05-20 17:43:34 +10:00
Damien Elmes
eb0c9f6e0a
fix progress bar getting stuck on image paste
2020-05-20 16:12:41 +10:00
Damien Elmes
6ae55a7a77
deprecate removeTempNote()
2020-05-20 15:01:05 +10:00
Damien Elmes
8da69c5d39
fix HTML editor in add screen
2020-05-20 14:59:22 +10:00
Damien Elmes
8f207cc900
drop mw.weakref usage in models.py for now
...
https://anki.tenderapp.com/discussions/beta-testing/1967-2126-189-g7384df8f-crash-at-note-types-fields-save
2020-05-20 13:53:34 +10:00
Damien Elmes
4fd8a4cf2d
update empty cards hook
...
Closes #515
2020-05-20 13:41:09 +10:00
Damien Elmes
9876c30d89
tidy up Qt import
2020-05-20 13:38:55 +10:00
Damien Elmes
e564a47504
Merge pull request #625 from evandroforks/fixed_check_box_called_twice
...
Fixed clayout.py rendering the contents twice when clicked
2020-05-20 12:48:48 +10:00
Damien Elmes
1d4fd50d8b
Merge pull request #626 from evandroforks/fix_previewer_button
...
Fixed previewer button not resetting the state when the preview
2020-05-20 12:48:17 +10:00
evandrocoan
64a90a457c
Fixed clayout.py rendering the contents twice when clicked
...
https://stackoverflow.com/questions/36808257/pyqt-radiobutton-ischecked-is-executed-twice
2020-05-19 20:17:20 -03:00
evandrocoan
3ea6f685b2
Added missing Anki icon to qt/aqt/previewer.py
2020-05-19 19:43:18 -03:00
evandrocoan
3dcfd57b07
Fixed previewer button not resetting the state when the preview
...
window is closed by its X button
2020-05-19 19:24:54 -03:00
evandrocoan
200bad3714
Explicitly close the importer file descriptor
...
https://github.com/ankitects/anki/pull 613
2020-05-18 15:54:20 -03:00
evandrocoan
efb62b9528
Add missing close file descriptors using context managers
2020-05-18 15:54:20 -03:00
Damien Elmes
31ceb5d730
simplify the migration popup
...
Avoid presenting the user with a wall of text they may not understand,
default to proceeding, and quit if the user cancels.
2020-05-18 20:15:59 +10:00
Damien Elmes
a53aac40f8
Merge pull request #610 from evandroforks/ask_confirmation_before_moving_anki_collection
...
Ask user confirmation before moving the Anki directory
2020-05-18 19:44:27 +10:00
Damien Elmes
e323a8f902
Merge pull request #619 from evandroforks/fix_empty_sound_tags
...
Also fix legacy.py::anki.sound._soundReg accepting empty tags
2020-05-18 19:31:22 +10:00
Damien Elmes
fe196bc1df
Merge pull request #620 from evandroforks/remove_unused_var
...
Remove unused t = time.time() variable on qt/aqt/browser.py
2020-05-18 19:20:08 +10:00
Damien Elmes
1fc951471c
fix python3.7 lint issue
2020-05-18 18:08:57 +10:00
Damien Elmes
252eb3a444
fix shared deck conf warning
2020-05-17 14:37:59 +10:00
Damien Elmes
8b57a61746
use deck tree for new/review count calculation
...
- wins back the performance lost by the decks and dconf not being
in memory, and the overhead of serializing data for DB calls
- card counts are no longer capped to 1000
- learn counts are currently still calculated separately - can't merge
v1 counts without changing the existing behaviour
- partially rendering the tree may yield more savings
2020-05-16 20:28:03 +10:00
Damien Elmes
8eada2b57d
add find_deck_in_tree()
2020-05-16 13:05:20 +10:00
Damien Elmes
578b60c104
save profile stats to file instead of generating report
...
Can use an external tool like snakeviz to query them after a run.
2020-05-16 12:53:01 +10:00
Damien Elmes
f6767d1cff
fix lint issues
2020-05-16 12:20:20 +10:00
Damien Elmes
0c340eba64
fix+speed up deck list from Filters button
...
I don't think it makes much sense to keep these lists that largely
duplicate the sidebar functionality, but they remain for now.
2020-05-16 11:54:08 +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
83adfb60cf
avoid duplicate reset in overview
2020-05-15 21:54:56 +10:00
Damien Elmes
964a69e54e
handle default deck and filtered deck suppression in the backend
2020-05-15 21:21:10 +10:00
Damien Elmes
2ac33500eb
fetch stock notetypes from backend
2020-05-15 17:08:24 +10:00
Damien Elmes
f650e5557f
add back card deletion count
...
cheaper to look up now that there's an index on notes.mid
2020-05-15 15:28:07 +10:00
Damien Elmes
00db72e365
show (Deck) when card hasn't been added
2020-05-15 15:01:28 +10:00
Damien Elmes
ed52a4dc3f
when previewing cards, use the default deck for now
...
Replay code needs to be able to retrieve deck options. We should
probably use the current deck or pass it in in the future.
2020-05-15 14:50:57 +10:00
Damien Elmes
68e1303880
update replay suppression in clayout
2020-05-15 14:26:00 +10:00
Damien Elmes
46c363d4aa
track changes in fields dialog as well
...
And avoid bumping schema until user actually saves, but warn at
start.
2020-05-15 13:59:44 +10:00
Damien Elmes
f1c5c88c10
no longer need to check addNote's return value
2020-05-14 21:59:42 +10:00
Damien Elmes
24ffb6ab76
check for empty cloze cards when rendering as well
2020-05-14 21:56:45 +10:00
Damien Elmes
782911471b
add "fill empty" checkbox
2020-05-14 20:58:45 +10:00
Damien Elmes
9a222e620a
update Add Field button
2020-05-14 18:01:15 +10:00
Damien Elmes
c5d574e9f4
use group box instead of tabs in card layout screen
2020-05-14 17:26:40 +10:00
Damien Elmes
5167bb57be
start reworking card layout screen
...
- front/back/css shown in tabs
- front/back preview switchable; only one webview needs to be loaded
- dropdown to select cloze number in preview
- search box to search in front/back/css
2020-05-14 15:24:29 +10:00
Damien Elmes
f23eb350e4
drop availOrds(), and use backend for getting cloze numbers
2020-05-14 12:14:00 +10:00
Damien Elmes
c601dcef24
remove obsolete preview code
2020-05-14 09:22:53 +10:00
Damien Elmes
6680cdf1d3
update the card layout screen
...
- changes are now committed in bulk when closing the dialog,
and can be canceled
- it's not necessary to save the note to the database to preview it
- duplicate fields are now shown as duplicates in the top list
- redraw preview more quickly
- use + instead of _ when deduplicating names, as the latter is a
glob character
2020-05-13 17:24:49 +10:00
Damien Elmes
12b8fe6147
don't hide static template text when card is empty
2020-05-13 11:17:44 +10:00
evandrocoan
3f517c71e4
Remove unused t = time.time() variable on qt/aqt/browser.py
2020-05-12 15:09:22 -03:00
evandrocoan
f8c6300e27
Also fix legacy.py::anki.sound._soundReg accepting empty tags
2020-05-12 12:43:35 -03:00
Damien Elmes
9317cee9ba
handle scheduling preferences in the backend
2020-05-12 21:13:34 +10:00
Damien Elmes
70cc1699a6
rewrite DB check
...
- notes with wrong field count are now recovered instead of
being deleted
- notes with missing note types are now recovered
- notes with missing cards are now recovered
- recover_missing_deck() still needs implementing
- checks required
2020-05-12 21:13:34 +10:00
Damien Elmes
2413f286b1
bulk tag add/remove/update; canonify on note save
...
also remove the tag list updated hook - we'll need a better solution in
the future than having the library code call back into the GUI code
2020-05-12 21:13:34 +10:00
Damien Elmes
7bab99d873
support disabling unicode normalization in notes
2020-05-12 21:13:34 +10:00
Damien Elmes
05ca797ee6
add pep8 name for findReplace
2020-05-12 21:13:34 +10:00
Damien Elmes
1852e32183
update find&replace in browser
...
sadly the UI still stutters on large selections - the calls
to get the selected rows from Qt are really slow.
2020-05-12 21:13:34 +10:00
Damien Elmes
c51ca666c3
catch schema mod in background
...
If the schema confirmation dialog is shown on a background thread it
will crash the app, so we convert this to an assertion error that gets
caught by the error handler. Code still needs to be updated to modify
the schema prior to moving to the background, but at least this way
it doesn't crash.
2020-05-12 21:13:34 +10:00
Damien Elmes
6e6d9ee1a3
check untyped in clayout
2020-05-12 21:13:34 +10:00
Damien Elmes
9f585d4d38
remove an unused import
2020-05-12 21:13:34 +10:00
Damien Elmes
25f122bf5c
update fields and models diags
...
- field changes are now applied when user closes dialog with save
button, in bulk
- models diag now fetches note type and saves it as required, instead
of holding on top a copy that can grow stale as changes are made in
subdialogs
- both dialogs now perform operations in the backend
- note.model() now fetches the note type on the fly, instead of
holding on to a copy that may become stale
2020-05-12 21:13:34 +10:00
Damien Elmes
f6931197d2
add helper to run background task with progress
2020-05-12 21:13:34 +10:00
Damien Elmes
36c1d1cf8c
reuse existing use count in note types screen
2020-05-12 21:13:33 +10:00
Damien Elmes
ce104d16a3
mypy/isort fixes
2020-05-12 21:13:33 +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
67421e02ec
add browserCollapsed as part of tree build
2020-05-12 21:13:33 +10:00
Damien Elmes
a0160d7f1e
fix mypy issues
2020-05-12 21:13:33 +10:00
Damien Elmes
a88bc1e836
speed up browser load by rendering deck tree in Rust and skipping counts
2020-05-12 21:13:33 +10:00
Damien Elmes
0bb80329e8
ensure collection doesn't get stuck open if loading fails
2020-05-12 21:13:33 +10:00
Damien Elmes
23586ffe90
catch template errors, and start on discarding changes to fields/cards
...
This is only a first step - all the current methods that implicitly
save need to be updated.
2020-05-12 21:13:33 +10:00
Damien Elmes
6e8860cafa
hook the empty cards code up to the GUI
2020-05-12 21:13:33 +10:00
Damien Elmes
f637ac957d
hook up new note and note type handling
...
- notetypes are fetched from the DB as needed, and cached in Python
- handle note type changes in the backend. Multiple operations can now
be performed in one go, but this is not currently exposed in the GUI.
- extra methods to grab sorted note type names quickly, and fetch by
name
- col.models.save() without a provided notetype is now a no-op
- note loading/saving handled in the backend
- notes with no valid cards can now be added
- templates can now be deleted even if they would previously
orphan notes
a number of fixmes have been left in notes.py and models.py
2020-05-12 21:13:33 +10:00
Damien Elmes
1ca7fb4a80
use quick check instead of full integrity check on collection close
2020-05-12 21:13:33 +10:00
evandrocoan
5f9dbf9b7d
Set to restart Anki application after profile directory migration
...
Ask user confirmation before moving the Anki directory
https://github.com/ankitects/anki/pull 610
2020-05-10 18:30:58 -03:00
Damien Elmes
7078415405
avoid renaming completer_, as add-ons depend on it
2020-05-08 18:17:57 +10:00
Damien Elmes
c02716ccd8
python formatting+lints
2020-05-08 17:30:27 +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
4a26e2ba77
bundle socks
...
https://anki.tenderapp.com/discussions/ankidesktop/39801-sync-error
2020-05-08 15:26:19 +10:00
evandrocoan
9f5c69ee94
Keep an window open showing the migration is in progress
2020-05-07 15:03:43 -03:00
evandrocoan
453da45c99
Ask user confirmation before moving the Anki directory
...
https://anki.tenderapp.com/discussions/ankidesktop/41245-unwanted-file-movingdeleting-behavior
2020-05-07 14:59:19 -03:00
Damien Elmes
961833a137
avoid mention of pip
2020-05-05 16:30:22 +10:00
Damien Elmes
2f57c646e0
benchmark->profile, and remove from error branches
2020-05-05 16:28:49 +10:00
Damien Elmes
e7ebcc7c75
Merge pull request #605 from evandroforks/benchmark_option
...
Created the --benchmark command line option
2020-05-05 16:23:00 +10:00
Damien Elmes
16d0bf24b4
Merge pull request #608 from evandroforks/fix_missing_pyaudio_import
...
Fix missing pyaudio blocking Anki from running
2020-05-05 16:22:34 +10:00
evandrocoan
0006269c01
Used showWarning asking the user to install pyaudio
2020-05-05 00:00:48 -03:00
evandrocoan
338e904bd4
Created the ANKI_RUN_BENCHMARK environment variable replacing
...
the command line argument.
2020-05-04 23:46:13 -03:00
evandrocoan
2e11a596aa
Fixed profiler word misspelling and stopped trimming the output
2020-05-04 23:15:23 -03:00
Damien Elmes
08f894735a
Merge pull request #607 from Arthur-Milchior/remove_a_try
...
Simplify the copying of field contents when resetting
2020-05-05 11:36:17 +10:00
Damien Elmes
b932333246
fix card layout screen on qt 5.9 regression ( #592 )
2020-05-05 11:26:13 +10:00
evandrocoan
b671c8e627
Fix missing pyaudio blocking Anki from running
...
https://github.com/ankitects/anki/pull 606
Remove pyaudio as mandatory dependency
2020-05-04 13:44:12 -03:00
Damien Elmes
5236e20a7a
Merge pull request #580 from Arthur-Milchior/debug_diag
...
mw.debug_diag is the dialog and not the window
2020-05-04 14:07:15 +10:00
Damien Elmes
9502fe790f
Merge pull request #584 from Arthur-Milchior/onModelchangeUsed
...
On modelchange used
2020-05-04 14:06:35 +10:00
Damien Elmes
6c20e5a7df
Merge pull request #585 from Arthur-Milchior/addButtonSaveNewFunction
...
addButton always save function
2020-05-04 13:58:46 +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
Damien Elmes
164fdb37d5
fix saving searches in browser
2020-05-04 12:26:50 +10:00
evandrocoan
b63bfc83d8
Created the --benchmark command line option
...
https://anki.tenderapp.com/discussions/ankidesktop/41106-card-audio-playback-changes-bug-in-212x
Based on the snippet: https://gist.github.com/evandrocoan/961d46e10424e53ba8946fac66e0efac
2020-05-03 20:34:43 -03:00
Arthur Milchior
f2fbf667cd
onModelChange: replacing try by if
2020-05-03 01:53:00 +02:00
Arthur Milchior
d427e1028b
single try in onModelChange
2020-05-03 01:53:00 +02:00
Arthur Milchior
936bb31997
onModelChange save note
...
I like the way onModelChange is done. Except that you forget to use
the note you computed.
2020-05-03 01:53:00 +02:00
Damien Elmes
9645b85df8
fix deck confs not deleting
...
https://anki.tenderapp.com/discussions/ankidesktop/41044-bug-report-anki-2124-macos-deleting-unused-option-groups
2020-04-30 08:10:29 +10:00
BlueGreenMagick
be6a5e2f13
Set tab width to 4 spaces
...
setTabStopWidth is deprecated, and setTabStopDistance is preferred
It's not entirely accurate however, which you can see
when you compare 10 tabs and 40 spaces
2020-04-29 11:34:09 +09:00
BlueGreenMagick
48e4396c55
make mypy ignore signal.connect lines
2020-04-28 09:16:56 +09:00
BlueGreenMagick
a6cd77ed6e
add deck rename context menu to sidebar
2020-04-28 09:16:56 +09:00
BlueGreenMagick
9c2eb8bf00
add context menu to SidebarTreeView
2020-04-28 09:16:56 +09:00
BlueGreenMagick
e7e19f8ac8
pass Browser to SidebarTreeView
2020-04-28 09:16:56 +09:00
BlueGreenMagick
1e124bf19c
Seperate SidebarTreeView class from Browser
2020-04-28 09:16:56 +09:00
BlueGreenMagick
56b6fad743
pass to SidebarItem its type
...
removed 'for in list' as mypy does not correctly infer its types
2020-04-28 09:16:56 +09:00
Arthur Milchior
3378daeca3
remove an useless asignment
...
Because fields of new notes are empty by default
2020-04-28 00:31:30 +02:00
Arthur Milchior
93d83e760b
remove a try, for code clarity
2020-04-28 00:31:24 +02:00
Damien Elmes
0c8f6ced09
Revert "Merge pull request #583 from Arthur-Milchior/remove_a_try"
...
This reverts commit e9ca61d1eb
, reversing
changes made to abb80231a5
.
2020-04-28 07:38:23 +10:00
Arthur Milchior
e86817305a
mw.debug_diag is the dialog and not the window
...
This will allow, for example, for add-ons to do self.debugDiag.text
and access the debugger text. I see very little reason to have a
direct access to the dialog window.
I should note that self.debugDiag is never used anywhere in the code,
so I think it should be deleted; unless you've heard of some add-on
using it.
2020-04-27 11:55:33 +02:00
Damien Elmes
e9ca61d1eb
Merge pull request #583 from Arthur-Milchior/remove_a_try
...
Simplify the code slightly
2020-04-27 19:12:00 +10:00
Arthur Milchior
31164adaec
addButton always save function
2020-04-26 17:01:47 +02:00
Arthur Milchior
e4a0ccc059
remove an useless asignment
...
Because fields of new notes are empty by default
2020-04-26 14:49:16 +02:00
Arthur Milchior
1771be8f1e
remove a try, for code clarity
2020-04-26 14:49:11 +02:00
BlueGreenMagick
f23a361876
use variable names
2020-04-26 15:47:19 +09:00
Damien Elmes
ce589fb975
Revert "Merge pull request #562 from ijgnd/master"
...
This reverts commit 4fb9dc734b
, reversing
changes made to c8fb409a49
.
https://anki.tenderapp.com/discussions/beta-testing/1920-config-can-copy-paste-but-cant-click-links-now
2020-04-21 09:10:45 +10:00
Damien Elmes
683f664d85
fix deleting deck configs
2020-04-20 13:23:05 +10:00
Damien Elmes
335815ab9c
fix renaming not updating dropdown
2020-04-20 13:17:55 +10:00
Damien Elmes
c023bdd78e
fix adding deck configs
2020-04-20 13:15:23 +10:00
evandrocoan
38fabcef52
Cache webview.py console regex expression and disable multiline
2020-04-17 03:43:16 -03:00
Damien Elmes
aa562f490c
fix delays caused by console.log regression in PR #560
...
https://anki.tenderapp.com/discussions/beta-testing/1918-reliably-reproduced-bug-in-2124beta6
2020-04-17 10:51:03 +10:00
Damien Elmes
394f7c630c
Merge pull request #560 from evandroforks/fix_javascript_console_output
...
Fixed javaScriptConsoleMessage showing 'error on line'
2020-04-16 10:15:56 +10:00
Damien Elmes
4fb9dc734b
Merge pull request #562 from ijgnd/master
...
make help text selectable
2020-04-16 10:14:02 +10:00
Damien Elmes
a7d5d27778
catch and report issues when downgrading
2020-04-16 10:11:16 +10:00
Damien Elmes
07343f6c9f
show a clearer error if the schema is too new
...
will hold off on making it translatable for now
2020-04-16 09:47:34 +10:00
Damien Elmes
d24cb66be9
downgrade manually
...
- A regular collection open/close no longer goes through the
upgrade/downgrade steps each time. This avoids wasted cycles, and will
become more important in the future when decks and note types are
split into separate tables.
- Added a downgrade button to the profiles screen to downgrade all
profiles and close the app.
- Downgrading is still automatic when exporting/doing a full sync.
2020-04-16 09:00:49 +10:00
Damien Elmes
a6b676039b
work around full sync on start closing the app
...
This is just a temporary solution until the syncing code can be
reworked.
https://anki.tenderapp.com/discussions/ankidesktop/39761-anki-crashing-after-sync-and-download
2020-04-16 08:10:17 +10:00
evandrocoan
2f174b40a6
Set to use a regular expression to remove the server name because
...
it is less prone to break in future updates.
2020-04-15 16:27:41 -03:00
evandrocoan
7061aac16d
Set to javaScriptConsoleMessage output to stdout because it
...
may raise error messages on the anki GUI.
2020-04-15 16:06:45 -03:00
ijgnd
e745677145
make help text selectable
...
This allows the user to copy e.g. values so that they don't have to retype them which might introduce typos.
2020-04-15 18:59:04 +02:00
Damien Elmes
16be20e2fa
don't write log files when exporting
2020-04-15 21:45:32 +10:00
Damien Elmes
65cfcf9226
pare back dark mode support
...
Anki now solely relies on the night mode setting in the preferences
to decide whether to show in light or dark mode. Some users wanted
to run Anki in light mode while keeping the rest of their system dark,
and there were various display problems when dark mode was changed
after Anki started that couldn't be easily worked around.
NSRequiresAquaAppearance is set again, which means we can rely on
the interface appearing properly and not changing as the macOS theme
is changed.
Users who only use dark mode, and preferred the native look of widgets
in dark mode, can achieve the previous appearance by running the
following command in the terminal:
defaults write net.ankiweb.dtop NSRequiresAquaSystemAppearance -bool no
And the following in the debug console:
mw.pm.meta["dark_mode_widgets"] = True
This is hidden behind a debug console command because it requires the
user ensure their system is always set to the same light/dark mode
as Anki.
2020-04-15 21:44:56 +10:00
Damien Elmes
a552abe688
update if a compatible branch is found, even if mtime is wrong
...
https://anki.tenderapp.com/discussions/ankiweb/4668-addon-auto-update-problems
2020-04-15 18:47:04 +10:00
evandrocoan
f3c561b6d9
Fixed javaScriptConsoleMessage showing 'error on line' for
...
all lines. The new output format is:
JS info /_anki/reviewer.js:166 autoadd
JS error /_anki/reviewer.js:240 Uncaught (in promise) NotAllowedError: play() can only be initiated by a user gesture.
2020-04-15 04:12:47 -03:00
Damien Elmes
351d8a309f
move autoplay() into card
2020-04-13 09:04:30 +10:00
Damien Elmes
10eb947402
fix replay audio again, and decouple the code from the reviewer
2020-04-13 08:59:36 +10:00
Damien Elmes
0c5f22f4ae
avoid adjusting position if selected row is visible
...
https://anki.tenderapp.com/discussions/beta-testing/1868-anki-2124-beta#comment_48227037
2020-04-11 15:54:52 +10:00
Damien Elmes
698bf9c780
Merge pull request #550 from BlueGreenMagick/debugDiag-contextMenu
...
add clear actions to context menu in debug console
2020-04-11 14:19:46 +10:00
Damien Elmes
a068fcdc9f
Update main.py
2020-04-11 14:19:27 +10:00
Damien Elmes
8b3f0100e4
fix error when replaying audio in preview screen
2020-04-10 20:33:48 +10:00
Damien Elmes
c964be3961
make sure preview window is closed when browser closed
2020-04-10 20:32:48 +10:00
Damien Elmes
26f5b9250c
grey out spinner if max=0
...
https://anki.tenderapp.com/discussions/ankidesktop/32710-custom-study
2020-04-10 20:32:48 +10:00
BlueGreenMagick
653f5765b8
add clear actions to context menu in debug console
2020-04-10 15:45:25 +09:00
Damien Elmes
8f7ef6ed2c
make sure progress stops when collection corrupt message shown
2020-04-09 14:19:20 +10:00
Damien Elmes
eff1b39e9f
fix deck_browser_did_render hook
2020-04-09 13:40:19 +10:00
Damien Elmes
3851246d60
Merge pull request #542 from BlueGreenMagick/addcards-cloze-warning
...
detect cloze cards with other filters
2020-04-08 16:30:00 +10:00
Damien Elmes
cbb2ce6928
Merge pull request #545 from BlueGreenMagick/draggable-field-pos
...
allow dragging fields to change its position
2020-04-08 16:22:27 +10:00
Damien Elmes
61793f92b8
fix preview closing
...
https://anki.tenderapp.com/discussions/beta-testing/1868-anki-2124-beta#comment_48228480
2020-04-08 16:21:20 +10:00
Damien Elmes
55b99511c0
print exception on close
2020-04-08 10:05:33 +10:00
BlueGreenMagick
6b3d6bec55
allow dragging fields to change its position
2020-04-07 16:42:33 +09:00
BlueGreenMagick
aa86bc8088
use model type to detect cloze notes
2020-04-07 14:02:53 +09:00
Damien Elmes
6ecf2ffa2c
Merge pull request #543 from Arthur-Milchior/sort_according_to_path
...
Sort according to path
2020-04-07 14:44:53 +10:00
Damien Elmes
1122ab4791
Merge pull request #541 from BlueGreenMagick/tmpNote-cloze
...
detect renamed cloze fields in note type preview
2020-04-07 14:17:44 +10:00
BlueGreenMagick
12b69af9b2
detect renamed cloze fields in note type preview
...
and cloze fields that is also other special field type
such as '{{cloze:hint:Text}}'
2020-04-07 08:56:54 +09:00
Arthur Milchior
bda2935de1
_basename to basename, since it's not private in use
2020-04-06 23:51:50 +02:00
Arthur Milchior
5315b717c0
_basename used where possible
2020-04-06 23:51:42 +02:00
Arthur Milchior
69a9425cd0
replace _path by path (because it's not private here)
2020-04-06 23:50:43 +02:00
Arthur Milchior
266c2022b5
uses _path where possible
2020-04-06 23:50:37 +02:00
Arthur Milchior
5d55c4cda2
Sort decks according to their paths
...
Currently it's sorted alphabetically. Because of this, "A::B" appears
between "A9" and "AA" in list of decks.
2020-04-06 22:49:25 +02:00
Damien Elmes
676f4e74a8
store config in separate DB table
...
- mtime is tracked on each key individually, which will allow
merging of config changes when syncing in the future
- added col.(get|set|remove)_config()
- in order to support existing code that was mutating returned
values (eg col.conf["something"]["another"] = 5), the returned list/dict
will be automatically wrapped so that when the value is dropped, it
will save the mutated item back to the DB if it's changed. Code that
is fetching lists/dicts from the config like so:
col.conf["foo"]["bar"] = baz
col.setMod()
will continue to work in most case, but should be gradually updated to:
conf = col.get_config("foo")
conf["bar"] = baz
col.set_config("foo", conf)
2020-04-06 15:39:47 +10:00
Damien Elmes
8b76098bc7
omit period in steps when possible
2020-04-06 15:39:47 +10:00
Damien Elmes
7375a0389a
add flag to skip downgrade on collection close
...
Disabled for now; when enabled it will allow faster collection
open and close in the normal case, while continuing to downgrade
when exporting or doing a full sync.
Also, when downgrading is disabled, the journal mode is no longer
changed back to delete.
2020-04-04 17:21:45 +10:00
Damien Elmes
ac4284b2de
update tag handling
...
- tag list stored in a separate DB table
- non-wildcard searches now do full unicode case folding
(eg tag:masse matches 'Maße')
- wildcard matches do simple unicode case folding
- some functions haven't been updated yet, so ascii folding will
continue to be used in some operations
2020-04-03 19:34:46 +10:00
Damien Elmes
333d0735ff
preserve mtime/usn when syncing deck config, and add snake_case names
2020-04-03 19:34:46 +10:00
Damien Elmes
2c99a4203f
Merge pull request #537 from Arthur-Milchior/add_card_did_init
...
hook add_card_did_init
2020-04-03 19:34:33 +10:00
Arthur Milchior
657fa9758b
hook add_card_did_init
2020-04-03 11:03:08 +02:00
Damien Elmes
6cf3b0ca18
add type checking to previewer
2020-04-03 09:13:33 +10:00
Damien Elmes
6049e15dac
add missing license header
2020-04-03 09:05:32 +10:00
Damien Elmes
a359c27c25
use old name for preview dialog to avoid breaking add-ons
2020-04-03 09:00:18 +10:00
Damien Elmes
5f9c126caa
fix some errors in the previewing code
2020-04-03 09:00:08 +10:00
Damien Elmes
4790fec881
render() conflicts with Qt method
2020-04-03 08:29:35 +10:00
Damien Elmes
de79087620
be explicit that the method is a no-op
2020-04-03 08:27:56 +10:00
Damien Elmes
f5e0ad8fad
tweak wording
2020-04-03 08:27:26 +10:00
Arthur Milchior
cd1fd6f9a2
snake case
2020-04-02 17:44:06 +02:00
Arthur Milchior
00d04cd6c9
Previewer is a QDialog
...
As suggested by Glutanimate in https://github.com/ankitects/anki/pull/532#discussion_r401256921
2020-04-02 17:44:06 +02:00
Arthur Milchior
6564f00748
Previewer: parent become private
...
It seems parent is a method of QDialog, so it creates a typing problem
2020-04-02 17:44:06 +02:00
Arthur Milchior
31f2f60757
Methods used by browser are not public
...
As suggested by Glutanimate on https://github.com/ankitects/anki/pull/532#discussion_r401254100
2020-04-02 17:44:06 +02:00
Arthur Milchior
0e21978577
remove the word preview from previewer variable
...
As suggested by glutanimate https://github.com/ankitects/anki/pull/532#discussion_r401255290
2020-04-02 17:44:06 +02:00
Arthur Milchior
92cec5c327
removing PreviewDialog dataclass
...
It can be replaced by the previewer itself. As suggested by
Glutanimate https://github.com/ankitects/anki/pull/532#discussion_r401252970
2020-04-02 17:44:06 +02:00
Arthur Milchior
c722b5bd2c
PreviewerListCards can take cids and class
...
This allow to avoid recomputing a card if it is known, while allowing
to compute it until it's actually displayed
2020-04-02 17:44:06 +02:00
Arthur Milchior
b76ee6f8e5
ListCardsPreviewer
2020-04-02 17:44:06 +02:00
Arthur Milchior
c4a38c5e36
Split PreviewerBrowser into a hierarchy
...
A part in common to see multiple cards. And a part specific for the browser
2020-04-02 17:44:06 +02:00
Arthur Milchior
727b7fb6e5
split onPreview Prev/Next
2020-04-02 17:44:06 +02:00
Arthur Milchior
79dece3124
split _updatePreviewButtons
...
This will allow to create a hierarchy in this class
2020-04-02 17:44:06 +02:00
Arthur Milchior
f42c164999
add a class to preview a single card
2020-04-02 17:44:06 +02:00
Arthur Milchior
944e82211f
Class PreviewerBrowser
...
This let a previewer class which can be used to display a single card,
and a previewer for the browser
2020-04-02 17:44:06 +02:00
Arthur Milchior
0a3d68a565
split = None
2020-04-02 17:44:06 +02:00
Arthur Milchior
6d98063ac3
vbox and bbox are attribute
2020-04-02 17:44:06 +02:00
Arthur Milchior
95e020f743
use card method
2020-04-02 17:44:06 +02:00
Arthur Milchior
179ba87ce4
previewer: create gui in a distinct function
2020-04-02 17:44:06 +02:00
Arthur Milchior
45ccd4aa3c
move previewer to a different class.
...
This uses exactly the same code, with one exception. In the previewer
`self` became `self.parent` in order to have action on the
browser. And in the browser, some `self` become `self.previewer` to
access the previewer. (Some function having an action on the previewer
starting from the browser now are separated in two. One version in the
previewer doing the same thing. One version in the browser, calling
the version in the previewer if it exists.)
Preview dialog now takes a QWidget in general, not necesarrily a
Browser. The parameter is called parent
2020-04-02 17:44:06 +02:00
Damien Elmes
b5f0f459ce
ignore row change events that arrive after browser closed
...
https://anki.tenderapp.com/discussions/ankidesktop/40148-bug-when-suspending-cards
2020-04-02 19:44:51 +10:00
Damien Elmes
634931cf9e
tweak hook name
2020-04-01 17:13:08 +10:00
Damien Elmes
28380d4183
Merge pull request #534 from Arthur-Milchior/tags_hook
...
hook tag_editor_received_a_key
2020-04-01 17:10:31 +10:00
Damien Elmes
5fe747f14a
left-align tags
...
https://anki.tenderapp.com/discussions/ankidesktop/40068-tags-column-in-browser-is-centered
2020-04-01 13:29:42 +10:00
Damien Elmes
c050833aba
always position selection in center after search
...
https://anki.tenderapp.com/discussions/beta-testing/1888-retaining-position-when-searching
2020-04-01 11:01:20 +10:00
Damien Elmes
c9da4bc1a6
allow aborting a media sync while http req in flight
...
The progress handling code needs a rethink, as we now have two separate
ways to flag that the media sync should abort. In the future, it may
make sense to switch to polling the backend for progress, instead of
passing a callback in.
2020-04-01 09:49:25 +10:00
Arthur Milchior
4b34e71030
hook tag_editor_received_a_key
...
I expect it to be useful for add-ons such as
https://github.com/fonol/anki-search-inside-add-card which interact
with the tag line
2020-03-31 15:05:41 +02:00
zjosua
bfdb5d01b5
Use double quotes in taglimit queries
2020-03-30 10:12:47 +02:00
Damien Elmes
ef79f7d676
Merge pull request #531 from Arthur-Milchior/browser_will_show_context_menu
...
hook browser_header_will_show_context_menu
2020-03-28 14:50:02 +10:00
Damien Elmes
47bd6264bd
Revert "Merge pull request #527 from Arthur-Milchior/explode_on_bridge_cmd"
...
This reverts commit 2264fe3f66
, reversing
changes made to 84b84ae31c
.
Causes a traceback when opening the add screen, clicking on Type,
and choosing a note type.
File "/Users/dae/Work/code/dtop/qt/aqt/webview.py", line 31, in cmd
return json.dumps(self.onCmd(str))
File "/Users/dae/Work/code/dtop/qt/aqt/webview.py", line 97, in _onCmd
return self._onBridgeCmd(str)
File "/Users/dae/Work/code/dtop/qt/aqt/webview.py", line 500, in _onBridgeCmd
return self.onBridgeCmd(cmd)
File "/Users/dae/Work/code/dtop/qt/aqt/editor.py", line 374, in onBridgeCmd
self._links[cmd](self, *args) # type: ignore
File "/Users/dae/Work/code/dtop/qt/aqt/editor.py", line 404, in onBlur
if gui_hooks.editor_did_unfocus_field(False, self.note, int(ord)):
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
2020-03-28 13:35:05 +10:00
Arthur Milchior
4bb49d404e
hook browser_header_will_show_context_menu
2020-03-27 23:06:22 +01:00
Damien Elmes
d81c725b46
Merge pull request #529 from Arthur-Milchior/load_note_once_on_note_type_change
...
Ensuring "setNote" is called only once during changing of note type
2020-03-27 15:28:49 +10:00
Damien Elmes
2264fe3f66
Merge pull request #527 from Arthur-Milchior/explode_on_bridge_cmd
...
Explode on bridge cmd
2020-03-27 15:22:14 +10:00
Arthur Milchior
0b633dbf40
Ensuring "setNote" is called only once during changing of note type
...
Initially, I wanted to solve the bug reported on
https://github.com/Arthur-Milchior/anki-html-src-in-field/issues/1
After some research, I finally discovered that the trouble was that,
when we change the note type in add card, the method
`aqt.editor.Editor.loadNote` is called twice. In itself, it would not
be a problem, but given the way callback works, its call back is
called twice on the last version of the webview. Which means that
`gui_hooks.editor_did_load_note` is called twice, which breaks this
add-on.
The reason why loadNote is called twice is because `setNote` is called
twice in `aqt.modelchooser.onModelChange`. The first time through
`gui_hooks.current_note_type_did_change` which calls
`addcards.AddCards.onModelChange` which calls `loadNote`, the second
time through `self.mw.reset()` which calls
`gui_hooks.state_did_reset()` which calls `addcards.AddCards.onReset`
which calls `setAndFocusNote` which calls `setNote`.
I should note furthermore that currently,
`gui_hooks.current_note_type_did_change` is called only when the model
chooser change a model. And `addCards.onModelChange` is never called,
only added to the hook `gui_hooks.current_note_type_did_change`. So
removing the line of code removed in this commit will have no side
effect in Anki itself. It will only affect the fact that this method
is called twice.
I do not know of any add-on calling `onModelChange` or
`gui_hooks.current_note_type_did_change`, but it means little, so of
course, it may always mean an add-on will break because of this
change. No way of being sure.
2020-03-26 21:26:13 +01:00
Arthur Milchior
c9496ef095
Ensure that focus, key and blur are treated as other commands
...
The reason to do that is that I can then call blur/key from other
method in add-on.
More precisely, I expect to create a method which captures the blur
command, ask anki to execute the standard version of the command, and
then execute more code once the note contains the new field value.
I should note that the code executed during blur/key/focus itself
didn't change. It's only it's location which changed.
2020-03-26 15:42:27 +01:00
Damien Elmes
fe327e32ca
fix progress dialog preventing schema mod
...
https://anki.tenderapp.com/discussions/beta-testing/1868-anki-2124-beta#comment_48183062
This is an ugly hack - in the future the calling code should be updated
to perform the check prior to starting the operation instead.
2020-03-26 21:07:53 +10:00
Damien Elmes
65b8988817
reduce the chances of add-ons preventing collections from loading
...
https://anki.tenderapp.com/discussions/ankidesktop/39953-sync-fail-with-images#comment_48182205
2020-03-26 09:53:15 +10:00
Arthur Milchior
9f4c4ea355
Explode onBridgeCmd
...
This way, an add-on can catch a blur command, do its change and then
call self.blur
2020-03-25 08:17:48 +01:00
Damien Elmes
818b9193a8
Merge pull request #523 from Arthur-Milchior/hook_note_will_load
...
Hook editor_note_will_load
2020-03-25 09:43:16 +10:00
Arthur Milchior
3799b8504f
strip to test whether field is empty
2020-03-24 11:55:55 +01:00
Arthur Milchior
31f18e3c94
Hook editor_note_will_load
...
A current problem I have is that there is nothing similar to hook
inside of javascript. It seems that it would be easier to be able to
add other methods in javascript and call them in loadNote. Currently I
simply redefined loadNote, which is far from perfect
2020-03-24 10:17:01 +01:00
Damien Elmes
6143a7e218
Merge pull request #525 from Hk-tang/change-to-more-pythonic
...
Change not not to bool
2020-03-24 16:01:15 +10:00
Damien Elmes
a51dba7255
Merge pull request #524 from Arthur-Milchior/indet_html
...
Ident html in editor
2020-03-24 16:00:57 +10:00
Damien Elmes
483d50cba8
Merge pull request #522 from Arthur-Milchior/editor_did_init
...
editor_did_init
2020-03-24 15:52:50 +10:00
evandrocoan
b1b3e5b87c
Merge remote-tracking branch 'danielelmes/master' into fix_tests_on_windows
...
# Conflicts:
# .github/scripts/trailing-newlines.sh
2020-03-23 18:44:11 -03:00
Hk-tang
521b0e9e14
Change not not to bool
2020-03-23 11:16:39 -06:00
Damien Elmes
b1a8107aa1
formatting
2020-03-23 19:54:01 +10:00
Damien Elmes
84eaf43525
reduce the chances of a race condition in mplayer code
...
Not perfect, it may still happen.
https://anki.tenderapp.com/discussions/ankidesktop/39832-an-error-occurred-audio
2020-03-23 19:15:32 +10:00
Damien Elmes
f889616ef1
don't pop up network errors for media sync
...
log them instead
2020-03-23 19:06:13 +10:00
Damien Elmes
f429986246
fix collection_did_load() not being called, and remove dead code
...
https://anki.tenderapp.com/discussions/ankidesktop/39765-_colloadingstate-is-never-run-thus-collection_did_load-hook-is-never-triggered
2020-03-23 18:57:23 +10:00
Damien Elmes
7d94465256
cache dark mode value so UI doesn't break when it changes
...
https://anki.tenderapp.com/discussions/ankidesktop/39550-cant-deactivate-night-mode-on-2121-for-mac
2020-03-23 18:39:37 +10:00
Damien Elmes
7a4f3d0318
dump more info in card()/bcard()
2020-03-23 18:39:00 +10:00
Arthur Milchior
349d145014
Ident html in editor
...
Sometime I like to print html to understand why it bugs. And I really
prefer to have html indented if it's okay with you. There is no change
appart from the identation and quotes
2020-03-23 08:15:48 +01:00
Damien Elmes
c615342130
fix English being shown in prefs for fully qualified langs like zh-CN
...
https://anki.tenderapp.com/discussions/ankidesktop/39845-a-new-bug-has-been-found
2020-03-23 16:08:06 +10:00
Damien Elmes
75b7ebb156
add back new_timezone_enabled(), as it's used in the prefs screen
2020-03-23 07:40:50 +10:00
Arthur Milchior
f2f92fb0c3
editor_did_init
...
That would be useful to add elements in the editor, such as in multi
column editor
2020-03-22 17:15:47 +01:00
Damien Elmes
99416477ac
allow customizing search order
2020-03-21 17:38:09 +10:00
Damien Elmes
dfa7f5e142
fix reversing sort order
2020-03-21 16:57:33 +10:00
Damien Elmes
9afbcd4178
remove old finder code; add search hooks to browser & remove old one
2020-03-21 16:38:46 +10:00
Damien Elmes
63ce44aaa7
enable sorting on the extra browser columns
2020-03-21 07:55:53 +10:00
Damien Elmes
9ee82d55b1
disable word wrap in browser rows
2020-03-20 21:15:23 +10:00
Damien Elmes
13f3719650
ensure endReset() is called even if an exception is raised
2020-03-20 21:15:23 +10:00
Damien Elmes
1318118461
flush config on sort order change
2020-03-20 21:15:23 +10:00
Damien Elmes
55c9f5dbeb
wait for media sync to complete before unloading collection
2020-03-20 21:15:23 +10:00
Damien Elmes
d03e13a1bd
reuse the existing backend instead of creating a new one
2020-03-20 21:15:23 +10:00
Damien Elmes
ba17567617
drop the separate i18n backend
2020-03-20 21:15:23 +10:00
Damien Elmes
8d429cd192
import .colpkg in a background thread
2020-03-20 21:15:23 +10:00
Damien Elmes
ad9dad8748
import .apkg files in a background thread
2020-03-20 21:15:23 +10:00
Damien Elmes
231fa30a86
import mapped files like csv in a background thread
2020-03-20 21:15:23 +10:00
Damien Elmes
53952ba131
export in a background thread
2020-03-20 21:15:23 +10:00
Damien Elmes
fa12213e98
move .reopen() to mw; fix exporting
2020-03-20 21:15:23 +10:00
Damien Elmes
fe59d11047
fix mypy warning
2020-03-20 21:15:23 +10:00
Damien Elmes
0f38514ad7
drop the DB progress handler code
...
This code was an awful hack to provide some semblance of UI
responsiveness while executing DB statements on the main thread.
Instead, we can just run DB statements in a background thread now,
keeping the UI responsive.
2020-03-20 21:15:23 +10:00
Damien Elmes
90d4d62c48
use a timer to automatically show progress window
...
We were previously relying on the DB progress hook to cause the
progress window to display.
Qt's progress dialogs do have built in support for automatically
showing, but it's easier to add a timer than change the existing
code to use it.
2020-03-20 21:15:23 +10:00
Damien Elmes
32555b2857
run Check DB in a background thread
...
Since the DB is now stored behind a mutex, we're no longer limited
to accessing the database on the main thread.
2020-03-20 21:15:23 +10:00
Damien Elmes
ae06b9e446
add Collection struct, and get media check working again
...
- media check no longer needs collection to be closed
- use savepoints for operations initiated by Rust, so they are
atomic without forcing a commit
2020-03-20 21:15:23 +10:00
Damien Elmes
6db4418f05
drop log= argument from Collection
2020-03-20 21:15:23 +10:00
Damien Elmes
f4d4078537
drop named sql arguments
2020-03-20 21:15:23 +10:00
Damien Elmes
c8b9afac0c
drop progress handler and timeout arg
2020-03-20 21:15:23 +10:00
Damien Elmes
0d43e9dca3
tweak add-on wording
2020-03-20 21:00:21 +10:00
Damien Elmes
b7c64aaf39
Merge pull request #517 from Arthur-Milchior/backup_is_done
...
hook backup_is_done
2020-03-20 20:56:33 +10:00
Damien Elmes
f274e85edf
Merge pull request #470 from Arthur-Milchior/accept_card
...
Hook to decide whether a note should be added.
2020-03-20 20:56:04 +10:00
Damien Elmes
b2aa0756c9
Merge pull request #516 from Arthur-Milchior/hook_models_advanced_will_show
...
Hook models_advanced_will_show
2020-03-20 20:42:14 +10:00
Arthur Milchior
97225a0364
Browser introduce method time_format
...
I expect to use this in my add-on 1243668133 (by monkey patching in
this case) where it would allow to show hours/minutes/seconds... in browser
2020-03-19 22:59:59 +01:00
Arthur Milchior
bfc305fa26
hook backup_is_done
...
I expect to use this hook in add-on 529955533. It'll serve me to
create long term backup at the same time than your backup
2020-03-19 13:21:00 +01:00
Arthur Milchior
b73507344c
Hook models_advanced_will_show
...
This will be useful for add-on 1863928230. I want to let users change
the LaTeX footer/header everywhere.
2020-03-19 12:03:09 +01:00
Arthur Milchior
e4ae41340f
Hook to decide whether a note should be added.
2020-03-19 03:39:53 +01:00
evandrocoan
1ade1a1a0f
Fixed moved comment line on qt/aqt/main.py, long variables names on
...
pylib/Makefile and qt/Makefile, and rg --version not going to /dev/null
on .github/scripts/trailing-newlines.sh
2020-03-18 11:36:50 -03:00
evandrocoan
034ac10cf4
Fixed error: Incompatible types in assignment on qt/aqt/main.py
...
aqt\main.py:1437: error: Incompatible types in assignment (expression has type Module, variable has type "LibraryLoader[WinDLL]") [assignment]
_dummy = wintypes
^
2020-03-17 19:48:16 -03:00
Damien Elmes
dfa10f5a1c
Merge pull request #509 from Arthur-Milchior/type_queue_in_browser
...
adding missing constants in browser file
2020-03-17 21:33:08 +10:00
Damien Elmes
acd3eb9058
Merge pull request #506 from Arthur-Milchior/editor_web_view_did_init
...
Hook editor_web_view_did_init
2020-03-17 20:53:20 +10:00
Arthur Milchior
e7ea8f412f
adding missing constants in browser file
2020-03-17 06:32:46 +01:00
evandrocoan
4bb0a75fe7
Give the 'typearrow' id to the type answer arrow
2020-03-16 00:42:08 -03:00
Arthur Milchior
89bb5fe79b
Hook editor_web_view_did_init
...
I hope to use this in oder to had features to the web view. In
particular, I expect the "spell checking" feature to use it
hopefully. Because currently it's incompatible with other add-on
dealing with the editor
2020-03-16 04:37:07 +01:00
Damien Elmes
0ecc189a9b
fix audio getting stuck (2/2)
2020-03-15 09:34:04 +10:00
Damien Elmes
f30853f5ed
fix audio getting stuck (1/2)
...
The problem was caused by stop() doing a spin loop on the main
thread waiting for the completion signal. This prevented Qt's run
loop from executing, and so the completion signal was never delivered,
meaning longer files would time out.
Fixed by reworking the code so that stop() does not block at all -
instead it just sets the termination flag, and AVPlayer does not
unset current_player. Then when the completion callback fires, it
can advance to the next file.
TTS code still needs updating, and the lock should be safe to remove
as the start/stop logic is all on the main thread.
2020-03-15 09:26:31 +10:00
Damien Elmes
e7452300a2
imports
2020-03-14 22:10:27 +10:00
Damien Elmes
8845b05933
make sure audio queue is cleared when transitioning between cards
...
https://anki.tenderapp.com/discussions/beta-testing/1846-anki-2122-beta#comment_48150139
2020-03-14 20:04:40 +10:00
Damien Elmes
522ee8fca7
drop the deck count warning
2020-03-14 19:41:33 +10:00
Damien Elmes
d9923b12ba
fix play icons not appearing in browser preview when autoplay off
2020-03-14 19:29:11 +10:00
Damien Elmes
aad491dbb9
possible fix for invalid handle issue
...
https://anki.tenderapp.com/discussions/ankidesktop/39346-cant-add-audio-on-flash-drive
2020-03-14 18:53:43 +10:00
Damien Elmes
33f312315e
must close progress before displaying error, or user can't click it away
2020-03-14 18:42:03 +10:00
evandrocoan
2e54d315e1
Fixed BeautifulSoup breaking string paths
...
https://anki.tenderapp.com/discussions/ankidesktop/39543-anki-is-replacing-the-character-by-when-i-exit-the-html-edit-mode-ctrlshiftx
2020-03-12 21:19:09 -03:00
Damien Elmes
f0be553e09
add media check window title, use consistent formatting in template
2020-03-12 18:02:22 +10:00
Damien Elmes
2f02867840
Merge pull request #503 from Arthur-Milchior/error_msg_in_schema
...
Error msg in schema
2020-03-11 16:00:47 +10:00
Damien Elmes
fd81fca4aa
fix wrong language selected in prefs screen
2020-03-11 14:58:57 +10:00
Arthur Milchior
5482cafef2
Allow add-on dev to show personalized message.
...
The error should be in "error_msg"
They can show:
* the original error message with {problem}
* the path of the error with {path},
* the value which does not match against the subchema with {error}
* the subschema against which the error occurs with {schema}
Thanks to Glutanimate for the idea https://github.com/ankitects/anki/pull/495#issuecomment-596685227
2020-03-11 01:39:39 +01:00
Arthur Milchior
0b04da6419
snake case for addon_schema
2020-03-11 00:56:14 +01:00
Damien Elmes
131d37dca5
add switch in prefs for new timezone handling code; bump sync version
...
AD devs: before updating the sync version to 10, please make sure
the new timezone code has been ported over. The core change to the
scheduler is in _updateCutoff():
9736e4a970/pylib/anki/schedv2.py (L1357)
with the following supporting Python functions:
9736e4a970/pylib/anki/schedv2.py (L1410)
_timing_today() is calculated in Rust (lines up to 92, the rest are
tests):
9736e4a970/rslib/src/sched/cutoff.rs (L20)
The change went through a few iterations before stabilising, so it's
probably easier to refer to the above code than the patches that got
us to that point.
2020-03-10 17:50:18 +10:00
Damien Elmes
0f4c3ab611
add restore media action
2020-03-10 13:35:09 +10:00
Damien Elmes
6ad2a1f9a3
add empty trash action in aqt
2020-03-10 12:49:40 +10:00
Arthur Milchior
74b2b18966
hook single_addon_selected
2020-03-09 12:45:10 +01:00
Arthur Milchior
4e1838bba8
hook addons_dialog_will_show
2020-03-09 12:45:10 +01:00
Damien Elmes
b1d0945d10
Merge branch 'master' into more_precise_config_error_message
2020-03-09 19:41:26 +10:00
Damien Elmes
bc435b8772
Merge pull request #499 from glutanimate/add-custom-dialogs-to-dialogmanager
...
Allow add-on authors to register their dialogs with the dialog manager
2020-03-09 19:40:34 +10:00
Arthur Milchior
c9b89c5394
More precise schema failure message
...
While creating schema for the add-on I used, I realized that my error
message was not precise enough.
For a big configuration such as in "Enhance main window", the message
"None is not of type 'string'" is almost useless.
So I added a path in the json config, to indicate where the error
is. And also which subschema is currently being used.
2020-03-08 16:38:06 +01:00
Glutanimate
05f69272d0
Elaborate more on the use case and requirements for dialog registration
2020-03-07 17:43:21 +01:00
Glutanimate
1ed2ba8983
Allow add-ons to register custom dialogs with the dialog manager
2020-03-07 17:35:09 +01:00
Glutanimate
0f9683a850
Add cursory type annotations for aqt.DialogManager
...
Typing DialogManager._dialogs properly would require more extensive
changes which could break a number of add-ons
2020-03-07 17:29:37 +01:00
Arthur Milchior
5adbc33d4c
hook debug_ran_hook
2020-03-06 15:01:22 +01:00
Arthur Milchior
3319b114de
hook debug_will_show_hook
2020-03-06 15:01:02 +01:00
Damien Elmes
4290bc81eb
Merge pull request #496 from TooYoungTooSimp/patch-1
...
Use anki.consts.SYNC_BASE instead of hardcoded url
2020-03-06 21:22:18 +10:00
Damien Elmes
5f4839a901
Merge pull request #495 from Arthur-Milchior/check_schema_before_accepting
...
add-on config check schema of user config
2020-03-06 21:14:47 +10:00
雷宇辰
a2604b80f5
Use anki.consts.SYNC_BASE instead of hardcoded url
...
Use `anki.consts.SYNC_BASE` instead of hardcoded url in function `MediaSyncer._endpoint`
2020-03-06 18:55:07 +08:00
Arthur Milchior
01c74bc015
add-on config check schema of user config
2020-03-05 16:31:17 +01:00
Damien Elmes
6bc3462700
fix regression introduced by PR #492
2020-03-05 09:24:26 +10:00
Damien Elmes
94b90d23fb
Merge pull request #493 from glutanimate/type-annotate-editor-card
...
Type-annotate editor.card
2020-03-05 07:26:40 +10:00
Damien Elmes
78e9959e78
Merge pull request #492 from Arthur-Milchior/print_json_decode_error
...
print json decode error message
2020-03-05 07:26:17 +10:00
Glutanimate
3948b778e8
Type-annotate editor.card
2020-03-04 17:41:26 +01:00
Arthur Milchior
85966f42dc
print json decode error message
...
The main point is to allow add-on dev' to debug their own json
2020-03-04 15:29:48 +01:00
Arthur Milchior
bc67268d82
config_unprettify_json
2020-03-04 08:25:14 +01:00
Arthur Milchior
e4986c7784
hook prettify_json
2020-03-04 08:25:14 +01:00
Damien Elmes
669bb3737f
Merge pull request #454 from glutanimate/display-addon-name-in-config-window
...
Display add-on name in add-on configuration window title
2020-03-02 16:59:44 +10:00
Damien Elmes
5cf7d6672e
Merge pull request #476 from Arthur-Milchior/hook_browser_init
...
Hook browser init
2020-03-02 15:40:10 +10:00
Damien Elmes
3d7f643184
Merge pull request #472 from Arthur-Milchior/hook_init_clayout
...
Hook init clayout
2020-03-02 15:39:23 +10:00
Alan Du
6c2dda6c9c
Monkeytype qt/aqt/reviewer.py
2020-03-01 10:16:08 -05:00
Alan Du
96ca469d12
Monkeytype qt/aqt/theme.py
2020-03-01 10:16:08 -05:00
Alan Du
f8c22499cb
Monkeytype qt/aqt/sound.py
2020-03-01 10:16:08 -05:00
Alan Du
eebf5d2a1d
Monkeytype qt/aqt/toolbar.py
2020-03-01 10:16:08 -05:00
Alan Du
cd570eef24
Monkeytype qt/aqt/webview.py
2020-03-01 10:16:08 -05:00
Arthur Milchior
80ba217772
hook for initializing clayout
2020-03-01 11:42:41 +01:00
Arthur Milchior
047e027e01
browser_did_init
2020-03-01 11:39:41 +01:00
Glutanimate
d22ad11224
Display add-on name in add-on configuration window title
2020-02-29 20:15:23 +01:00
Damien Elmes
2db7591b6d
fix shared link
2020-02-29 21:43:37 +10:00
Damien Elmes
7bde0556cb
Merge pull request #473 from evandroforks/fix_docs_urllink
...
Fixed anki website docs link on pylib/anki/consts.py
2020-02-29 21:39:11 +10:00
Damien Elmes
e2c6fd464c
Merge pull request #468 from BlueGreenMagick/fix-comment-setwebexports
...
allow either \ or / in web exports filter
2020-02-29 21:25:12 +10:00
Damien Elmes
8c0d4c8059
restore mpv/mplayer missing warning that got lost in the av changes
...
and ensure the UI doesn't get temporarily stuck after the command fails
2020-02-29 21:20:08 +10:00
Damien Elmes
56b2cc58ed
point user to manual if they're trying to disable night mode in dark mode
2020-02-29 20:44:49 +10:00
BlueGreenMagick
e46ace5044
match both forward slash and os seperator
2020-02-29 12:36:10 +09:00
evandrocoan
21b66cd86b
Fixed anki website docs link on pylib/anki/consts.py
2020-02-28 22:18:19 -03:00
Damien Elmes
a954dc1066
fix _tidy_name() comment
2020-02-28 17:14:47 +10:00
Damien Elmes
43f5d13ed6
migrate strings with trailing newlines to fluent
2020-02-27 20:36:40 +10:00
Alan Du
a63c9e5a9a
Apply mypy improvements to aqt
2020-02-26 22:27:58 -05:00
Damien Elmes
e04cbfd7f8
Merge pull request #462 from Arthur-Milchior/filter_empty_card
...
Add a hook to change empty cards to delete
2020-02-27 12:53:52 +10:00
Damien Elmes
0c49431719
FString -> TR
2020-02-27 12:25:19 +10:00
Damien Elmes
e439e8cdec
add string for media log title, and add button in prefs to access it
2020-02-27 12:22:24 +10:00
Damien Elmes
644670d0d6
return a localized error for all error kinds
...
some errors are not yet localized, but now the Python code
doesn't need to think about which property to use
2020-02-27 10:46:24 +10:00
Arthur Milchior
5ff1f3890f
Add a hook to change empty cards to delete
2020-02-26 10:59:34 -08:00
Damien Elmes
cfe4af81cf
add missing short argument to legacy fmtTimeSpan()
2020-02-26 20:36:59 +10:00
Damien Elmes
a634188ec5
fix dark mode target Qt version
2020-02-26 16:53:35 +10:00
Damien Elmes
65ec9d190d
formatting fixes
2020-02-25 17:56:46 +10:00
Damien Elmes
db69f84c0a
interrupt current audio when autoplay off
2020-02-25 17:49:06 +10:00
Damien Elmes
f71484a444
ensure user doesn't try to export into data folder
...
https://anki.tenderapp.com/discussions/ankidesktop/39008-export-path-accidentally-set-to-collectionmedia-possible-damage
2020-02-25 17:38:49 +10:00
Damien Elmes
06dee0ef08
formatting fix
2020-02-25 17:29:10 +10:00
Damien Elmes
fbbbbd6a7d
tweak rounding
...
- avoid rounding minutes
- round the seconds taken in the card info screen
- provide different precise and imprecise modes, since we need
to display seconds to multiple decimals in some areas
2020-02-25 17:29:06 +10:00
Damien Elmes
fd835d9b64
fix display of 1+ day intervals in review history
...
https://anki.tenderapp.com/discussions/ankidesktop/39189-interval-field-of-card-info-display-wrong-unit
2020-02-25 17:00:02 +10:00
Damien Elmes
32b38bf26d
ensure Anki starts on Windows systems that don't have TTS installed
2020-02-25 16:25:17 +10:00
Damien Elmes
621774559f
don't allow UI scale < 100%
...
Both Windows and Linux installs fail to render properly when the scale
is below 100%:
https://anki.tenderapp.com/discussions/ankidesktop/38909-user-interface-size
Retina Macs do render properly, but they tend to display at appropriate
size out of the box anyway.
2020-02-25 16:20:14 +10:00
Damien Elmes
0fae85d2b4
don't pick up system dark theme in -alternate Mac build
...
The older Qt doesn't support it properly
2020-02-25 15:46:39 +10:00
Glutanimate
8454e27efb
Use a consistent function signature across load and save hooks
2020-02-24 15:47:48 +01:00
Glutanimate
7cc9311b79
Add deck_conf_did_setup_ui_form hook
...
Called earlier than deck_conf_will_show, allowing add-on authors
to perform UI modifications before the deck config is loaded.
2020-02-24 15:29:23 +01:00
Glutanimate
335047187a
Add hooks for extending the deck options dialog
...
Introduces three new hooks:
* deck_conf_will_show: Allows adding or modifying widgets
* deck_conf_did_load_config: Allows add-on widgets to read from config
* deck_conf_will_save_config: Allows add-on widgets to write to config
2020-02-24 13:42:30 +01:00
Damien Elmes
2f4ee0e523
Merge pull request #456 from Arthur-Milchior/noDefaultDeckInBrowser
...
No default deck in browser
2020-02-24 19:35:49 +10:00
Damien Elmes
b9280ca31e
enable v2 apkg export
2020-02-24 18:54:55 +10:00
Damien Elmes
1afac2492b
fix tr()
2020-02-24 18:37:02 +10:00
Damien Elmes
0a618c40ad
add Tobias to contributors
...
if anyone else is reading this and thinks they should be on the list,
please let me know!
2020-02-24 18:36:37 +10:00
Damien Elmes
e73157285e
remove old fmtTimeSpan() and associated strings
2020-02-23 18:47:16 +10:00
Damien Elmes
703b9da09c
move the big error message into FTL
...
this works around the issue Pontoon has with saving translations with
trailing newlines, and makes it easier for translators to update in
the future, as the errors are now using markdown
2020-02-23 18:01:34 +10:00
Damien Elmes
0e931808c9
translations no longer require an open collection
2020-02-23 14:57:02 +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
Arthur Milchior
bb86c9dbd6
should(default)deckbedisplayed in snake case
2020-02-22 04:08:01 -08:00
Arthur Milchior
927749d7a6
Remove options for all/allNames
...
Instead, we always see default deck if it has a child
As indicated in https://github.com/ankitects/anki/pull/452
2020-02-22 04:03:42 -08:00
Arthur Milchior
1126ae293e
forceDefault to force_default
2020-02-22 04:01:42 -08: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
f4330cd213
simplify interval display in review log
2020-02-21 15:29:38 +10:00
Damien Elmes
2fc15d0d3a
add non-abbreviated timespan translation; update existing short=True calls
...
- drop the '5m3s' special casing done in the card stats screen, and
just use decimals
- change alignment of the review log so that the non-abbreviated
spans are easier to read
2020-02-21 15:29:38 +10:00
Damien Elmes
598226a5c0
possible fix for race conditions in the sound code
...
https://anki.tenderapp.com/discussions/ankidesktop/39030-erro-ao-adicionar-arquivo-de-udio
the lock should at least ensure _process doesn't disappear in the
middle of our logic, and the longer wait should reduce the chances
of .stop() timing out and allowing multiple audio files to play
Not very happy with the current approach, as in the timeout case
you have multiple threads competing to access the same data
2020-02-21 15:14:09 +10:00
Damien Elmes
abe9f50c14
Revert "Merge pull request #452 from Arthur-Milchior/noDefaultDeckInBrowser"
...
This reverts commit b93d30795c
, reversing
changes made to e16d6055c1
.
More discussion required on https://github.com/ankitects/anki/pull/452
2020-02-21 12:27:39 +10:00
Damien Elmes
b3585502cd
Merge pull request #448 from glutanimate/top_toolbar_links_hook
...
Add a hook for adding links to the top toolbar
2020-02-21 12:18:25 +10:00
Damien Elmes
b93d30795c
Merge pull request #452 from Arthur-Milchior/noDefaultDeckInBrowser
...
No default deck in browser
2020-02-21 12:10:36 +10:00
Glutanimate
496548d886
Refactor ToolbarLink dataclass into create_link arguments
...
ToolbarLink was more of a vestigial left-over from an interim
implementation. This change simplifies link addition and brings
it closer in line with adding buttons in the editor screen
2020-02-20 18:22:31 +01:00
Glutanimate
075a2792f5
Restore gui_hooks changes
2020-02-20 17:05:27 +01:00
Glutanimate
de333cd503
Add ids to all link elements
2020-02-20 16:34:02 +01:00
Glutanimate
a7d56561ba
Rename CenterLink to more generic ToolbarLink and add inline docs
2020-02-20 16:30:22 +01:00
Glutanimate
dfefd67508
Update 'top_toolbar_did_init_links' hook
2020-02-20 16:23:33 +01:00
Glutanimate
e13fee5aa3
Refactor center link creation and link handler registration
...
Uses a CenterLink dataclass to describe individual links, and transforms
them into HTML using create_link, which may also be used by add-ons.
2020-02-20 16:15:50 +01:00
Glutanimate
33f7d7ed50
Merge branch 'master' into top_toolbar_links_hook
2020-02-20 15:17:48 +01:00
Arthur Milchior
0f18e9ee4b
no default in left-side browser
2020-02-19 02:42:04 -08:00
Arthur Milchior
bdcd111d72
Replace g[idx] by variable name
2020-02-19 02:41:57 -08:00
Arthur Milchior
a0bd232cfd
remove default deck from filter list
2020-02-19 02:41:56 -08:00
Damien Elmes
d0ec26709b
pin fcntl, which went missing on Linux in a recent update
2020-02-19 19:59:31 +10:00
Arthur Milchior
bdf10d9649
method shouldBeDisplayed
2020-02-19 01:56:33 -08:00
BlueGreenMagick
8318cb8e0c
fix typo
...
<font> tag was closed by </span>
2020-02-19 17:46:12 +09:00
Damien Elmes
e0951e4cfe
add 'new #' prefix to new cards in the due column
2020-02-18 11:16:15 +10:00
Damien Elmes
8c80e46d80
fix card info screen
2020-02-18 10:59:24 +10:00
Damien Elmes
0309113b0a
fix legacy filter return values being ignored
2020-02-18 09:12:16 +10:00
Damien Elmes
3ea272989b
fix negative number in compat message
2020-02-18 08:27:47 +10:00
Damien Elmes
25ecb5d1f0
Merge pull request #450 from Arthur-Milchior/selectCardInBrowserFromReviewer
...
Current card get selected in browser
2020-02-18 08:27:34 +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
775765ff4f
Complete OverviewContent docs
2020-02-17 16:53:47 +01:00
Glutanimate
f7ae2fa1f7
Add overview_will_render_content hook
2020-02-17 16:49:21 +01:00
Glutanimate
8ff1a2e770
Bundle individual section hooks together into one
...
Uses new dataclass 'DeckBrowserContent'
2020-02-17 16:26:21 +01:00
Arthur Milchior
8ecd606ada
Current card get selected in browser
...
I'm pretty sure it was the way it worked before. I'm surprised that
it's not the case anymore.
If you open the browser from the reviewer, the current card get
selected if it exists. The current note is still entirely displayed.
Personally, I want to know easily which is the current card. Opening
the browser is the easiest way to do it; assuming I can see the
current card selected
2020-02-17 04:10:47 -08:00
Damien Elmes
ca0df4929d
add fallback for tr if collection not open
...
When syncing media on close, the collection may be closed before
media syncing completes.
A better solution in the future will be decouple translations from
the collection object.
2020-02-17 17:39:01 +10:00
Damien Elmes
1524e7dcac
split "Due" into three different contexts for translators
2020-02-17 14:41:01 +10:00
Damien Elmes
d612aa0945
localize some error messages
2020-02-17 11:38:22 +10:00
Damien Elmes
67a741958c
use new i18n infrastructure for more media check / media sync strings
2020-02-17 10:18:20 +10:00
Damien Elmes
f6a881f950
pass progress back as translated string(s)
2020-02-17 08:40:17 +10:00
Damien Elmes
6c9e9eb330
drop unused threadLocal and noHint i18n code
2020-02-17 08:40:17 +10:00
Damien Elmes
97b9b94fc7
use new file locations for translations
...
- translation files are now stored in a separate repo, and
use a layout compatible with Pontoon
- normalize the language code in aqt, so that old config settings
and command line arguments are correctly handled
- store Qt and gettext translations in separate subfolders
- remove Crowdin scripts
2020-02-17 08:40:17 +10:00
Damien Elmes
f6ddcd81df
fix sync deauth
2020-02-17 08:40:17 +10:00
Damien Elmes
5c8e3df612
include report in MediaCheckOutput
2020-02-17 08:40:17 +10:00
Damien Elmes
4c0f216df2
use media.trash for unused media deletion as well
2020-02-17 08:40:17 +10:00
Damien Elmes
4fc898ec1e
accept clicks on the progress dialog close button when updating
2020-02-17 08:40:17 +10:00
Damien Elmes
0c27126817
fix latex render progress; display more frequently
2020-02-17 08:40:17 +10:00
Damien Elmes
49cda5ffbb
rename aqt/media.py to mediacheck.py
2020-02-17 08:40:17 +10:00
Damien Elmes
2d0499580f
if latex fails to render in bulk, show the user the problem
2020-02-17 08:40:17 +10:00
Damien Elmes
9df2a08cb0
new render_all_latex() + gui button; remove some old code
2020-02-17 08:40:17 +10:00
Damien Elmes
c347c9aee8
sort media list
2020-02-17 08:40:17 +10:00
Damien Elmes
6f158c8555
plug new media check in
2020-02-17 08:40:17 +10:00
Damien Elmes
aa832e9117
backend stores media folder/db locations; don't need to pass them in
2020-02-17 08:40:17 +10:00
Damien Elmes
7ae6244f6a
log media DB change registration progress, and allow aborting it
2020-02-17 08:40:17 +10:00
Damien Elmes
5fe1bfc5b4
simplify code by accumulating stats at the source
2020-02-17 08:40:17 +10:00
Damien Elmes
98279add15
defer errors on upload to media check
2020-02-17 08:40:17 +10:00
Damien Elmes
d38c2c12d5
autosync media every ~15 minutes
2020-02-17 08:40:17 +10:00
Damien Elmes
12d009e503
autosync media on close
2020-02-17 08:40:17 +10:00
Damien Elmes
59a7993011
autosync media on startup
2020-02-17 08:40:17 +10:00
Damien Elmes
fdd850c0f0
add extra hook for media sync start/stop
2020-02-17 08:40:17 +10:00
Damien Elmes
de27cf2a63
if toolbar refreshed, make sure not to clear syncing
2020-02-17 08:40:16 +10:00
Damien Elmes
6a64c8dfcc
use enums for some common errors
2020-02-17 08:40:16 +10:00
Damien Elmes
c329759a88
catch DB errors in sync
2020-02-17 08:40:16 +10:00
Damien Elmes
ec9abf1ce5
pass in endpoint
2020-02-17 08:40:16 +10:00
Damien Elmes
0c124188cd
catch network errors
2020-02-17 08:40:16 +10:00
Damien Elmes
93c768cab9
move more logic into mediasync.py, handle auth errors
2020-02-17 08:40:16 +10:00
Damien Elmes
347ac80086
remove unused code
2020-02-17 08:40:16 +10:00
Damien Elmes
cb0ce4146f
show spinner when media sync active, click to reveal dialog
2020-02-17 08:40:16 +10:00
Damien Elmes
ea4de9a6de
connect media sync progress to Python, add a progress dialog
2020-02-17 08:40:16 +10:00
Damien Elmes
4096d21c07
add add_file() and write_data()
2020-02-17 08:40:16 +10:00
Damien Elmes
57b678a939
put head text after css/js imports so it can override them
...
as discussed in PR #438
2020-02-17 08:38:59 +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
Damien Elmes
0ec3bbe1af
Merge pull request #447 from glutanimate/browser-sidebar-tree-hooks
...
Add browser_will_build_tree filter
2020-02-16 08:36:28 +10:00
Damien Elmes
990a6c394b
Merge pull request #445 from glutanimate/new-html-view-hooks-2
...
Allow add-on authors to easily inject their own content into Anki's web views – take 3
2020-02-16 08:32:34 +10:00
Glutanimate
621e634bb2
Add a convenience function for creating toolbar links
...
Similar to aqt.editor.Editor.addButton
2020-02-15 23:22:41 +01:00
Glutanimate
18ae9e612e
Add top_toolbar_did_init_links hook
...
Allows extending the links in the top toolbar, in a similar
fashion to editor_did_init_shortcuts
2020-02-15 23:21:23 +01:00
Glutanimate
a8aac761f1
Add browser_will_build_tree filter
...
Allows add-ons to populate the browser sidebar tree with their own
items, and/or take over specific construction stages in their
entirety
2020-02-15 21:03:15 +01:00
Glutanimate
3637f466b4
Update documentation for webview_will_set_content and WebContent
2020-02-15 15:03:58 +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
Damien Elmes
f7ebb8c28f
Merge pull request #433 from Arthur-Milchior/ints
...
Constants
2020-02-14 08:37:31 +10:00
ijgnd
d0ea2ad749
small fix: store return value for hook in preview
2020-02-13 18:51:11 +01:00
Glutanimate
c86e55d451
Fix "js" parameter type
2020-02-12 22:20:30 +01:00
Glutanimate
c839cda19f
Fix missing "Optional" import and lint
2020-02-12 22:15:44 +01:00
Glutanimate
5bd38ce0a5
Pass CardInfoDialog context to stdHtml
2020-02-12 22:12:45 +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
1c677bb9d4
night mode fix for find dupes screen
2020-02-12 08:28:33 +10:00
Damien Elmes
3425bee968
provide easy access to browser from preview/dupes handlers
2020-02-12 08:28:21 +10:00
Damien Elmes
2c4c8d4ab0
tweak wording
2020-02-12 08:14:16 +10:00
Arthur Milchior
a087d0e4c4
Adding export option in Browser
2020-02-11 10:50:59 -08:00
Arthur Milchior
617043f632
browser._exporting
2020-02-11 10:50:59 -08:00
Arthur Milchior
272db65f0a
Replace list of deck by "Browser Selection"
2020-02-11 10:50:59 -08:00
Arthur Milchior
a6567da259
if cards are selected, default is apkg
2020-02-11 10:50:59 -08:00
Arthur Milchior
d8669835d8
aqt.exporter takes extra argument cid
2020-02-11 10:49:13 -08:00
Damien Elmes
af26922493
fix error when double-clicking open profile button
...
https://anki.tenderapp.com/discussions/ankidesktop/38670-bug-when-auto-sync-is-enabled-and-open-profile-button-is-double-clicked
2020-02-10 09:32:56 +10:00
Damien Elmes
072b64c819
work around HTML editor race condition on macOS
...
https://anki.tenderapp.com/discussions/beta-testing/1785-cant-see-html-boxes
2020-02-10 09:25:11 +10:00
Damien Elmes
7fcb6b5672
pass instance to webview_did_receive_js_message instead of string
2020-02-09 08:59:29 +10:00
Damien Elmes
5bd67509ae
Merge pull request #441 from Arthur-Milchior/hookRefreshOverview
...
Allow to change main window when overview/deckbrowser is shown
2020-02-09 08:02:41 +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
c8b794e6cc
formatting
2020-02-07 17:55:26 +10:00
Damien Elmes
5b01f0dad1
more legible graph colours in night mode
2020-02-07 13:21:46 +10:00
Arthur Milchior
fc5c1fd16a
correct missing french translation
2020-02-05 20:48:30 -08:00
Arthur Milchior
35c8f21eb6
Reformatting through black
2020-02-04 08:47:36 -08:00
Arthur Milchior
957f0c8e8b
QUEUE and TYPE day learn, relearn
2020-02-04 08:47:36 -08:00
Arthur Milchior
45bf763238
QUEUE_TYPE_REV and CARD_TYPE_REV
2020-02-04 08:47:36 -08:00
Arthur Milchior
69436643fe
CARD_TYPE_LRN and QUEUE_TYPE_LRN
2020-02-04 08:47:35 -08:00
Damien Elmes
3f3c1255bf
clearer variable names
2020-02-04 17:10:20 +10:00
Damien Elmes
2ccece86a7
minor wording tweak
2020-02-04 17:06:41 +10:00
Damien Elmes
8dd75edaa9
default human_version to None
2020-02-04 17:03:21 +10:00
Damien Elmes
d200d33aa5
Merge pull request #435 from ijgnd/debug2
...
Extend Copy Debug Info and add human_version to manifest.json
2020-02-04 17:01:50 +10:00
ijgnd
62527f0b54
about.py - some type hints
2020-02-04 04:16:51 +01:00
ijgnd
6e1996f701
Extend Copy Debug Info
2020-02-04 04:16:51 +01:00
ijgnd
de9331a03e
add human_version to manifest.json
...
edit 7586c67 add human_version to manifest.json
2020-02-04 04:16:12 +01:00
Arthur Milchior
a1cc0787d2
QUEUE_TYPE_NEW and CARD_TYPE_NEW
2020-02-03 02:24:37 -08:00
Arthur Milchior
25c579926b
radioCram
2020-02-03 02:24:37 -08:00
Arthur Milchior
fc7636c194
radioPreview
2020-02-03 02:24:37 -08:00
Arthur Milchior
7e0b4522fb
radioAhead
2020-02-03 02:24:37 -08:00
Arthur Milchior
20bb24a641
radioForgot
2020-02-03 02:24:37 -08:00
Arthur Milchior
c3bd167958
radiorRev
2020-02-03 02:24:37 -08:00
Arthur Milchior
da39ef378c
radioNew
2020-02-03 02:24:37 -08:00
Damien Elmes
5d91580ce2
add option to disable audio interrupting
2020-02-03 08:55:14 +10:00
Damien Elmes
ab1f2429a7
formatting
2020-02-02 13:09:02 +10: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
3c48cbff6f
more contrast on buttons and scrollbars
2020-02-02 12:53:35 +10:00
Damien Elmes
dd9812c7ed
match fusion bars to webview bars, bump size again
2020-02-02 12:25:07 +10:00
Damien Elmes
92888345fb
fix gridline color in macOS dark mode
...
https://anki.tenderapp.com/discussions/beta-testing/1752-beta7-nightmode-issues-on-mac
2020-02-02 12:01:27 +10:00
Damien Elmes
05be20f834
make pylint happy
2020-01-31 14:30:41 +10:00
Damien Elmes
c70badcd5a
only import darkdetect on a Mac
2020-01-31 14:14:54 +10:00