mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
* Use dynamic text for software update online/local
This commit is contained in:
@@ -436,7 +436,8 @@ filesystem.is.utf8.option.utf8 UTF-8
|
|||||||
flashupdate.actionreadflash lese Flash
|
flashupdate.actionreadflash lese Flash
|
||||||
flashupdate.cantopenfile kann Datei nicht öffnen
|
flashupdate.cantopenfile kann Datei nicht öffnen
|
||||||
flashupdate.cantopenmtd kann das MTD-Device nicht öffnen
|
flashupdate.cantopenmtd kann das MTD-Device nicht öffnen
|
||||||
flashupdate.checkupdate Nach Updates suchen
|
flashupdate.checkupdate_internet Online nach Updates suchen
|
||||||
|
flashupdate.checkupdate_local Lokales Update
|
||||||
flashupdate.currentversion_sep Installierte Version
|
flashupdate.currentversion_sep Installierte Version
|
||||||
flashupdate.currentversiondate Datum
|
flashupdate.currentversiondate Datum
|
||||||
flashupdate.currentversiontime Uhrzeit
|
flashupdate.currentversiontime Uhrzeit
|
||||||
|
@@ -436,7 +436,8 @@ filesystem.is.utf8.option.utf8 UTF-8
|
|||||||
flashupdate.actionreadflash reading
|
flashupdate.actionreadflash reading
|
||||||
flashupdate.cantopenfile can't open file
|
flashupdate.cantopenfile can't open file
|
||||||
flashupdate.cantopenmtd can't open mtd-device
|
flashupdate.cantopenmtd can't open mtd-device
|
||||||
flashupdate.checkupdate Check for updates
|
flashupdate.checkupdate_internet Check for online updates
|
||||||
|
flashupdate.checkupdate_local Local update
|
||||||
flashupdate.currentversion_sep Current version
|
flashupdate.currentversion_sep Current version
|
||||||
flashupdate.currentversiondate Date
|
flashupdate.currentversiondate Date
|
||||||
flashupdate.currentversiontime Time
|
flashupdate.currentversiontime Time
|
||||||
|
@@ -51,11 +51,13 @@ CSoftwareUpdate::CSoftwareUpdate()
|
|||||||
{
|
{
|
||||||
width = w_max (40, 10);
|
width = w_max (40, 10);
|
||||||
fe = new CFlashExpert();
|
fe = new CFlashExpert();
|
||||||
|
update_item = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
CSoftwareUpdate::~CSoftwareUpdate()
|
CSoftwareUpdate::~CSoftwareUpdate()
|
||||||
{
|
{
|
||||||
delete fe;
|
delete fe;
|
||||||
|
delete update_item;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CSoftwareUpdate::exec(CMenuTarget* parent, const std::string &/*actionKey*/)
|
int CSoftwareUpdate::exec(CMenuTarget* parent, const std::string &/*actionKey*/)
|
||||||
@@ -79,19 +81,21 @@ int CSoftwareUpdate::showSoftwareUpdate()
|
|||||||
|
|
||||||
//flashing
|
//flashing
|
||||||
CFlashUpdate flash;
|
CFlashUpdate flash;
|
||||||
softUpdate.addItem(new CMenuForwarder(LOCALE_FLASHUPDATE_CHECKUPDATE, true, NULL, &flash, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
|
neutrino_locale_t up_text = (g_settings.softupdate_mode == 0) ? LOCALE_FLASHUPDATE_CHECKUPDATE_LOCAL : LOCALE_FLASHUPDATE_CHECKUPDATE_INTERNET;
|
||||||
|
update_item = new CMenuForwarder(up_text, true, NULL, &flash, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED);
|
||||||
|
softUpdate.addItem(update_item);
|
||||||
|
|
||||||
|
//settings
|
||||||
|
CUpdateSettings update_settings(update_item);
|
||||||
|
softUpdate.addItem(new CMenuForwarder(LOCALE_FLASHUPDATE_SETTINGS, true, NULL, &update_settings, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
|
||||||
|
|
||||||
|
softUpdate.addItem(GenericMenuSeparatorLine);
|
||||||
|
|
||||||
//expert-functions
|
//expert-functions
|
||||||
CMenuWidget mtdexpert(LOCALE_FLASHUPDATE_EXPERTFUNCTIONS, NEUTRINO_ICON_UPDATE, width, MN_WIDGET_ID_MTDEXPERT);
|
CMenuWidget mtdexpert(LOCALE_FLASHUPDATE_EXPERTFUNCTIONS, NEUTRINO_ICON_UPDATE, width, MN_WIDGET_ID_MTDEXPERT);
|
||||||
showSoftwareUpdateExpert(&mtdexpert);
|
showSoftwareUpdateExpert(&mtdexpert);
|
||||||
softUpdate.addItem(new CMenuForwarder(LOCALE_FLASHUPDATE_EXPERTFUNCTIONS, true, NULL, &mtdexpert, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
|
softUpdate.addItem(new CMenuForwarder(LOCALE_FLASHUPDATE_EXPERTFUNCTIONS, true, NULL, &mtdexpert, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW));
|
||||||
|
|
||||||
softUpdate.addItem(GenericMenuSeparatorLine);
|
|
||||||
|
|
||||||
//settings
|
|
||||||
CUpdateSettings update_settings;
|
|
||||||
softUpdate.addItem(new CMenuForwarder(LOCALE_FLASHUPDATE_SETTINGS, true, NULL, &update_settings, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW ));
|
|
||||||
|
|
||||||
int res = softUpdate.exec (NULL, "");
|
int res = softUpdate.exec (NULL, "");
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@@ -40,6 +40,7 @@ class CSoftwareUpdate : public CMenuTarget
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
int width;
|
int width;
|
||||||
|
CMenuForwarder * update_item;
|
||||||
int showSoftwareUpdate();
|
int showSoftwareUpdate();
|
||||||
void showSoftwareUpdateExpert(CMenuWidget *w_mtd_expert);
|
void showSoftwareUpdateExpert(CMenuWidget *w_mtd_expert);
|
||||||
|
|
||||||
|
@@ -43,9 +43,10 @@
|
|||||||
#include <system/debug.h>
|
#include <system/debug.h>
|
||||||
|
|
||||||
|
|
||||||
CUpdateSettings::CUpdateSettings()
|
CUpdateSettings::CUpdateSettings(CMenuForwarder * update_item)
|
||||||
{
|
{
|
||||||
width = w_max (40, 10);
|
width = w_max (40, 10);
|
||||||
|
updateItem = update_item;
|
||||||
#ifdef USE_SMS_INPUT
|
#ifdef USE_SMS_INPUT
|
||||||
input_url_file = new CStringInputSMS(LOCALE_FLASHUPDATE_URL_FILE, g_settings.softupdate_url_file, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789!""$%&/()=?-. ");
|
input_url_file = new CStringInputSMS(LOCALE_FLASHUPDATE_URL_FILE, g_settings.softupdate_url_file, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789!""$%&/()=?-. ");
|
||||||
#endif
|
#endif
|
||||||
@@ -113,7 +114,7 @@ int CUpdateSettings::initMenu()
|
|||||||
#endif
|
#endif
|
||||||
CMenuForwarder * fw_update_dir = new CMenuForwarder(LOCALE_EXTRA_UPDATE_DIR, !g_settings.softupdate_mode, g_settings.update_dir , this, "update_dir", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED);
|
CMenuForwarder * fw_update_dir = new CMenuForwarder(LOCALE_EXTRA_UPDATE_DIR, !g_settings.softupdate_mode, g_settings.update_dir , this, "update_dir", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED);
|
||||||
|
|
||||||
CUrlConfigSetupNotifier url_setup_notifier(fw_url, fw_update_dir);
|
CUrlConfigSetupNotifier url_setup_notifier(fw_url, fw_update_dir, updateItem);
|
||||||
|
|
||||||
CMenuOptionChooser *oj_mode = new CMenuOptionChooser(LOCALE_FLASHUPDATE_UPDATEMODE, &g_settings.softupdate_mode, FLASHUPDATE_UPDATEMODE_OPTIONS, FLASHUPDATE_UPDATEMODE_OPTION_COUNT, true, &url_setup_notifier);
|
CMenuOptionChooser *oj_mode = new CMenuOptionChooser(LOCALE_FLASHUPDATE_UPDATEMODE, &g_settings.softupdate_mode, FLASHUPDATE_UPDATEMODE_OPTIONS, FLASHUPDATE_UPDATEMODE_OPTION_COUNT, true, &url_setup_notifier);
|
||||||
|
|
||||||
@@ -128,10 +129,11 @@ int CUpdateSettings::initMenu()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CUrlConfigSetupNotifier::CUrlConfigSetupNotifier( CMenuItem* i1, CMenuItem* i2)
|
CUrlConfigSetupNotifier::CUrlConfigSetupNotifier( CMenuItem* i1, CMenuItem* i2, CMenuForwarder * f1)
|
||||||
{
|
{
|
||||||
toDisable[0] = i1;
|
toDisable[0] = i1;
|
||||||
toDisable[1] = i2;
|
toDisable[1] = i2;
|
||||||
|
updateItem = f1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CUrlConfigSetupNotifier::changeNotify(const neutrino_locale_t, void *)
|
bool CUrlConfigSetupNotifier::changeNotify(const neutrino_locale_t, void *)
|
||||||
@@ -139,9 +141,11 @@ bool CUrlConfigSetupNotifier::changeNotify(const neutrino_locale_t, void *)
|
|||||||
if (g_settings.softupdate_mode){
|
if (g_settings.softupdate_mode){
|
||||||
toDisable[0]->setActive(true);
|
toDisable[0]->setActive(true);
|
||||||
toDisable[1]->setActive(false);
|
toDisable[1]->setActive(false);
|
||||||
|
updateItem->setTextLocale(LOCALE_FLASHUPDATE_CHECKUPDATE_INTERNET);
|
||||||
}else{
|
}else{
|
||||||
toDisable[0]->setActive(false);
|
toDisable[0]->setActive(false);
|
||||||
toDisable[1]->setActive(true);
|
toDisable[1]->setActive(true);
|
||||||
|
updateItem->setTextLocale(LOCALE_FLASHUPDATE_CHECKUPDATE_LOCAL);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -49,8 +49,9 @@ class CUrlConfigSetupNotifier : public CChangeObserver
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
CMenuItem* toDisable[2];
|
CMenuItem* toDisable[2];
|
||||||
|
CMenuForwarder * updateItem;
|
||||||
public:
|
public:
|
||||||
CUrlConfigSetupNotifier( CMenuItem*, CMenuItem*);
|
CUrlConfigSetupNotifier( CMenuItem*, CMenuItem*, CMenuForwarder *);
|
||||||
bool changeNotify(const neutrino_locale_t = NONEXISTANT_LOCALE, void *data = NULL);
|
bool changeNotify(const neutrino_locale_t = NONEXISTANT_LOCALE, void *data = NULL);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -58,6 +59,7 @@ class CUpdateSettings : public CMenuTarget
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
int width;
|
int width;
|
||||||
|
CMenuForwarder * updateItem;
|
||||||
int initMenu();
|
int initMenu();
|
||||||
|
|
||||||
CFlashExpert *fe;
|
CFlashExpert *fe;
|
||||||
@@ -66,7 +68,7 @@ class CUpdateSettings : public CMenuTarget
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CUpdateSettings();
|
CUpdateSettings(CMenuForwarder * update_item);
|
||||||
~CUpdateSettings();
|
~CUpdateSettings();
|
||||||
int exec(CMenuTarget* parent, const std::string & actionKey);
|
int exec(CMenuTarget* parent, const std::string & actionKey);
|
||||||
};
|
};
|
||||||
|
@@ -463,7 +463,8 @@ typedef enum
|
|||||||
LOCALE_FLASHUPDATE_ACTIONREADFLASH,
|
LOCALE_FLASHUPDATE_ACTIONREADFLASH,
|
||||||
LOCALE_FLASHUPDATE_CANTOPENFILE,
|
LOCALE_FLASHUPDATE_CANTOPENFILE,
|
||||||
LOCALE_FLASHUPDATE_CANTOPENMTD,
|
LOCALE_FLASHUPDATE_CANTOPENMTD,
|
||||||
LOCALE_FLASHUPDATE_CHECKUPDATE,
|
LOCALE_FLASHUPDATE_CHECKUPDATE_INTERNET,
|
||||||
|
LOCALE_FLASHUPDATE_CHECKUPDATE_LOCAL,
|
||||||
LOCALE_FLASHUPDATE_CURRENTVERSION_SEP,
|
LOCALE_FLASHUPDATE_CURRENTVERSION_SEP,
|
||||||
LOCALE_FLASHUPDATE_CURRENTVERSIONDATE,
|
LOCALE_FLASHUPDATE_CURRENTVERSIONDATE,
|
||||||
LOCALE_FLASHUPDATE_CURRENTVERSIONTIME,
|
LOCALE_FLASHUPDATE_CURRENTVERSIONTIME,
|
||||||
|
@@ -463,7 +463,8 @@ const char * locale_real_names[] =
|
|||||||
"flashupdate.actionreadflash",
|
"flashupdate.actionreadflash",
|
||||||
"flashupdate.cantopenfile",
|
"flashupdate.cantopenfile",
|
||||||
"flashupdate.cantopenmtd",
|
"flashupdate.cantopenmtd",
|
||||||
"flashupdate.checkupdate",
|
"flashupdate.checkupdate_internet",
|
||||||
|
"flashupdate.checkupdate_local",
|
||||||
"flashupdate.currentversion_sep",
|
"flashupdate.currentversion_sep",
|
||||||
"flashupdate.currentversiondate",
|
"flashupdate.currentversiondate",
|
||||||
"flashupdate.currentversiontime",
|
"flashupdate.currentversiontime",
|
||||||
|
Reference in New Issue
Block a user