imageinfo: add possible information for used libstb-hal

Origin commit data
------------------
Commit: 6e110b2ee7
Author: Thilo Graf <dbt@novatux.de>
Date: 2018-12-31 (Mon, 31 Dec 2018)
This commit is contained in:
2018-12-31 10:10:30 +01:00
committed by vanhofen
parent c362192b6d
commit d02441baaf
2 changed files with 29 additions and 17 deletions

View File

@@ -25,6 +25,10 @@
#include <config.h> #include <config.h>
#endif #endif
#if HAVE_CONFIG_HAL_H
#include <version_hal.h>
#endif
#include <gui/imageinfo.h> #include <gui/imageinfo.h>
#include <global.h> #include <global.h>
@@ -50,6 +54,7 @@
#define VERSION_FILE TARGET_PREFIX "/.version" #define VERSION_FILE TARGET_PREFIX "/.version"
#define RELEASE_FILE "/etc/os-release" #define RELEASE_FILE "/etc/os-release"
using namespace std; using namespace std;
extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */
@@ -269,7 +274,7 @@ void CImageInfo::InitInfoData()
{ {
v_info.clear(); v_info.clear();
image_info_t pretty_name = {LOCALE_IMAGEINFO_OS,""}; image_info_t pretty_name = {g_Locale->getText(LOCALE_IMAGEINFO_OS),""};
if (file_exists(RELEASE_FILE)){ if (file_exists(RELEASE_FILE)){
config.loadConfig(RELEASE_FILE); config.loadConfig(RELEASE_FILE);
string tmpstr = config.getString("PRETTY_NAME", ""); string tmpstr = config.getString("PRETTY_NAME", "");
@@ -309,9 +314,9 @@ void CImageInfo::InitInfoData()
printf("[CImageInfo]\t[%s - %d], WARNING! %s contains possible wrong version format, content = [%s]\n", __func__, __LINE__, VERSION_FILE, version_string.c_str()); printf("[CImageInfo]\t[%s - %d], WARNING! %s contains possible wrong version format, content = [%s]\n", __func__, __LINE__, VERSION_FILE, version_string.c_str());
#endif #endif
image_info_t imagename = {LOCALE_IMAGEINFO_IMAGE, config.getString("imagename", PACKAGE_NAME)}; image_info_t imagename = {g_Locale->getText(LOCALE_IMAGEINFO_IMAGE), config.getString("imagename", PACKAGE_NAME)};
if (!version_string.empty()){ if (!version_string.empty()){
image_info_t version = {LOCALE_IMAGEINFO_VERSION, version_string}; image_info_t version = {g_Locale->getText(LOCALE_IMAGEINFO_VERSION), version_string};
imagename.info_text += " "; imagename.info_text += " ";
imagename.info_text += version_string; imagename.info_text += version_string;
v_info.push_back(imagename); v_info.push_back(imagename);
@@ -324,19 +329,26 @@ void CImageInfo::InitInfoData()
//kernel //kernel
struct utsname uts_info; struct utsname uts_info;
if (uname(&uts_info) == 0) if (uname(&uts_info) == 0)
v_info.push_back({LOCALE_IMAGEINFO_KERNEL, uts_info.release}); v_info.push_back({g_Locale->getText(LOCALE_IMAGEINFO_KERNEL), uts_info.release});
v_info.push_back({LOCALE_IMAGEINFO_DATE, builddate}); v_info.push_back({g_Locale->getText(LOCALE_IMAGEINFO_DATE), builddate});
//creator //creator
v_info.push_back({LOCALE_IMAGEINFO_CREATOR, config.getString("creator", "n/a")}); v_info.push_back({g_Locale->getText(LOCALE_IMAGEINFO_CREATOR), config.getString("creator", "n/a")});
//gui name //gui
v_info.push_back({LOCALE_IMAGEINFO_GUI, config.getString("gui", PACKAGE_NAME)}); v_info.push_back({g_Locale->getText(LOCALE_IMAGEINFO_GUI), config.getString("gui", PACKAGE_STRING)});
#ifdef VCS #ifdef VCS
//vcs //gui vcs
v_info.push_back({LOCALE_IMAGEINFO_VCS, VCS}); v_info.push_back({g_Locale->getText(LOCALE_IMAGEINFO_VCS), VCS});
#endif
#if HAVE_CONFIG_HAL_H
//libstb-hal version
v_info.push_back({"libstb_hal:", getPackageString()});
//libstb-hal git status
v_info.push_back({g_Locale->getText(LOCALE_IMAGEINFO_VCS), getPackageVersionGit()});
#endif #endif
//internal api versions //internal api versions
@@ -355,14 +367,14 @@ void CImageInfo::InitInfoData()
s_api += YHTTPD_NAME; s_api += YHTTPD_NAME;
s_api += + " "; s_api += + " ";
s_api += YHTTPD_VERSION; s_api += YHTTPD_VERSION;
v_info.push_back({LOCALE_IMAGEINFO_API, s_api}); v_info.push_back({g_Locale->getText(LOCALE_IMAGEINFO_API), s_api});
//www //www
v_info.push_back({LOCALE_IMAGEINFO_HOMEPAGE, config.getString("homepage", "n/a")}); v_info.push_back({g_Locale->getText(LOCALE_IMAGEINFO_HOMEPAGE), config.getString("homepage", "n/a")});
//doc //doc
v_info.push_back({LOCALE_IMAGEINFO_DOKUMENTATION, config.getString("docs", "http://wiki.neutrino-hd.de")}); v_info.push_back({g_Locale->getText(LOCALE_IMAGEINFO_DOKUMENTATION), config.getString("docs", "http://wiki.neutrino-hd.de")});
//support //support
v_info.push_back( {LOCALE_IMAGEINFO_FORUM, config.getString("forum", "http://forum.tuxbox.org")}); v_info.push_back( {g_Locale->getText(LOCALE_IMAGEINFO_FORUM), config.getString("forum", "http://forum.tuxbox.org")});
} }
@@ -385,7 +397,7 @@ void CImageInfo::InitInfos()
//create label and text items //create label and text items
y_tmp = 0; y_tmp = 0;
for (size_t i=0; i<v_info.size(); i++) { for (size_t i=0; i<v_info.size(); i++) {
CComponentsExtTextForm *item = new CComponentsExtTextForm(1, y_tmp, cc_info->getWidth(), 0, g_Locale->getText(v_info[i].caption), v_info[i].info_text); CComponentsExtTextForm *item = new CComponentsExtTextForm(1, y_tmp, cc_info->getWidth(), 0, v_info[i].caption, v_info[i].info_text);
item->setLabelWidthPercent(15); item->setLabelWidthPercent(15);
if (!item_font){ if (!item_font){
@@ -401,7 +413,7 @@ void CImageInfo::InitInfos()
cc_info->addCCItem(item); cc_info->addCCItem(item);
//add an offset before homepage and license and at the end //add an offset before homepage and license and at the end
if (v_info[i].caption == LOCALE_IMAGEINFO_CREATOR || v_info[i].caption == LOCALE_IMAGEINFO_FORUM){ if (v_info[i].caption == g_Locale->getText(LOCALE_IMAGEINFO_CREATOR) || v_info[i].caption == g_Locale->getText(LOCALE_IMAGEINFO_FORUM)){
CComponentsShapeSquare *spacer = new CComponentsShapeSquare(1, y_tmp+=item_offset, 1, item_offset); CComponentsShapeSquare *spacer = new CComponentsShapeSquare(1, y_tmp+=item_offset, 1, item_offset);
//spacer ist not visible! //spacer ist not visible!
spacer->allowPaint(false); spacer->allowPaint(false);

View File

@@ -38,7 +38,7 @@
typedef struct image_info_t typedef struct image_info_t
{ {
neutrino_locale_t caption; std::string caption;
std::string info_text; std::string info_text;
} image_info_struct_t; } image_info_struct_t;