Anki/qt/aqt
Arthur Milchior efaaae8ce4
Cloze button get disabled outside of cloze field (#3879)
* NF: replace `disabled` by `enabled`

This allows to remove the negations and, in my opinion, make the code
easier to understand and edit.

* Cloze button get disabled outside of cloze field

More specifically, if the user focus in a field that is not a cloze
field, the button are still there but appear as disabled. The shortcut
instead of adding the cloze context shows an alert explaining why this
can't be done.

While this message is already displayed when the user tries to add a
note with cloze in non-cloze field, I suspect it will save time to
stop the user as soon as possible from making mistake. This should
make very clear what is authorized and what is not.

It'll also be a reminder of whether the current field is a cloze or
not.

In order to do this, I added a back-end method (that I expect we may
reuse in ankidroid) to get the index of the fields used in cloze. This
set is sent to the note editor, which propagates it where needed.

In mathjax, the cloze symbol is removed when the selected field is not
a cloze field.
2025-04-24 18:37:41 +10:00
..
browser Fix AnkiWebPage not being initialized for default web view kinds (e.g. in add-ons) (#3933) 2025-04-22 21:22:40 +10:00
data Revert "Fix ease button alignment (#3474)" (#3522) 2024-10-26 18:50:02 +10:00
forms Fix AnkiWebPage not being initialized for default web view kinds (e.g. in add-ons) (#3933) 2025-04-22 21:22:40 +10:00
import_export Enable strict_optional for aqt/data, aqt/forms, aqt/import_export (#3489) 2024-10-12 14:36:15 +10:00
operations Feat/grade now (#3840) 2025-03-15 17:30:40 +07:00
qt Revert "Qt 6.8.1" 2025-01-25 21:41:33 +11:00
__init__.py Fix broken window decorations on unpackaged GNOME instances (#3858) 2025-03-19 17:58:42 +07:00
_macos_helper.py Update type annotations (#3322) 2024-07-26 17:57:25 +07:00
about.py Fix error when middle clicking in editor on systems w/o global mouse selection (#3923) 2025-04-15 20:26:18 +10:00
addcards.py only change notetype/deck when reopening if no changes to discard (#3798) 2025-02-09 15:58:21 +03:00
addons.py Add-ons Dialog: disable View Config/Page/Files buttons when clicking them would not lead to useful result (#3869) 2025-03-19 04:27:34 +03:00
ankihub.py Integrate AnkiHub Sign-in (#3232) 2024-08-17 10:58:23 +07:00
changenotetype.py Enable strict_optional for aqt/clayout, changenotetype, fields (#3544) 2024-10-30 13:40:40 +03:00
clayout.py Fix: Close cards missing "copy card info" button (#3811) 2025-02-16 16:10:04 +07:00
colors.py Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
customstudy.py Fix mypy errors 2024-10-26 19:19:20 -07:00
dbcheck.py Ensure DB check tooltip appears in main window 2024-04-30 23:21:41 +10:00
debug_console.py Increase font size in debug console (#3743) 2025-01-20 06:47:33 +03:00
deckbrowser.py Add title for some dialogs and avoid hardcoding the text of the discard changes dialog (#3846) 2025-03-10 15:53:43 +07:00
deckchooser.py Allow choosing filtered decks in stats (#3687) 2025-01-04 17:39:16 +03:00
deckconf.py Improve exception handling (#3290) 2024-08-04 20:51:13 +07:00
deckdescription.py Enable strict_optional for aqt/deckdescription.py (#3538) 2024-10-28 14:18:16 +10:00
deckoptions.py Deck options without bridge (#3571) 2025-01-08 21:30:30 +11:00
editcurrent.py set editor's card when reopening (#3814) 2025-02-16 16:11:28 +07:00
editor.py Cloze button get disabled outside of cloze field (#3879) 2025-04-24 18:37:41 +10:00
emptycards.py Fix AnkiWebPage not being initialized for default web view kinds (e.g. in add-ons) (#3933) 2025-04-22 21:22:40 +10:00
errors.py Prompt user to apply Windows updates when SSL connection fails 2025-02-06 22:57:15 +07:00
exporting.py Update type annotation syntax (#3283) 2024-07-21 14:00:52 +07:00
fields.py Add title for some dialogs and avoid hardcoding the text of the discard changes dialog (#3846) 2025-03-10 15:53:43 +07:00
filtered_deck.py Enable strict_optional for aqt/deckoptions, editcurrent, filtered_deck (#3556) 2024-11-07 08:33:41 +10:00
flags.py Use default flag name when flag is renamed to empty string (#3826) 2025-02-21 16:38:04 +07:00
gui_hooks.py Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
importing.py update error message (#3612) 2024-12-06 03:05:49 +03:00
legacy.py Import submodules directly (#1662) 2022-02-13 13:40:47 +10:00
log.py Add support for python logging (#2969) 2024-02-11 16:41:50 +10:00
main.py add hook for day rollover (#3817) 2025-02-18 13:46:15 +07:00
mediacheck.py Enable strict_optional for aqt/mediacheck, theme, toolbar (#3569) 2024-11-12 19:47:04 +03:00
mediasrv.py Restore ability to check pages externally on other devices 2025-04-24 18:33:09 +10:00
mediasync.py Enable strict_optional for aqt/mediasync, package, progress (#3577) 2024-11-15 16:24:50 +03:00
modelchooser.py Enable strict_optional for aqt/modelchooser.py (#3539) 2024-10-28 14:19:31 +10:00
models.py Fix "Note Types" dialog moving down each time it is opened (#3718) 2025-01-12 15:33:37 +11:00
mpv.py Fix mpv loadfile syntax change 2 (#3711) 2025-01-10 19:16:08 +11:00
notetypechooser.py Enable strict_optional for aqt/notetypechooser, stats, switch (#3558) 2024-11-08 13:42:42 +03:00
overview.py Fix mypy errors 2024-10-26 19:07:43 -07:00
package.py Enable strict_optional for aqt/mediasync, package, progress (#3577) 2024-11-15 16:24:50 +03:00
preferences.py Remove legacy import option (#3536) 2024-11-05 18:25:06 +10:00
profiles.py Add an option to disable middle click to paste on Linux (#3904) 2025-04-15 19:51:00 +10:00
progress.py feat: add title to some of the sync dialogs (#3838) 2025-03-03 15:03:28 +03:00
props.py Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
py.typed mark anki and aqt modules as having typing info 2020-01-13 13:03:37 +10:00
reviewer.py Add hooks for comparing answers (#3855) 2025-03-15 12:12:01 +07:00
schema_change_tracker.py Add ability to restore a notetype to its original configuration (#2472) 2023-04-18 14:07:51 +10:00
sound.py Harden access to internal API (#3925) 2025-04-17 11:15:10 +10:00
stats.py Fix AnkiWebPage not being initialized for default web view kinds (e.g. in add-ons) (#3933) 2025-04-22 21:22:40 +10:00
studydeck.py Enable strict_optional for aqt/studydeck, tts, mediasrv (#3542) 2024-10-29 12:05:54 +03:00
stylesheets.py Use platform-native button layout in dialogs and messageboxes (#3725) 2025-01-13 14:24:21 +11:00
switch.py Remove hardcoded note/card colours from switch.py (#3629) 2024-12-14 21:30:28 +11:00
sync.py feat: add title to some of the sync dialogs (#3838) 2025-03-03 15:03:28 +03:00
tagedit.py Enable strict_optional for aqt/tagedit, utils, sync (#3578) 2024-11-15 16:29:19 +03:00
taglimit.py Fix mypy errors 2024-10-26 19:33:04 -07:00
taskman.py fix: Task manager exception handling (#3839) 2025-03-10 14:17:50 +07:00
theme.py Use platform-native button layout in dialogs and messageboxes (#3725) 2025-01-13 14:24:21 +11:00
toolbar.py Refactoring and comments (#3721) 2025-01-12 15:46:20 +11:00
tts.py Don't parse TTS text as XML (#3651) 2024-12-22 11:09:00 +10:00
undo.py Dependency updates (#3040) 2024-02-28 16:28:04 +07:00
update.py Fix UI hanging when update check stalls 2024-10-15 21:32:46 +10:00
utils.py feat: add title to some of the sync dialogs (#3838) 2025-03-03 15:03:28 +03:00
webview.py Fix AnkiWebPage not being initialized for default web view kinds (e.g. in add-ons) (#3933) 2025-04-22 21:22:40 +10:00
widgetgallery.py Improve debug console (#2435) 2023-03-15 15:29:05 +10:00
winpaths.py run pyupgrade over codebase [python upgrade required] 2021-10-04 15:05:48 +10:00