diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index ebd8172d7..98f9e7d5d 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -2436,6 +2436,8 @@ opkg.messagebox.remove %s entfernen? opkg.messagebox.size.error Nicht genügend freier Speicher für Paketinstallation verfügbar! opkg.messagebox.updates.available Paket-Aktualisierung(en) verfügbar! opkg.success.install Installation erfolgreich!\nNeustart von Neutrino kann erforderlich sein. Jetzt neu starten? +opkg.separator.packages.available verfügbare Pakete +opkg.separator.packages.installed installierte Pakete opkg.title Paketverwaltung opkg.update.check Prüfe auf Updates ... opkg.update.reading_lists Paketlisten werden eingelesen ... diff --git a/data/locale/english.locale b/data/locale/english.locale index 4a8f47440..8881f9e75 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2436,6 +2436,8 @@ opkg.messagebox.remove Remove %s? opkg.messagebox.size.error Not enough free memory available for this package! opkg.messagebox.updates.available Package update(s) available! opkg.success.install Install successful!\n restart of Neutrino might be required. Restart now? +opkg.separator.packages.available available packages +opkg.separator.packages.installed installed packages opkg.title Package Management opkg.update.check Checking for updates ... opkg.update.reading_lists Reading package lists ... diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index 0512881db..66343f581 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -521,13 +521,13 @@ void COPKGManager::updateMenu() } std::vector& items = menu->getItems(); -// Sorts the elements of the menu object, starting from the fifth element, because they are intro items. -// The sorting is done in two steps: first, the elements are sorted based on the value of iconName_Info_right. -// The values NEUTRINO_ICON_MARKER_UPDATE_AVAILABLE, NEUTRINO_ICON_MARKER_DOWNLOAD_LATER and NEUTRINO_ICON_MARKER_DIALOG_OK -// are sorted from highest to lowest priority. -// If two elements have the same value for iconName_Info_right, they are sorted by their name using std::strcmp. + // Sorts the elements of the menu object, starting from the fifth element, because previous items are intro items. + // The sorting is done in two steps: first, the elements are sorted based on the value of iconName_Info_right. + // The values NEUTRINO_ICON_MARKER_UPDATE_AVAILABLE, NEUTRINO_ICON_MARKER_DOWNLOAD_LATER and NEUTRINO_ICON_MARKER_DIALOG_OK + // are sorted from highest to lowest priority. + // If two elements have the same value for iconName_Info_right, they are sorted by their names. -// We know position (5) of menu separator from we will start sort. + // We know position (5) of menu separator from we will start sort. std::sort(items.begin() + 5, items.end(), [](CMenuItem* a, CMenuItem* b) { int aValue = 0, bValue = 0; @@ -550,6 +550,19 @@ void COPKGManager::updateMenu() else return aValue > bValue; }); + + // Now we have a sorted list, but we need some menu separators with text that describes what is inside the sections. + for (size_t i = 5; i < items.size()-1; i++) + { + if (items[i]->iconName_Info_right != NULL) + if (items[i]->iconName_Info_right != items[i + 1]->iconName_Info_right) + { + if (items[i + 1]->iconName_Info_right == NEUTRINO_ICON_MARKER_DOWNLOAD_LATER) + menu->insertItem(i + 1, new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_OPKG_SEPARATOR_PACKAGES_AVAILABLE)); + else + menu->insertItem(i + 1, new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_OPKG_SEPARATOR_PACKAGES_INSTALLED)); + } + } } bool COPKGManager::removeInfoBarTxt() diff --git a/src/system/locals.h b/src/system/locals.h index 77ad11256..6fb91a2a2 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2463,6 +2463,8 @@ typedef enum LOCALE_OPKG_MESSAGEBOX_SIZE_ERROR, LOCALE_OPKG_MESSAGEBOX_UPDATES_AVAILABLE, LOCALE_OPKG_SUCCESS_INSTALL, + LOCALE_OPKG_SEPARATOR_PACKAGES_AVAILABLE, + LOCALE_OPKG_SEPARATOR_PACKAGES_INSTALLED, LOCALE_OPKG_TITLE, LOCALE_OPKG_UPDATE_CHECK, LOCALE_OPKG_UPDATE_READING_LISTS, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index b4b69f930..425ec552e 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2463,6 +2463,8 @@ const char * locale_real_names[] = "opkg.messagebox.size.error", "opkg.messagebox.updates.available", "opkg.success.install", + "opkg.separator.packages.available", + "opkg.separator.packages.installed", "opkg.title", "opkg.update.check", "opkg.update.reading_lists",