Commit graph

28 commits

Author SHA1 Message Date
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
Arthur Milchior
cb2df4fc1a NF: HelpPage in an enum
Hopefully, this can help with updating on next manual update and maybe even linking to manual translation
2021-01-26 02:16:37 +01:00
Damien Elmes
8075d46011 convert setWindowFlags call into helper, and fix invalid variables
"type: ignore" was masking the invalid references to self in places
like showText()
2021-01-07 14:24:49 +10:00
BlueGreenMagick
9a29d1b97a remove context help button 2021-01-06 22:15:48 +09:00
Arthur Milchior
ebd4938507 Reject field name with : { or }
More than {{ is acceptable to start a tag, which means that `{{{Foo}}` won't be interpreted as "the content of `Foo`"
and should be rejected. For the sake of clarity and parsing, I suspect that those symbol should be rejected elsewhere
too.

Similary `{{Foo}}}` won't be interpreted as "Show the content of field `Foo}`" even if this field exists, so it's better
to reject `}`. It's clearly necessary to reject "}}" inside the field name, rejecting "}" seems easier to explain and
avoid future unexpected problem if the templates change.

The ":" are used to separate filters, and rejecting it in field name would ensure that there is no ambiguity.
2020-12-28 07:33:26 +01:00
Arthur Milchior
b2e0d0b968 Rejects field names starting with #, ^ and / 2020-12-28 06:23:49 +01:00
Arthur Milchior
ae489b1278 New field are stripped
Otherwise, you can rename "Back" to " Front" and then get unexpected result
2020-12-28 06:18:42 +01:00
Henrik Giesel
599cfb37a1 Fix fields_did_rename_field 2020-12-01 02:28:10 +01:00
abdo
caade20ad4 Strip isolation characters from more strings 2020-11-18 18:03:04 +03:00
Damien Elmes
b02badb224 update multi-line _() references 2020-11-18 11:32:22 +10:00
Damien Elmes
686b640e11 update some qt ngettext references 2020-11-18 09:22:27 +10:00
Damien Elmes
2feddb3d70 update temporary val="%s" references to standard ftl 2020-11-17 22:00:44 +10:00
Damien Elmes
066b1498ae merge bulk of qt/ - designer files still to do 2020-11-17 17:42:43 +10:00
abdo
96eadecdec Use replace instead of strip
https://github.com/ankitects/anki/pull/801
2020-10-22 15:21:30 +03:00
abdo
69da22a2b9 Strip double quotes from names
Strip double quotes from all kinds of names

https://github.com/ankitects/anki/pull/798
2020-10-21 21:48:49 +03:00
Damien Elmes
362ebef832 Merge pull request #790 from hgiesel/fields
Add fields_did_rename_field and fields_did_remove_field hooks
2020-10-12 12:36:39 +10:00
Henrik Giesel
0f09258e68 Add fields_did_rename_field and fields_did_remove_field hooks 2020-10-11 19:16:30 +02:00
johan456789
0ebe5d14eb fix help url paths 2020-10-10 00:38:07 +08:00
Arthur Milchior
110f4c664f Any removed 2020-08-12 01:37:21 +02: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
Damien Elmes
6c4d6ad933 track changes in fields dialog as well
And avoid bumping schema until user actually saves, but warn at
start.
2020-05-15 13:59:44 +10:00
Damien Elmes
257e893d95 update the card layout screen
- changes are now committed in bulk when closing the dialog,
and can be canceled
- it's not necessary to save the note to the database to preview it
- duplicate fields are now shown as duplicates in the top list
- redraw preview more quickly
- use + instead of _ when deduplicating names, as the latter is a
glob character
2020-05-13 17:24:49 +10:00
Damien Elmes
2641862b56 update fields and models diags
- field changes are now applied when user closes dialog with save
button, in bulk
- models diag now fetches note type and saves it as required, instead
of holding on top a copy that can grow stale as changes are made in
subdialogs
- both dialogs now perform operations in the backend
- note.model() now fetches the note type on the fly, instead of
holding on to a copy that may become stale
2020-05-12 21:13:34 +10:00
Damien Elmes
4aac9635fa catch template errors, and start on discarding changes to fields/cards
This is only a first step - all the current methods that implicitly
save need to be updated.
2020-05-12 21:13:33 +10:00
Damien Elmes
4d33b2d8f7 use qconnect everywhere, and fix some typing issues
a step towards check_untyped_defs in aqt, but there's still 100+
issues to resolve
2020-05-04 13:23:08 +10:00
BlueGreenMagick
e7dba3709b allow dragging fields to change its position 2020-04-07 16:42:33 +09:00
Damien Elmes
2a00e0a6b0 tweaking the folder names again
hopefully that's the last of it
2020-01-03 07:48:38 +10:00
Renamed from anki-qt/aqt/fields.py (Browse further)