Commit graph

592 commits

Author SHA1 Message Date
Damien Elmes
6a7a18126f Merge pull request #537 from Arthur-Milchior/add_card_did_init
hook add_card_did_init
2020-04-03 19:34:33 +10:00
Arthur Milchior
952d943440 hook add_card_did_init 2020-04-03 11:03:08 +02:00
evandrocoan
b879c4a951 Fixed double python version check for python_requires=">=3.7" 2020-04-02 22:56:53 -03:00
evandrocoan
2cc12313dd Deprecated sdist wheels and pyqtwebengine as dependency 2020-04-02 22:56:48 -03:00
evandrocoan
e613e0dcbd Set the minimum python version required by anki on qt/setup.py 2020-04-02 22:56:44 -03:00
evandrocoan
7d1c5140a8 Set to build a source distribution instead of build distribution
for aqt on qt/Makefile, because .whl files are just zip simple
zip files and do not support dynamic versioning. Also, there is no
restriction for aqt to be shipped as source tarball because it does
not ship any binaries.
2020-04-02 22:56:37 -03:00
evandrocoan
745371f510 Fixed setup.py installing pyqtwebengine on older versions of pyqt 2020-04-02 22:56:33 -03:00
evandrocoan
4f591235c7 Set to checks.yml install and import anki wheels
# Conflicts:
#	.github/workflows/checks.yml
2020-04-02 22:56:13 -03:00
Damien Elmes
1f64059897 add type checking to previewer 2020-04-03 09:13:33 +10:00
Damien Elmes
da55f82619 add missing license header 2020-04-03 09:05:32 +10:00
Damien Elmes
3f965f5534 use old name for preview dialog to avoid breaking add-ons 2020-04-03 09:00:18 +10:00
Damien Elmes
8eca40dab8 fix some errors in the previewing code 2020-04-03 09:00:08 +10:00
Damien Elmes
d7edbedac0 Merge pull request #535 from evandroforks/upload_wheels_to_pypi
Created the GitHub Actions step Upload to PyPi
2020-04-03 08:40:17 +10:00
Damien Elmes
3959f7dcb8 render() conflicts with Qt method 2020-04-03 08:29:35 +10:00
Damien Elmes
c74cf44e90 be explicit that the method is a no-op 2020-04-03 08:27:56 +10:00
Damien Elmes
62586f75d0 tweak wording 2020-04-03 08:27:26 +10:00
Arthur Milchior
ef0cbb3a79 snake case 2020-04-02 17:44:06 +02:00
Arthur Milchior
c9bd4b53a3 Previewer is a QDialog
As suggested by Glutanimate in https://github.com/ankitects/anki/pull/532#discussion_r401256921
2020-04-02 17:44:06 +02:00
Arthur Milchior
391fd69061 Previewer: parent become private
It seems parent is a method of QDialog, so it creates a typing problem
2020-04-02 17:44:06 +02:00
Arthur Milchior
2eed489792 Methods used by browser are not public
As suggested by Glutanimate on https://github.com/ankitects/anki/pull/532#discussion_r401254100
2020-04-02 17:44:06 +02:00
Arthur Milchior
d85c8288f6 remove the word preview from previewer variable
As suggested by glutanimate https://github.com/ankitects/anki/pull/532#discussion_r401255290
2020-04-02 17:44:06 +02:00
Arthur Milchior
be66a0f1cd removing PreviewDialog dataclass
It can be replaced by the previewer itself. As suggested by
Glutanimate https://github.com/ankitects/anki/pull/532#discussion_r401252970
2020-04-02 17:44:06 +02:00
Arthur Milchior
1ee6bcbdcb PreviewerListCards can take cids and class
This allow to avoid recomputing a card if it is known, while allowing
to compute it until it's actually displayed
2020-04-02 17:44:06 +02:00
Arthur Milchior
7bf2631ea8 ListCardsPreviewer 2020-04-02 17:44:06 +02:00
Arthur Milchior
09a4a5307f Split PreviewerBrowser into a hierarchy
A part in common to see multiple cards. And a part specific for the browser
2020-04-02 17:44:06 +02:00
Arthur Milchior
b5b6786f95 split onPreview Prev/Next 2020-04-02 17:44:06 +02:00
Arthur Milchior
8bb2b037ef split _updatePreviewButtons
This will allow to create a hierarchy in this class
2020-04-02 17:44:06 +02:00
Arthur Milchior
cad44bb899 add a class to preview a single card 2020-04-02 17:44:06 +02:00
Arthur Milchior
7ce77e071d Class PreviewerBrowser
This let a previewer class which can be used to display a single card,
and a previewer for the browser
2020-04-02 17:44:06 +02:00
Arthur Milchior
0b80b157e7 split = None 2020-04-02 17:44:06 +02:00
Arthur Milchior
1322cd8e11 vbox and bbox are attribute 2020-04-02 17:44:06 +02:00
Arthur Milchior
6e30edd79f use card method 2020-04-02 17:44:06 +02:00
Arthur Milchior
6767431633 previewer: create gui in a distinct function 2020-04-02 17:44:06 +02:00
Arthur Milchior
7ea1ff840f move previewer to a different class.
This uses exactly the same code, with one exception. In the previewer
`self` became `self.parent` in order to have action on the
browser. And in the browser, some `self` become `self.previewer` to
access the previewer. (Some function having an action on the previewer
starting from the browser now are separated in two. One version in the
previewer doing the same thing. One version in the browser, calling
the version in the previewer if it exists.)

