Commit graph

825 commits

Author SHA1 Message Date
Damien Elmes
d9a39b565f 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
750ccc4bd7 Save and restore the debug console window geometry and splitter 2020-05-30 20:58:55 -03:00
evandrocoan
b6b5c37ab9 Add saveSplitter and restoreSplitter to clayout.py
# Conflicts:
#	qt/aqt/clayout.py
2020-05-30 20:33:57 -03:00
evandrocoan
1d82fadaa0 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
be6726b19f 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
6b66dad3b6 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
2b13ec5857 add maximize button to HTML editor
closes ankitects/help-wanted#1
2020-05-29 08:43:33 +10:00
Damien Elmes
32de1ee5f9 fix progress window not disappearing when importing csv 2020-05-29 08:40:25 +10:00
Glutanimate
96b3b29a6f Add main_window_did_init hook and clarify difference to profile_did_open 2020-05-28 13:30:22 +02:00
evandrocoan
a34ecefc96 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
79cfe3914e remove unused variable 'w' from '_onHtmlEdit' 2020-05-27 12:04:49 +02:00
sandersantema
94e6078fcd add saveGeom and restoreGeom to htmlEditor 2020-05-27 12:04:00 +02:00
Damien Elmes
e40f507a87 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
fa8a9499ce Merge pull request #636 from BlueGreenMagick/typing-contextmenuevent
add evt type for contextMenuEvent method
2020-05-27 10:23:44 +10:00
Damien Elmes
4e23460bda Merge pull request #635 from BlueGreenMagick/typing
add typehint for eventFilter method
2020-05-27 10:23:28 +10:00
Damien Elmes
833faf1e63 try mpv on Windows again
https://github.com/ankitects/anki/pull/621
2020-05-27 09:21:41 +10:00
Damien Elmes
eb49062617 apply mpv fix
c0d9544812
2020-05-27 09:19:20 +10:00
Damien Elmes
9e5dad86a8 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
26a8353664 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
3ee66375da fix drag drop field repositioning 2020-05-26 18:27:38 +09:00
BlueGreenMagick
60501852c2 add evt type for contextMenuEvent method 2020-05-26 17:12:39 +09:00
BlueGreenMagick
b8f73fee2f add typehint for eventFilter method 2020-05-26 17:08:55 +09:00
Damien Elmes
74d3b2ed41 allow hook to modify search text 2020-05-25 16:54:57 +10:00
Damien Elmes
5a790b4d35 Merge pull request #633 from hgiesel/dconf_hooks
Add three deck config hooks
2020-05-24 09:53:22 +10:00
Damien Elmes
e9fea26d1c use keyword args for calls with more than one argument 2020-05-24 09:12:47 +10:00
Damien Elmes
bbcc566e6d migrate the remaining methods 2020-05-24 08:36:50 +10:00
Henrik Giesel
91d7cd29b2 Satisfy black reformatter 2020-05-23 11:14:52 +02:00
Damien Elmes
927ed25b02 more methods 2020-05-23 14:01:36 +10:00
Henrik Giesel
ae57c6fbeb 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
d57ded706f migrate more methods to service 2020-05-22 22:09:33 +10:00
Damien Elmes
a512cbfd5d EMPTY_CARDS should not be translatable 2020-05-22 11:45:14 +10:00
Damien Elmes
7eff75f5f3 hook expected an int, not a str 2020-05-22 11:27:40 +10:00
Damien Elmes
b90d20a3c1 fix custom study not saving 2020-05-22 11:25:11 +10:00
Damien Elmes
7676748e6c 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
d31f2d8c23 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
59d3473149 show 'changes saved' in parent window 2020-05-22 10:43:41 +10:00
Damien Elmes
dcbfa23eed show message when search fails 2020-05-22 10:43:28 +10:00
Damien Elmes
40dc633d7f monospace font in clayout 2020-05-22 09:58:20 +10:00
Damien Elmes
e5f32e2f4e use context manager in retrieveURL 2020-05-21 10:58:42 +10:00
Damien Elmes
238ec0e4cb clearer variable names in retrieveURL 2020-05-21 09:22:34 +10:00
Damien Elmes
32016bc02b 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
fbfe611f03 Added missing Anki icon to debug window 2020-05-20 19:21:31 -03:00
evandrocoan
04dc65ef78 Fixed HttpClient session not being closed 2020-05-20 19:20:41 -03:00
Damien Elmes
0b04658920 fix shortcut keys in clayout 2020-05-21 07:51:35 +10:00
Damien Elmes
75570683db left-align radio buttons in clayout 2020-05-20 19:56:53 +10:00
Damien Elmes
b3e8c63d65 update missed storage._Collection references 2020-05-20 19:45:46 +10:00
Damien Elmes
068cc43095 storage->collection 2020-05-20 17:58:28 +10:00
Damien Elmes
4f5fc9a63d 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
bac4232829 fix progress bar getting stuck on image paste 2020-05-20 16:12:41 +10:00
Damien Elmes
883d9a8851 deprecate removeTempNote() 2020-05-20 15:01:05 +10:00