RumovZ
64fd90d633
Simplify sidebar context menu separators
...
Qt can collapse consecutive menu separators, so no need to check if a
subroutine has actually added any actions to the menu.
2021-09-19 18:33:36 +02:00
RumovZ
8fd0e89a5a
Disable unusable browser actions on row change
2021-09-17 16:16:34 +02:00
Damien Elmes
2c235ccc70
don't check state of current card when repositioning
...
closes #1365
2021-09-13 14:56:53 +10:00
RumovZ
f1fcd8830d
Disable 'Rename with Parents' for top-level items
2021-08-30 11:10:14 +02:00
Damien Elmes
48028aa397
Merge pull request #1319 from abdnh/sidebar-scroll-center
...
Use PositionAtCenter for sidebar scrolling
2021-08-02 18:35:38 +10:00
Damien Elmes
28535b4f84
Merge pull request #1311 from hikaru-y/flag-mark-icons-in-previewer
...
Show flag and mark icons in previewer
2021-08-02 18:33:36 +10:00
abdo
26b6688cb2
Use PositionAtCenter for sidebar scrolling
2021-08-02 10:57:54 +03:00
Damien Elmes
8e48722cf0
prevent hiding of sidebar
...
https://forums.ankiweb.net/t/browser-format-issues/11504/10
2021-07-28 11:14:09 +10:00
hikaru-y
7c90637922
Show flag and mark icons in previewer
2021-07-26 20:13:42 +09:00
RumovZ
16e3f2c7f3
Fix browser search completer
...
Adding an empty entry at the top fixes
https://forums.ankiweb.net/t/anki-2-1-45-beta/10664/45
and allows for scrolling back to an empty line.
2021-07-17 12:23:19 +02:00
Damien Elmes
4ed0260248
Merge pull request #1297 from hgiesel/browsershortcuts
...
Allow Using Ctrl+Shift+P from Browser when focusing Qt components
2021-07-17 15:18:36 +10:00
Henrik Giesel
f016df00cd
Remove unnecessary lambda
2021-07-17 04:17:28 +02:00
Henrik Giesel
59f801abc7
Allow Using Ctrl+Shift+P from Browser when focusing Qt components
2021-07-17 03:39:27 +02:00
Damien Elmes
c93476512c
Merge pull request #1292 from hgiesel/reviewerplus
...
Move reviewer to ts/reviewer v2
2021-07-17 09:10:14 +10:00
hikaru-y
dc11d7c297
Revert "Follow-up to #1271 (Preload answer images)"
2021-07-16 23:57:49 +09:00
Henrik Giesel
170bc5c25e
Revert to MathJax through script tag
2021-07-16 16:56:57 +02:00
Henrik Giesel
28e2f62793
Remove protobuf important from reiewer (no longer necessary (?))
2021-07-16 16:56:56 +02:00
Henrik Giesel
70040d508e
Include MathJax over ts/reviewer
2021-07-16 16:56:56 +02:00
Henrik Giesel
c62d2dc033
Export jquery via ts/reviewer
2021-07-16 16:56:56 +02:00
Henrik Giesel
8ee6eb71eb
Include css-browser-selector via ts/reviewer
2021-07-16 16:56:56 +02:00
Henrik Giesel
11f06161c9
Include protobuf in clayout and browser (p)reviewer
2021-07-16 16:56:56 +02:00
Damien Elmes
eb4e18a45f
Merge pull request #1293 from RumovZ/find-and-replace
...
Find & Replace
2021-07-16 10:47:16 +10:00
RumovZ
9ba35b9efb
Remove redundant QueryOp in rename_deck()
2021-07-15 08:56:47 +02:00
RumovZ
0804d054b7
Remove unused name prefix of sidebar templates
2021-07-13 16:41:50 +02:00
RumovZ
4f17400021
Add sidebar actions
...
- Find & Replace for notetype fields
- Rename with Parents for decks and tags
2021-07-13 16:34:02 +02:00
RumovZ
4b1218184d
Rework Find & Replace dialog:
...
- Add option to affect whole collection
- Allow to open without selection
- Add parameter for presetting field
2021-07-13 16:33:45 +02:00
Damien Elmes
492137d264
Merge pull request #1291 from RumovZ/addon-cols
...
Show key of unknown browser columns
2021-07-13 13:35:54 +10:00
RumovZ
211f39836d
Show key of unknown browser columns
2021-07-12 19:03:51 +02:00
RumovZ
300ff08ad0
Add mock browser model to support legacy resetting
2021-07-12 12:36:26 +02:00
Damien Elmes
2238cdaa43
rename Config in protobuf to avoid conflict with module name
...
+ use the enum directly, instead of wrapping it in an object
Python code retains the old "Config" name.
2021-07-11 19:27:08 +10:00
Damien Elmes
af6a80c4ec
Merge pull request #1277 from RumovZ/config-keys
...
Add constants for literal config keys
2021-07-07 09:14:40 +10:00
RumovZ
e763745e05
Add pylib/browser.py for literal config keys
...
Also, remove config bools for sort order.
2021-07-05 12:44:48 +02:00
hikaru-y
00eaf63d41
Follow-up to #1271
...
- remove no-longer-required 'escape_media_filenames()' b21af06d
- clean up previewer.py
2021-07-05 01:13:17 +09:00
Damien Elmes
29808094c8
Merge pull request #1271 from hikaru-y/preload-images
...
Preload answer images
2021-07-04 15:50:55 +10:00
hikaru-y
bf93324448
Preload images to be displayed on answer side
2021-07-03 21:33:00 +09:00
RumovZ
94cc0cf901
Add flag manager and hook
...
'FlagManager' allows cached access to the flag objects, takes care of
renaming flags and notifies GUI components with the hook
'flag_label_did_change'.
2021-07-02 11:16:10 +02:00
Henrik Giesel
01cc9df232
Add flag icons from mdi after all
...
- This way, we can also use their modifier versions with little pluses/minuses
2021-07-01 01:16:50 +02:00
Henrik Giesel
d5f8a6e50c
Remove multiple icons, new notetype/cardtype icons
2021-07-01 01:12:11 +02:00
Henrik Giesel
eec7eae885
Remove name_prefix from field sidebar item
2021-06-30 21:02:23 +02:00
Henrik Giesel
32f3c5dbe7
Replace card state and clock icon
2021-06-30 21:02:23 +02:00
Henrik Giesel
1850f24c4b
Replace saved search icon
2021-06-30 21:02:23 +02:00
Henrik Giesel
5031bafb61
Add NOTETYPE_FIELD sidebar items
2021-06-30 21:02:23 +02:00
Henrik Giesel
fecceb1997
Add notetype icons
2021-06-30 21:02:23 +02:00
Henrik Giesel
5fe2519619
Add new icons for decks
2021-06-30 21:02:23 +02:00
Henrik Giesel
d9a368631f
Add tag_multiple icon
2021-06-30 21:02:23 +02:00
Damien Elmes
309f5ee528
minor follow-up to #1257
...
No need for a separate argument, as we only want to scroll when
searching.
2021-06-29 11:53:10 +10:00
Damien Elmes
8743ccf682
Merge pull request #1257 from abdnh/sidebar-scroll-to-first-match
...
Scroll to first sidebar search match
2021-06-29 11:44:28 +10:00
Damien Elmes
2bada06570
use inner function instead of return value in _expand_where_necessary()
2021-06-29 11:40:59 +10:00
abdo
27313ba53d
Scroll to first sidebar search match
2021-06-28 14:44:09 +03:00
RumovZ
1be1ca5911
Fix id check for today and card state items
2021-06-28 12:55:59 +02:00
Damien Elmes
c0dccee9fa
Merge pull request #1252 from RumovZ/fix-tag-expand
...
Fix expanding/collapsing tags triggering refresh
2021-06-27 18:45:29 +10:00
Damien Elmes
f9560586cb
PEP8 collection.py
2021-06-27 15:12:22 +10:00
Damien Elmes
d6e3964151
PEP8 cards.py
2021-06-27 12:12:23 +10:00
RumovZ
5cc2932fcb
Add hook "browser_sidebar_will_show_context_menu"
2021-06-25 17:01:17 +02:00
RumovZ
7a82ea01b8
Fix expanding/collapsing tags triggering refresh
2021-06-24 17:27:53 +02:00
Damien Elmes
4ffca62afe
allow customization of default search text
...
https://forums.ankiweb.net/t/whats-the-default-search-when-browsing-now-also-how-do-i-choose-to-browse-current-deck/8922
2021-06-24 11:24:30 +10:00
Henrik Giesel
43171c02af
Allow inclusion of external icons into aqt/forms/icons
...
+ Replace old tag icon with mdi tag and tag-off icon
2021-06-16 17:19:21 +10:00
Henrik Giesel
8fd024c020
Make Browser root nodes use "_*" uniformly
2021-06-16 17:19:21 +10:00
Damien Elmes
153e1e8d41
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
e589edf6fd
when focusing current card, position at top
...
trying out the changes mentioned on
https://github.com/ankitects/anki/pull/1222#discussion_r648051997
2021-06-09 21:01:29 +10:00
Damien Elmes
379317cfe0
ensure current card centered even if it was already visible
...
Otherwise if a user reviews a card while keeping Browse open, the
card may not be centered if it was already in view.
2021-06-08 16:22:56 +10:00
Damien Elmes
94ef3102d1
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
aaba9a777a
fix note changes triggering a queue rebuild
2021-06-08 12:09:35 +10:00
Damien Elmes
c63e3ed72d
Merge pull request #1222 from RumovZ/browser-card
...
Change handling of browser's card parameter
2021-06-08 09:32:43 +10:00
RumovZ
b09d71c2ec
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
998a3c0f7f
add Rescheduled to Today section of sidebar
...
https://forums.ankiweb.net/t/anki-2-1-45-alpha/10061/105
2021-06-05 12:55:07 +10:00
cherryblossom
462da55fd5
fix documentation links
2021-06-03 16:51:03 +10:00
Damien Elmes
d38f57cf3c
Merge pull request #1213 from RumovZ/new-flags
...
Add pink, turquoise and purple flags
2021-06-02 11:22:26 +10:00
Damien Elmes
c80e852ada
prevent error storm when browser table encounters panic
2021-06-02 11:15:39 +10:00
RumovZ
d6d712c4a7
Rename violet to pink
2021-06-01 18:14:43 +02:00
Damien Elmes
b52ac3883e
Merge pull request #1209 from RumovZ/drop-saved-search
...
Drag & drop for saved search
2021-06-01 17:50:55 +10:00
Damien Elmes
ea60b73275
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
RumovZ
9e56a4421b
Add violet, turquoise and purple flags
2021-05-31 12:03:30 +02:00
Damien Elmes
0b6beaa1da
remove deck protobuf from frontend
...
Like the previous change, avoid exposing the protobuf as a public API
for now. It requires more thought, and is probably better done with
either extra helper accessors like decks.name(), or via a native class.
2021-05-31 16:31:06 +10:00
RumovZ
fb9cbf9816
Make a new item the current item after refresh
2021-05-30 10:46:59 +02:00
RumovZ
bf0dbeb5f0
Skip saving search if it already exists
2021-05-30 10:11:40 +02:00
RumovZ
a989b4e8e9
Enable drop to create saved search
2021-05-30 09:30:22 +02:00
RumovZ
0297a698e8
Fix renaming of unused tag
...
Unused tags can't be renamed, but since the CollectionOp returns success
in any case, the provisionally renamed sidebar item needs to be reset.
2021-05-28 19:18:21 +02:00
RumovZ
f443058209
Prevent sidebar toolbar from folding
...
If there is little space, Qt replaces some tools of the toolbar with an
expandable menu indicated by an arrow. But this arrow is invisible in
night mode.
2021-05-28 18:09:44 +02:00
RumovZ
99bc3c698f
Fix restoring current sidebar element for cards
2021-05-28 17:46:46 +02:00
Damien Elmes
4a0758b34f
always start in first sidebar mode
...
I didn't notice anyone objecting; let's see how this is received.
https://forums.ankiweb.net/t/anki-2-1-45-alpha/10061/35
2021-05-24 14:51:21 +10:00
Damien Elmes
1f7118a8e3
config updates by the frontend now skip undo by default
2021-05-24 14:50:46 +10:00
Damien Elmes
380317d701
Merge pull request #1186 from RumovZ/ctx-actions
...
Update context action states after card op
2021-05-24 10:49:23 +10:00
RumovZ
fb8194d82a
Remove browser.oneModelNotes()
2021-05-22 19:12:03 +02:00
RumovZ
fa81437ad6
Check notetype count in browser.onChangeModel()
2021-05-22 19:11:06 +02:00
RumovZ
bb829feeac
Update context action states after card op
2021-05-22 08:35:47 +02:00
Damien Elmes
8378ecc2d9
Merge pull request #1185 from RumovZ/scrolling
...
Scroll pixels instead of columns horizontally
2021-05-22 10:59:09 +10:00
Damien Elmes
80d32dc7c8
fix find&replace searching in incorrect field
2021-05-22 10:12:14 +10:00
RumovZ
c6d95a8e3d
Scroll pixels instead of columns horizontally
2021-05-21 18:59:53 +02:00
Damien Elmes
5427668303
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
ba727735bd
report changed cards when changing deck/flag
...
+ fix repeated flag shortcut not toggling
2021-05-21 16:03:05 +10:00
RumovZ
71dd8edabd
Move flags into separate module
2021-05-20 10:26:18 +02:00
RumovZ
58243fad52
Remove redundant pylint exception
2021-05-19 19:44:49 +02:00
RumovZ
1c3134e9c2
Use dataclass instead of tuple for loaded flags
2021-05-19 19:17:43 +02:00
RumovZ
316beb6f63
Use custom flag labels for browser actions
2021-05-19 11:00:02 +02:00
RumovZ
9ebdb84512
Make sidebar flags renamable
2021-05-19 10:04:40 +02:00
Damien Elmes
0767754ca6
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
f4ddf90399
Merge pull request #1170 from RumovZ/fix-columns
...
Fix column issues
2021-05-18 09:24:15 +10:00
Damien Elmes
c267a1d0e1
PreviewDialog was missing from top level browser module
2021-05-18 09:10:28 +10:00
RumovZ
0ef8a2e802
Set column sizes and indicator after state change
2021-05-17 20:13:45 +02:00
RumovZ
58a18eb261
Block events when restoring headers
...
Restoring headers after switching states was triggering
_on_column_toggled(), leading to unexpected results.
2021-05-17 20:07:52 +02:00
RumovZ
6f12d48ad5
Make failed sort column change a no-op
...
The previous behaviour when a non-sortable column was clicked was to
trigger the sorting routine, which was usually a no-op, but would
reorder rows if the configured sort column was hidden.
2021-05-17 18:33:59 +02:00
Damien Elmes
2e312eb13d
update find_duplicates to use QueryOp/CollectionOp
2021-05-08 16:58:18 +10:00
Damien Elmes
db415b08e4
move query_op into operations/, and add the ability to show progress
2021-05-08 16:35:43 +10:00
Damien Elmes
34c26a8b1c
split browser dialogs into separate files
2021-05-08 15:08:45 +10:00
Damien Elmes
d8cea1385c
the find_and_replace alias is not required
...
Was only added recently, so nothing should depend on it yet.
2021-05-08 14:34:57 +10:00
Damien Elmes
9c51aa5a64
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
6dd78b0ea5
Merge pull request #1159 from hgiesel/newapproach
...
Prefer idiomatic Svelte features over dynamic components
2021-05-08 11:35:31 +10:00
Henrik Giesel
755b39b59e
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
26e9fba1f7
update docstrings for latest black
2021-05-07 18:12:56 +10:00
Damien Elmes
4242d82adf
fix find&replace
2021-05-07 14:02:40 +10:00
Henrik Giesel
8c32691d30
Fix Preview Button after changing from f-string to normal string
2021-05-07 02:12:37 +02:00
Henrik Giesel
bb2fb8e9f5
Fix ButtonDropdown
2021-05-07 02:04:44 +02:00
Henrik Giesel
dd99524ae0
Enable setting of PreviewButton and hiding of cloze button again
2021-05-07 02:04:42 +02:00
Damien Elmes
e468daa060
undoing of notetype templates
2021-04-30 17:30:48 +10:00
RumovZ
8e0298120d
Add separate no_arg_trigger decorator
2021-04-26 08:46:08 +02:00
Damien Elmes
532840bbfc
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
7ac84a38d6
Remove some unnecessary lambdas
2021-04-25 19:51:57 +02:00
RumovZ
4b91c2b9f1
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
a21a4d330b
Initialize editor toolbar via function, not web component
2021-04-25 18:32:01 +02:00
Damien Elmes
68a4f4bade
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
f3b344a571
fix error when user cancels out of set due date/reposition
2021-04-25 19:33:25 +10:00
RumovZ
f898f5507c
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
01b53a6be8
Make update algorithm in editor-toolbar/index.ts recursive
2021-04-23 20:50:09 +02:00
Henrik Giesel
9e952e428e
Use rawButton in browser.py
2021-04-23 17:34:42 +02:00
Damien Elmes
04f0adb847
fix Find Dupes activation
2021-04-20 21:13:21 +10:00
RumovZ
eb9fbb9c0f
Add sidebar filter "first review today"
2021-04-18 13:27:10 +02:00
Henrik Giesel
ff8cfd1c3e
Add type to add_preview_shortcut
2021-04-15 15:50:29 +02:00
Henrik Giesel
1a04ca32fe
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
277d0af336
Add Preview shortcut for browser
2021-04-15 13:09:51 +02:00
Henrik Giesel
f5687f5aec
Add support for Preview button in Browser
2021-04-15 13:09:50 +02:00
RumovZ
f35110a0eb
Fix ChangeModel combos being cleared after setup()
2021-04-14 23:01:40 +02:00
Damien Elmes
2629240272
Merge pull request #1127 from Arthur-Milchior/factorize_current_search
...
NF: factorize browser.current_search
2021-04-14 19:16:59 +10:00
Arthur Milchior
ad9adee26a
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
2a43d42323
run black/isort on Python scripts
2021-04-14 18:22:02 +10:00
Damien Elmes
ec6a2f7e2a
Merge pull request #1124 from hgiesel/dropjquerypy2
...
Remove jQuery from remaining qt/aqt files
2021-04-14 12:43:11 +10:00
Henrik Giesel
d2a5d9e246
Satisfy formatter
2021-04-13 20:29:59 +02:00
Henrik Giesel
10c7d4bf34
Remove jquery from browser.py
2021-04-13 19:54:45 +02:00
RumovZ
f62cfc15c2
Move previewer.py into browser folder
2021-04-13 11:38:35 +02:00
RumovZ
38621d0fac
Declare all legacy pathnames in browser init
2021-04-13 11:30:32 +02:00
RumovZ
e37dc6c68c
Move find_and_replace.py into browser/dialogs
2021-04-13 11:21:36 +02:00
RumovZ
12d3084e46
Refactor sidebar.py into browser folder
2021-04-13 11:05:49 +02:00
RumovZ
a1e8746efd
Refactor browser and table into folders
2021-04-12 09:50:44 +02:00