mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 00:11:14 +02:00
COPKGManager: add function to get status for new package updates
This commit is contained in:
@@ -250,6 +250,27 @@ void COPKGManager::updateMenu()
|
|||||||
menu->setFooter(COPKGManagerFooterButtons, COPKGManagerFooterButtonCount);
|
menu->setFooter(COPKGManagerFooterButtons, COPKGManagerFooterButtonCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool COPKGManager::hasUpdates()
|
||||||
|
{
|
||||||
|
if (!hasOpkgSupport())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
bool ret = false;
|
||||||
|
|
||||||
|
getPkgData(OM_LIST);
|
||||||
|
getPkgData(OM_LIST_UPGRADEABLE);
|
||||||
|
|
||||||
|
for (map<string, struct pkg>::iterator it = pkg_map.begin(); it != pkg_map.end(); it++){
|
||||||
|
if (it->second.upgradable){
|
||||||
|
dprintf(DEBUG_INFO, "[neutrino opkg] Update packages available...\n");
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_map.clear();
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
void COPKGManager::refreshMenu() {
|
void COPKGManager::refreshMenu() {
|
||||||
list_installed_done = false,
|
list_installed_done = false,
|
||||||
list_upgradeable_done = false;
|
list_upgradeable_done = false;
|
||||||
|
@@ -86,5 +86,6 @@ class COPKGManager : public CMenuTarget
|
|||||||
|
|
||||||
int exec(CMenuTarget* parent, const std::string & actionKey);
|
int exec(CMenuTarget* parent, const std::string & actionKey);
|
||||||
static bool hasOpkgSupport();
|
static bool hasOpkgSupport();
|
||||||
|
bool hasUpdates();
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user