Quick note and deck buttons (Fork for 2.1) [Official thread]

ijg's Avatar

ijg

19 Apr, 2020 11:54 AM

If you have a problem with the add-on Quick note and deck buttons (Fork for 2.1) post in this thread. This way I get notified. If you make a new thread I will likely miss it. If you post your comment, question or bug report on ankiweb as a review I won't get notified. You really should post in this thread.

  1. 1 Posted by Jacques on 12 May, 2020 09:03 AM

    Jacques's Avatar

    Thanks for providing this!

    It seems that I don't really need any Deck-Buttons, b/c I change deck and note type at the same time within the "model_button_rows".

    You can also shortcut only/no button so that a button is not shown for this option. In this case you can only you must set shortcut.

    How exactly is this done? I tried

    {
        "deck_button_rows": [
            [
                {
                    "shortcut": ""
                }
            ]
        ],
    

    that doesn't work ...

    Cheers ... ;)

  2. 2 Posted by ijg on 13 May, 2020 12:35 AM

    ijg's Avatar

    Thanks for this report. My description for this function doesn't make sense and at the moment this doesn't work. I'll release a new version this week. In the new version it will be enough to add one line to the relevant entry: "shortcut only/no button": true

  3. 3 Posted by Jacques on 13 May, 2020 07:58 AM

    Jacques's Avatar

    Thanks, good to hear!

  4. 4 Posted by Jacques on 14 May, 2020 10:28 AM

    Jacques's Avatar

    What I've done is the following, and it seems to work fine:

    "deck_button_rows": [
            [
                {
                    "deck": "Deck1",
                    "label": "Deck1",
                    "shortcut only/no button": true
                }
            ]
        ],
    
    That means there's no button, and no shortcut, would that be a problem?

    I don't really need the "deck_button_rows"; I can change note type and deck within the "model_button_rows", and I do not want to waste a keyboard shortcut, that I could use for something else.

    Anyway, thanks for this awesome addon ... :D

  5. 5 Posted by ijg on 14 May, 2020 06:38 PM

    ijg's Avatar

    You can remove even more:

    "deck_button_rows": [],
    

    Also: Could you update the add-on and try out if the new version works for you. Now you can also make the deck area wider if you adjust the config. If you run into a problem please let me know.

  6. 6 Posted by Jacques on 15 May, 2020 08:37 AM

    Jacques's Avatar

    Could you update the add-on and try out if the new version works for you.

    Yes, I've updated; works fine (BTW, I'm on macOS). I have not tried all options; I use Ctrl+1, and Ctrl+2 to switch between 2 note types; both shortcuts choose the same deck, and add the same tag.

    However, there's one thing that may need some fixing:

    When I open a different Anki-profile, where Decks and Note Types have different names, then the Add-On gets thrown off; it displays some random buttons, and the shortcuts don't work.

    I think that's to be expected; but the behaviour persists even when I switch back to the original Anki-profile. I have to restart Anki for the Add-On to work properly again.

    It's not a problem, I simply disable the Add-On when I work with different Anki-profiles.

    Maybe it's getting too complicated if the Add-On had different config files for each Anki-profile ... ;)

    The Add-On should probably just disable itself if the note types/decks from the config file don't exist in the Anki-profile.

  7. 7 Posted by ijg on 15 May, 2020 09:04 AM

    ijg's Avatar

    Thanks for the feedback. I've added the "per profile" config to my todo list (but admittedly it's very low priority for me).

  8. 8 Posted by Jacques on 15 May, 2020 10:26 AM

    Jacques's Avatar

    "per profile" ... low priority

    I understand ;)

    Short addendum:

    Just the sheer fact alone of switching profiles throws off the Add-On, even if, in the new profile one switches to, all the note types and decks specified in the config, actually do exist.

    So for users with several Anki profiles who want to use the Add-On:

    • start Anki
    • directly go to the correct profile, and add the cards you want
    • if you want to switch profiles, quit Anki first

    Anyway, great work!!

  9. 9 Posted by Jacques on 15 May, 2020 10:33 AM

    Jacques's Avatar

    ...

    • if you want to switch profiles: disable the Add-On and quit Anki; restart Anki and choose different profile

    ...

  10. 10 Posted by ijg on 15 May, 2020 11:34 AM

    ijg's Avatar

    I just updated the add-on. Now at least you can disable it for selected profiles/enable it only in selected profiles. This should work without restarting.

    Could you test this update and let me know if it works as expected?

  11. 11 Posted by Jacques on 15 May, 2020 04:52 PM

    Jacques's Avatar

    Thanks very much for your effort!

    It's getting there, still a little 'snag' ...

    Below is the code; I tried the lists separately, then combined. Here's what happened (there should be 1 pair of buttons, 1 button for note type 1, and one button for note type 2):

    • The Add-On works correctly in myProfile1 only if myProfile1 is the first profile I select after starting Anki.
    • The Add-On also works correctly insofar as it is now indeed ignored in all the other profiles.
    • But if I select myProfile1 after having first opened one or more of the other profiles (myProfile2, myProfile3, etc), the Add-On does NOT work correctly: instead of only 1 pair of buttons, there are now 2 pairs, 3 pairs, ..., or even 6 pairs (i.e. 12 buttons). When clicked on with the mouse, the buttons select the correct note types, decks, and tags (buttons 1, 3, 5, etc select note type 1, buttons 2, 4, 6, etc select note type 2), but the keyboard shortcuts no longer work.

    The only way to get the Add-On working properly again is to restart Anki and select myProfile1 straight away.

    "Enable only for these profiles": [
            "myProfile1"
        ],
    
    "Disable for these profiles": [
            "myProfile2",
            "myProfile3",
            "myProfile4",
            "myProfile5"
        ],
    

    Hope this helps ...

  12. 12 Posted by ijg on 15 May, 2020 06:09 PM

    ijg's Avatar

    Thanks for the good problem description. The most recent version should fix this. Does it work now as expected? I don't care about this feature so I'm outsourcing the testing to you ...

  13. 13 Posted by Jacques on 15 May, 2020 06:59 PM

    Jacques's Avatar

    Does it work now as expected?

    Short answer: YES!

    And not only in one profile, but in all profiles where the note type/deck names specified in the config file do exist.

    So all one needs now is the disable list with all profiles where note types / decks have different names.

    Here's how I set it up now (myProfile1 and myProfile2 are the profiles where the Add-On works fine):

    "Disable for these profiles": [
            "myProfile3",
            "myProfile4",
            "myProfile5"
        ],
        "Enable only for these profiles": [],
    

    And for myProfile3-5, I could just create different 1331140127 folders and rotate them around as needed ...

  14. 14 Posted by Jacques on 16 May, 2020 06:47 AM

    Jacques's Avatar

    ... or create unused dummy note types/decks.

  15. 15 Posted by tara on 07 Jul, 2020 02:51 AM

    tara's Avatar

    there seems to be extra buttons when I go to add cards, then in the tags it says "really_adjust_the_config_of_the_addon_Quick_note_and_deck_buttons" I was very confused so came here. running 2.1.23 on Mac 10.13.6. Please see attached photo

  16. 16 Posted by ijg on 07 Jul, 2020 09:01 AM

    ijg's Avatar

    You should "really adjust the config of the addon Quick note and deck buttons".

    In the main window toolbar click on Tools, then Add-ons. In the dialog that opens double click my addon (or select it and click "Config"). Then a config window opens: Go through it and remove the placeholder texts I have like "adjust_the_config_of_the_addon_Quick_note_and_deck_buttons" or "really_adjust_the_config_of_the_addon_Quick_note_and_deck_buttons" and "remove_this". Then restart Anki.

    I added these "fake" tags so that this tag feature is more easy to discover and to adjust.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac