mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
Merge branch 'ni/tuxbox' into ni/mp/tuxbox
Origin commit data
------------------
Commit: 6673ffd4ea
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-03-03 (Fri, 03 Mar 2017)
This commit is contained in:
@@ -83,6 +83,8 @@
|
||||
|
||||
extern int allow_flash;
|
||||
|
||||
//#define DRYRUN
|
||||
|
||||
//#define gTmpPath "/var/update/"
|
||||
#define gTmpPath "/tmp/"
|
||||
#define gUserAgent "neutrino/softupdater 1.0"
|
||||
@@ -193,7 +195,7 @@ bool CFlashUpdate::checkOnlineVersion()
|
||||
#ifdef DEBUG
|
||||
printf("[update] url %s version %s (%d) timestamp %s (%ld) md5 %s name %s\n", url.c_str(), version.c_str(), newVer, versionInfo.getDate(), versionInfo.getDateTime(), md5.c_str(), name.c_str());
|
||||
#endif
|
||||
if(versionInfo.snapshot < '3' && (newVer > curVer || versionInfo.getDateTime() > curInfo.getDateTime())) {
|
||||
if(versionInfo.snapshot <= '2' && (newVer > curVer || versionInfo.getDateTime() > curInfo.getDateTime())) {
|
||||
newfound = true;
|
||||
printf("[update] found new image\n");
|
||||
break;
|
||||
@@ -225,7 +227,7 @@ bool CFlashUpdate::selectHttpImage(void)
|
||||
curVer = curInfo.getVersion();
|
||||
|
||||
httpTool.setStatusViewer(this);
|
||||
showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_GETINFOFILE)); // UTF-8
|
||||
showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_GETINFOFILE));
|
||||
|
||||
char current[200];
|
||||
#if 0
|
||||
@@ -261,19 +263,14 @@ bool CFlashUpdate::selectHttpImage(void)
|
||||
if (startpos == std::string::npos)
|
||||
{
|
||||
startpos = 0;
|
||||
endpos = std::string::npos;
|
||||
updates_lists.push_back(url.substr(startpos, endpos - startpos));
|
||||
}
|
||||
else
|
||||
{
|
||||
update_php(url, curInfo.getType()); //NI
|
||||
//startpos += 2;
|
||||
//endpos = url.find('/', startpos);
|
||||
startpos = url.find('/', startpos+2)+1;
|
||||
endpos = std::string::npos;
|
||||
updates_lists.push_back(url.substr(startpos, endpos - startpos));
|
||||
}
|
||||
//updates_lists.push_back(url.substr(startpos, endpos - startpos));
|
||||
endpos = std::string::npos;
|
||||
updates_lists.push_back(url.substr(startpos, endpos - startpos));
|
||||
|
||||
//NI don't paint separator for lists with no entry
|
||||
//NI SelectionWidget.addItem(new CMenuSeparator(CMenuSeparator::STRING | CMenuSeparator::LINE, updates_lists.rbegin()->c_str()));
|
||||
@@ -283,6 +280,7 @@ bool CFlashUpdate::selectHttpImage(void)
|
||||
{
|
||||
std::ifstream in(gTmpPath LIST_OF_UPDATES_LOCAL_FILENAME);
|
||||
bool enabled;
|
||||
CMenuForwarder * mf;
|
||||
while (in >> url >> version >> md5 >> std::ws)
|
||||
{
|
||||
urls.push_back(url);
|
||||
@@ -298,12 +296,11 @@ bool CFlashUpdate::selectHttpImage(void)
|
||||
#ifdef DEBUG
|
||||
printf("[update] url %s version %s (%d) timestamp %s (%ld) md5 %s name %s\n", url.c_str(), version.c_str(), newVer, versionInfo.getDate(), versionInfo.getDateTime(), md5.c_str(), name.c_str());
|
||||
#endif
|
||||
if(versionInfo.snapshot < '3' && (newVer > curVer || versionInfo.getDateTime() > curInfo.getDateTime()))
|
||||
if(versionInfo.snapshot <= '2' && (newVer > curVer || versionInfo.getDateTime() > curInfo.getDateTime()))
|
||||
newfound = 1;
|
||||
if(!allow_flash && (versionInfo.snapshot < '3'))
|
||||
if(!allow_flash && (versionInfo.snapshot <= '2'))
|
||||
enabled = false;
|
||||
fileTypes[i] = versionInfo.snapshot;
|
||||
//std::string description = versionInfo.getType();
|
||||
std::string description = versionInfo.getReleaseCycle();
|
||||
description += ' ';
|
||||
description += versionInfo.getType();
|
||||
@@ -320,9 +317,10 @@ bool CFlashUpdate::selectHttpImage(void)
|
||||
SelectionWidget.addItem(new CMenuSeparator(CMenuSeparator::STRING | CMenuSeparator::LINE, updates_lists.rbegin()->c_str()));
|
||||
separator = true;
|
||||
}
|
||||
//SelectionWidget.addItem(new CMenuForwarder(names[i].c_str(), enabled, descriptions[i].c_str(), new CUpdateMenuTarget(i, &selected)));
|
||||
CUpdateMenuTarget * up = new CUpdateMenuTarget(i, &selected);
|
||||
SelectionWidget.addItem(new CMenuDForwarder(descriptions[i].c_str(), enabled, names[i].c_str(), up));
|
||||
mf = new CMenuDForwarder(descriptions[i].c_str(), enabled, names[i].c_str(), up);
|
||||
//TODO mf->setHint(NEUTRINO_ICON_HINT_SW_UPDATE, "");
|
||||
SelectionWidget.addItem(mf);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
@@ -332,7 +330,7 @@ bool CFlashUpdate::selectHttpImage(void)
|
||||
|
||||
if (urls.empty())
|
||||
{
|
||||
ShowMsg(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_FLASHUPDATE_GETINFOFILEERROR), CMsgBox::mbrOk, CMsgBox::mbOk); // UTF-8
|
||||
ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_FLASHUPDATE_GETINFOFILEERROR, CMsgBox::mbrOk, CMsgBox::mbOk);
|
||||
return false;
|
||||
}
|
||||
if (notify) {
|
||||
@@ -355,7 +353,7 @@ bool CFlashUpdate::selectHttpImage(void)
|
||||
fileType = fileTypes[selected];
|
||||
//NI #ifdef BOXMODEL_CS_HD2
|
||||
#if 0
|
||||
if(fileType < '3') {
|
||||
if(fileType <= '2') {
|
||||
int esize = CMTDInfo::getInstance()->getMTDEraseSize(sysfs);
|
||||
printf("[update] erase size is %x\n", esize);
|
||||
if (esize == 0x40000) {
|
||||
@@ -382,11 +380,10 @@ bool CFlashUpdate::getUpdateImage(const std::string & version)
|
||||
else return false;
|
||||
|
||||
sprintf(dest_name, "%s/%s", g_settings.update_dir.c_str(), fname);
|
||||
showStatusMessageUTF(std::string(g_Locale->getText(LOCALE_FLASHUPDATE_GETUPDATEFILE)) + ' ' + version); // UTF-8
|
||||
showStatusMessageUTF(std::string(g_Locale->getText(LOCALE_FLASHUPDATE_GETUPDATEFILE)) + ' ' + version);
|
||||
|
||||
printf("get update (url): %s - %s\n", filename.c_str(), dest_name);
|
||||
return httpTool.downloadFile(filename, dest_name, 40 );
|
||||
//return httpTool.downloadFile(filename, gTmpPath UPDATE_LOCAL_FILENAME, 40 );
|
||||
}
|
||||
|
||||
bool CFlashUpdate::checkVersion4Update()
|
||||
@@ -395,7 +392,7 @@ bool CFlashUpdate::checkVersion4Update()
|
||||
CFlashVersionInfo * versionInfo;
|
||||
neutrino_locale_t msg_body;
|
||||
#ifdef DEBUG
|
||||
printf("[update] mode is %d\n", softupdate_mode);
|
||||
printf("[update] mode is %d\n", softupdate_mode);
|
||||
#endif
|
||||
if(softupdate_mode==1) //internet-update
|
||||
{
|
||||
@@ -404,7 +401,7 @@ printf("[update] mode is %d\n", softupdate_mode);
|
||||
|
||||
showLocalStatus(100);
|
||||
showGlobalStatus(20);
|
||||
showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_VERSIONCHECK)); // UTF-8
|
||||
showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_VERSIONCHECK));
|
||||
|
||||
printf("internet version: %s\n", newVersion.c_str());
|
||||
|
||||
@@ -417,18 +414,18 @@ printf("[update] mode is %d\n", softupdate_mode);
|
||||
versionInfo = new CFlashVersionInfo(newVersion);//Memory leak: versionInfo
|
||||
sprintf(msg, g_Locale->getText(msg_body), versionInfo->getDate(), versionInfo->getTime(), versionInfo->getReleaseCycle(), versionInfo->getType());
|
||||
|
||||
if(fileType < '3')
|
||||
if(fileType <= '2')
|
||||
{
|
||||
if ((strncmp(RELEASE_CYCLE, versionInfo->getReleaseCycle(), 2) != 0) &&
|
||||
(ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_WRONGBASE), CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes))
|
||||
(ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_WRONGBASE, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes))
|
||||
{
|
||||
delete versionInfo;
|
||||
//ShowHint(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_FLASHUPDATE_WRONGBASE)); // UTF-8
|
||||
//ShowHint(LOCALE_MESSAGEBOX_ERROR, LOCALE_FLASHUPDATE_WRONGBASE);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((strcmp("Release", versionInfo->getType()) != 0) &&
|
||||
//(ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_EXPERIMENTALIMAGE), CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes)) // UTF-8
|
||||
//(ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_EXPERIMENTALIMAGE, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes))
|
||||
(ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_EXPERIMENTALIMAGE, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes))
|
||||
{
|
||||
delete versionInfo;
|
||||
@@ -444,8 +441,10 @@ printf("[update] mode is %d\n", softupdate_mode);
|
||||
CFileBrowser UpdatesBrowser;
|
||||
|
||||
CFileFilter UpdatesFilter;
|
||||
|
||||
//NI
|
||||
if (allow_flash) {
|
||||
if (allow_flash)
|
||||
{
|
||||
UpdatesFilter.addFilter(FILEBROWSER_UPDATE_FILTER);
|
||||
#ifdef BOXMODEL_CS_HD2
|
||||
if (CMTDInfo::getInstance()->getMTDEraseSize(sysfs) == 0x40000 /* Tank */)
|
||||
@@ -487,7 +486,7 @@ printf("[update] mode is %d\n", softupdate_mode);
|
||||
if (file_selected->getType() == CFile::FILE_PKG_PACKAGE){
|
||||
COPKGManager opkg;
|
||||
if (opkg.hasOpkgSupport()){
|
||||
int msgres = ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_OPKG_WARNING_3RDPARTY_PACKAGES, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE, 700); // UTF-8
|
||||
int msgres = ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_OPKG_WARNING_3RDPARTY_PACKAGES, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE, 700);
|
||||
if (msgres == CMsgBox::mbrYes){
|
||||
if (!opkg.installPackage(UpdatesBrowser.getSelectedFile()->Name))
|
||||
DisplayErrorMessage(g_Locale->getText(LOCALE_OPKG_FAILURE_INSTALL));
|
||||
@@ -516,9 +515,8 @@ printf("[update] mode is %d\n", softupdate_mode);
|
||||
}
|
||||
|
||||
strcpy(msg, g_Locale->getText(LOCALE_FLASHUPDATE_NOVERSION));
|
||||
//never read msg_body = LOCALE_FLASHUPDATE_MSGBOX_MANUAL;
|
||||
}
|
||||
return (ShowMsg(LOCALE_MESSAGEBOX_INFO, msg, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) == CMsgBox::mbrYes); // UTF-8
|
||||
return (ShowMsg(LOCALE_MESSAGEBOX_INFO, msg, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) == CMsgBox::mbrYes);
|
||||
}
|
||||
|
||||
int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
@@ -536,13 +534,13 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
paint();
|
||||
|
||||
if(sysfs.size() < 8) {
|
||||
ShowHint(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_FLASHUPDATE_CANTOPENMTD));
|
||||
ShowHint(LOCALE_MESSAGEBOX_ERROR, LOCALE_FLASHUPDATE_CANTOPENMTD);
|
||||
hide();
|
||||
return menu_return::RETURN_REPAINT;
|
||||
}
|
||||
if(!checkVersion4Update()) {
|
||||
hide();
|
||||
return menu_ret; //menu_return::RETURN_REPAINT;
|
||||
return menu_ret;
|
||||
}
|
||||
|
||||
#ifdef VFD_UPDATE
|
||||
@@ -561,7 +559,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
|
||||
if(!getUpdateImage(newVersion)) {
|
||||
hide();
|
||||
ShowHint(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_FLASHUPDATE_GETUPDATEFILEERROR)); // UTF-8
|
||||
ShowHint(LOCALE_MESSAGEBOX_ERROR, LOCALE_FLASHUPDATE_GETUPDATEFILEERROR);
|
||||
return menu_return::RETURN_REPAINT;
|
||||
}
|
||||
sprintf(fullname, "%s/%s", g_settings.update_dir.c_str(), fname);
|
||||
@@ -571,18 +569,17 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
showGlobalStatus(40);
|
||||
|
||||
CFlashTool ft;
|
||||
//ft.setMTDDevice(MTD_DEVICE_OF_UPDATE_PART);
|
||||
ft.setMTDDevice(sysfs);
|
||||
ft.setStatusViewer(this);
|
||||
|
||||
showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_MD5CHECK)); // UTF-8
|
||||
showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_MD5CHECK));
|
||||
if((softupdate_mode==1) && !ft.check_md5(filename, file_md5)) {
|
||||
hide();
|
||||
ShowHint(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_FLASHUPDATE_MD5SUMERROR)); // UTF-8
|
||||
ShowHint(LOCALE_MESSAGEBOX_ERROR, LOCALE_FLASHUPDATE_MD5SUMERROR);
|
||||
return menu_return::RETURN_REPAINT;
|
||||
}
|
||||
if(softupdate_mode==1) { //internet-update
|
||||
if ( ShowMsg(LOCALE_MESSAGEBOX_INFO, (fileType < '3') ? LOCALE_FLASHUPDATE_INSTALL_IMAGE : LOCALE_FLASHUPDATE_INSTALL_PACKAGE, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes) // UTF-8
|
||||
if ( ShowMsg(LOCALE_MESSAGEBOX_INFO, (fileType <= '2') ? LOCALE_FLASHUPDATE_INSTALL_IMAGE : LOCALE_FLASHUPDATE_INSTALL_PACKAGE, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes)
|
||||
{
|
||||
hide();
|
||||
return menu_return::RETURN_REPAINT;
|
||||
@@ -594,12 +591,12 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
#ifdef DEBUG
|
||||
printf("[update] flash/install filename %s type %c\n", filename.c_str(), fileType);
|
||||
#endif
|
||||
if(fileType < '3') {
|
||||
if(fileType <= '2') {
|
||||
//flash it...
|
||||
#if ENABLE_EXTUPDATE
|
||||
#ifndef BOXMODEL_CS_HD2
|
||||
if (g_settings.apply_settings) {
|
||||
if (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_APPLY_SETTINGS), CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) == CMsgBox::mbrYes)
|
||||
if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_APPLY_SETTINGS, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) == CMsgBox::mbrYes)
|
||||
if (!CExtUpdate::getInstance()->applySettings(filename, CExtUpdate::MODE_SOFTUPDATE)) {
|
||||
hide();
|
||||
return menu_return::RETURN_REPAINT;
|
||||
@@ -608,21 +605,21 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG1
|
||||
#ifdef DRYRUN
|
||||
if(1) {
|
||||
#else
|
||||
if(!ft.program(filename, 80, 100)) {
|
||||
#endif
|
||||
hide();
|
||||
ShowHint(LOCALE_MESSAGEBOX_ERROR, ft.getErrorMessage().c_str()); // UTF-8
|
||||
ShowHint(LOCALE_MESSAGEBOX_ERROR, ft.getErrorMessage().c_str());
|
||||
return menu_return::RETURN_REPAINT;
|
||||
}
|
||||
|
||||
//status anzeigen
|
||||
showGlobalStatus(100);
|
||||
showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_READY)); // UTF-8
|
||||
showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_READY));
|
||||
hide();
|
||||
ShowHint(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_FLASHREADYREBOOT)); // UTF-8
|
||||
ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_FLASHREADYREBOOT);
|
||||
sleep(2);
|
||||
ft.reboot();
|
||||
}
|
||||
@@ -637,30 +634,24 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
fread(buffer, (uint32_t)filesize, 1, fd);
|
||||
fclose(fd);
|
||||
buffer[filesize] = 0;
|
||||
ShowMsg(LOCALE_MESSAGEBOX_INFO, buffer, CMsgBox::mbrBack, CMsgBox::mbBack); // UTF-8
|
||||
ShowMsg(LOCALE_MESSAGEBOX_INFO, buffer, CMsgBox::mbrBack, CMsgBox::mbBack);
|
||||
free(buffer);
|
||||
}
|
||||
}
|
||||
else // not image, install
|
||||
{
|
||||
const char install_sh[] = "/bin/install.sh";
|
||||
#ifdef DEBUG1
|
||||
printf("[update] calling %s %s %s\n",install_sh, g_settings.update_dir.c_str(), filename.c_str() );
|
||||
#else
|
||||
printf("[update] calling %s %s %s\n",install_sh, g_settings.update_dir.c_str(), filename.c_str() );
|
||||
#ifndef DRYRUN
|
||||
my_system(3, install_sh, g_settings.update_dir.c_str(), filename.c_str());
|
||||
#endif
|
||||
showGlobalStatus(100);
|
||||
ShowHint(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_READY)); // UTF-8
|
||||
ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_READY);
|
||||
}
|
||||
hide();
|
||||
return menu_return::RETURN_REPAINT;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
CFlashExpert::CFlashExpert()
|
||||
:CProgressWindow()
|
||||
{
|
||||
@@ -875,17 +866,17 @@ void CFlashExpert::readmtd(int preadmtd)
|
||||
setTitle(LOCALE_FLASHUPDATE_TITLEREADFLASH);
|
||||
paint();
|
||||
showGlobalStatus(0);
|
||||
showStatusMessageUTF((std::string(g_Locale->getText(LOCALE_FLASHUPDATE_ACTIONREADFLASH)) + " (" + mtdInfo->getMTDName(preadmtd) + ')')); // UTF-8
|
||||
showStatusMessageUTF((std::string(g_Locale->getText(LOCALE_FLASHUPDATE_ACTIONREADFLASH)) + " (" + mtdInfo->getMTDName(preadmtd) + ')'));
|
||||
CFlashTool ft;
|
||||
ft.setStatusViewer( this );
|
||||
ft.setMTDDevice(mtdInfo->getMTDFileName(preadmtd));
|
||||
|
||||
if(!ft.readFromMTD(filename, 100)) {
|
||||
showStatusMessageUTF(ft.getErrorMessage()); // UTF-8
|
||||
showStatusMessageUTF(ft.getErrorMessage());
|
||||
sleep(10);
|
||||
} else {
|
||||
showGlobalStatus(100);
|
||||
showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_READY)); // UTF-8
|
||||
showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_READY));
|
||||
char message[500];
|
||||
sprintf(message, g_Locale->getText(LOCALE_FLASHUPDATE_SAVESUCCESS), filename.c_str());
|
||||
sleep(1);
|
||||
@@ -908,7 +899,7 @@ void CFlashExpert::writemtd(const std::string & filename, int mtdNumber)
|
||||
FILESYSTEM_ENCODING_TO_UTF8_STRING(filename).c_str(),
|
||||
CMTDInfo::getInstance()->getMTDName(mtdNumber).c_str());
|
||||
|
||||
if (ShowMsg(LOCALE_MESSAGEBOX_INFO, message, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes) // UTF-8
|
||||
if (ShowMsg(LOCALE_MESSAGEBOX_INFO, message, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes)
|
||||
return;
|
||||
#ifdef VFD_UPDATE
|
||||
CVFD::getInstance()->showProgressBar2(0,"checking",0,"Update Neutrino");
|
||||
@@ -922,14 +913,14 @@ void CFlashExpert::writemtd(const std::string & filename, int mtdNumber)
|
||||
ft.setStatusViewer( this );
|
||||
ft.setMTDDevice( CMTDInfo::getInstance()->getMTDFileName(mtdNumber) );
|
||||
if(!ft.program( (std::string)g_settings.update_dir + "/" + filename, 50, 100)) {
|
||||
showStatusMessageUTF(ft.getErrorMessage()); // UTF-8
|
||||
showStatusMessageUTF(ft.getErrorMessage());
|
||||
sleep(10);
|
||||
} else {
|
||||
showGlobalStatus(100);
|
||||
showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_READY)); // UTF-8
|
||||
showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_READY));
|
||||
sleep(2);
|
||||
hide();
|
||||
ShowHint(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_FLASHREADYREBOOT)); // UTF-8
|
||||
ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_FLASHREADYREBOOT);
|
||||
ft.reboot();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user