BlueGreenMagick
ffb6ae2dc6
match both forward slash and os seperator
2020-02-29 12:36:10 +09:00
evandrocoan
bc5a9da396
Fixed anki website docs link on pylib/anki/consts.py
2020-02-28 22:18:19 -03:00
Arthur Milchior
f20b0e43cd
indicate that card_will_show belong to multiple windows
2020-02-28 13:34:48 +01:00
Damien Elmes
749541226e
fix _tidy_name() comment
2020-02-28 17:14:47 +10:00
Damien Elmes
80cd519d40
stop fetching qt translations as part of recompile step
2020-02-27 20:38:05 +10:00
Damien Elmes
6aafefbc0c
fix echo statement
2020-02-27 20:37:44 +10:00
Damien Elmes
1e03223320
dump po data into json to speed up invocations
2020-02-27 20:37:24 +10:00
Damien Elmes
2de865d7f0
migrate strings with trailing newlines to fluent
2020-02-27 20:36:40 +10:00
Damien Elmes
5f7046e841
strip whitespace in extracted strings
2020-02-27 17:38:02 +10:00
Damien Elmes
56d902b669
fix extract-po-string path
2020-02-27 17:37:40 +10:00
Damien Elmes
f5f2063211
remove submodule that crept into Alan's patch
2020-02-27 14:33:15 +10:00
evandrocoan
59d45f309a
Merge remote-tracking branch 'danielelmes/master' into fix_windows_build
...
# Conflicts:
# CONTRIBUTORS
2020-02-27 00:54:16 -03:00
Alan Du
df55645ced
Apply mypy improvements to aqt
2020-02-26 22:27:58 -05:00
evandrocoan
4a2456f62f
Merge remote-tracking branch 'danielelmes/master' into fix_windows_build
...
# Conflicts:
# Makefile
2020-02-27 00:20:34 -03:00
Damien Elmes
fcc965e81a
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
93c2e04267
FString -> TR
2020-02-27 12:25:19 +10:00
Damien Elmes
3dc0567f89
add string for media log title, and add button in prefs to access it
2020-02-27 12:22:24 +10:00
Damien Elmes
83d894ac87
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
228db67c93
Add a hook to change empty cards to delete
2020-02-26 10:59:34 -08:00
Damien Elmes
946a2e6a3e
add missing short argument to legacy fmtTimeSpan()
2020-02-26 20:36:59 +10:00
Damien Elmes
b276e6f9ac
fix push-i18n
2020-02-26 18:09:06 +10:00
Damien Elmes
7d691d7571
don't abort build if mo file fails; rename files for consistency
...
Issues are now checked for in CI, so there's no need to break the
build for everyone each time there's a problem with the gettext
catalogs.
2020-02-26 17:47:02 +10:00
Damien Elmes
8b728b4a1e
fix dark mode target Qt version
2020-02-26 16:53:35 +10:00
evandrocoan
0eee3061dc
Removed the qt/Makefile INSTALL_PYAUDIO variable and
...
created the Makefile SYSTEM_PACKAGES updating README.development
2020-02-25 21:08:05 -03:00
Damien Elmes
94ba217c25
formatting fixes
2020-02-25 17:56:46 +10:00
Damien Elmes
5ca00fc92d
interrupt current audio when autoplay off
2020-02-25 17:49:06 +10:00
Damien Elmes
c240690da7
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
c172557e47
formatting fix
2020-02-25 17:29:10 +10:00
Damien Elmes
59328d9ade
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
fa41f24bf6
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
999aa74eb2
ensure Anki starts on Windows systems that don't have TTS installed
2020-02-25 16:25:17 +10:00
Damien Elmes
8efc23229c
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
evandrocoan
2d316748a7
Merge remote-tracking branch 'danielelmes/master' into fix_windows_build
...
# Conflicts:
# Makefile
2020-02-25 03:16:57 -03:00
evandrocoan
9e690f80e7
Renamed FIND_EXEC to FIND, replaced IS_WINDOWS by specific commands
...
as PYTHON_BIN, ACTIVE_SCRIPT and INSTALL_PYAUDIO.
Fixed echo statements not using @ to suppress double message output.
Deprecated the usage of ECHOCMD := /bin/echo -e because it has no
effect: https://stackoverflow.com/questions/60387684/how-to-make-the-makefile-echos-to-use-bin-echo-e
# Conflicts:
# Makefile
2020-02-25 03:15:11 -03:00
Damien Elmes
9aa23c4846
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
Damien Elmes
592741deaa
change default night mode card background to dark grey
2020-02-25 15:43:56 +10:00
Damien Elmes
d8695b215f
use -q instead of --for-msgfmt so older gettext versions don't break
...
I was mainly using it to keep the output tidy anyway
2020-02-25 13:52:40 +10:00
Damien Elmes
d26a68f20e
Merge pull request #458 from glutanimate/add-deck-conf-hooks
...
Add deck options hooks
2020-02-25 13:38:04 +10:00
evandrocoan
5fab701431
Added -o pipefail to all set -e ensuring the build fails when some
...
operation with pipe exits error status.
# Conflicts:
# Makefile
2020-02-24 20:18:56 -03:00
evandrocoan
6a70adf6f4
Fixed msgmerge not stopping the shell on error
2020-02-24 17:54:59 -03:00
evandrocoan
a3e2793e25
Fixed build-mo-files not stopping on build errors
2020-02-24 17:02:27 -03:00
evandrocoan
6d16298254
Fixed development compilation with Windows 10
...
1. Documented on README.development how to setup the environment
for Windows.
2. Fixed qt/ts/package.json not working due usage of ; instead
of &&
3. Fixed copy-qt-files rsync using Windows paths instead of Unix
ones
4. Fixed Makefile's using Windows Linux Subsystem bash instead of
the Cygwin one.
5. Ensured running the correct pip module by using python -m pip
instead of just pip.
6. Fixed Makefiles using Windows `find` command, instead of the
Cygwin's one (POSIX find).
7. Fixed pyenv sourcing/activate using /pyevn/bin/ instead of
/python/Scripts/ on Windows.
8. Fixed pyaudio not installing/linking with portaudio on Windows
by installing for a patched fork at evandroforks/pyaudio
9. Forked and fixed portaudio not building with Visual Studio 2017
or superior and added the reference for the patched fork on
README.development at evandroforks/portaudio.
2020-02-24 14:59:11 -03:00
Glutanimate
f7b256a860
Use a consistent function signature across load and save hooks
2020-02-24 15:47:48 +01:00
Glutanimate
d1dc0362b6
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
368a485847
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
43dae5c90e
Merge pull request #456 from Arthur-Milchior/noDefaultDeckInBrowser
...
No default deck in browser
2020-02-24 19:35:49 +10:00
Damien Elmes
db486dd25c
enable v2 apkg export
2020-02-24 18:54:55 +10:00
Damien Elmes
0e6b584483
fix tr()
2020-02-24 18:37:02 +10:00
Damien Elmes
d085fcea64
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
087afc94d8
merge po with pot before building mo
...
fixes errors in strings that have been removed from the template
2020-02-24 15:35:52 +10:00
Damien Elmes
70ae99778f
remove old fmtTimeSpan() and associated strings
2020-02-23 18:47:16 +10:00
Damien Elmes
f710e58cee
check-po-files moved into i18n repo
2020-02-23 18:33:03 +10:00
Damien Elmes
1c69747b5a
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
024126b3be
support aqt-specific FTL files
2020-02-23 18:00:13 +10:00
Damien Elmes
d270a01b61
update extract-po-string
...
- use fluent.syntax for output (only non-plural case for now)
- add confirmation step
2020-02-23 17:58:43 +10:00
Damien Elmes
c98247fa0f
translations no longer require an open collection
2020-02-23 14:57:02 +10:00
Damien Elmes
0d1a30c6d8
rework Fluent handling
...
- all .ftl files for a language are concatenated into a single file
at build time
- all languages are included in the binary
- external ftl files placed in the ftl folder can override the
built-in definitions
- constants are automatically generated for each string key
- dropped the separate StringsGroup enum
2020-02-23 13:22:50 +10:00
Arthur Milchior
adfbd0d70f
should(default)deckbedisplayed in snake case
2020-02-22 04:08:01 -08:00
Arthur Milchior
6a50730f0d
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
89b79d9800
forceDefault to force_default
2020-02-22 04:01:42 -08:00
Damien Elmes
258a8a04f0
fix comment
2020-02-21 20:10:58 +10:00
Damien Elmes
7d4d713c49
remove unused import
2020-02-21 19:58:54 +10:00
Damien Elmes
3a83d9844a
add studied_today(), move to statistics.ftl
2020-02-21 18:01:15 +10:00
Damien Elmes
ce84a1a246
don't use implicit $ in extract-po-strings
2020-02-21 17:06:57 +10:00
Damien Elmes
05c20e72e8
split ftl and po syncing scripts
2020-02-21 15:29:38 +10:00
Damien Elmes
8afaaf9c70
simplify interval display in review log
2020-02-21 15:29:38 +10:00
Damien Elmes
ddf1d6acbd
add plural support to extract-po-string
2020-02-21 15:29:38 +10:00
Damien Elmes
74bff450e2
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
b0cd1b23f2
support variables when importing from gettext
2020-02-21 15:29:38 +10:00
Damien Elmes
bda7e0e0a4
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
e98e85a0b8
Revert "Merge pull request #452 from Arthur-Milchior/noDefaultDeckInBrowser"
...
This reverts commit 56d908cc28 , reversing
changes made to c123b5bf95 .
More discussion required on https://github.com/ankitects/anki/pull/452
2020-02-21 12:27:39 +10:00
Damien Elmes
a30e4d9313
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
56d908cc28
Merge pull request #452 from Arthur-Milchior/noDefaultDeckInBrowser
...
No default deck in browser
2020-02-21 12:10:36 +10:00
Glutanimate
4f50f6c669
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
8aa7e9e32e
Restore gui_hooks changes
2020-02-20 17:05:27 +01:00
Glutanimate
1df7a29765
Add ids to all link elements
2020-02-20 16:34:02 +01:00
Glutanimate
0e8c8ae775
Rename CenterLink to more generic ToolbarLink and add inline docs
2020-02-20 16:30:22 +01:00
Glutanimate
af2c353aa7
Update 'top_toolbar_did_init_links' hook
2020-02-20 16:23:33 +01:00
Glutanimate
1a8ef9e589
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
05f5b4d664
Merge branch 'master' into top_toolbar_links_hook
2020-02-20 15:17:48 +01:00
Arthur Milchior
59587f1bb2
no default in left-side browser
2020-02-19 02:42:04 -08:00
Arthur Milchior
541e586db1
Replace g[idx] by variable name
2020-02-19 02:41:57 -08:00
Arthur Milchior
aa1668ec96
remove default deck from filter list
2020-02-19 02:41:56 -08:00
Damien Elmes
20c765cf91
pin fcntl, which went missing on Linux in a recent update
2020-02-19 19:59:31 +10:00
Arthur Milchior
9860d5ba5e
method shouldBeDisplayed
2020-02-19 01:56:33 -08:00
BlueGreenMagick
b81db34fbd
fix typo
...
<font> tag was closed by </span>
2020-02-19 17:46:12 +09:00
Damien Elmes
5bb81a95c2
add 'new #' prefix to new cards in the due column
2020-02-18 11:16:15 +10:00
Damien Elmes
fdf297afa0
fix card info screen
2020-02-18 10:59:24 +10:00
Damien Elmes
0e7f433071
fix legacy filter return values being ignored
2020-02-18 09:12:16 +10:00
Damien Elmes
d2929bcc64
fix negative number in compat message
2020-02-18 08:27:47 +10:00
Damien Elmes
08bb73b4d9
Merge pull request #450 from Arthur-Milchior/selectCardInBrowserFromReviewer
...
Current card get selected in browser
2020-02-18 08:27:34 +10:00
Damien Elmes
0a562c2eac
Merge pull request #449 from glutanimate/html-content-section-hooks
...
Add hooks for modifying HTML body sections in the deck browser and overview screens
2020-02-18 08:20:01 +10:00
Glutanimate
ed2782b185
Complete OverviewContent docs
2020-02-17 16:53:47 +01:00
Glutanimate
0e95badd80
Add overview_will_render_content hook
2020-02-17 16:49:21 +01:00
Glutanimate
803b0432f1
Bundle individual section hooks together into one
...
Uses new dataclass 'DeckBrowserContent'
2020-02-17 16:26:21 +01:00
Arthur Milchior
3763d35149
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
e020aa54f9
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
9ffae5650f
fix initial build failing
2020-02-17 15:48:27 +10:00
Damien Elmes
fd01cac4d7
split "Due" into three different contexts for translators
2020-02-17 14:41:01 +10:00
Damien Elmes
b9276f8d56
add helper script to extract previous translated string
2020-02-17 13:41:21 +10:00
Damien Elmes
d13473d456
make sure ftl files get updated
2020-02-17 12:35:55 +10:00
Damien Elmes
908bd93831
fix sync-git
2020-02-17 11:45:56 +10:00
Damien Elmes
f40a00f0cb
localize some error messages
2020-02-17 11:38:22 +10:00
Damien Elmes
f6643eda53
use new i18n infrastructure for more media check / media sync strings
2020-02-17 10:18:20 +10:00
Damien Elmes
1f736239cd
pass progress back as translated string(s)
2020-02-17 08:40:17 +10:00
Damien Elmes
8450214cda
add ftl to the build process, and a sync-git script
...
also
- ensure po files are checked when updated
- add start of sync.ftl
2020-02-17 08:40:17 +10:00
Damien Elmes
632041f14f
drop unused threadLocal and noHint i18n code
2020-02-17 08:40:17 +10:00
Damien Elmes
ff9daa099b
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
067ade9a3b
move Gettext translations into separate repo for Pontoon
2020-02-17 08:40:17 +10:00
Damien Elmes
0acae7ecf7
update translations
2020-02-17 08:40:17 +10:00
Damien Elmes
7a0d1ffae0
fix sync deauth
2020-02-17 08:40:17 +10:00
Damien Elmes
834989a019
include report in MediaCheckOutput
2020-02-17 08:40:17 +10:00
Damien Elmes
89626c1a72
use media.trash for unused media deletion as well
2020-02-17 08:40:17 +10:00
Damien Elmes
fc7c2fe187
accept clicks on the progress dialog close button when updating
2020-02-17 08:40:17 +10:00
Damien Elmes
7ce49cb1f8
fix latex render progress; display more frequently
2020-02-17 08:40:17 +10:00
Damien Elmes
71c2730244
rename aqt/media.py to mediacheck.py
2020-02-17 08:40:17 +10:00
Damien Elmes
c4d6d9480c
if latex fails to render in bulk, show the user the problem
2020-02-17 08:40:17 +10:00
Damien Elmes
625b5728cc
new render_all_latex() + gui button; remove some old code
2020-02-17 08:40:17 +10:00
Damien Elmes
edbb23b0ce
sort media list
2020-02-17 08:40:17 +10:00
Damien Elmes
790f3c9f72
plug new media check in
2020-02-17 08:40:17 +10:00
Damien Elmes
edf60b10d4
backend stores media folder/db locations; don't need to pass them in
2020-02-17 08:40:17 +10:00
Damien Elmes
9c60f2c77e
log media DB change registration progress, and allow aborting it
2020-02-17 08:40:17 +10:00
Damien Elmes
ef14b1a96b
simplify code by accumulating stats at the source
2020-02-17 08:40:17 +10:00
Damien Elmes
1f931a5b78
defer errors on upload to media check
2020-02-17 08:40:17 +10:00
Damien Elmes
469798f523
autosync media every ~15 minutes
2020-02-17 08:40:17 +10:00
Damien Elmes
14cb7357fb
autosync media on close
2020-02-17 08:40:17 +10:00
Damien Elmes
728e71f589
autosync media on startup
2020-02-17 08:40:17 +10:00
Damien Elmes
e9884a4b14
add extra hook for media sync start/stop
2020-02-17 08:40:17 +10:00
Damien Elmes
5835a68f47
if toolbar refreshed, make sure not to clear syncing
2020-02-17 08:40:16 +10:00
Damien Elmes
77158760ff
use enums for some common errors
2020-02-17 08:40:16 +10:00
Damien Elmes
85b5c26930
catch DB errors in sync
2020-02-17 08:40:16 +10:00
Damien Elmes
bd14e30f63
constant sync spin speed
2020-02-17 08:40:16 +10:00
Damien Elmes
b883b09414
pass in endpoint
2020-02-17 08:40:16 +10:00
Damien Elmes
c489b6b7ac
catch network errors
2020-02-17 08:40:16 +10:00
Damien Elmes
c02a490be0
move more logic into mediasync.py, handle auth errors
2020-02-17 08:40:16 +10:00
Damien Elmes
ecab2da99e
remove unused code
2020-02-17 08:40:16 +10:00
Damien Elmes
1ba2e30854
show spinner when media sync active, click to reveal dialog
2020-02-17 08:40:16 +10:00
Damien Elmes
738e415463
connect media sync progress to Python, add a progress dialog
2020-02-17 08:40:16 +10:00
Damien Elmes
c9a5ed3cc6
add add_file() and write_data()
2020-02-17 08:40:16 +10:00
Damien Elmes
dee114df63
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
c3c31d1454
Add deck_browser_will_render_section hook
...
Allows add-on authors to specifcally target and modify individual
sections of the deck browser HTML body at string composition time.
2020-02-16 19:29:01 +01:00
Damien Elmes
415cb15661
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
f6bad7b9c3
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
b7dde202b5
Add a convenience function for creating toolbar links
...
Similar to aqt.editor.Editor.addButton
2020-02-15 23:22:41 +01:00
Glutanimate
5378587f67
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
b7e0d4388a
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
356eda66f4
Update documentation for webview_will_set_content and WebContent
2020-02-15 15:03:58 +01:00
Glutanimate
28a394a074
Assume that web assets without a specified subpath are under /_anki
...
Maintains compatibility with existing add-ons
2020-02-15 15:03:43 +01:00
Damien Elmes
3d1e89f014
Merge pull request #433 from Arthur-Milchior/ints
...
Constants
2020-02-14 08:37:31 +10:00
ijgnd
e39d18647f
small fix: store return value for hook in preview
2020-02-13 18:51:11 +01:00
Glutanimate
f2f16903b6
Fix "js" parameter type
2020-02-12 22:20:30 +01:00
Glutanimate
ffdafaee6d
Fix missing "Optional" import and lint
2020-02-12 22:15:44 +01:00
Glutanimate
7e213bdcd5
Pass CardInfoDialog context to stdHtml
2020-02-12 22:12:45 +01:00
Glutanimate
d7836e3af8
Add webview_will_set_content hook & update supporting code accordingly
2020-02-12 22:00:13 +01:00
Glutanimate
88b5d94513
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
5faaf35eec
fix odd outline in replay button, and center align
...
https://anki.tenderapp.com/discussions/beta-testing/1708-anki-2120-beta#comment_48079637
2020-02-12 09:18:32 +10:00
Damien Elmes
faded8f56d
study screen -> overview screen wording
...
This is a test change to see how Crowdin handles wording tweaks
2020-02-12 09:02:48 +10:00
Damien Elmes
369c810778
update translations
2020-02-12 08:59:14 +10:00
Damien Elmes
084e059508
constrain editor and reviewer image width to container width
...
view height still makes more sense in the reviewing screen so images
are relative to the window instead of the document
2020-02-12 08:33:55 +10:00
Damien Elmes
89f926f177
night mode fix for find dupes screen
2020-02-12 08:28:33 +10:00
Damien Elmes
e64b1e0ca2
provide easy access to browser from preview/dupes handlers
2020-02-12 08:28:21 +10:00
Damien Elmes
27dabaeaa6
tweak wording
2020-02-12 08:14:16 +10:00
Damien Elmes
f8338b094d
move export notes action to the notes menu
2020-02-12 08:09:12 +10:00
Arthur Milchior
097e6d4b46
Adding export option in Browser
2020-02-11 10:50:59 -08:00
Arthur Milchior
c16a3954fa
browser._exporting
2020-02-11 10:50:59 -08:00
Arthur Milchior
078a10ae55
Replace list of deck by "Browser Selection"
2020-02-11 10:50:59 -08:00
Arthur Milchior
9c158e615e
if cards are selected, default is apkg
2020-02-11 10:50:59 -08:00
Arthur Milchior
d1183df830
aqt.exporter takes extra argument cid
2020-02-11 10:49:13 -08:00
Damien Elmes
897f7ed249
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
6096d19b85
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
a7348f0d23
ensure the inverted images don't appear over toolbar
2020-02-09 09:30:37 +10:00
Damien Elmes
c8eb939231
support AnkiMobile's drawings in night mode
2020-02-09 09:20:08 +10:00
Damien Elmes
fc40182335
pass instance to webview_did_receive_js_message instead of string
2020-02-09 08:59:29 +10:00
Damien Elmes
b4761698cb
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
0d23f5dafb
Allow to change main window when overview/deckbrowser is shown
2020-02-08 08:09:12 -08:00
Damien Elmes
cc27baef35
formatting
2020-02-07 17:55:26 +10:00
Damien Elmes
c8f3c5819d
don't filter strong/em; sort list of tags
2020-02-07 17:55:17 +10:00
Damien Elmes
e0d81675c2
update translations
2020-02-07 13:26:15 +10:00
Damien Elmes
d20ac6f341
more legible graph colours in night mode
2020-02-07 13:21:46 +10:00
Arthur Milchior
769c806c2d
correct missing french translation
2020-02-05 20:48:30 -08:00
Arthur Milchior
607bcc55c2
Reformatting through black
2020-02-04 08:47:36 -08:00
Arthur Milchior
611ce618a8
QUEUE and TYPE day learn, relearn
2020-02-04 08:47:36 -08:00
Arthur Milchior
41ffdbd504
QUEUE_TYPE_REV and CARD_TYPE_REV
2020-02-04 08:47:36 -08:00
Arthur Milchior
44368caf55
CARD_TYPE_LRN and QUEUE_TYPE_LRN
2020-02-04 08:47:35 -08:00
Damien Elmes
16e9a9c32f
clearer variable names
2020-02-04 17:10:20 +10:00
Damien Elmes
ff466ff3e9
minor wording tweak
2020-02-04 17:06:41 +10:00
Damien Elmes
511d2cf469
default human_version to None
2020-02-04 17:03:21 +10:00
Damien Elmes
89ad3ae00c
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
aabfb83fb5
about.py - some type hints
2020-02-04 04:16:51 +01:00
ijgnd
0c4f520725
Extend Copy Debug Info
2020-02-04 04:16:51 +01:00
ijgnd
486c5871af
add human_version to manifest.json
...
edit 7586c67 add human_version to manifest.json
2020-02-04 04:16:12 +01:00
Arthur Milchior
e27b2ff554
QUEUE_TYPE_NEW and CARD_TYPE_NEW
2020-02-03 02:24:37 -08:00
Arthur Milchior
e5b4dc62ae
radioCram
2020-02-03 02:24:37 -08:00
Arthur Milchior
0a4641cc2d
radioPreview
2020-02-03 02:24:37 -08:00
Arthur Milchior
e4d698e399
radioAhead
2020-02-03 02:24:37 -08:00
Arthur Milchior
1ffde9ca7f
radioForgot
2020-02-03 02:24:37 -08:00
Arthur Milchior
d2007462da
radiorRev
2020-02-03 02:24:37 -08:00
Arthur Milchior
46c62526d0
radioNew
2020-02-03 02:24:37 -08:00
Damien Elmes
b8f90f4e4b
add option to disable audio interrupting
2020-02-03 08:55:14 +10:00
Damien Elmes
85b3a1dc94
formatting
2020-02-02 13:09:02 +10:00
Damien Elmes
62b5c4bf73
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
6dbbc52d1a
more contrast on buttons and scrollbars
2020-02-02 12:53:35 +10:00
Damien Elmes
c1c1a54ea8
match fusion bars to webview bars, bump size again
2020-02-02 12:25:07 +10:00
Damien Elmes
55c8a10a9d
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
cca836de34
make pylint happy
2020-01-31 14:30:41 +10:00
Damien Elmes
3377fea96c
only import darkdetect on a Mac
2020-01-31 14:14:54 +10:00
Damien Elmes
596a38d0f8
mypy+darkdetect fix
2020-01-31 13:45:25 +10:00
Damien Elmes
fe9f886955
update translations
2020-01-31 13:44:46 +10:00
Damien Elmes
74f5acce6e
when dark mode not active, match fusion buttons
2020-01-31 13:39:52 +10:00
Damien Elmes
d13e6cb29e
redraw top toolbar when deck list refreshed
...
Just a hack that allows users to click on Decks to adjust the colour
after a macOS theme change.
2020-01-31 13:31:31 +10:00
Damien Elmes
a25c092a8b
ignore dark mode when running from source, as it doesn't work
2020-01-31 13:30:35 +10:00
Damien Elmes
b7c492c40c
maintain separate icon cache for light and dark themes
2020-01-31 13:30:12 +10:00
Damien Elmes
7a63c42b39
use night mode when dark mode active, using standard macOS theme
2020-01-31 13:15:08 +10:00
Damien Elmes
39b7786573
put % in spinners
...
fixes the lone % shown for users of the v1 scheduler
2020-01-31 12:19:51 +10:00
Damien Elmes
bc609dc2d9
ignore immediate=True in progress dialog
...
Instead, set the busy cursor immediately to give the user feedback,
but defer popup for at least 500ms. This will hopefully address the
white flash in night mode on Windows, and prevent progress dialogs
from rapidly appearing and disappearing for short operations.
2020-01-31 08:47:05 +10:00
Damien Elmes
5da6797a99
ignore foreground/background colour in spans when night mode active
...
This prevents pasted text from a standard webpage appearing as
black on white. It could theoretically be made smarter in the future,
but handling all the situations where the background or foreground
colour is not exactly #000/#fff might be tricky.
2020-01-31 08:03:09 +10:00
Damien Elmes
58fdc22486
make link/filtered deck colour in night mode more blue
2020-01-31 07:38:14 +10:00
Damien Elmes
4f6d18ee19
drop the extraneous svg group
2020-01-31 07:23:35 +10:00
Damien Elmes
3309d0f8c6
disable elastic scrolling to work around Qt's buggy behaviour on macOS
2020-01-31 07:12:27 +10:00
Damien Elmes
42f09fe933
add compat soundLink selector back
2020-01-31 07:01:22 +10:00
Damien Elmes
a8e0b53165
add .night_mode as well
...
Please report if this causes any regressions.
2020-01-31 07:00:01 +10:00
Damien Elmes
bbd134fcc6
use SVG for the play icon, and reduce the default size to 40px
2020-01-28 10:11:29 +10:00
Damien Elmes
d09a0e6115
update translations
2020-01-27 18:17:59 +10:00
Damien Elmes
2bada0e891
tolerate branch idx out of range
...
Branches can't be deleted at the moment, but this may change in the
future.
2020-01-27 17:59:40 +10:00
Damien Elmes
8014fd6574
mac top toolbar looks better with a slightly whiter border
2020-01-27 17:02:40 +10:00
Damien Elmes
8bd253c48f
rework update checks to match latest AnkiWeb API
2020-01-27 17:01:09 +10:00
Damien Elmes
bd94e6fc01
fix +ve max versions being marked as disabled
2020-01-27 16:58:12 +10:00
Damien Elmes
92adb7a6db
don't do HTML filtering when pasting urls/text/images
...
fixes
https://anki.tenderapp.com/discussions/ankidesktop/37752-anki-21-wont-play-audio-files-with-a-blank-in-the-title
2020-01-26 19:13:31 +10:00
Damien Elmes
7abe5d2a9b
fix pylint
2020-01-26 18:57:32 +10:00
Damien Elmes
f38aa3f320
style tags area like fields
2020-01-26 18:47:28 +10:00
Damien Elmes
7b84eb2c7f
remove the extra margin in the editing area so everything lines up
2020-01-26 18:26:03 +10:00
Damien Elmes
f253711559
remove the line at the top of the editor
2020-01-26 18:25:44 +10:00
Damien Elmes
dbaac0ae23
use a darker rather than lighter border in night mode
2020-01-26 18:16:21 +10:00
Damien Elmes
42527d0b08
add a (perhaps temporary) tts-voices: filter to show all available engines
2020-01-26 17:35:07 +10:00
Damien Elmes
47bcb3845c
support speed control in tts tags
2020-01-26 14:31:07 +10:00
Damien Elmes
54626b4ae3
slightly lighter, larger night mode scrollbar
2020-01-26 10:39:53 +10:00
Damien Elmes
68dc9d1e61
fix webview button alignment on Linux
...
caused by the height: specification inside webview.py
2020-01-26 10:18:24 +10:00
Damien Elmes
6973df52a0
fix tags area and stats buttons in night mode
2020-01-26 09:13:38 +10:00
Damien Elmes
2d4d89d5a5
fix autoplaying of audio in preview screen, and drop extend_and_play()
2020-01-25 16:02:34 +10:00
Damien Elmes
cf815d01c5
respond to play button clicks in preview screen + card layout screen
2020-01-25 16:02:21 +10:00
Glutanimate
dbe8e8f6e1
Fix formatting error
2020-01-24 15:48:05 +01:00
Glutanimate
b1cecb08d4
Equip Reviewer._showAnswer with hooks covering common add-on usages
2020-01-24 15:36:05 +01:00
Damien Elmes
1d78e3f5ba
Merge pull request #429 from zjosua/latex-nightmode
...
Invert LaTeX in night mode
2020-01-24 17:37:12 +10:00
Damien Elmes
99ccabf7c1
Merge pull request #428 from Arthur-Milchior/unusedOptional
...
"unused" variable become optional.
2020-01-24 17:28:47 +10:00
Damien Elmes
405c21eda8
support min/max add-on versions in download and ankiaddon manifest
2020-01-24 17:25:52 +10:00
zjosua
9564be80d0
Invert LaTeX in night mode
2020-01-24 08:23:27 +01:00
Damien Elmes
6bbab6e9f9
move strip_av_refs() into anki.sound
2020-01-24 15:48:40 +10:00
Arthur Milchior
577b68b205
"unused" variable become optional.
...
Adding this parameter broke one of my add-on, see
https://github.com/Arthur-Milchior/anki-keep-model-in-add-cards/issues/1
Since those parameters are not used, setting them to None by default,
as was done in some other method, seems acceptable
2020-01-23 21:46:42 -08:00
Damien Elmes
46c6a7f7e4
extract and flag AV tags as part of the render process
...
We can now show replay buttons for the audio contained in {{FrontSide}}
without having to play it again when the answer is shown.
The template code now always defers FrontSide rendering, as it wasn't
a big saving, and meant the logic had to be implemented twice.
2020-01-24 11:06:11 +10:00
Damien Elmes
e61759bf35
fix night mode tooltips
2020-01-24 07:55:14 +10:00
Damien Elmes
54d8a04e8e
night mode scrollbars in webviews
2020-01-24 07:41:39 +10:00
Damien Elmes
2603b4037d
fix link colour
2020-01-24 07:17:24 +10:00
Damien Elmes
70e96521d6
fix filtered deck colour
2020-01-24 07:17:20 +10:00
Damien Elmes
f80bcf15ca
fix mpv failing to load
2020-01-24 07:06:59 +10:00
Damien Elmes
1dc673a068
fix white background in day mode
2020-01-23 18:36:42 +10:00
Damien Elmes
58cbca9a8c
inject legacy funcs referencing aqt in GUI load
2020-01-23 18:20:19 +10:00
Damien Elmes
a9749bbcb1
fix inconsistently sized buttons and add platform classes
2020-01-23 18:05:55 +10:00
Damien Elmes
5855c465c0
better dupe color
2020-01-23 18:01:29 +10:00
Damien Elmes
78a8229577
don't wait as long for player to stop
2020-01-23 17:27:07 +10:00
Damien Elmes
43cfcaca3d
iconFromRef() compat
2020-01-23 17:27:07 +10:00
Damien Elmes
6e984b3cc3
fix audio displaying console window on Windows
2020-01-23 17:27:07 +10:00
Damien Elmes
6c50b09ff0
fix white flash on webview load
2020-01-23 17:27:07 +10:00
Damien Elmes
35435a130e
basic night mode support
...
Forces the Fusion theme when running night mode, so we don't need
to work around platform themes that don't respond to the defined
palette.
Feedback/suggestions on the chosen colours welcome - _vars.scss is the
file to change if you want to experiment with adjustments.
2020-01-23 17:27:07 +10:00
Damien Elmes
1fa162c6b5
move css files to scss
2020-01-23 17:27:07 +10:00
Damien Elmes
e3940b4e4f
handle spaces in voices, add platform prefix
2020-01-22 17:50:08 +10:00
Damien Elmes
f987310a50
move ignore statements for python 3.7
...
sigh :-(
https://github.com/python/mypy/issues/3251#issuecomment-490298556
2020-01-22 16:54:18 +10:00
Damien Elmes
214871c7a4
make pylint happy
2020-01-22 15:37:58 +10:00
Damien Elmes
712779886a
add a hook for when playback begins
2020-01-22 14:41:32 +10:00
Damien Elmes
42c04817c7
make .command() behave the same way for mplayer and mpv
2020-01-22 14:11:25 +10:00
Damien Elmes
bfc0ac1c0f
simplify taskman, and add .run_on_main()
2020-01-22 14:09:51 +10:00
Damien Elmes
cd4d4b8adb
add pause and seek forward/back shortcuts to review screen
2020-01-22 12:50:33 +10:00
Damien Elmes
4f9c9e1770
add a webview_did_receive_js_message hook
2020-01-22 11:06:12 +10:00
Damien Elmes
5aae3e2e39
add optional result_callback arg to pycmd() definition
2020-01-22 10:28:45 +10:00
Damien Elmes
c1021bc046
include card ordinal in clayout
2020-01-22 10:28:10 +10:00
Damien Elmes
837ac57ab2
add option in prefs to hide replay audio buttons
2020-01-21 21:00:17 +10:00
Damien Elmes
2b9a74fe5c
mypy fixes
2020-01-21 20:42:06 +10:00
Damien Elmes
52a41d9a8e
formatting fixes
2020-01-21 20:39:25 +10:00
Damien Elmes
27b14aea3e
add a helper for caching generated files
2020-01-21 20:35:23 +10:00
Damien Elmes
5b7699563f
when matching voices, need to check language matches too
2020-01-21 20:35:00 +10:00
Damien Elmes
0df9837a66
fix mpv args
...
https://anki.tenderapp.com/discussions/ankidesktop/38186-mpvprocesserror-unable-to-start-process
2020-01-21 19:29:50 +10:00
Damien Elmes
e326236f7c
compare only on rank, as voices may be subclassed
2020-01-21 18:33:14 +10:00
Damien Elmes
8ddb49eb76
add Windows TTS support
2020-01-21 17:34:47 +10:00
Damien Elmes
171764e3e0
add replay buttons to reviewing screen
2020-01-21 14:47:03 +10:00
Damien Elmes
6d1d806b3a
make sure we don't mutate list passed to play_from_tags()
2020-01-21 14:43:33 +10:00
Damien Elmes
202dc608a3
deal with spaces in macOS voices like "Bad News"
2020-01-21 13:38:37 +10:00
Damien Elmes
9dc9151963
add file-based TTS say implementation as well
2020-01-21 13:21:43 +10:00
Damien Elmes
b0d2958721
add rank handling to TTS; parse TTS args in get_av_tags()
2020-01-21 12:41:37 +10:00
Damien Elmes
a85ad8b257
more TTS and sound work
...
- use provided language and voices when playing on Mac
- fix hang in waiting for termination
- allow players to return a rank for a given tag,
which will allow for the best matching player to be chosen
depending on the context (eg, prioritize one player for videos,
one tts player for certain voices, etc)
2020-01-21 11:34:25 +10:00
Damien Elmes
222ecc35ce
spawn a new slave mode mplayer for each file
...
This solves a few problems:
- We no longer need to write temporary files to disk, as files
passed on the command line with non-Latin text can be read by mplayer.
- We no longer need to deal with mplayer processes left around in
the background that have failed to terminate.
- We don't need to deal with the added complexity that comes with
polling mplayer's status output to determine when the file has finished
playing.
Also add seek_relative(), toggle_pause() and shutdown() as optional
methods on AVPlayer.
2020-01-21 08:55:15 +10:00
Damien Elmes
8b1d029eb9
support interrupting say; fix race in simple player
2020-01-21 07:28:19 +10:00
Damien Elmes
f9ca9501ac
pass task manager in instead of creating a new one
2020-01-21 06:49:09 +10:00
Damien Elmes
41272674d8
add .stop() to mpv
2020-01-21 06:45:32 +10:00
Damien Elmes
7bf4c9f08f
get mpv slave mode working with new API
...
Also move the mpv-specific hooks into AVPlayer
2020-01-20 22:01:38 +10:00
Damien Elmes
8a09d1365e
minor tidyup to sound.py
2020-01-20 21:03:22 +10:00
Damien Elmes
3a427ba5b1
don't need allSounds/stripSounds in qt's sound.py
2020-01-20 20:13:01 +10:00
Damien Elmes
263a04c887
update qt/ to use the new API
2020-01-20 20:10:38 +10:00
Damien Elmes
4d3858023b
add a proof of concept TTS implementation on Mac
2020-01-20 20:08:19 +10:00
Damien Elmes
b5758c2cff
rework the audio player API and add a simpler player implementation
...
- the new API operates on AVTags so it can support TTS as well as
audio files
- added a simple "run for each file" implementation for mpv and mplayer.
- will need to test handling of unicode filenames on Windows
- the old mpv and mplayer code is currently not active
2020-01-20 20:07:11 +10:00
Damien Elmes
71fe9a015a
we can depend on pyaudio being available now that the code is in qt/
2020-01-20 19:21:24 +10:00
Damien Elmes
ca46e01ffc
update translations
2020-01-19 16:58:34 +10:00
Damien Elmes
81684ecf52
fix download log newlines
2020-01-19 16:46:24 +10:00
Damien Elmes
8dfd3e93f8
fix <br> remaining when image attached to empty field
2020-01-19 16:41:39 +10:00
Damien Elmes
168cd54827
leave percent-escaped text from the editor alone
...
Originally added in d7339d9a27b8abd65fbcf85f809fb0089046986f;
unfortunately the change message does not describe why. Images
are handled separately, so it should theoretically not be required,
and keeping it in leads to garbled text when people include %
on their cards.
Latest report at https://anki.tenderapp.com/discussions/ankidesktop/38138-errors-in-conversion-of-latex-and-ea
2020-01-19 16:29:46 +10:00
Damien Elmes
283601768c
avoid setting provided_name if not in the json
2020-01-19 14:10:48 +10:00
Damien Elmes
afe54ff6bc
update add-ons even if they're disabled
...
If a user enables an old add-on and restarts immediately, it won't have
had a chance to update, and may raise errors that could have been
prevented if the user was running the latest version.
2020-01-19 14:04:57 +10:00
Damien Elmes
f1f5a401f2
send point version when downloading
...
AnkiWeb will return a 404 if add-on does not support that version
2020-01-19 13:43:16 +10:00
Damien Elmes
5646ee642a
automatically disable add-ons that have been marked as incompatible
2020-01-19 13:37:55 +10:00
Damien Elmes
92c82e29e1
add write_addon_meta(); use methods for derived values
2020-01-19 13:06:53 +10:00
Damien Elmes
6f2603710e
use an object for add-on metadata instead of reading the dict directly
...
also, sort disabled add-ons to the end
2020-01-19 12:44:53 +10:00
Damien Elmes
0a57969a44
AnkiRequestsClient -> HttpClient
2020-01-19 11:33:27 +10:00
Damien Elmes
1ff42d776c
check for add-on updates once a day
2020-01-19 11:31:09 +10:00
Damien Elmes
33d02709b5
refactor add-on downloading/installing/updating
...
- web requests done on a background thread
- easier to use outside of the addon dialog
- gets max point version info from AnkiWeb, which we can use in
the future
2020-01-19 10:37:15 +10:00
Damien Elmes
7a28533c85
fix display errors on macOS after updating add-ons
2020-01-19 10:33:51 +10:00
Damien Elmes
1ae2528153
add helper for background execution
2020-01-19 10:06:01 +10:00
Damien Elmes
d86b231c2b
pass in a progress callback instead of http_data_did_[send|receive]
...
If a request is happening on a background thread, the GUI code
receiving requests on that thread can lead to a crash
Add-on downloading still to do.
2020-01-18 17:49:59 +10:00
Damien Elmes
705ab55fef
move AnkiRequestsClient into its own file
...
It should still be accessible via anki.sync as well.
2020-01-18 15:45:14 +10:00
Damien Elmes
897a7e6584
remove template/ from i18n
2020-01-17 11:14:54 +10:00
Damien Elmes
88577605de
update translations
2020-01-17 11:09:24 +10:00
Damien Elmes
5d29ad51da
move types.py into the files responsible for each type
2020-01-17 10:17:33 +10:00
Damien Elmes
dfcc81af08
fix formatting
2020-01-16 12:45:48 +10:00
Damien Elmes
05a99a1bf6
option to invert paste handling in prefs
2020-01-16 12:36:04 +10:00
Damien Elmes
5e4f8673c4
fix preview button shortcut
...
Qt 'helpfully' erases any existing shortcuts when .setText() is called,
and as PyQt's generated forms set the text after the shortcut is set,
it gets lost.
https://anki.tenderapp.com/discussions/ankidesktop/38038-does-ctrlshiftp-doesnt-trigger-preview-in-browse
2020-01-16 12:31:02 +10:00
Damien Elmes
552839fdce
don't change current deck if custom study fails to create
...
just a quick fix for now
https://anki.tenderapp.com/discussions/ankidesktop/37834-bug-custom-study-session-created-even-when-there-are-no-cards-that-match-selected-criteria
2020-01-16 11:26:22 +10:00
Damien Elmes
2d30177b98
revert to the old wrap() behaviour
...
wrap2() was introduced recently to try and resolve an issue where
styling outside of the wrapped section was getting lost. eg,
<b>some [text] etc</b>
When the user created a cloze deletion or added math tags to the [text]
part, the text ended up not being bold - the inner portion is displayed
without styling.
wrap2() used setFormat("inserttext", ...), which did fix that issue
- but it also introduced multiple new issues:
- any HTML inside the selected area, including newlines and images,
was lost
- the unicode entities inserted when creating a cloze deletion in
RTL mode end up inserted as plain text
For now, I'm just going to revert to the old behaviour. If anyone
has a suggestion for an approach that is able to preserve both the
inner formatting and the surrounding formatting, a pull request
or post on the forums would be appreciated!
2020-01-16 10:33:36 +10:00
Damien Elmes
68791b7008
fix invalid func name in unfocus hook
...
Don't know why mypy and pylint both failed to catch this :-(
2020-01-16 08:53:28 +10:00
Damien Elmes
f02f845193
fix cases where we used the wrong type sig to connect to gui hook
2020-01-16 07:53:12 +10:00
Damien Elmes
20db4ab2f3
add qconnect helper and some type hints
...
The type hints allow mypy to check the gui_hook calls, revealing a
bunch of places that are broken as they expect no arguments like the
legacy hooks.
To make mypy happy about PyQt's signal.connect(func), a qconnect()
helper has been added.
2020-01-16 07:41:23 +10:00
Damien Elmes
18e06b0926
Merge pull request #421 from ErezVolk/tag-changed-grooming
...
Tag modified grooming
2020-01-15 20:25:51 +10:00
Erez Volk
8b83b1a3d3
Small fixes and tweaks to "Tag Modified":
...
- No need for the checkbox, as an unchecked box is equal to an empty
`QLineEdit`.
- The value was saved to the profile but not loaded.
- And the real pièce de résistance: I've figured out how to "Promote"
the `QLineEdit` to a `TagEdit`.
Hope you like it! :)
2020-01-15 10:46:05 +02:00
Damien Elmes
b22dc71810
more tweaks for readability/consistency
2020-01-15 17:45:35 +10:00
Damien Elmes
dd780b2898
more hook tweaks, and merge the pre-render field and template hooks
2020-01-15 17:18:11 +10:00
Damien Elmes
8bad40152d
remove _hook/_filter suffix
2020-01-15 16:53:24 +10:00
Damien Elmes
a38b5c1bb6
tweak the hook names in anki/
...
still a work in progress
2020-01-15 16:43:22 +10:00
Damien Elmes
e6f60e65f0
fix file path in comment
2020-01-15 15:29:23 +10:00
Damien Elmes
32edb4522d
migrate addHook/remHook calls
2020-01-15 13:49:26 +10:00
Damien Elmes
141c86acd9
idempotent hook removal
...
This matches remHook()'s behaviour
2020-01-15 13:16:43 +10:00
Damien Elmes
f6ccde1c2f
tidy hooks, add reviewCleanup
2020-01-15 13:03:11 +10:00
Damien Elmes
aa0300af90
migrate most of the remaining runHook() calls
2020-01-15 12:46:53 +10:00
Damien Elmes
8fb11a4070
remove unused function
2020-01-15 12:17:29 +10:00
Damien Elmes
550264b1e5
add more hooks, tweak wording for consistency
2020-01-15 12:16:54 +10:00
Damien Elmes
2f2d376746
clean stale build folders before build
...
setuptools will bundle up files from that folder even if they're
no longer in the source tree.
2020-01-15 10:07:39 +10:00
Damien Elmes
ac9470dd5f
move hook gen code out of anki/
...
It's not needed at runtime, and this allows hooks to be updated
even when the code is broken.
2020-01-15 09:11:20 +10:00
Damien Elmes
e250550ac0
add _ prefix to generated classes to improve code completion
2020-01-15 08:58:27 +10:00
Damien Elmes
80d7333c9d
add some more hooks; stringify fully qualified types
...
To avoid circular imports, types that contain a '.' are automatically
converted to strings.
2020-01-15 08:56:56 +10:00
Damien Elmes
ac07cf3920
remove some comments that are no longer relevant
2020-01-14 20:45:18 +10:00
Damien Elmes
50729da84a
if profile is corrupt and is reset, need to set default lang again
...
Fixes https://anki.tenderapp.com/discussions/ankidesktop/37994-traceback-error-with-windows-64bit-standard-installation
2020-01-14 15:18:07 +10:00
Damien Elmes
2aae03cdf1
fix startup when prefs.db not readable
...
If we fail to open the Anki 2.0 prefs.db file, on the second try
we need to revert to a new file instead of trying the same broken
file again.
2020-01-14 14:59:46 +10:00
Damien Elmes
5b3852b2ba
if pm.meta() fails, need to unset pm
...
This prevents a startup failure caused by trying to set
the UI scale when .meta() is not working. Startup still
fails, but the correct message is displayed now.
2020-01-14 14:57:24 +10:00
Damien Elmes
7352e0f43b
switch to classes for hooks
...
This allows us to add a docstring to .append() so users can see
the names of the arguments that are being passed, and means we
don't have to remember to prepend run_ when calling a hook.
2020-01-14 08:54:07 +10:00
Damien Elmes
21feaf9a63
include py.typed for mypy
...
these builds are now available on
https://github.com/ankitects/anki-typecheck
The add-on docs will be updated shortly to provide info on
using the new hooks and type checking.
2020-01-13 21:18:03 +10:00
Damien Elmes
2834cdcc6a
add license to wheels and option to skip bundling extra files
2020-01-13 20:04:23 +10:00
Damien Elmes
555d1f0e55
add a flag to handle the legacy hook missing args case
...
And update a few more hooks.
2020-01-13 18:37:08 +10:00
Damien Elmes
3d94af972e
update the rest of the anki/ hooks/filters
2020-01-13 17:59:52 +10:00
Damien Elmes
ad59c96bdd
run black on generated hooks
2020-01-13 17:55:58 +10:00
Damien Elmes
765c7a143c
buildinfo required to generate hooks
2020-01-13 14:55:32 +10:00
Damien Elmes
aa8b1645a7
add separate file for gui hooks
2020-01-13 14:38:05 +10:00
Damien Elmes
ae4ea8db22
New type-safe approach to hooks/filters
...
Still todo:
- Add separate module for GUI hooks
- Update the remaining runHook/runFilter() calls
- Document the changes, including defensive registration
2020-01-13 13:57:51 +10:00
Damien Elmes
356962cb2c
mark anki and aqt modules as having typing info
...
This means once they're installed via develop or a wheel, add-ons
will be able to more easily typecheck their code against the Anki
code.
2020-01-13 13:03:37 +10:00
Damien Elmes
74d0db0bb5
update translations
...
update translations
2020-01-10 08:21:52 +10:00
Glutanimate
4be8351d2c
Add hook for AddCards.addNote
2020-01-08 21:29:28 +01:00
Damien Elmes
34ac272349
show stdout/stderr when running tests
2020-01-08 15:52:51 +10:00
Damien Elmes
9232414095
bump minimum python version from 3.6 to 3.7
2020-01-07 18:34:36 +10:00
Damien Elmes
b1b2cae2bb
remove dupe line
2020-01-06 20:59:18 +10:00
Damien Elmes
194697753d
don't need to rerun checks each time buildhash changes
2020-01-06 19:30:54 +10:00
Damien Elmes
f710d558fd
add tests and setup.py to checks; fix warnings
2020-01-06 15:27:59 +10:00
Erez Volk
8707ffe02a
BUGFIX: QLineEdit doesn't have .toPlainText()
2020-01-05 07:54:45 +02:00
Damien Elmes
27ff4b6a26
skip the automatic push
2020-01-05 08:52:46 +10:00
Damien Elmes
dcf244a44e
update translations
2020-01-05 08:43:39 +10:00
Damien Elmes
d1f5ff4694
make file context relative to root
2020-01-05 08:35:46 +10:00
Damien Elmes
2e86079712
clearer commit message
2020-01-05 08:35:08 +10:00
Damien Elmes
96f721b8c6
update
2020-01-05 08:15:47 +10:00
Damien Elmes
95145addcb
add missing pywin32
2020-01-05 07:34:36 +10:00
Damien Elmes
7334d7a687
wheel deps should be checked at install time, not build time
2020-01-05 07:34:36 +10:00
Glutanimate
a0de4ca0e1
Use add-on name rather than package name when reporting on conflicts
...
Brings _installationSuccessReport more in line with messaging in
AddonManager.toggleEnabled
2020-01-04 04:49:36 +01:00
Glutanimate
34cba492ab
Further tweak messaging depending on Anki's state at installation time
2020-01-04 04:45:43 +01:00
Glutanimate
af508cec71
When possible, install add-on before add-ons are loaded
...
Removes the need to restart Anki if it is not running when
user launches .ankiaddon file
2020-01-04 04:34:16 +01:00
Glutanimate
e4c3a23007
Fix type hints and remove obsolete argument
2020-01-04 04:31:33 +01:00
Glutanimate
6a37cd05bb
Make sure to pass pending imports on to installAddon
...
also: refactor add-on check
2020-01-04 04:30:33 +01:00
Damien Elmes
1fa01bca67
don't reference missing readme in setup.py
2020-01-04 12:21:58 +10:00
Damien Elmes
39f2ca54e8
quieten wheel build
2020-01-04 12:21:58 +10:00
Damien Elmes
c88694333b
update readme, remove submodule readmes
2020-01-04 12:21:58 +10:00
Damien Elmes
351699268a
move top level scripts into makefile
2020-01-04 12:21:58 +10:00
Glutanimate
e1e848c6ed
Merge branch 'ankiaddon-filetype-handling' of https://github.com/Glutanimate/anki into ankiaddon-filetype-handling
2020-01-04 02:36:28 +01:00
Glutanimate
be89378ee2
Adjust type annotations, format string, and remove tooltip on cancel
...
Other areas of Anki don't confirm cancelling actions with tooltips,
so after further consideration, the tooltip felt out of the place and
might have actually confused users into thinking some action was
being performed.
2020-01-04 01:30:20 +01:00
Aristotelis
e6a3e7360b
Merge pull request #1 from amboss-mededu/add-amboss-contrib
...
Add AMBOSS as a contributor
2020-01-03 18:45:20 +01:00
Yann Salimi
f70f7dd518
Add AMBOSS as a contributor
2020-01-03 18:37:50 +01:00
Glutanimate
b61610142e
Fix mypy and black checks
2020-01-03 18:23:28 +01:00
Glutanimate
6cad2b2983
Add .ankiaddon mime-type on Linux and register Anki as its handler
2020-01-03 17:58:11 +01:00
Glutanimate
8b2588f079
Extend CLI with the ability to install .ankiaddon packages
...
Allows Anki to register a mime-type handler for .ankiaddon files
Other small collateral changes:
+ fix positioning issues with some prompts and progress dialog
+ add prompt titles where they were missing
+ add type annotations for AddonManager installation methods
+ explicitly import os in main (used to be imported via aqt.qt)
2020-01-03 17:57:33 +01:00
Glutanimate
74b0899ef1
Extend showInfo with the ability to add custom buttons
...
Grants more flexibility in user prompt design
2020-01-03 17:48:17 +01:00
Glutanimate
6bf7736e84
Refactor add-on installation error handling
...
Allows extending the installation pathways more easily.
In preparation of .ankiaddon file type handling.
2020-01-03 16:32:20 +01:00
Erez Volk
0e77bfc010
Enable Tag Modified iff importMode is Update
2020-01-03 08:32:44 +02:00
Erez Volk
bf6672d7e8
Merge remote-tracking branch 'upstream/master' into add-tags-on-update
2020-01-03 08:13:04 +02:00
Damien Elmes
a113887d56
add buildhash to rspy and aqt, and check all three modules match
2020-01-03 15:15:18 +10:00
Damien Elmes
5eee63ca6d
use proper version number in build outputs
2020-01-03 14:36:14 +10:00
Damien Elmes
7efccd69f8
output into dist/
2020-01-03 14:32:26 +10:00
Damien Elmes
a71f607936
make sure isort preserves ordering if anki installed into python env
2020-01-03 13:34:51 +10:00
Damien Elmes
c0438373dd
move license info into one place
2020-01-03 09:41:30 +10:00
Damien Elmes
df2cc2fb02
switch from nose2 to pytest
...
pytest will show what differs in simple assert statements
concurrent mode is supported with a plugin, but like nose2, concurrent
mode hides the cause of import errors, so I've left it off for now.
2020-01-03 08:52:10 +10:00
Damien Elmes
86bb676007
integrate i18n into new structure
2020-01-03 08:24:59 +10:00
Damien Elmes
6d0c9cd289
add translations from crowdin
2020-01-03 07:59:33 +10:00
Damien Elmes
e1621ed66a
merge i18n into qt/
2020-01-03 07:59:00 +10:00
Damien Elmes
2a00e0a6b0
tweaking the folder names again
...
hopefully that's the last of it
2020-01-03 07:48:38 +10:00