Commit Graph

48 Commits

Author SHA1 Message Date
Damien Elmes
61e86cc29d new change notetype implementation for the frontend
- changes can now be undone
- the same field can now be mapped to multiple target fields, allowing
fields to be cloned
- the old Qt dialog has been removed
- the old col.models.change() API calls the new code, to avoid
breaking existing consumers. It requires the field map to always
be passed in, but that appears to have been the common case.
- closes #1175
2021-06-10 22:19:24 +10:00
Damien Elmes
afaaa763ec don't wait before scrolling to current card
https://github.com/ankitects/anki/pull/1222#discussion_r647017566
2021-06-08 12:54:05 +10:00
Damien Elmes
1479957538 fix note changes triggering a queue rebuild 2021-06-08 12:09:35 +10:00
RumovZ
8a9c9829e8 Change handling of browser's card parameter
If a search is provided execute it, else search for current deck.
Then try to select and scroll to the provided card.
2021-06-07 16:42:17 +02:00
Damien Elmes
e124f935a5 fix timebox causing crash
When a modal was created with another window as its parent, the other
window was being returned, when it was the current window that we
actually wanted. This caused nextCard() to be called again when it
presented the timebox modal, leading to a stack overflow.

https://forums.ankiweb.net/t/anki-2-1-45-alpha/10061/71
2021-06-01 15:35:18 +10:00
Damien Elmes
a0eebb78ce
Merge pull request #1186 from RumovZ/ctx-actions
Update context action states after card op
2021-05-24 10:49:23 +10:00
RumovZ
ff76d50338 Remove browser.oneModelNotes() 2021-05-22 19:12:03 +02:00
RumovZ
0dca3ef548 Check notetype count in browser.onChangeModel() 2021-05-22 19:11:06 +02:00
RumovZ
29589fcf0d Update context action states after card op 2021-05-22 08:35:47 +02:00
Damien Elmes
3d4cf26758 expose undoable config changes to frontend; refresh sidebar
The browser header handling still needs updating
2021-05-21 17:50:41 +10:00
Damien Elmes
99b7da49a9 report changed cards when changing deck/flag
+ fix repeated flag shortcut not toggling
2021-05-21 16:03:05 +10:00
RumovZ
5a6ba1b0b9 Move flags into separate module 2021-05-20 10:26:18 +02:00
RumovZ
6fb2d30426 Remove redundant pylint exception 2021-05-19 19:44:49 +02:00
RumovZ
5fa68c885a Use dataclass instead of tuple for loaded flags 2021-05-19 19:17:43 +02:00
RumovZ
30736ddf75 Use custom flag labels for browser actions 2021-05-19 11:00:02 +02:00
Damien Elmes
9f3f6bab7d enable redo support
Also:

- fix issues where the Undo action in the Browse screen was not
consistent with the main window. The existing hook signature has been
changed; from a snapshot of the add-on code from a few months ago, it
was not a hook that was being used by anyone.
- change the undo shortcut in the Browse window to match the main
window. It was different because undoing a change in the editing area
could accidentally trigger an undo of an operation, but the damage is
limited now that (most) operations can be redone. If it still proves to
be a problem, perhaps we should just always swallow ctrl+z when an
editing field is focused.
2021-05-19 15:18:39 +10:00
Damien Elmes
b887032244 split browser dialogs into separate files 2021-05-08 15:08:45 +10:00
Damien Elmes
78a3536bfc move "find duplicates" into separate file
As far as I'm aware, no add-ons were extending that screen, so I've
dropped the old context object and the export in browser/__init__.py
2021-05-08 14:33:43 +10:00
Damien Elmes
010c3da770
Merge pull request #1159 from hgiesel/newapproach
Prefer idiomatic Svelte features over dynamic components
2021-05-08 11:35:31 +10:00
Henrik Giesel
8b0c6ba5df Check for id when inserting dynamic elements
* I'm not sure it behaved, if there were multiple elements
  inserted by different add-ons into the same container
