evandrocoan
a99e455414
Removed duplicated mediasrv.py security check and fixed invalid
...
command/path error message.
2020-07-02 20:39:03 -03:00
evandrocoan
1218d109e8
Fix jest unit tests after merge
...
# Conflicts:
# qt/aqt/mediasrv.py
# qt/ts/src/ankimedia.ts
# qt/ts/src/reviewer-exceptions.test.ts
# qt/ts/src/reviewer.test.ts
# ts/package.json
2020-07-02 14:30:43 -03:00
evandrocoan
0142ac3ca2
Replaced send_from_directory by send_file to simplify the code
2020-07-02 13:52:07 -03:00
evandrocoan
1e6fa5f8eb
Ensure protection against directory transversal
...
https://security.openstack.org/guidelines/dg_using-file-paths.html
2020-07-02 13:52:03 -03:00
evandrocoan
be10da58d9
Fixed aqt/mediasrv.py:14: error: unused 'type: ignore' comment
...
from waitress.server import create_server # type: ignore
https://github.com/evandroforks/anki/runs/743801391#step:25:1129
2020-07-02 13:51:59 -03:00
evandrocoan
020415efb9
Replaced the mediasrv.py SimpleHttp server by flask and waitress,
...
fixing HTML5 media support.
https://stackoverflow.com/questions/37044064/html-audio-cant-set-currenttime
https://stackoverflow.com/questions/21956683/enable-access-control-on-simple-http-server
https://stackoverflow.com/questions/5052635/what-is-relation-between-content-length-and-byte-ranges-in-http-1-1
https://stackoverflow.com/questions/16725907/google-app-engine-serving-mp3-for-audio-element-needs-content-range-header
I was trying to use HTML5 audio tag to display audios like:
```html
<audio id="elem_audio" src="myfile.mp3" controls></audio>
```
![image](https://user-images.githubusercontent.com/5332158/79063321-565b5500-7c77-11ea-9f8d-6e1df6f07892.png )
But the progress bar seek was not working. After researching, I found the problem was the HTML server not properly responding to the HTML5 header requests. The HTML server should respond to quite complicated things as 206 partial, properly handle keep-alive, provide media ranges and other HTTP headers: https://stackoverflow.com/questions/37044064/html-audio-cant-set-currenttime
To implement all these on the Simple HTTP server would be quite complicated. Then, instead, I imported the `flask` web server, which is quite simple and straight forward to use. Now, the back-end is using a secure complaint HTTP back-end:
1. https://palletsprojects.com/p/flask/
> Flask is a lightweight WSGI web application framework. It is designed to make getting started quick and easy, with the ability to scale up to complex applications. It began as a simple wrapper around Werkzeug and Jinja and has become one of the most popular Python web application frameworks.
>
> Flask offers suggestions, but doesn't enforce any dependencies or project layout. It is up to the developer to choose the tools and libraries they want to use. There are many extensions provided by the community that make adding new functionality easy.
1. https://docs.pylonsproject.org/projects/waitress/en/latest/
> Waitress is meant to be a production-quality pure-Python WSGI server with very acceptable performance. It has no dependencies except ones which live in the Python standard library. It runs on CPython on Unix and Windows under Python 2.7+ and Python 3.5+. It is also known to run on PyPy 1.6.0 on UNIX. It supports HTTP/1.0 and HTTP/1.1.
Right now, anki does not support fields passing file names directly to HTML audio tags, but this can be easily done with (https://github.com/ankitects/anki/pull 540 - Added arguments to the sound tag) plus the commit 826a97df61
, the HTML5 audio tag can be used like this:
```html
// Audio = [sound:myfile.mp3|onlyfilename]
<audio id="elem_audio" src="{{Audio}}" controls controlsList="nodownload"></audio>
```
![image](https://user-images.githubusercontent.com/5332158/79063736-c539ad80-7c79-11ea-8420-40b72185f4e7.png )
# Conflicts:
# qt/aqt/mediasrv.py
2020-07-02 13:51:49 -03:00
Damien Elmes
48b6510aef
dump error on profile load fail
...
may help diagnose
https://forums.ankiweb.net/t/i-couldnt-open-anki-resetting-corrupt-global/190
2020-07-02 10:35:01 +10:00
Damien Elmes
04b1ca7559
defer top toolbar drawing until after add-ons loaded
...
https://forums.ankiweb.net/t/anki-2-1-28-beta/629/13
2020-07-02 10:23:14 +10:00
Damien Elmes
dfda5750a1
add new strings to .po files as part of template update
...
Pontoon appears to only update existing gettext translations; it
won't add new ones on its own. Fixes
https://forums.ankiweb.net/t/anki-2-1-28-beta/629/6
2020-07-02 10:03:39 +10:00
Damien Elmes
97869d0f57
fix scrollbars on fields on Windows/Linux
2020-07-02 09:51:50 +10:00
Damien Elmes
4d23a69e9a
formatting
2020-07-01 14:01:24 +10:00
Damien Elmes
6db954fbbe
don't allow table inside field to extend outside of field
...
https://anki.tenderapp.com/discussions/private/4498-adjust-textbox-geometry-in-add-note-window
2020-07-01 12:13:04 +10:00
Damien Elmes
bedd9dadb1
add option to disable media syncing
...
https://forums.ankiweb.net/t/error-when-adding-audio-file/495/2
2020-07-01 11:35:24 +10:00
Damien Elmes
05fb67d409
show clearer error when media db locked
...
should not happen frequently during a sync, but may happen during
the initial change checking stage
https://forums.ankiweb.net/t/error-when-adding-audio-file/495/2
2020-07-01 11:19:06 +10:00
Damien Elmes
40f270c386
shift+click on the graphs button to access old graphs for now
2020-06-30 20:07:46 +10:00
Damien Elmes
101deb002b
graphs now work in night mode
2020-06-30 16:23:46 +10:00
Damien Elmes
f3febea4b0
update edited/changed column labels
...
https://github.com/ankitects/anki/pull/674/files
2020-06-29 18:34:03 +10:00
Damien Elmes
52cd9fc4b8
plug new graphs code into GUI
...
Still some work to do. Feedback welcome!
2020-06-29 15:53:56 +10:00
Damien Elmes
d4cd4535e6
lint fixes
2020-06-29 15:53:56 +10:00
Damien Elmes
72609bee18
add option to webview to skip external browser open
2020-06-29 15:48:01 +10:00
Damien Elmes
1f4f5b8c45
include generated js in aqt_data
2020-06-29 15:48:01 +10:00
Damien Elmes
41d77b0255
get i18n working in typescript
2020-06-29 15:48:01 +10:00
Damien Elmes
329186f140
qt's js code now shares ts/node_modules; more graph work
2020-06-29 15:48:01 +10:00
Damien Elmes
2a3ef80c90
update qt ts to prettier 2.0
2020-06-29 15:48:01 +10:00
Damien Elmes
dcff5e28fa
add top level component and pass search/day limit back from frontend
2020-06-29 15:48:00 +10:00
Damien Elmes
82568a1f3e
experiment with exposing raw card/revlog data to frontend
2020-06-29 15:48:00 +10:00
Damien Elmes
35975b142b
Merge pull request #675 from kelciour/mpv-changes-2
...
A few mpv changes 2
2020-06-29 15:47:09 +10:00
kelciour
696f7e4373
Fix "make check" by defining dummy _register_callbacks method in MPVBase
2020-06-27 13:07:46 +03:00
kelciour
d1b74dfcb6
Fix no sound after mpv restart
2020-06-27 03:46:40 +03:00
kelciour
422e313c16
Replace mpv "idle" property with "end-file" event
2020-06-27 03:46:40 +03:00
kelciour
610f9eb236
Replace default mpv quit keybindings if mpv version is >= 0.30
...
4614d432a8
2020-06-27 03:46:40 +03:00
neitrinoweb
69f73b57e7
add type hints
2020-06-25 17:27:52 +03:00
neitrinoweb
c7db6331cf
fix missing typing import
2020-06-25 16:53:24 +03:00
Damien Elmes
5e5dc517ca
work around yet another qt bug
...
https://anki.tenderapp.com/discussions/beta-testing/2017-httpsforumsankiwebnettrestore-defaults-config-not-visually-updated420
2020-06-24 11:12:45 +10:00
Damien Elmes
ef55c0a2ee
remove the script-message commands that older mpv version don't support
...
https://github.com/ankitects/anki/pull/671#issuecomment-647798343
2020-06-23 14:30:42 +10:00
Damien Elmes
c3e007f069
remove mpv keybindings on init
...
On a machine here, they cause the following error:
raise MPVCommandError("%r: %s" % (message["command"], e))
aqt.mpv.MPVCommandError: ['keybind', 'q', 'stop']: invalid parameter
2020-06-22 13:22:57 +10:00
Damien Elmes
f24321dc65
Merge pull request #671 from kelciour/mpv-changes
...
A few mpv changes
2020-06-22 12:12:58 +10:00
Damien Elmes
2cd86f38f4
Merge pull request #670 from evandroforks/print_version
...
Create the command line argument -v/--version to print version
2020-06-22 12:06:18 +10:00
kelciour
678b751010
Reset pause mode when switching to the next file
2020-06-20 02:04:35 +03:00
kelciour
d64c26f20a
Replace deprecated "idle" event with "idle-active" property
2020-06-20 02:04:35 +03:00
kelciour
9aee8085e0
Disable OSC idle message
2020-06-20 02:04:34 +03:00
kelciour
ae533fce71
Replace default mpv "quit" keybindings with "stop"
...
https://github.com/mpv-player/mpv/blob/master/etc/input.conf
2020-06-20 02:04:34 +03:00
evandrocoan
9867e5e1f7
Create the command line argument -v/--version to print version
...
https://forums.ankiweb.net/t/i-couldnt-open-anki-resetting-corrupt-global/190
2020-06-19 13:13:10 -03:00
Arthur Milchior
3eabe4c3f7
Strip name of added deck
...
There is currently what I believe to be a bug: create a deck " ".
The creation is accepted and the name is renamed to "blank". Instead,
I believe you'd want to strip the deck name before testing its
emptiness.
2020-06-17 11:58:33 +02:00
Damien Elmes
b51f03085e
migrate card stats to backend
...
Currently this renders the HTML directly like the previous Python
implementation - doing it in JS would probably make more sense in the
future.
2020-06-15 17:22:16 +10:00
Damien Elmes
2845941a28
Merge pull request #667 from BlueGreenMagick/refresh-deck-list
...
refresh deck list when adding deck via deckchooser
2020-06-12 09:12:51 +10:00
Damien Elmes
9e0494047e
Merge pull request #666 from BlueGreenMagick/studydeck-name
...
get deck name after adding deck
2020-06-12 09:12:21 +10:00
Damien Elmes
8f36a0fbb0
Merge pull request #665 from BlueGreenMagick/remove-a-var
...
Add type hints to deckchooser
2020-06-12 09:11:54 +10:00
Damien Elmes
37bf56c56e
remove ellipsis
2020-06-12 09:04:19 +10:00
BlueGreenMagick
e3889d49c9
add typehint to deckchooser.py
...
every occurunce of self.widget is type ignored
because QHBoxLayout has a method named widget
renaming this property will allow type hints
2020-06-11 14:19:36 +09:00
BlueGreenMagick
20da11f57e
refresh deck list when adding deck via deckchooser
2020-06-11 13:00:10 +09:00
BlueGreenMagick
4e6ba4df78
get deck name after adding deck
2020-06-11 12:50:17 +09:00
BlueGreenMagick
552db2b94d
remove self.deck set to mw.col as it isn't used
2020-06-11 11:59:27 +09:00
Quentin Nerden
86713d110e
Update message to match gui
...
The Change Note Type... command is under the Notes menu, not the Edit menu
2020-06-09 11:49:47 +02:00
Damien Elmes
f44597bb3a
Merge pull request #650 from evandroforks/remember_last_inputs
...
Remember last inputs for Find and Replace and Duplicates Find
2020-06-09 14:43:58 +10:00
Damien Elmes
3275aff335
Merge pull request #662 from gaul/screen/none
...
Handle None from QApplication.desktop().screen()
2020-06-09 14:42:59 +10:00
Damien Elmes
30a8d3260b
Merge pull request #655 from Arthur-Milchior/history_line
...
History line
2020-06-09 14:42:45 +10:00
Damien Elmes
62ab2ed36d
remove unused import
2020-06-09 14:14:12 +10:00
Damien Elmes
1aaf1059b4
formatting
2020-06-09 14:07:39 +10:00
Damien Elmes
c77d017135
catch invalid regex in search
...
https://github.com/ankitects/anki/pull/652
2020-06-09 11:46:07 +10:00
Damien Elmes
43da12a445
(un)escape image references in HTML editor to fix ampersand handling
...
https://anki.tenderapp.com/discussions/ankidesktop/41479-image-names-with-are-breaking
2020-06-09 11:22:07 +10:00
Andrew Gaul
e366b86af2
Handle None from QApplication.desktop().screen()
...
This prevents a crash when Anki is open for multiple days. Reference:
https://anki.tenderapp.com/discussions/ankidesktop/41879-qt-cannot-create-window-no-screens-available
2020-06-09 09:57:35 +09:00
Damien Elmes
5f2987d0f8
allow input.conf in Anki data folder
...
https://anki.tenderapp.com/discussions/beta-testing/1964-anki-2128-alpha#comment_48382756
2020-06-09 10:26:25 +10:00
Damien Elmes
4033f6d37e
fix mistaken qconnect replacement
2020-06-09 10:20:16 +10:00
Damien Elmes
20ee0a8b1b
fix 'NoneType' object has no attribute 'latest_progress'
...
https://anki.tenderapp.com/discussions/beta-testing/1964-anki-2128-alpha#comment_48382636
2020-06-09 09:07:41 +10:00
evandrocoan
947f58032f
Moved the utils.py new save/restore functions together
2020-06-08 16:23:32 -03:00
evandrocoan
38fba41fb2
Renamed save_combo_index to save_combo_index_for_session
2020-06-08 16:23:28 -03:00
Arthur Milchior
c81a9b3d61
hook: history_line
...
I expect to use this hook to create an add-on which will simply remove
the ",,". By ignoring empty fields I expect to make this easier to
use.
2020-06-08 20:47:01 +02:00
Damien Elmes
7c444b4d35
add progress to db check
2020-06-08 21:07:36 +10:00
evandrocoan
1d32873869
Renamed new function on qt/aqt/utils.py to snake case
2020-06-08 01:35:31 -03:00
evandrocoan
b23b404f68
Created the profiles.py session attribute for things to forgot
...
each time Anki restarted and set to only fill the find and replace
dialogs when they were filled on the actual session.
2020-06-08 01:35:31 -03:00
evandrocoan
4bc895f7df
Moved restoreComboHistory below saveComboHistory as others
2020-06-08 01:35:31 -03:00
evandrocoan
87d051fa71
Set to browser.py finddupes.ui remember the last selected field
...
https://anki.tenderapp.com/discussions/ankidesktop/39468-find-and-replace-does-not-remember-the-input-from-last-time
2020-06-08 01:35:31 -03:00
evandrocoan
bf55ebbd8a
Added some type checking to utils.py QComboBox restore functions
...
# Conflicts:
# qt/aqt/utils.py
2020-06-08 01:35:31 -03:00
evandrocoan
f27ad0c524
Moved restoreComboHistory closer to restoreComboIndex on utils.py
2020-06-08 01:35:31 -03:00
evandrocoan
6047c6ecc0
Renamed setupComboBoxHistory to restoreComboHisotory,
...
saveComboActiveIndex to saveComboIndex, saveComboBoxHistory to
saveComboHistory and restoreComboActiveIndex to restoreComboIndex.
2020-06-08 01:35:31 -03:00
evandrocoan
a78b3d522e
Set to browser.py finddupes.ui remember the last search text
...
https://anki.tenderapp.com/discussions/ankidesktop/39468-find-and-replace-does-not-remember-the-input-from-last-time
2020-06-08 01:35:31 -03:00
evandrocoan
a74e43a515
Set to browser.py findreplace.ui remember the last selected field
...
by creating saveComboActiveIndex and restoreComboActiveIndex.
https://anki.tenderapp.com/discussions/ankidesktop/39468-find-and-replace-does-not-remember-the-input-from-last-time
2020-06-08 01:35:31 -03:00
evandrocoan
40f98a244f
Set to browser.py findreplace.ui remember the last regex/case
...
by creating the saveIsChecked and restoreIsChecked.
https://anki.tenderapp.com/discussions/ankidesktop/39468-find-and-replace-does-not-remember-the-input-from-last-time
2020-06-08 01:35:31 -03:00
evandrocoan
54d7f136cb
Created the setupComboBoxHistory and saveComboBoxHistory to remove
...
duplicated/common code.
https://anki.tenderapp.com/discussions/ankidesktop/39468-find-and-replace-does-not-remember-the-input-from-last-time
2020-06-08 01:35:31 -03:00
evandrocoan
3971ea5518
Set to remember the last replace input for findreplace.ui
...
https://anki.tenderapp.com/discussions/ankidesktop/39468-find-and-replace-does-not-remember-the-input-from-last-time
2020-06-08 01:35:31 -03:00
evandrocoan
ba99c5ecb5
Set to remember the last find input for findreplace.ui
...
https://anki.tenderapp.com/discussions/ankidesktop/39468-find-and-replace-does-not-remember-the-input-from-last-time
2020-06-08 01:35:31 -03:00
Damien Elmes
a0c1b68b86
Merge pull request #660 from brownbat/tooltip-positioning
...
Update tooltip() in utils.py
2020-06-08 11:40:43 +10:00
Damien Elmes
fd895c88ca
Merge pull request #659 from BlueGreenMagick/paste-typehint
...
add type hint to paste-related functions
2020-06-08 11:32:16 +10:00
Damien Elmes
26330da119
Merge pull request #657 from BlueGreenMagick/prof-name
...
don't allow addons21 as profile name
2020-06-08 11:30:27 +10:00
Damien Elmes
186ccc5f01
pin legacy modules
...
https://anki.tenderapp.com/discussions/ankidesktop/42248-potentially-serious-image-issue#comment_48388863
2020-06-08 11:12:51 +10:00
Thomas B
26b94e1948
Update tooltip() in utils.py
...
Allow x,y offsets to be specified for tooltip(), useful for accomodating longer tooltips.
2020-06-07 16:06:23 -04:00
BlueGreenMagick
6cf95d97e7
add type hint to paste-related functions
2020-06-07 12:06:11 +09:00
BlueGreenMagick
7df3c9f0b1
don't allow addons21 as profile name
...
because addons21 and profiles directory are stored in same directory
2020-06-05 22:44:59 +09:00
Damien Elmes
4a69b55a90
add note/card removal to backend
2020-06-04 18:21:04 +10:00
Damien Elmes
e1b0fe1832
add .count() to hooks, and list->sequence in note deletion
2020-06-04 18:20:03 +10:00
evandrocoan
d566045991
Add missing quotes to typecheck-setup.sh for paths with spaces on
...
the name.
2020-06-02 21:37:58 -03:00
Damien Elmes
36de3ff6fd
more fixes for bundled Qt types
2020-06-03 09:55:30 +10:00
Damien Elmes
08ac2601ed
update qt version pin
2020-06-03 09:55:04 +10:00
Damien Elmes
4c6bd7b037
lint fixes
2020-06-02 17:58:14 +10:00
Damien Elmes
59bbf02364
new stubs don't require as many ignores
2020-06-02 17:56:32 +10:00
Damien Elmes
2a52314d58
Switch to PyQt 5.15's (slightly broken) built-in stubs
2020-06-02 17:52:18 +10:00
Damien Elmes
b3752e8618
fix initial login
2020-06-02 15:10:58 +10:00
Damien Elmes
f0b6d13ead
save browser columns when changed, not on each browser close
2020-06-02 13:39:15 +10:00
Damien Elmes
4d7e23111e
change sync label to indicate sync state
...
- blue for normal sync, red for full sync required
- refactor status fetching code so we don't hold a collection lock
during the network request, which slows things down
- fix sync spinner restarting when returning to deck list
2020-06-02 13:23:01 +10:00
Damien Elmes
49971d0235
fix media sync progress not updating, and issues closing profile
2020-06-01 13:57:10 +10:00
Damien Elmes
00138c6ba0
make sure browser sidebar refreshes on reset()
...
if items are modified in a sync, the sidebar needs to reflect it
2020-06-01 13:57:10 +10:00
Damien Elmes
90e19daec2
handle aborting normal sync
...
- Use a separate abort handle, as the media sync is running
in the background and we need to be able to target them separately.
The current progress handling is going to need a rethink if we introduce
any other background tasks in the future.
- Roll back the transaction when interrupting.
2020-06-01 13:57:10 +10:00
Damien Elmes
c6f0710ce7
report normal sync progress
...
Also:
- provide a way for the progress handler to skip the throttling so that
we can ensure progress is updated at the end of a stage
- show 'checking' at the end of full sync
2020-06-01 13:57:10 +10:00
Damien Elmes
6bf9f5bc6c
lint fixes
2020-06-01 13:57:10 +10:00
Damien Elmes
27a36482c0
unify sync error handling; handle interrupted
2020-06-01 13:57:10 +10:00
Damien Elmes
a8ad4abf37
add "immediate" progress back
...
on ops which we know are going to take time, it makes the interface
look more responsive to pop up the progress more quickly
2020-06-01 13:57:10 +10:00
Damien Elmes
7e221f0acf
update auto-sync code
2020-06-01 13:57:10 +10:00
Damien Elmes
058ff1b71a
show server message if present
2020-06-01 13:57:10 +10:00
Damien Elmes
87ca8e39a8
progress bar tweaks
2020-06-01 13:57:10 +10:00
Damien Elmes
0e5b7da62a
login/full up/full down plugged in
2020-06-01 13:57:10 +10:00
Damien Elmes
ee6d7f82e7
rework progress handling
...
- client now polls status instead of backend pushing it
- supports multiple threads
- update throttling happens in one place
2020-06-01 13:57:10 +10:00
Damien Elmes
b254b1f722
another snapshot of sync work
...
progress handler is going to need to be reworked to function across
threads
2020-06-01 13:57:10 +10:00
Damien Elmes
8516ed8655
handle images served from directory + svg content type
...
https://anki.tenderapp.com/discussions/ankidesktop/41974-win-linux-when-pasting-some-html-i-get-error-in-_run_command-ankirsbackendioerror-ioerror
2020-06-01 13:40:17 +10:00
Damien Elmes
caf95742da
handle unicode hostnames
...
https://anki.tenderapp.com/discussions/ankidesktop/41915-something-wrong-and-i-cant-start-anki
2020-06-01 13:40:17 +10:00
evandrocoan
5bec874a7b
Set to also print the correct QT log message category
2020-05-31 19:38:02 -03:00
evandrocoan
25ff525cc9
Print qt context if it exists
...
https://stackoverflow.com/questions/42561295/qt-error-is-printed-on-the-console-how-to-see-where-it-originates-from
https://stackoverflow.com/questions/35894171/redirect-qdebug-output-to-file-with-pyqt5
https://anki.tenderapp.com/discussions/ankidesktop/42070-anki-closes-without-warning-when-importing-conflicting-shared-deck
https://doc.qt.io/qt-5/qtglobal.html#qInstallMessageHandler
2020-05-31 19:38:02 -03:00
Damien Elmes
9594a3ef9b
add some more names to about.py
...
If you've contributed and are missing from the list, please send me
a PR!
2020-06-01 06:27:14 +10:00
Damien Elmes
268edc237a
Merge pull request #645 from evandroforks/resize_clayout_editor_and_preview
...
Allow to resize clayout.py horizontal space between the text editor and the card preview
2020-06-01 05:53:40 +10:00
evandrocoan
9257e75762
Save and restore the debug console window geometry and splitter
2020-05-30 20:58:55 -03:00
evandrocoan
6bd80fef67
Add saveSplitter and restoreSplitter to clayout.py
...
# Conflicts:
# qt/aqt/clayout.py
2020-05-30 20:33:57 -03:00
evandrocoan
a5fd8398c4
Allow to resize clayout.py horizontal space between the text editor
...
and the card preview.
# Conflicts:
# qt/aqt/clayout.py
2020-05-30 20:33:10 -03:00
Damien Elmes
cfc2a549f1
Merge pull request #641 from glutanimate/add-main-window-did-init-hook
...
Add main_window_did_init hook
2020-05-29 08:56:47 +10:00
Damien Elmes
36bc50d65f
Merge pull request #640 from evandroforks/fix_render_card_being_called_twice
...
Fixed previewer.py::render_card() being called twice in row
2020-05-29 08:48:35 +10:00
Damien Elmes
255ac3679b
add maximize button to HTML editor
...
closes ankitects/help-wanted#1
2020-05-29 08:43:33 +10:00
Damien Elmes
f3a8bb28d5
fix progress window not disappearing when importing csv
2020-05-29 08:40:25 +10:00
Glutanimate
6147356330
Add main_window_did_init hook and clarify difference to profile_did_open
2020-05-28 13:30:22 +02:00
evandrocoan
f78166cda2
Fixed previewer.py::render_card() being called twice in row
...
Related to: https://github.com/ankitects/anki/pull 529
Ensuring "setNote" is called only once during changing of note type
After debugging the code, every time the cards changes, there are
two stacktraces generated and triggered when note cards change:
calling 1590591251.4621403
File "qt/runanki", line 4, in <module>
File "F:\anki\qt\aqt\__init__.py", line 365, in run
_run()
File "F:\anki\qt\aqt\__init__.py", line 515, in _run
app.exec()
File "F:\anki\qt\aqt\webview.py", line 467, in handler
cb(val)
File "F:\anki\qt\aqt\editor.py", line 477, in <lambda>
self.web.evalWithCallback("saveNow(%d)" % keepFocus, lambda res: callback())
File "F:\anki\qt\aqt\browser.py", line 858, in <lambda>
self.editor.saveNow(lambda: self._onRowChanged(current, previous))
File "F:\anki\qt\aqt\browser.py", line 880, in _onRowChanged
self._renderPreview(True)
File "F:\anki\qt\aqt\browser.py", line 1576, in _renderPreview
self._previewer.render_card(cardChanged)
File "F:\anki\qt\aqt\previewer.py", line 136, in render_card
print('calling', time.time(), "\n", "".join( traceback.format_stack() ) )
calling 1590591251.4766161
File "qt/runanki", line 4, in <module>
File "F:\anki\qt\aqt\__init__.py", line 365, in run
_run()
File "F:\anki\qt\aqt\__init__.py", line 515, in _run
app.exec()
File "F:\anki\qt\aqt\webview.py", line 467, in handler
cb(val)
File "F:\anki\qt\aqt\editor.py", line 453, in oncallback
gui_hooks.editor_did_load_note(self)
File "F:\anki\qt\aqt\gui_hooks.py", line 1168, in __call__
hook(editor)
File "F:\anki\qt\aqt\browser.py", line 887, in onLoadNote
self.refreshCurrentCard(editor.note)
File "F:\anki\qt\aqt\browser.py", line 884, in refreshCurrentCard
self._renderPreview(False)
File "F:\anki\qt\aqt\browser.py", line 1576, in _renderPreview
self._previewer.render_card(cardChanged)
File "F:\anki\qt\aqt\previewer.py", line 136, in render_card
print('calling', time.time(), "\n", "".join( traceback.format_stack() ) )
2020-05-27 14:41:07 -03:00
sandersantema
8f993c8e31
remove unused variable 'w' from '_onHtmlEdit'
2020-05-27 12:04:49 +02:00
sandersantema
3407fb7b2b
add saveGeom and restoreGeom to htmlEditor
2020-05-27 12:04:00 +02:00
Damien Elmes
835d1eb994
Merge pull request #637 from BlueGreenMagick/field-drag-drop-fix
...
fix drag drop field repositioning
2020-05-27 10:24:07 +10:00
Damien Elmes
4c89d0cc5e
Merge pull request #636 from BlueGreenMagick/typing-contextmenuevent
...
add evt type for contextMenuEvent method
2020-05-27 10:23:44 +10:00
Damien Elmes
7ef884d3b9
Merge pull request #635 from BlueGreenMagick/typing
...
add typehint for eventFilter method
2020-05-27 10:23:28 +10:00
Damien Elmes
d04699ad06
try mpv on Windows again
...
https://github.com/ankitects/anki/pull/621
2020-05-27 09:21:41 +10:00
Damien Elmes
c37390ae14
apply mpv fix
...
c0d9544812
2020-05-27 09:19:20 +10:00
Damien Elmes
97618564f4
fix typechecking breaking with latest mypy_protobuf
...
the change that caused it:
https://github.com/dropbox/mypy-protobuf/issues/118
This is more awkward to handle now, as the types are only available
at type-checking time. Python's static typing is such a mess :-(
2020-05-27 09:14:02 +10:00
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
58a243aa6c
EMPTY_CARDS should not be translatable
2020-05-22 11:45:14 +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
Damien Elmes
8300d8d85c
Merge pull request #630 from evandroforks/close_http_client_connections
...
Fixed HttpClient session not being closed
2020-05-21 09:17:07 +10:00
evandrocoan
14692fb345
Added missing Anki icon to debug window
2020-05-20 19:21:31 -03: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
12b9a7e368
left-align radio buttons in clayout
2020-05-20 19:56:53 +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
8bd5d756e2
bump version
2020-05-18 12:50:20 +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
29379a9a50
update extract-po-string to handle plurals again
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
Damien Elmes
85b28f13d2
avoid installing pyaudio on every run
2020-05-12 21:10:21 +10:00
Damien Elmes
436bdd6970
Merge pull request #611 from evandroforks/automatically_install_pyaudio_on_make_check
...
Automatically install pyaudio when running make check
2020-05-12 20:44:25 +10:00
Damien Elmes
74c97ad6d3
bump version
2020-05-11 19:28:17 +10:00
Damien Elmes
4e44694136
Revert "use isolation characters instead of direction markers in cloze handling"
...
This reverts commit e838769d02
.
Caused a regression:
https://anki.tenderapp.com/discussions/ankidesktop/41384-cloze-deletions-in-2125-and-2126
2020-05-11 19:25:49 +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
evandrocoan
4cf64519fb
Automatically install pyaudio when running make check
2020-05-09 13:26:42 -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
d98e3fa371
Merge pull request #606 from evandroforks/remove_pyaudio_as_dependency
...
Remove pyaudio as mandatory dependency
2020-05-04 13:37:19 +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
1e4748d45e
Remove pyaudio as mandatory dependency
...
Pyaudio on Windows is difficult to install and complicates things
when someone is using the wheels just for autocomletion on IDEs as
PyCharm:
https://anki.tenderapp.com/discussions/add-ons/44009-problems-with-code-completion
2020-05-03 23:05:38 -03: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
b337dda8df
bump version
2020-05-02 10:22:00 +10:00
evandrocoan
a48fa4ad87
Add missing aqt and anki modules dependency requirements
2020-04-30 17:30:22 -03: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
Damien Elmes
00cf4fc585
bump version
2020-04-28 08:57:56 +10: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
Damien Elmes
abb80231a5
Merge pull request #582 from evandroforks/fix_make_clean
...
Fixed make clean rule not working on Windows
2020-04-27 19:10:21 +10:00
Damien Elmes
5746302817
Merge pull request #581 from BlueGreenMagick/use-var-name
...
use variable names
2020-04-27 19:10:04 +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
evandrocoan
26480fb13c
Fixed make clean rule not working on Windows
2020-04-26 03:02:02 -03:00
evandrocoan
06056236c0
Fixed build-mo-files not failing the build when msgmerge
...
is not found:
https://github.com/ankitects/anki/runs/617116053?check_suite_focus=true#step:27:1244
The build was not falling because when you do `(commands)` in a
shell script, the `set -e` directive is not inherited. Then, either
do not start a new shell or just use an if to test the error condition.
2020-04-25 05:17:24 -03:00
Damien Elmes
361959bdc4
Merge pull request #573 from evandroforks/printWidth100
...
Set .prettierrc printWidth to 88 because the default is too short
2020-04-23 20:01:58 +10:00
evandrocoan
51ec5d0fa9
Set .prettierrc printWidth to 88 because the default is too short
2020-04-22 23:11:03 -03:00
Damien Elmes
4b8cf631d5
add selectable flag while preserving link clicking
...
https://anki.tenderapp.com/discussions/beta-testing/1920-config-can-copy-paste-but-cant-click-links-now
2020-04-21 09:11:56 +10: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
Damien Elmes
385dbf88c3
Merge pull request #569 from evandroforks/limit_error_message_size
...
Also limit the size of the error message
2020-04-20 11:14:53 +10:00
Damien Elmes
2939931004
split scheduling prefs into separate tab
...
https://anki.tenderapp.com/discussions/ankidesktop/40610-windows-anki-everything-was-enlarged-to-150
https://anki.tenderapp.com/discussions/beta-testing/1916-preferences-screen-partly-invisible
2020-04-20 11:11:00 +10:00
evandrocoan
9dda28def4
Also limit the size of the error message in case it is
...
build by a concatenation of stack traces, i.e.,
```js
throw new Error(err + err.stack)
```
2020-04-17 16:28:31 -03:00
evandrocoan
67a8af0cbf
Limit the reviewer.ts stack size
...
https://anki.tenderapp.com/discussions/beta-testing/1918-reliably-reproduced-bug-in-2124beta6#comment_48247959
2020-04-17 03:53:15 -03: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