Commit Graph

4110 Commits

Author SHA1 Message Date
Damien Elmes
6cf3b0ca18 add type checking to previewer 2020-04-03 09:13:33 +10:00
Damien Elmes
6049e15dac add missing license header 2020-04-03 09:05:32 +10:00
Damien Elmes
a359c27c25 use old name for preview dialog to avoid breaking add-ons 2020-04-03 09:00:18 +10:00
Damien Elmes
5f9c126caa fix some errors in the previewing code 2020-04-03 09:00:08 +10:00
Damien Elmes
ee71e5dd59 use support URL and point to source repo 2020-04-03 08:44:59 +10:00
Damien Elmes
342bb64092
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
4790fec881 render() conflicts with Qt method 2020-04-03 08:29:35 +10:00
Damien Elmes
de79087620 be explicit that the method is a no-op 2020-04-03 08:27:56 +10:00
Damien Elmes
f5e0ad8fad tweak wording 2020-04-03 08:27:26 +10:00
Damien Elmes
eae46b4a6f
Merge pull request #532 from Arthur-Milchior/previewer
Previewer
2020-04-03 08:20:43 +10:00
evandrocoan
58ba764cb6 Fixed old cache making build fail
# Conflicts:
#	.github/workflows/checks.yml
2020-04-02 14:47:10 -03:00
Arthur Milchior
cd1fd6f9a2 snake case 2020-04-02 17:44:06 +02:00
Arthur Milchior
00d04cd6c9 Previewer is a QDialog
As suggested by Glutanimate in https://github.com/ankitects/anki/pull/532#discussion_r401256921
2020-04-02 17:44:06 +02:00
Arthur Milchior
6564f00748 Previewer: parent become private
It seems parent is a method of QDialog, so it creates a typing problem
2020-04-02 17:44:06 +02:00
Arthur Milchior
31f2f60757 Methods used by browser are not public
As suggested by Glutanimate on https://github.com/ankitects/anki/pull/532#discussion_r401254100
2020-04-02 17:44:06 +02:00
Arthur Milchior
0e21978577 remove the word preview from previewer variable
As suggested by glutanimate https://github.com/ankitects/anki/pull/532#discussion_r401255290
2020-04-02 17:44:06 +02:00
Arthur Milchior
92cec5c327 removing PreviewDialog dataclass
It can be replaced by the previewer itself. As suggested by
Glutanimate https://github.com/ankitects/anki/pull/532#discussion_r401252970
2020-04-02 17:44:06 +02:00
Arthur Milchior
c722b5bd2c PreviewerListCards can take cids and class
This allow to avoid recomputing a card if it is known, while allowing
to compute it until it's actually displayed
2020-04-02 17:44:06 +02:00
Arthur Milchior
b76ee6f8e5 ListCardsPreviewer 2020-04-02 17:44:06 +02:00
Arthur Milchior
c4a38c5e36 Split PreviewerBrowser into a hierarchy
A part in common to see multiple cards. And a part specific for the browser
2020-04-02 17:44:06 +02:00
Arthur Milchior
727b7fb6e5 split onPreview Prev/Next 2020-04-02 17:44:06 +02:00
Arthur Milchior
79dece3124 split _updatePreviewButtons
This will allow to create a hierarchy in this class
2020-04-02 17:44:06 +02:00
Arthur Milchior
f42c164999 add a class to preview a single card 2020-04-02 17:44:06 +02:00
Arthur Milchior
944e82211f Class PreviewerBrowser
This let a previewer class which can be used to display a single card,
and a previewer for the browser
2020-04-02 17:44:06 +02:00
Arthur Milchior
0a3d68a565 split = None 2020-04-02 17:44:06 +02:00
Arthur Milchior
6d98063ac3 vbox and bbox are attribute 2020-04-02 17:44:06 +02:00
Arthur Milchior
95e020f743 use card method 2020-04-02 17:44:06 +02:00
Arthur Milchior
179ba87ce4 previewer: create gui in a distinct function 2020-04-02 17:44:06 +02:00
Arthur Milchior
45ccd4aa3c move previewer to a different class.
This uses exactly the same code, with one exception. In the previewer
`self` became `self.parent` in order to have action on the
browser. And in the browser, some `self` become `self.previewer` to
access the previewer. (Some function having an action on the previewer
starting from the browser now are separated in two. One version in the
previewer doing the same thing. One version in the browser, calling
the version in the previewer if it exists.)

Preview dialog now takes a QWidget in general, not necesarrily a
Browser. The parameter is called parent
2020-04-02 17:44:06 +02:00
evandrocoan
28bb56744d Fixed double python version check for python_requires=">=3.7" 2020-04-02 12:31:12 -03:00
Damien Elmes
b5f0f459ce ignore row change events that arrive after browser closed
https://anki.tenderapp.com/discussions/ankidesktop/40148-bug-when-suspending-cards
2020-04-02 19:44:51 +10:00
evandrocoan
069cc11a86 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
03f9be21e9 return the added card id instead of mutating the backend card object 2020-04-02 12:09:46 +10:00
Damien Elmes
431683aa5d make sure None is returned in no-such-card case 2020-04-02 11:29:40 +10:00
Damien Elmes
70a1992f70 fix is:due search 2020-04-02 09:33:05 +10:00
Damien Elmes
c68a2fc838 return interrupted err when media sync aborted 2020-04-01 21:40:14 +10:00
Damien Elmes
c57801c168 tolerate string values in deck["conf"] 2020-04-01 19:36:40 +10:00
Damien Elmes
05cc47a5d3 fix push-i18n-ftl 2020-04-01 18:20:31 +10:00
Damien Elmes
546f4b44fc FString -> TR 2020-04-01 18:16:43 +10:00
Damien Elmes
5392bd8e28 fix extract-po-string.py 2020-04-01 17:49:31 +10:00
Damien Elmes
dfa1ce6429 translate default deck config name 2020-04-01 17:49:25 +10:00
Damien Elmes
d342955830 remove defaultConf 2020-04-01 17:36:46 +10:00
Damien Elmes
a5940e3557 add fixme 2020-04-01 17:36:33 +10:00
Damien Elmes
634931cf9e tweak hook name 2020-04-01 17:13:08 +10:00
Damien Elmes
28380d4183
Merge pull request #534 from Arthur-Milchior/tags_hook
hook tag_editor_received_a_key
2020-04-01 17:10:31 +10:00
Damien Elmes
d396460332 ignore .DS_Store in trash
https://anki.tenderapp.com/discussions/ankidesktop/40035-anki-2123-on-macos-ds_store-files-in-new-anki-trash
2020-04-01 13:37:57 +10:00
Damien Elmes
5fe747f14a left-align tags
https://anki.tenderapp.com/discussions/ankidesktop/40068-tags-column-in-browser-is-centered
2020-04-01 13:29:42 +10:00
Damien Elmes
c050833aba always position selection in center after search
https://anki.tenderapp.com/discussions/beta-testing/1888-retaining-position-when-searching
2020-04-01 11:01:20 +10:00
Damien Elmes
6495240914 add some timeouts
I'm waiting to hear back from the reqwests author on the best way to
handle this. For now, this change just adds short timeouts
to the quick requests, and will wait for up to an hour when sending/
receiving files to allow for the slow connection+large file case.
2020-04-01 10:03:54 +10:00
Damien Elmes
c9da4bc1a6 allow aborting a media sync while http req in flight
The progress handling code needs a rethink, as we now have two separate
ways to flag that the media sync should abort. In the future, it may
make sense to switch to polling the backend for progress, instead of
passing a callback in.
2020-04-01 09:49:25 +10:00