Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Divide board menu into submenus #9238

Merged
merged 6 commits into from
Mar 25, 2020

Commits on Mar 25, 2020

  1. Handle nested submenus of the Tools menu

    There is some code that, for each submenu under Tools, shows the
    selected item in the label of the submenu itself (e.g. before opening
    the submenu). This was done whenever the Tools menu is opened and
    iterated over all the items in the submenu to identify the s
    
    Previously, this code only looked at direct children of the submenu.
    Now, this code also looks through submenus recursively, to keep the code
    working even when items are divided over sub-submenus.
    
    This makes a small behaviour change: previously, the first selected item
    with a non-zero label was used. Now, the first selected item is used,
    which makes the code a bit cleaner. I cannot quickly see any case where
    the first selected item would have an empty text (and even more that
    there is *another* selected item), so this check seems unnecessary. If
    this case would occur nonetheless, it would only mean the selected item
    is not displayed in the tools menu, nothing would otherwise break.
    matthijskooijman authored and cmaglie committed Mar 25, 2020
    Configuration menu
    Copy the full SHA
    4e97727 View commit details
    Browse the repository at this point in the history
  2. Separate the boards menu per platform

    Previously, the Tools->Boards menu was one long list, divided into
    different platforms by (unselectable) headers. When more than one or two
    platforms were installed, this quickly results in a very long list of
    boards that is hard to navigate.
    
    This commit changes the board menu to have a submenu for each platform,
    where each submenu contains just the boards for that platform.
    
    Note that this first keeps a list of board items and then adds those to
    the boards menu later. This could have been done directly, but the
    intermediate list makes it easier to special-case single platform
    installations, as well as sort the list in subsequent commits.
    
    This fixes part of arduino#8858.
    matthijskooijman authored and cmaglie committed Mar 25, 2020
    Configuration menu
    Copy the full SHA
    89cf600 View commit details
    Browse the repository at this point in the history
  3. Do not use a boards submenu with just one platform

    When just one platform is installed, it does not make much sense to use
    a submenu, so just add the boards directly under the boards menu as
    before.
    matthijskooijman authored and cmaglie committed Mar 25, 2020
    Configuration menu
    Copy the full SHA
    1964b81 View commit details
    Browse the repository at this point in the history
  4. Sort board submenus alphabetically

    This sorts the board submenus themselves, based on the displayed name.
    This does not change the ordering of board items within these submenus
    (which uses the order from boards.txt).
    matthijskooijman authored and cmaglie committed Mar 25, 2020
    Configuration menu
    Copy the full SHA
    55fa3f5 View commit details
    Browse the repository at this point in the history
  5. Do not translate labels of boards submenus

    Otherwise it may happen some weird sorting when untraslated and
    translated labels are sorted together:
    
        Arduino megaAVR Boards
        Arduino nRF52 Board
        ESP32 Arduino
        ESP8266 Modules
        Schede Arduino AVR   <-- the localized string falls to the bottom
    
    Also there is no way for 3rd party boards developers to actually provide
    a translation, so let's just remove them.
    cmaglie committed Mar 25, 2020
    Configuration menu
    Copy the full SHA
    e003049 View commit details
    Browse the repository at this point in the history
  6. Removed some trivial warnings

    cmaglie committed Mar 25, 2020
    Configuration menu
    Copy the full SHA
    b821f75 View commit details
    Browse the repository at this point in the history