flashtool: add posibilty to get localized and non-localized type

Origin commit data
------------------
Branch: ni/coolstream
Commit: 40b84d1077
Author: vanhofen <vanhofen@gmx.de>
Date: 2018-01-06 (Sat, 06 Jan 2018)

Origin message was:
------------------
- flashtool: add posibilty to get localized and non-localized type

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2018-01-06 14:46:09 +01:00
parent dff25a1144
commit f42b1b9095
7 changed files with 18 additions and 18 deletions

View File

@@ -764,8 +764,8 @@ flashupdate.titlereadflash Flash auslesen
flashupdate.titlewriteflash Flash schreiben flashupdate.titlewriteflash Flash schreiben
flashupdate.type_addon Erweiterung flashupdate.type_addon Erweiterung
flashupdate.type_beta Beta flashupdate.type_beta Beta
flashupdate.type_internal Intern
flashupdate.type_locale Sprachdatei flashupdate.type_locale Sprachdatei
flashupdate.type_nightly Nightly
flashupdate.type_release Release flashupdate.type_release Release
flashupdate.type_settings Einstellungen flashupdate.type_settings Einstellungen
flashupdate.type_text Text flashupdate.type_text Text

View File

@@ -764,8 +764,8 @@ flashupdate.titlereadflash Reading Flash
flashupdate.titlewriteflash Writing Flash flashupdate.titlewriteflash Writing Flash
flashupdate.type_addon Addon flashupdate.type_addon Addon
flashupdate.type_beta Beta flashupdate.type_beta Beta
flashupdate.type_internal Internal
flashupdate.type_locale Locale flashupdate.type_locale Locale
flashupdate.type_nightly Nightly
flashupdate.type_release Release flashupdate.type_release Release
flashupdate.type_settings Settings flashupdate.type_settings Settings
flashupdate.type_text Text flashupdate.type_text Text

View File

@@ -237,7 +237,7 @@ bool CFlashUpdate::selectHttpImage(void)
g_Locale->getText(LOCALE_FLASHUPDATE_CURRENTVERSIONTIME), curInfo.getTime()); g_Locale->getText(LOCALE_FLASHUPDATE_CURRENTVERSIONTIME), curInfo.getTime());
#endif #endif
//NI //NI
snprintf(current, 200, "%s %s %s %s", curInfo.getReleaseCycle(), curInfo.getType(), curInfo.getDate(), curInfo.getTime()); snprintf(current, 200, "%s %s %s %s", curInfo.getReleaseCycle(), curInfo.getType(true), curInfo.getDate(), curInfo.getTime());
CMenuWidget SelectionWidget(LOCALE_FLASHUPDATE_SELECTIMAGE, NEUTRINO_ICON_UPDATE, listWidth, MN_WIDGET_ID_IMAGESELECTOR); CMenuWidget SelectionWidget(LOCALE_FLASHUPDATE_SELECTIMAGE, NEUTRINO_ICON_UPDATE, listWidth, MN_WIDGET_ID_IMAGESELECTOR);
@@ -298,7 +298,7 @@ bool CFlashUpdate::selectHttpImage(void)
fileTypes[i] = versionInfo.snapshot; fileTypes[i] = versionInfo.snapshot;
std::string description = versionInfo.getReleaseCycle(); std::string description = versionInfo.getReleaseCycle();
description += ' '; description += ' ';
description += versionInfo.getType(); description += versionInfo.getType(true);
description += ' '; description += ' ';
description += versionInfo.getDate(); description += versionInfo.getDate();
description += ' '; description += ' ';
@@ -410,7 +410,7 @@ bool CFlashUpdate::checkVersion4Update()
msg_body = LOCALE_FLASHUPDATE_MSGBOX; msg_body = LOCALE_FLASHUPDATE_MSGBOX;
#ifdef SQUASHFS #ifdef SQUASHFS
versionInfo = new CFlashVersionInfo(newVersion);//Memory leak: versionInfo versionInfo = new CFlashVersionInfo(newVersion);//Memory leak: versionInfo
sprintf(msg, g_Locale->getText(msg_body), versionInfo->getDate(), versionInfo->getTime(), versionInfo->getReleaseCycle(), versionInfo->getType()); sprintf(msg, g_Locale->getText(msg_body), versionInfo->getDate(), versionInfo->getTime(), versionInfo->getReleaseCycle(), versionInfo->getType(true));
if (fileType <= '2') if (fileType <= '2')
{ {

View File

@@ -547,28 +547,28 @@ const char *CFlashVersionInfo::getReleaseCycle(void) const
return releaseCycle; return releaseCycle;
} }
const char *CFlashVersionInfo::getType(void) const const char *CFlashVersionInfo::getType(bool localized) const
{ {
switch (snapshot) switch (snapshot)
{ {
case '0': case '0':
return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_RELEASE); return (localized ? g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_RELEASE) : "Release");
case '1': case '1':
return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_BETA); return (localized ? g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_BETA) : "Beta");
case '2': case '2':
return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_INTERNAL); return (localized ? g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_NIGHTLY) : "Nightly");
case 'L': case 'L':
return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_LOCALE); return (localized ? g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_LOCALE) : "Locale");
case 'S': case 'S':
return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_SETTINGS); return (localized ? g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_SETTINGS) : "Settings");
case 'A': case 'A':
return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_ADDON); return (localized ? g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_ADDON) : "Addon");
case 'U': case 'U':
return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_UPDATE); return (localized ? g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_UPDATE) : "Update");
case 'T': case 'T':
return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_TEXT); return (localized ? g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_TEXT) : "Text");
default: default:
return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_UNKNOWN); return (localized ? g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_UNKNOWN) : "Unknown");
} }
} }

