diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 3bbd0658b..bf335143b 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -480,6 +480,8 @@ flashupdate.globalprogress Gesamtstatus: flashupdate.head Aktualisierung flashupdate.md5check Imageprüfung flashupdate.md5sumerror Das Image ist fehlerhaft +flashupdate.menu_apply_kernel Kernel flashen +flashupdate.menu_apply_settings Settingsübernahme erlauben flashupdate.msgbox Es wurde folgendes neues File gefunden:\nDatum: %s, %s\nBasisImage: %s\nTyp: %s\n\nWollen Sie diese Version jetzt herunterladen\nund installieren? flashupdate.msgbox_manual Es wurde ein neues Image gefunden:\nDatum: %s, %s\nBasisImage: %s\nImageTyp: %s\n\nWollen Sie diese Version jetzt installieren? flashupdate.mtdselector Partitions-Auswahl diff --git a/data/locale/english.locale b/data/locale/english.locale index 1e7c25a81..fac97418a 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -480,6 +480,8 @@ flashupdate.globalprogress Global Progress: flashupdate.head Software Update flashupdate.md5check checking image flashupdate.md5sumerror image has errors +flashupdate.menu_apply_kernel Flashing kernel +flashupdate.menu_apply_settings Allow apply settings flashupdate.msgbox Found the following new file:\nDate: %s, %s\nBaseImage: %s\nType: %s\n\nDo you want to download and install this version now? flashupdate.msgbox_manual Found the following new image:\nDate: %s, %s\nBaseImage: %s\nImageType: %s\n\nDo you want to install this version now? flashupdate.mtdselector Partition-Selector diff --git a/src/gui/update.cpp b/src/gui/update.cpp index a31df3b9b..685e34340 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -465,9 +465,11 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) if(fileType < '3') { CNeutrinoApp::getInstance()->exec(NULL, "savesettings"); //flash it... - if (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_APPLY_SETTINGS), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) == CMessageBox::mbrYes) - if (!CExtUpdate::getInstance()->applySettings(filename, CExtUpdate::MODE_SOFTUPDATE)) - return menu_return::RETURN_REPAINT; + if (g_settings.apply_settings) { + if (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_APPLY_SETTINGS), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) == CMessageBox::mbrYes) + if (!CExtUpdate::getInstance()->applySettings(filename, CExtUpdate::MODE_SOFTUPDATE)) + return menu_return::RETURN_REPAINT; + } #ifdef DEBUG1 if(1) { diff --git a/src/gui/update_settings.cpp b/src/gui/update_settings.cpp index 7c7742194..27e609283 100644 --- a/src/gui/update_settings.cpp +++ b/src/gui/update_settings.cpp @@ -35,6 +35,7 @@ #include #include +#include #include #include "update_settings.h" #include "filebrowser.h" @@ -103,56 +104,34 @@ int CUpdateSettings::exec(CMenuTarget* parent, const std::string &actionKey) /* init options for software update */ int CUpdateSettings::initMenu() { - CMenuWidget w_upsettings(LOCALE_SERVICEMENU_UPDATE, NEUTRINO_ICON_UPDATE, width, MN_WIDGET_ID_SOFTWAREUPDATE_SETTINGS); + COnOffNotifier* OnOffNotifier = new COnOffNotifier(0); + CMenuWidget w_upsettings(LOCALE_SERVICEMENU_UPDATE, NEUTRINO_ICON_UPDATE, width, MN_WIDGET_ID_SOFTWAREUPDATE_SETTINGS); w_upsettings.addIntroItems(LOCALE_FLASHUPDATE_SETTINGS); -#if 0 -#ifdef USE_SMS_INPUT - CMenuForwarder * fw_url = new CMenuForwarder(LOCALE_FLASHUPDATE_URL_FILE, g_settings.softupdate_mode, g_settings.softupdate_url_file, input_url_file, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); -#else - CMenuForwarder * fw_url = new CMenuForwarder(LOCALE_FLASHUPDATE_URL_FILE, g_settings.softupdate_mode, g_settings.softupdate_url_file, this, "select_url_config_file", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); -#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); - - 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); -#endif - CMenuForwarder * fw_url = new CMenuForwarder(LOCALE_FLASHUPDATE_URL_FILE, true, g_settings.softupdate_url_file, this, "select_url_config_file", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); +// fw_url->setHint("", LOCALE_MENU_HINT_XXX); CMenuForwarder * fw_update_dir = new CMenuForwarder(LOCALE_EXTRA_UPDATE_DIR, true, g_settings.update_dir , this, "update_dir", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); +// fw_update_dir->setHint("", LOCALE_MENU_HINT_XXX); + + CMenuOptionChooser *apply_settings = new CMenuOptionChooser(LOCALE_FLASHUPDATE_MENU_APPLY_SETTINGS, &g_settings.apply_settings, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, OnOffNotifier); +// apply_settings->setHint("", LOCALE_MENU_HINT_XXX); #if 0 - w_upsettings.addItem(oj_mode, true); - w_upsettings.addItem(GenericMenuSeparatorLine); + CMenuOptionChooser *apply_kernel = new CMenuOptionChooser(LOCALE_FLASHUPDATE_MENU_APPLY_KERNEL, &g_settings.apply_kernel, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.apply_settings); +// apply_kernel->setHint("", LOCALE_MENU_HINT_XXX); + OnOffNotifier->addItem(apply_kernel); #endif + w_upsettings.addItem(fw_update_dir); w_upsettings.addItem(fw_url); + w_upsettings.addItem(GenericMenuSeparatorLine); + w_upsettings.addItem(apply_settings); +#if 0 + w_upsettings.addItem(apply_kernel); +#endif int res = w_upsettings.exec (NULL, ""); + delete OnOffNotifier; return res; } - -#if 0 -CUrlConfigSetupNotifier::CUrlConfigSetupNotifier( CMenuItem* i1, CMenuItem* i2, CMenuForwarder * f1) -{ - toDisable[0] = i1; - toDisable[1] = i2; - updateItem = f1; -} - -bool CUrlConfigSetupNotifier::changeNotify(const neutrino_locale_t, void *) -{ - if (g_settings.softupdate_mode){ - toDisable[0]->setActive(true); - toDisable[1]->setActive(false); - updateItem->setTextLocale(LOCALE_FLASHUPDATE_CHECKUPDATE_INTERNET); - }else{ - toDisable[0]->setActive(false); - toDisable[1]->setActive(true); - updateItem->setTextLocale(LOCALE_FLASHUPDATE_CHECKUPDATE_LOCAL); - } - return false; -} -#endif diff --git a/src/neutrino.cpp b/src/neutrino.cpp index d200bad33..33207c2ef 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -656,6 +656,8 @@ int CNeutrinoApp::loadSetup(const char * fname) //Software-update g_settings.softupdate_mode = configfile.getInt32( "softupdate_mode", 1 ); + g_settings.apply_kernel = configfile.getBool("apply_kernel" , false); + g_settings.apply_settings = configfile.getBool("apply_settings" , true); strcpy(g_settings.softupdate_url_file, configfile.getString("softupdate_url_file", "/var/etc/update.urls").c_str()); strcpy(g_settings.softupdate_proxyserver, configfile.getString("softupdate_proxyserver", "" ).c_str()); @@ -1086,6 +1088,8 @@ void CNeutrinoApp::saveSetup(const char * fname) //Software-update configfile.setInt32 ("softupdate_mode" , g_settings.softupdate_mode ); + configfile.setBool("apply_kernel", g_settings.apply_kernel); + configfile.setBool("apply_settings", g_settings.apply_settings); configfile.setString("softupdate_url_file" , g_settings.softupdate_url_file ); configfile.setString("softupdate_proxyserver" , g_settings.softupdate_proxyserver ); diff --git a/src/system/locals.h b/src/system/locals.h index 3ca5ec115..646edf3b9 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -507,6 +507,8 @@ typedef enum LOCALE_FLASHUPDATE_HEAD, LOCALE_FLASHUPDATE_MD5CHECK, LOCALE_FLASHUPDATE_MD5SUMERROR, + LOCALE_FLASHUPDATE_MENU_APPLY_KERNEL, + LOCALE_FLASHUPDATE_MENU_APPLY_SETTINGS, LOCALE_FLASHUPDATE_MSGBOX, LOCALE_FLASHUPDATE_MSGBOX_MANUAL, LOCALE_FLASHUPDATE_MTDSELECTOR, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 5499fe2c4..a51053452 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -507,6 +507,8 @@ const char * locale_real_names[] = "flashupdate.head", "flashupdate.md5check", "flashupdate.md5sumerror", + "flashupdate.menu_apply_kernel", + "flashupdate.menu_apply_settings", "flashupdate.msgbox", "flashupdate.msgbox_manual", "flashupdate.mtdselector", diff --git a/src/system/settings.h b/src/system/settings.h index 8df207ac6..b87a35cfd 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -472,6 +472,8 @@ struct SNeutrinoSettings char softupdate_proxyserver[31]; char softupdate_proxyusername[31]; char softupdate_proxypassword[31]; + int apply_settings; + int apply_kernel; //BouquetHandling int bouquetlist_mode;