Commit graph

1708 commits

Author SHA1 Message Date
RumovZ
b21d1dcbc0 Merge branch 'master' into dyn-deckconf 2021-02-01 23:33:41 +01:00
RumovZ
7b39fb6484 Rename standard buttons to have transaltions 2021-02-01 23:20:57 +01:00
RumovZ
99ffc08dbf Make browser links unfocusable
Since Enter would trigger Accept anyway, there is no point in them
having focus.
2021-02-01 21:17:15 +01:00
RumovZ
3e30bd4610 Enable renaming from dyndeck dialogue 2021-02-01 21:02:22 +01:00
RumovZ
320b82aae6 Add cross links for second dyndeck filter 2021-02-01 19:10:05 +01:00
RumovZ
fbc5de4596 Style browser-from-filtered-deck button
Use theme color and add hover effect.
2021-02-01 18:01:57 +01:00
Damien Elmes
748aeb9df1 add a bunch of return types 2021-02-01 23:53:23 +10:00
RumovZ
b76632eb62 Add button in dynDeckConf to search in browser 2021-02-01 13:55:03 +01:00
Damien Elmes
83892eac51 add types to various other files
Mainly automated with MonkeyType
2021-02-01 22:08:56 +10:00
RumovZ
ef413b90c6 Rename "Filtered Deck from Current Filter" 2021-02-01 12:09:37 +01:00
Damien Elmes
8be63cb902 add some types to main.py 2021-02-01 20:59:18 +10:00
RumovZ
27609a784f Change filtered-deck shortcut in browser to Ctrl+G 2021-02-01 11:59:16 +01:00
RumovZ
d57d0f977b Make browser accept optional args and add reopen
That way, the caller doesn't have to hold a reference to the browser and
explicitly call it again, if it wants to search for something specific.
Also, if the browser was closed and opened for a single-card-search, it
now won't perform a redundant current-deck-search first.
2021-02-01 11:54:28 +01:00
Damien Elmes
8dc5ea8bb6 add types to utils.py
The function signatures for things like getFile() are awful, but
sadly are used by a bunch of add-ons.
2021-02-01 20:23:48 +10:00
RumovZ
aa6cf51527 Fix pylints and type annotations in dyndeckconf
Also fix int representation of learning steps.
2021-02-01 09:56:10 +01:00
RumovZ
2a82e43c0b Make DialogManager accept kwargs
When opening a dialogue accepting multiple optional arguments, relying
on position is error-prone and requires passing Nones to fill unused
parameter slots.
2021-02-01 08:50:19 +01:00
Damien Elmes
dc261c5abf add helper script to run mypy daemon 2021-02-01 17:29:03 +10:00
Damien Elmes
34935bf478 add types to editor.py 2021-02-01 17:28:35 +10:00
Damien Elmes
b3f9d12606 Merge pull request #962 from hgiesel/editordirs
Make editor a rollup package within data/web/js
2021-02-01 13:40:54 +10:00
Damien Elmes
fe0d6b3a10 add missing types to sidebar.py 2021-02-01 09:51:46 +10:00
Damien Elmes
2070847868 add missing types to browser.py 2021-02-01 09:39:55 +10:00
RumovZ
90e1a75dd6 Add current-filter-to-filtered-deck action 2021-01-31 23:16:49 +01:00
RumovZ
23d1481d34 Make dyndeckconf a registered dialogue 2021-01-31 22:37:08 +01:00
Henrik Giesel
9f3403d704 Move editor css to editor directory 2021-01-31 19:03:40 +01:00
RumovZ
53513f371f Rework dynndeckconf
- Handle deck building inside class. New deck is built unless caller
  passes filtered deck.