View File

@@ -92,7 +92,7 @@ class CFlashVersionInfo
const char *getDate(void) const; const char *getDate(void) const;
const char *getTime(void) const; const char *getTime(void) const;
const char *getReleaseCycle(void) const; const char *getReleaseCycle(void) const;
const char *getType(void) const; const char *getType(bool localized = false) const;
int getVersion(void) const; int getVersion(void) const;
time_t getDateTime(void) const { return datetime; }; time_t getDateTime(void) const { return datetime; };
}; };

View File

@@ -790,8 +790,8 @@ typedef enum
LOCALE_FLASHUPDATE_TITLEWRITEFLASH, LOCALE_FLASHUPDATE_TITLEWRITEFLASH,
LOCALE_FLASHUPDATE_TYPE_ADDON, LOCALE_FLASHUPDATE_TYPE_ADDON,
LOCALE_FLASHUPDATE_TYPE_BETA, LOCALE_FLASHUPDATE_TYPE_BETA,
LOCALE_FLASHUPDATE_TYPE_INTERNAL,
LOCALE_FLASHUPDATE_TYPE_LOCALE, LOCALE_FLASHUPDATE_TYPE_LOCALE,
LOCALE_FLASHUPDATE_TYPE_NIGHTLY,
LOCALE_FLASHUPDATE_TYPE_RELEASE, LOCALE_FLASHUPDATE_TYPE_RELEASE,
LOCALE_FLASHUPDATE_TYPE_SETTINGS, LOCALE_FLASHUPDATE_TYPE_SETTINGS,
LOCALE_FLASHUPDATE_TYPE_TEXT, LOCALE_FLASHUPDATE_TYPE_TEXT,

View File

@@ -790,8 +790,8 @@ const char * locale_real_names[] =
"flashupdate.titlewriteflash", "flashupdate.titlewriteflash",
"flashupdate.type_addon", "flashupdate.type_addon",
"flashupdate.type_beta", "flashupdate.type_beta",
"flashupdate.type_internal",
"flashupdate.type_locale", "flashupdate.type_locale",
"flashupdate.type_nightly",
"flashupdate.type_release", "flashupdate.type_release",
"flashupdate.type_settings", "flashupdate.type_settings",
"flashupdate.type_text", "flashupdate.type_text",