Preview dialog now takes a QWidget in general, not necesarrily a
Browser. The parameter is called parent
2020-04-02 17:44:06 +02:00
Damien Elmes
91c2e89360 ignore row change events that arrive after browser closed
https://anki.tenderapp.com/discussions/ankidesktop/40148-bug-when-suspending-cards
2020-04-02 19:44:51 +10:00
evandrocoan
30107ab09d Created the GitHub Actions step Upload to PyPi to run only on
tagged releases of anki:
https://anki.tenderapp.com/discussions/ankidesktop/40025-anki-in-python-package-index
2020-04-02 02:57:34 -03:00
Damien Elmes
f195296106 fix push-i18n-ftl 2020-04-01 18:20:31 +10:00
Damien Elmes
526569693c fix extract-po-string.py 2020-04-01 17:49:31 +10:00
Damien Elmes
0359a6ae38 tweak hook name 2020-04-01 17:13:08 +10:00
Damien Elmes
525fae808d Merge pull request #534 from Arthur-Milchior/tags_hook
hook tag_editor_received_a_key
2020-04-01 17:10:31 +10:00
Damien Elmes
8d952570a8 left-align tags
https://anki.tenderapp.com/discussions/ankidesktop/40068-tags-column-in-browser-is-centered
2020-04-01 13:29:42 +10:00
Damien Elmes
78aad6b64b always position selection in center after search
https://anki.tenderapp.com/discussions/beta-testing/1888-retaining-position-when-searching
2020-04-01 11:01:20 +10:00
Damien Elmes
284ee0860b allow aborting a media sync while http req in flight
The progress handling code needs a rethink, as we now have two separate
ways to flag that the media sync should abort. In the future, it may
make sense to switch to polling the backend for progress, instead of
passing a callback in.
2020-04-01 09:49:25 +10:00
Arthur Milchior
102670a5a6 hook tag_editor_received_a_key
I expect it to be useful for add-ons such as
https://github.com/fonol/anki-search-inside-add-card which interact
with the tag line
2020-03-31 15:05:41 +02:00
zjosua
487d02fff2 Use double quotes in taglimit queries 2020-03-30 10:12:47 +02:00
Damien Elmes
2fdca03043 Merge pull request #531 from Arthur-Milchior/browser_will_show_context_menu
hook browser_header_will_show_context_menu
2020-03-28 14:50:02 +10:00
Damien Elmes
76dec75947 Revert "Merge pull request #527 from Arthur-Milchior/explode_on_bridge_cmd"
This reverts commit 9e6a2ba1e6, reversing
changes made to fc846ac4e4.

Causes a traceback when opening the add screen, clicking on Type,
and choosing a note type.

  File "/Users/dae/Work/code/dtop/qt/aqt/webview.py", line 31, in cmd
    return json.dumps(self.onCmd(str))
  File "/Users/dae/Work/code/dtop/qt/aqt/webview.py", line 97, in _onCmd
    return self._onBridgeCmd(str)
  File "/Users/dae/Work/code/dtop/qt/aqt/webview.py", line 500, in _onBridgeCmd
    return self.onBridgeCmd(cmd)
  File "/Users/dae/Work/code/dtop/qt/aqt/editor.py", line 374, in onBridgeCmd
    self._links[cmd](self, *args)  # type: ignore
  File "/Users/dae/Work/code/dtop/qt/aqt/editor.py", line 404, in onBlur
    if gui_hooks.editor_did_unfocus_field(False, self.note, int(ord)):
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
2020-03-28 13:35:05 +10:00
Arthur Milchior
015d07ec56 hook browser_header_will_show_context_menu 2020-03-27 23:06:22 +01:00
Damien Elmes
ccee3af22c Merge pull request #529 from Arthur-Milchior/load_note_once_on_note_type_change
Ensuring "setNote" is called only once during changing of note type
2020-03-27 15:28:49 +10:00
Damien Elmes
36314f3b6f Merge pull request #528 from evandroforks/create_actions_for_windows_macos
Create actions for Windows and Mac OS
2020-03-27 15:26:22 +10:00