diff --git a/es-app/src/guis/GuiScraperMenu.cpp b/es-app/src/guis/GuiScraperMenu.cpp index a9bee62d2..2919127d9 100644 --- a/es-app/src/guis/GuiScraperMenu.cpp +++ b/es-app/src/guis/GuiScraperMenu.cpp @@ -63,6 +63,8 @@ GuiScraperMenu::GuiScraperMenu(Window* window) : GuiComponent(window), mSystems->selectEntry(i) : mSystems->unselectEntry(i); } } + // Sort the systems by their full names. + mSystems->sortEntriesByName(); mMenu.addWithLabel("Systems", mSystems); addEntry("CONTENT SETTINGS", 0x777777FF, true, [this] { diff --git a/es-app/src/views/SystemView.cpp b/es-app/src/views/SystemView.cpp index 044f2f41e..602939bdc 100644 --- a/es-app/src/views/SystemView.cpp +++ b/es-app/src/views/SystemView.cpp @@ -146,6 +146,10 @@ void SystemView::populate() "OK", nullptr)); } } + + // Sort the systems by their full names. + std::sort(std::begin(mEntries), std::end(mEntries), + [](Entry a, Entry b) { return a.object->getFullName() < b.object->getFullName(); }); } void SystemView::goToSystem(SystemData* system, bool animate) diff --git a/es-app/src/views/ViewController.cpp b/es-app/src/views/ViewController.cpp index a5eb6c76f..8aa218c2d 100644 --- a/es-app/src/views/ViewController.cpp +++ b/es-app/src/views/ViewController.cpp @@ -100,7 +100,8 @@ void ViewController::goToStart() // Requested system doesn't exist. Settings::getInstance()->setString("StartupSystem", ""); } - goToSystemView(SystemData::sSystemVector.at(0)); + // Get the first system entry as sorted by full system names in SystemView. + goToSystemView(getSystemListView()->getFirst()); } void ViewController::ReloadAndGoToStart() diff --git a/es-core/src/components/OptionListComponent.h b/es-core/src/components/OptionListComponent.h index 907ac4538..e7967a125 100644 --- a/es-core/src/components/OptionListComponent.h +++ b/es-core/src/components/OptionListComponent.h @@ -16,6 +16,8 @@ #include "Log.h" #include "Window.h" +#include + // Used to display a list of options. // Can select one or multiple options. @@ -199,6 +201,12 @@ public: onSelectedChanged(); } + void sortEntriesByName() + { + std::sort(std::begin(mEntries), std::end(mEntries), + [](OptionListData a, OptionListData b) { return a.name < b.name; }); + } + HelpStyle getHelpStyle() override { return mHelpStyle; }; private: