mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-26 15:02:56 +02:00
imageinfo: get package version from package manager instead source
Works only if ENABLE_PKG_MANAGEMENT is enabled
This commit is contained in:
@@ -365,14 +365,7 @@ void CImageInfo::InitInfoData()
|
||||
v_info.push_back({g_Locale->getText(LOCALE_IMAGEINFO_CREATOR), creator});
|
||||
|
||||
//gui
|
||||
v_info.push_back({g_Locale->getText(LOCALE_IMAGEINFO_GUI), config.getString("gui", PACKAGE_NAME)});
|
||||
|
||||
#ifdef VCS
|
||||
//gui vcs
|
||||
v_info.push_back({g_Locale->getText(LOCALE_IMAGEINFO_VCS), VCS});
|
||||
#else
|
||||
v_info.push_back({g_Locale->getText(LOCALE_IMAGEINFO_VCS), PACKAGE_VERSION_GIT});
|
||||
#endif
|
||||
initGuiInfo();
|
||||
|
||||
//stb info
|
||||
initHalInfo();
|
||||
@@ -397,6 +390,29 @@ void CImageInfo::initBuildDateInfo()
|
||||
v_info.push_back({g_Locale->getText(LOCALE_IMAGEINFO_DATE), builddate});
|
||||
}
|
||||
|
||||
void CImageInfo::initGuiInfo()
|
||||
{
|
||||
string gui_info = PACKAGE_NAME;
|
||||
#if ENABLE_PKG_MANAGEMENT
|
||||
string pkg_name = "neutrino-mp";
|
||||
gui_info += " (";
|
||||
gui_info += pkg_name;
|
||||
gui_info += " ";
|
||||
gui_info += man.getPkgInfo(pkg_name, "Version", true);
|
||||
gui_info += ")";
|
||||
#endif
|
||||
v_info.push_back({g_Locale->getText(LOCALE_IMAGEINFO_GUI), config.getString("gui", gui_info)});
|
||||
|
||||
#ifndef ENABLE_PKG_MANAGEMENT
|
||||
# ifdef VCS
|
||||
//gui vcs
|
||||
v_info.push_back({g_Locale->getText(LOCALE_IMAGEINFO_VCS), VCS});
|
||||
# else
|
||||
v_info.push_back({g_Locale->getText(LOCALE_IMAGEINFO_VCS), PACKAGE_VERSION_GIT});
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void CImageInfo::initHalInfo()
|
||||
{
|
||||
#if USE_STB_HAL
|
||||
|
@@ -35,6 +35,10 @@
|
||||
#include <gui/components/cc.h>
|
||||
#include <configfile.h>
|
||||
|
||||
#if ENABLE_PKG_MANAGEMENT
|
||||
#include "opkg_manager.h"
|
||||
#endif
|
||||
|
||||
typedef struct image_info_t
|
||||
{
|
||||
std::string caption;
|
||||
@@ -52,6 +56,9 @@ class CImageInfo : public CMenuTarget
|
||||
int y_tmp;
|
||||
std::vector<image_info_t> v_info;
|
||||
|
||||
#if ENABLE_PKG_MANAGEMENT
|
||||
COPKGManager man;
|
||||
#endif
|
||||
void Clean();
|
||||
void Init();
|
||||
void InitInfoData();
|
||||
@@ -60,6 +67,7 @@ class CImageInfo : public CMenuTarget
|
||||
void InitBuildInfos();
|
||||
void initBuildDateInfo();
|
||||
void initKernelInfo();
|
||||
void initGuiInfo();
|
||||
void initHalInfo();
|
||||
void InitInfoText(const std::string& text);
|
||||
void initSupportInfo();
|
||||
|
Reference in New Issue
Block a user