mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
gui/update.cpp: add local variable for update mode
This commit is contained in:
@@ -287,9 +287,9 @@ bool CFlashUpdate::checkVersion4Update()
|
|||||||
CFlashVersionInfo * versionInfo;
|
CFlashVersionInfo * versionInfo;
|
||||||
neutrino_locale_t msg_body;
|
neutrino_locale_t msg_body;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("[update] mode is %d\n", g_settings.softupdate_mode);
|
printf("[update] mode is %d\n", softupdate_mode);
|
||||||
#endif
|
#endif
|
||||||
if(g_settings.softupdate_mode==1) //internet-update
|
if(softupdate_mode==1) //internet-update
|
||||||
{
|
{
|
||||||
if(!selectHttpImage())
|
if(!selectHttpImage())
|
||||||
return false;
|
return false;
|
||||||
@@ -383,8 +383,14 @@ printf("[update] mode is %d\n", g_settings.softupdate_mode);
|
|||||||
return (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, msg, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) == CMessageBox::mbrYes); // UTF-8
|
return (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, msg, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) == CMessageBox::mbrYes); // UTF-8
|
||||||
}
|
}
|
||||||
|
|
||||||
int CFlashUpdate::exec(CMenuTarget* parent, const std::string &)
|
int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||||
{
|
{
|
||||||
|
printf("CFlashUpdate::exec: [%s]\n", actionKey.c_str());
|
||||||
|
if (actionKey == "local")
|
||||||
|
softupdate_mode = 0;
|
||||||
|
else
|
||||||
|
softupdate_mode = 1;
|
||||||
|
|
||||||
if(parent)
|
if(parent)
|
||||||
parent->hide();
|
parent->hide();
|
||||||
|
|
||||||
@@ -410,7 +416,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &)
|
|||||||
paint();
|
paint();
|
||||||
showGlobalStatus(20);
|
showGlobalStatus(20);
|
||||||
|
|
||||||
if(g_settings.softupdate_mode==1) //internet-update
|
if(softupdate_mode==1) //internet-update
|
||||||
{
|
{
|
||||||
char const * fname = rindex(filename.c_str(), '/') +1;
|
char const * fname = rindex(filename.c_str(), '/') +1;
|
||||||
char fullname[255];
|
char fullname[255];
|
||||||
@@ -432,12 +438,12 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &)
|
|||||||
ft.setStatusViewer(this);
|
ft.setStatusViewer(this);
|
||||||
|
|
||||||
showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_MD5CHECK)); // UTF-8
|
showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_MD5CHECK)); // UTF-8
|
||||||
if((g_settings.softupdate_mode==1) && !ft.check_md5(filename, file_md5)) {
|
if((softupdate_mode==1) && !ft.check_md5(filename, file_md5)) {
|
||||||
hide();
|
hide();
|
||||||
ShowHintUTF(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_FLASHUPDATE_MD5SUMERROR)); // UTF-8
|
ShowHintUTF(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_FLASHUPDATE_MD5SUMERROR)); // UTF-8
|
||||||
return menu_return::RETURN_REPAINT;
|
return menu_return::RETURN_REPAINT;
|
||||||
}
|
}
|
||||||
if(g_settings.softupdate_mode==1) { //internet-update
|
if(softupdate_mode==1) { //internet-update
|
||||||
if ( ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, (fileType < '3') ? "Flash downloaded image ?" : "Install downloaded pack ?", CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) != CMessageBox::mbrYes) // UTF-8
|
if ( ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, (fileType < '3') ? "Flash downloaded image ?" : "Install downloaded pack ?", CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) != CMessageBox::mbrYes) // UTF-8
|
||||||
{
|
{
|
||||||
hide();
|
hide();
|
||||||
|
@@ -54,6 +54,7 @@ class CFlashUpdate : public CProgressWindow
|
|||||||
std::string installedVersion;
|
std::string installedVersion;
|
||||||
std::string newVersion;
|
std::string newVersion;
|
||||||
int menu_ret;
|
int menu_ret;
|
||||||
|
int softupdate_mode;
|
||||||
|
|
||||||
bool selectHttpImage(void);
|
bool selectHttpImage(void);
|
||||||
bool getUpdateImage(const std::string & version);
|
bool getUpdateImage(const std::string & version);
|
||||||
|
Reference in New Issue
Block a user