From ff4e1148766668d2ddcf0b04e7d170c0356a9662 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 10 Apr 2021 15:51:30 +0200 Subject: [PATCH] opkg_manager: move visual update check into own methode --- src/gui/opkg_manager.cpp | 14 +++++++++++--- src/gui/opkg_manager.h | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index 91bd9a14f..de869efeb 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -553,15 +553,23 @@ void COPKGManager::refreshMenu() { updateMenu(); } -int COPKGManager::showMenu() + +void COPKGManager::showUpdateCheckResult() { - installed = false; - if (checkUpdates()){ + checkUpdates(); + + if (num_updates) + { std::string update_msg = to_string(num_updates) + " "; update_msg += g_Locale->getText(LOCALE_OPKG_MESSAGEBOX_UPDATES_AVAILABLE); DisplayInfoMessage(update_msg.c_str()); } +} +int COPKGManager::showMenu() +{ + installed = false; + showUpdateCheckResult(); #if 0 getPkgData(OM_LIST); getPkgData(OM_LIST_UPGRADEABLE); diff --git a/src/gui/opkg_manager.h b/src/gui/opkg_manager.h index 46c18c4b1..cc693fa8c 100644 --- a/src/gui/opkg_manager.h +++ b/src/gui/opkg_manager.h @@ -107,6 +107,7 @@ class COPKGManager : public CMenuTarget std::string getBlankPkgName(const std::string& line); bool isInstalled(const std::string& pkg_name); bool isUpgradable(const std::string& pkg_name); + void showUpdateCheckResult(); /*! * Gets an info from opkg command info or status from a package via keywords as std::string