2021-05-07 16:50:17 +02:00
Damien Elmes
7442eed41a update docstrings for latest black 2021-05-07 18:12:56 +10:00
Henrik Giesel
de8abebcd1 Fix Preview Button after changing from f-string to normal string 2021-05-07 02:12:37 +02:00
Henrik Giesel
2112b419f9 Fix ButtonDropdown 2021-05-07 02:04:44 +02:00
Henrik Giesel
e80f43e8fc Enable setting of PreviewButton and hiding of cloze button again 2021-05-07 02:04:42 +02:00
Damien Elmes
248373ef30 undoing of notetype templates 2021-04-30 17:30:48 +10:00
RumovZ
abd02d7891 Add separate no_arg_trigger decorator 2021-04-26 08:46:08 +02:00
Damien Elmes
f77983fc9f
Merge pull request #1154 from RumovZ/fix-skip-dec
Fix skip_if_selection_is_empty() for triggers
2021-04-26 09:21:42 +10:00
RumovZ
594fe303da Remove some unnecessary lambdas 2021-04-25 19:51:57 +02:00
RumovZ
9900f73cee Fix skip_if_selection_is_empty() for triggers
It seems to be enough if one decorator calls pyqtSlot(), but to avoid
problems in the future, let's have all decorators do that.
2021-04-25 19:50:56 +02:00
Henrik Giesel
f5fba15435 Initialize editor toolbar via function, not web component 2021-04-25 18:32:01 +02:00
Damien Elmes
b7b329cf90
Merge pull request #1151 from RumovZ/no-sel-dec
Fix some problems with browser actions while selection is empty
2021-04-25 20:48:40 +10:00
Damien Elmes
a1ce048ed5 fix error when user cancels out of set due date/reposition 2021-04-25 19:33:25 +10:00
RumovZ
b1392980f5 Skip some browser methods if selection is empty
This was handled inconsistently before:
* Select Notes would throw a search error.
* Set Due Date would throw an exception.
* Dialogs with no effect would open.
* No-ops would be pushed to the undo queue.
2021-04-25 08:47:15 +02:00
Henrik Giesel
48b7cb49f9 Make update algorithm in editor-toolbar/index.ts recursive 2021-04-23 20:50:09 +02:00
Henrik Giesel
7563a3c929 Use rawButton in browser.py 2021-04-23 17:34:42 +02:00
Damien Elmes
41d5cae7db fix Find Dupes activation 2021-04-20 21:13:21 +10:00
Henrik Giesel
5702b3c273 Add type to add_preview_shortcut 2021-04-15 15:50:29 +02:00
Henrik Giesel
82f6e19955 Add Latex formatting options to menu
*  Format shortcuts in monospace font and increase padding a little bit
2021-04-15 15:20:37 +02:00
Henrik Giesel
53ae03becc Add Preview shortcut for browser 2021-04-15 13:09:51 +02:00
Henrik Giesel
a7d24e7159 Add support for Preview button in Browser 2021-04-15 13:09:50 +02:00
Arthur Milchior
be44d4eeed NF: factorize browser.current_search
I was looking at search code and find out that's already slightly more clear/short even if NF
2021-04-14 10:55:41 +02:00
Damien Elmes
fc8a5759d5
Merge pull request #1124 from hgiesel/dropjquerypy2
Remove jQuery from remaining qt/aqt files
2021-04-14 12:43:11 +10:00
Henrik Giesel
3e1b42bb62 Satisfy formatter 2021-04-13 20:29:59 +02:00
Henrik Giesel
64c7d405f5 Remove jquery from browser.py 2021-04-13 19:54:45 +02:00
RumovZ
594a98eff1 Move previewer.py into browser folder 2021-04-13 11:38:35 +02:00
RumovZ
88086596b6 Move find_and_replace.py into browser/dialogs 2021-04-13 11:21:36 +02:00
RumovZ
7ee40e3dce Refactor sidebar.py into browser folder 2021-04-13 11:05:49 +02:00
RumovZ
2000c80fd2 Refactor browser and table into folders 2021-04-12 09:50:44 +02:00