mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-02 18:31:12 +02:00
update.cpp: use default message windows
Origin commit data
------------------
Commit: 718a228f8e
Author: Thilo Graf <dbt@novatux.de>
Date: 2020-07-09 (Thu, 09 Jul 2020)
This commit is contained in:
@@ -34,8 +34,8 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <gui/update.h>
|
#include "update.h"
|
||||||
#include <gui/update_ext.h>
|
#include "update_ext.h"
|
||||||
|
|
||||||
#include <global.h>
|
#include <global.h>
|
||||||
#include <neutrino.h>
|
#include <neutrino.h>
|
||||||
@@ -342,7 +342,7 @@ bool CFlashUpdate::selectHttpImage(void)
|
|||||||
|
|
||||||
if (urls.empty())
|
if (urls.empty())
|
||||||
{
|
{
|
||||||
ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_FLASHUPDATE_GETINFOFILEERROR, CMsgBox::mbrOk, CMsgBox::mbOk);
|
DisplayErrorMessage(g_Locale->getText(LOCALE_FLASHUPDATE_GETINFOFILEERROR));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (notify) {
|
if (notify) {
|
||||||
@@ -547,7 +547,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
paint();
|
paint();
|
||||||
|
|
||||||
if(sysfs.size() < 8) {
|
if(sysfs.size() < 8) {
|
||||||
ShowHint(LOCALE_MESSAGEBOX_ERROR, LOCALE_FLASHUPDATE_CANTOPENMTD);
|
DisplayErrorMessage(g_Locale->getText(LOCALE_FLASHUPDATE_CANTOPENMTD));
|
||||||
hide();
|
hide();
|
||||||
return menu_return::RETURN_REPAINT;
|
return menu_return::RETURN_REPAINT;
|
||||||
}
|
}
|
||||||
@@ -572,7 +572,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
|
|
||||||
if(!getUpdateImage(newVersion)) {
|
if(!getUpdateImage(newVersion)) {
|
||||||
hide();
|
hide();
|
||||||
ShowHint(LOCALE_MESSAGEBOX_ERROR, LOCALE_FLASHUPDATE_GETUPDATEFILEERROR);
|
DisplayErrorMessage(g_Locale->getText(LOCALE_FLASHUPDATE_GETUPDATEFILEERROR));
|
||||||
return menu_return::RETURN_REPAINT;
|
return menu_return::RETURN_REPAINT;
|
||||||
}
|
}
|
||||||
sprintf(fullname, "%s/%s", g_settings.update_dir.c_str(), fname);
|
sprintf(fullname, "%s/%s", g_settings.update_dir.c_str(), fname);
|
||||||
@@ -588,7 +588,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_MD5CHECK));
|
showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_MD5CHECK));
|
||||||
if((softupdate_mode==1) && !ft.check_md5(filename, file_md5)) {
|
if((softupdate_mode==1) && !ft.check_md5(filename, file_md5)) {
|
||||||
hide();
|
hide();
|
||||||
ShowHint(LOCALE_MESSAGEBOX_ERROR, LOCALE_FLASHUPDATE_MD5SUMERROR);
|
DisplayErrorMessage(g_Locale->getText(LOCALE_FLASHUPDATE_MD5SUMERROR));
|
||||||
return menu_return::RETURN_REPAINT;
|
return menu_return::RETURN_REPAINT;
|
||||||
}
|
}
|
||||||
if(softupdate_mode==1) { //internet-update
|
if(softupdate_mode==1) { //internet-update
|
||||||
@@ -624,7 +624,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
hide();
|
hide();
|
||||||
ShowHint(LOCALE_MESSAGEBOX_ERROR, ft.getErrorMessage().c_str());
|
DisplayErrorMessage(ft.getErrorMessage().c_str());
|
||||||
return menu_return::RETURN_REPAINT;
|
return menu_return::RETURN_REPAINT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -804,7 +804,7 @@ bool CFlashExpert::checkSize(int mtd, std::string &backupFile)
|
|||||||
std::string path = getPathName(backupFile);
|
std::string path = getPathName(backupFile);
|
||||||
if (!file_exists(path.c_str())) {
|
if (!file_exists(path.c_str())) {
|
||||||
snprintf(errMsg, sizeof(errMsg)-1, g_Locale->getText(LOCALE_FLASHUPDATE_READ_DIRECTORY_NOT_EXIST), path.c_str());
|
snprintf(errMsg, sizeof(errMsg)-1, g_Locale->getText(LOCALE_FLASHUPDATE_READ_DIRECTORY_NOT_EXIST), path.c_str());
|
||||||
ShowHint(LOCALE_MESSAGEBOX_ERROR, errMsg);
|
DisplayErrorMessage(errMsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -815,7 +815,7 @@ bool CFlashExpert::checkSize(int mtd, std::string &backupFile)
|
|||||||
if (mtd == -1) { // check disk space for image creation
|
if (mtd == -1) { // check disk space for image creation
|
||||||
if (!get_fs_usage("/", btotal, bused, &bsize)) {
|
if (!get_fs_usage("/", btotal, bused, &bsize)) {
|
||||||
snprintf(errMsg, sizeof(errMsg)-1, g_Locale->getText(LOCALE_FLASHUPDATE_READ_VOLUME_ERROR), "root0");
|
snprintf(errMsg, sizeof(errMsg)-1, g_Locale->getText(LOCALE_FLASHUPDATE_READ_VOLUME_ERROR), "root0");
|
||||||
ShowHint(LOCALE_MESSAGEBOX_ERROR, errMsg);
|
DisplayErrorMessage(errMsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
backupRequiredSize = ((bused * bsize) / 1024ULL) * 2ULL; // twice disk space for summarized image
|
backupRequiredSize = ((bused * bsize) / 1024ULL) * 2ULL; // twice disk space for summarized image
|
||||||
@@ -829,7 +829,7 @@ bool CFlashExpert::checkSize(int mtd, std::string &backupFile)
|
|||||||
btotal = 0; bused = 0; bsize = 0;
|
btotal = 0; bused = 0; bsize = 0;
|
||||||
if (!get_fs_usage(path.c_str(), btotal, bused, &bsize)) {
|
if (!get_fs_usage(path.c_str(), btotal, bused, &bsize)) {
|
||||||
snprintf(errMsg, sizeof(errMsg)-1, g_Locale->getText(LOCALE_FLASHUPDATE_READ_VOLUME_ERROR), path.c_str());
|
snprintf(errMsg, sizeof(errMsg)-1, g_Locale->getText(LOCALE_FLASHUPDATE_READ_VOLUME_ERROR), path.c_str());
|
||||||
ShowHint(LOCALE_MESSAGEBOX_ERROR, errMsg);
|
DisplayErrorMessage(errMsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
uint64_t backupMaxSize = (btotal - bused) * (uint64_t)bsize;
|
uint64_t backupMaxSize = (btotal - bused) * (uint64_t)bsize;
|
||||||
@@ -840,7 +840,7 @@ bool CFlashExpert::checkSize(int mtd, std::string &backupFile)
|
|||||||
|
|
||||||
if (backupMaxSize < backupRequiredSize) {
|
if (backupMaxSize < backupRequiredSize) {
|
||||||
snprintf(errMsg, sizeof(errMsg)-1, g_Locale->getText(LOCALE_FLASHUPDATE_READ_NO_AVAILABLE_SPACE), path.c_str(), to_string(backupMaxSize).c_str(), to_string(backupRequiredSize).c_str());
|
snprintf(errMsg, sizeof(errMsg)-1, g_Locale->getText(LOCALE_FLASHUPDATE_READ_NO_AVAILABLE_SPACE), path.c_str(), to_string(backupMaxSize).c_str(), to_string(backupRequiredSize).c_str());
|
||||||
ShowHint(LOCALE_MESSAGEBOX_ERROR, errMsg);
|
DisplayErrorMessage(errMsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user