- If no deck is passed and current deck is filtered, copy settings.
- Remove exec_().
2021-01-31 18:20:47 +01:00
Henrik Giesel
978258067b Move editor to /ts/editor 2021-01-31 14:15:03 +01:00
Henrik Giesel
e667191899 Fix type issues 2021-01-31 13:34:39 +01:00
Henrik Giesel
aba2506394 Make editor a rollup package 2021-01-31 13:34:37 +01:00
RumovZ
632ad14801 Remove protobuf filters whole_col and current_deck 2021-01-31 11:12:49 +01:00
Damien Elmes
56a75c07dc add public wrappers for remaining backend functions 2021-01-31 18:56:16 +10:00
Damien Elmes
ebfc9d1915 move rsbridge into _backend 2021-01-31 18:55:45 +10:00
Damien Elmes
a6be0f493b start work on more clearly defining backend/protobuf boundaries
- anki._backend stores the protobuf files and rsbackend.py code
- pylib modules import protobuf messages directly from the
_pb2 files, and explicitly export any will be returned or consumed
by public pylib functions, so that calling code can import from pylib
- the "rsbackend" no longer imports and re-exports protobuf messages
- pylib can just consume them directly.
- move errors to errors.py

Still todo:

- rsbridge
- finishing the work on rsbackend, and check what we need to add
back to the original file location to avoid breaking add-ons
2021-01-31 18:55:45 +10:00
RumovZ
4cb9bf7326 Add missing sidebar onClicks 2021-01-31 08:56:34 +01:00
Damien Elmes
9a697fd843 Merge branch 'more-backend-search' into main 2021-01-31 14:21:51 +10:00
Damien Elmes
86713be79c disable multiple selection for now 2021-01-31 14:02:38 +10:00
Damien Elmes
3708d28d0c disable dragging of unsupported items 2021-01-31 13:46:31 +10:00
Damien Elmes
1e573003e9 support dragging multiple decks at once 2021-01-31 13:46:31 +10:00
Damien Elmes
3a06fd2808 add missing check for on_done==None in with_progress() 2021-01-31 13:46:31 +10:00
Damien Elmes
0f8b0df491 support drag&drop of decks in sidebar 2021-01-31 13:46:31 +10:00
Damien Elmes
5710e4bbd0 move drag/drop deck logic to backend 2021-01-31 13:46:31 +10:00
RumovZ
d3d18d34c5 Remove search button and reword search bar hint 2021-01-30 19:23:40 +01:00
RumovZ
2539747115 Manually namespace enum variants in SearchTerm
In protobuf "...enum values use C++ scoping rules, meaning that
enum values are siblings of their type, not children of it.
Therefore, [an enum variant] must be unique within [a message],
not just within [the enum.]"
So we must prefix enum variants with their enum's name, but can
also call them directly from the message namespace.
The protobuf crate is smart, though, and strips the prefixes.

(Simultaneously change some SearchTerm variant names.)
2021-01-30 17:56:29 +01:00
RumovZ
cdabb0ecbe Replace leftover _named_filter with _filter_func 2021-01-30 17:39:21 +01:00
Henrik Giesel
a94bcbcc74 Fix focus on first field upon opening editor 2021-01-30 14:20:14 +01:00
RumovZ
353355fb15 Build list in focusCid and specify exception
model.cards may be a protobuf sequence but focusCid needs list's index
method, so convert to list, but only if needed.
2021-01-30 13:15:46 +01:00
RumovZ
540338cea3 Import SearchTerm from collection in aqt 2021-01-30 12:51:24 +01:00
RumovZ
a20ee1c844 Fix type annotations in browser search 2021-01-30 11:24:33 +01:00
RumovZ
9a1ff40b65 Update docstrings for browser search 2021-01-30 11:05:48 +01:00
RumovZ
fd07ef212a Auto search and check input before model search
- Search for current deck automatically on browser setup.
- Hide current deck and current card searches.
- Check user search input before passing it on to the model, so invalid
  searches don't change TableView.
2021-01-30 10:53:42 +01:00
Damien Elmes
747075e9a7 Merge pull request #957 from hgiesel/fieldsshadow
Implement editor as Web Component
2021-01-30 15:13:58 +10:00