diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 4f37afc45..ede204b93 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -722,6 +722,15 @@ flashupdate.selectimage Verfügbare Images/Files flashupdate.settings Update-Einstellungen flashupdate.titlereadflash Flash auslesen flashupdate.titlewriteflash Flash schreiben +flashupdate.type_addon Erweiterung +flashupdate.type_beta Beta +flashupdate.type_internal Intern +flashupdate.type_locale Sprachdatei +flashupdate.type_release Release +flashupdate.type_settings Einstellungen +flashupdate.type_text Text +flashupdate.type_unknown Unbekannt +flashupdate.type_update Aktualisierung flashupdate.update_with_settings_del_skipped Ordner [%s] kann nicht gelöscht werden. Eintrag wird übersprungen. flashupdate.update_with_settings_error Error Flashspeicher!\n \nIm neuen Image sind nur noch %ld KB (von %ld KB) frei,\ndas ist zu wenig, um einen sicheren Betrieb zu gewährleisten.\n \nDer Vorgang wird abgebrochen! flashupdate.update_with_settings_processed Image wird bearbeitet ... diff --git a/data/locale/english.locale b/data/locale/english.locale index a25447ea3..1371ccb94 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -722,6 +722,15 @@ flashupdate.selectimage Available Images/Files flashupdate.settings Update settings flashupdate.titlereadflash Reading Flash flashupdate.titlewriteflash Writing Flash +flashupdate.type_addon Addon +flashupdate.type_beta Beta +flashupdate.type_internal Internal +flashupdate.type_locale Locale +flashupdate.type_release Release +flashupdate.type_settings Settings +flashupdate.type_text Text +flashupdate.type_unknown Unknown +flashupdate.type_update Update flashupdate.update_with_settings_del_skipped Folder [%s] can not be deleted. Entry is skipped. flashupdate.update_with_settings_error Flash Error!\n \nNew Image only has %ld KB (out of %ld KB) left. Not\nenough space to complete this operation.\n \nCanceling operation! flashupdate.update_with_settings_processed Image is being processed ... diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index 41dd40eea..4e2c9f742 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -37,7 +37,7 @@ using namespace std; -CBuildInfo::CBuildInfo(bool show) : CComponentsWindow(0, 0, 90/*%*/, 90/*%*/, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) +CBuildInfo::CBuildInfo(bool show) : CComponentsWindow(0, 0, CCW_PERCENT 90, CCW_PERCENT 90, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) { initVarBuildInfo(); if (show) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index ab0663a2d..73a6e23a5 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -169,13 +169,13 @@ void CComponentsWindow::initWindowSize() if (cc_parent) return; - if (width > 0 && width <= 100) //percentage conversion TODO: behavior inside parent - width = frameBuffer->getScreenWidth()*width/100; + if (width < 0 && width >= -100) //percentage conversion TODO: behavior inside parent + width = frameBuffer->getScreenWidth()*abs(width)/100; if (width == 0 || (unsigned)width > frameBuffer->getScreenWidth()) width = frameBuffer->getScreenWidth(); - if (height > 0 && height <= 100) //percentage conversion TODO: behavior inside parent - height = frameBuffer->getScreenHeight()*height/100; + if (height < 0 && height >= -100) //percentage conversion TODO: behavior inside parent + height = frameBuffer->getScreenHeight()*abs(height)/100; if (height == 0 || (unsigned)height > frameBuffer->getScreenHeight()) height = frameBuffer->getScreenHeight(); } diff --git a/src/gui/components/cc_frm_window.h b/src/gui/components/cc_frm_window.h index cb1b5288e..52b4e0012 100644 --- a/src/gui/components/cc_frm_window.h +++ b/src/gui/components/cc_frm_window.h @@ -29,6 +29,8 @@ #include "cc_frm_header.h" #include "cc_frm_footer.h" +#define CCW_PERCENT - //placeholder for negative sign '-', used for discret dimensions parameters + //! Sub class of CComponentsForm. Shows a window with prepared items. /*! CComponentsWindow provides prepared items like header, footer and a container for @@ -135,6 +137,7 @@ class CComponentsWindow : public CComponentsForm CC_WINDOW_RIGHT_SIDEBAR = 2 }; + /**simple constructor for CComponentsWindow, this shows a window over full screen * @param[in] parent * @li optional: expects type CComponentsForm * as possible parent object, default = NULL @@ -148,9 +151,9 @@ class CComponentsWindow : public CComponentsForm * @param[in] y_pos * @li expects type const &int, defines y position on screen * @param[in] w - * @li expects type const &int, width of window, Note: value = 0 uses full screen, value > 0 to 100 interpreted as percent value of screen, value > 100 use native lines count on screen + * @li expects type const &int, width of window, Note: value = 0 uses full screen * @param[in] h - * @li expects type const &int, height of window, Note: value = 0 uses full screen, value > 0 to 100 interpreted as percent value of screen, value > 100 use native lines count on screen + * @li expects type const &int, height of window, Note: value = 0 uses full screen * @param[in] caption * @li optional: expects type const std::string&, defines title of window header * @param[in] iconname @@ -158,16 +161,24 @@ class CComponentsWindow : public CComponentsForm * @param[in] parent * @li optional: expects type CComponentsForm * as possible parent object, default = NULL * @param[in] shadow_mode - * @li optional: expects type int as mode, default = CC_SHADOW_OFF - * possible values are - * CC_SHADOW_ON = (CC_SHADOW_RIGHT | CC_SHADOW_BOTTOM | CC_SHADOW_CORNER_BOTTOM_LEFT | CC_SHADOW_CORNER_BOTTOM_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT) - * @see cc_types.h + * @li optional: expects type int as mode, default = CC_SHADOW_OFF \n + * possible values are \n + * CC_SHADOW_ON = (CC_SHADOW_RIGHT | CC_SHADOW_BOTTOM | CC_SHADOW_CORNER_BOTTOM_LEFT | CC_SHADOW_CORNER_BOTTOM_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT) \n + * Take a look into cc_types.h * @param[in] color_frame * @li optional: expects type fb_pixel_t, defines frame color, default = COL_FRAME_PLUS_0 * @param[in] color_body * @li optional: expects type fb_pixel_t, defines color color, default = COL_MENUCONTENT_PLUS_0 * @param[in] color_shadow * @li optional: expects type fb_pixel_t, defines shadow color, default = COL_SHADOW_PLUS_0 + * + * @note Discret dimensions parameters: values < 0 to -100 will be interpreted as percent values related to screen. + * For better readability please use placeholder 'CCW_PERCENT' as negative sign '-' \n + * Example: \n + * this inits a window with position x100 y100 on screen with dimensions 700px x 800px \n + * CComponentsWindow win(100, 100, 700, 800, "Test window");\n + * this inits a window with position x100 y100 on screen with 50% of screen size assigned with discret percental screen dimensions \n + * CComponentsWindow win(100, 100, CCW_PERCENT 50, CCW_PERCENT 50, "Test window"); */ CComponentsWindow( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& caption = "", diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 170bb41a2..ce718f256 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -2254,9 +2254,13 @@ void CInfoViewer::killTitle() sigbox->kill(); #endif header->kill(); -#if 0 //not really required to kill clock, header does this +#if 1 //not really required to kill clock, header does this <--- really ???? if (clock) + { clock->kill(); + delete clock; + clock = NULL; + } #endif body->kill(); @@ -2568,7 +2572,10 @@ void CInfoViewer::ResetModules() delete header; header = NULL; delete body; body = NULL; delete infobar_txt; infobar_txt = NULL; - delete clock; clock = NULL; + if (clock) + { + delete clock; clock = NULL; + } delete txt_cur_start; txt_cur_start = NULL; delete txt_cur_event; txt_cur_event = NULL; delete txt_cur_event_rest; txt_cur_event_rest = NULL; diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 6c8b8bc22..55b19f4e0 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 69 +#define LUA_API_VERSION_MINOR 70 diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index 067b2c7bc..16d3edcc7 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -270,6 +270,20 @@ static void set_lua_variables(lua_State *L) { "RADIUS_MID", RADIUS_MID }, { "RADIUS_SMALL", RADIUS_SMALL }, { "RADIUS_MIN", RADIUS_MIN }, + { "RADIUS_NONE", RADIUS_NONE }, + { NULL, 0 } + }; + + /* offsets, exported as e.g. OFFSET['SHADOW'] */ + table_key offsets[] = + { + { "SHADOW", OFFSET_SHADOW }, + { "INTER", OFFSET_INTER }, + { "INNER_LARGE", OFFSET_INNER_LARGE }, + { "INNER_MID", OFFSET_INNER_MID }, + { "INNER_SMALL", OFFSET_INNER_SMALL }, + { "INNER_MIN", OFFSET_INNER_MIN }, + { "INNER_NONE", OFFSET_INNER_NONE }, { NULL, 0 } }; @@ -330,7 +344,8 @@ static void set_lua_variables(lua_State *L) { "STYLE_ITALIC", (lua_Integer)CNeutrinoFonts::FONT_STYLE_ITALIC }, { "MAX", (lua_Integer)CNeutrinoFonts::DYNFONTEXT_MAX }, { "MAXIMUM_FONTS", (lua_Integer)CLuaInstance::DYNFONT_MAXIMUM_FONTS }, - { "TO_WIDE", (lua_Integer)CLuaInstance::DYNFONT_TO_WIDE }, + { "TO_WIDE", (lua_Integer)CLuaInstance::DYNFONT_TOO_WIDE }, // just here to stay backward compatible + { "TOO_WIDE", (lua_Integer)CLuaInstance::DYNFONT_TOO_WIDE }, { "TOO_HIGH", (lua_Integer)CLuaInstance::DYNFONT_TOO_HIGH }, { NULL, 0 } }; @@ -375,6 +390,7 @@ static void set_lua_variables(lua_State *L) { "SCREEN", screenopts }, { "FONT", fontlist }, { "CORNER", corners }, + { "OFFSET", offsets }, { "MENU_RETURN", menureturn }, { "APIVERSION", apiversion }, { "PLAYSTATE", playstate }, @@ -1036,7 +1052,7 @@ int CLuaInstance::getDynFont(lua_State *L) dx = luaL_checkint(L, 2); if (dx > (lua_Integer)CFrameBuffer::getInstance()->getScreenWidth(true)) { lua_pushnil(L); - lua_pushinteger(L, DYNFONT_TO_WIDE); + lua_pushinteger(L, DYNFONT_TOO_WIDE); return 2; } dy = luaL_checkint(L, 3); diff --git a/src/gui/lua/luainstance.h b/src/gui/lua/luainstance.h index 21ebb625b..fe0ad3bff 100644 --- a/src/gui/lua/luainstance.h +++ b/src/gui/lua/luainstance.h @@ -46,7 +46,7 @@ public: enum { DYNFONT_NO_ERROR = 0, DYNFONT_MAXIMUM_FONTS = 1, - DYNFONT_TO_WIDE = 2, + DYNFONT_TOO_WIDE = 2, DYNFONT_TOO_HIGH = 3 }; diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index edc63a0bb..1a9e2c283 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3223,7 +3223,7 @@ void CMovieBrowser::loadMovies(bool doRefresh) { TRACE("[mb] loadMovies: \n"); - CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, 50/*%*/, 25/*%*/, NULL, show_mode == MB_SHOW_YT ? &ytparser.OnLoadVideoInfo : &OnLoadFile, &OnLoadDir); + CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, CCW_PERCENT 50, CCW_PERCENT 10, NULL, show_mode == MB_SHOW_YT ? &ytparser.OnLoadVideoInfo : &OnLoadFile, &OnLoadDir); loadBox.enableShadow(); loadBox.paint(); diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index d104d2542..68528e1d8 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -866,7 +866,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) //with signals sigc::signal OnProgress0, OnProgress1; - CProgressWindow pw2("Progress Single Test -> single Signal", 700, 200, &OnProgress0); + CProgressWindow pw2("Progress Single Test -> single Signal", CCW_PERCENT 50, CCW_PERCENT 30, &OnProgress0); pw2.paint(); for(size_t i = 0; i< max; i++){ @@ -875,7 +875,9 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) } pw2.hide(); - CProgressWindow pw3("Progress Single Test -> dub Signal", 700, 200, NULL, &OnProgress0, &OnProgress1); + OnProgress0.clear(); + OnProgress1.clear(); + CProgressWindow pw3("Progress Single Test -> dub Signal", CCW_PERCENT 50, CCW_PERCENT 20, NULL, &OnProgress0, &OnProgress1); pw3.paint(); for(size_t i = 0; i< max; i++){ diff --git a/src/gui/update.cpp b/src/gui/update.cpp index 86e497df6..43ade2362 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -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(); } } diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index e2410dc01..9be482054 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -101,8 +101,7 @@ void CProgressWindow::Init( signal *statusSignal, //set window height h_height = ccw_head->getHeight(); - ccw_body->setHeight((OFFSET_INNER_MID + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight())*ccw_body->size()); - + ccw_body->setHeight(ccw_body->back()->getYPos()+ ccw_body->back()->getHeight()+ OFFSET_INNER_MID); height = max(height, ccw_body->getHeight() + h_height); //set position on screen @@ -114,8 +113,8 @@ CProgressBar* CProgressWindow::getProgressItem() CProgressBar *pBar = new CProgressBar(); pBar->allowPaint(false); int y_tmp = 0; - for(size_t i = 0; i< ccw_body->size(); i++){ - y_tmp += ccw_body->getCCItem(i)->getHeight(); + for(size_t i = ccw_body->size()-1; i< ccw_body->size(); i++){ + y_tmp += ccw_body->getCCItem(i)->getYPos() + ccw_body->getCCItem(i)->getHeight(); y_tmp += OFFSET_INNER_MID; } pBar->setDimensionsAll(OFFSET_INNER_MID, y_tmp, width-2*OFFSET_INNER_MID, g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight()); diff --git a/src/gui/widget/progresswindow.h b/src/gui/widget/progresswindow.h index 10624dea8..e94d08755 100644 --- a/src/gui/widget/progresswindow.h +++ b/src/gui/widget/progresswindow.h @@ -28,8 +28,8 @@ #include #include "menue.h" -#define PW_MIN_WIDTH 50 //% -#define PW_MIN_HEIGHT 25 //% +#define PW_MIN_WIDTH CCW_PERCENT 50 +#define PW_MIN_HEIGHT CCW_PERCENT 20 class CProgressWindow : public CComponentsWindow, public CMenuTarget { diff --git a/src/neutrino.cpp b/src/neutrino.cpp index cddda23cf..093a4c05d 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -527,6 +527,8 @@ int CNeutrinoApp::loadSetup(const char * fname) if (timer_remotebox_itemcount) { for (int i = 0; i < timer_remotebox_itemcount; i++) { timer_remotebox_item timer_rb; + timer_rb.online = false; + timer_rb.port = 0; std::string k; k = "timer_remotebox_ip_" + to_string(i); timer_rb.rbaddress = configfile.getString(k, ""); @@ -4764,9 +4766,10 @@ void stop_daemons(bool stopall, bool for_flash) if(!for_flash && !stopall && g_settings.hdmi_cec_mode && g_settings.hdmi_cec_standby){ videoDecoder->SetCECMode((VIDEO_HDMI_CEC_MODE)0); } - - delete InfoClock; - delete FileTimeOSD; + if(InfoClock) + delete InfoClock; + if(FileTimeOSD) + delete FileTimeOSD; delete &CMoviePlayerGui::getInstance(); CZapit::getInstance()->Stop(); diff --git a/src/system/flashtool.cpp b/src/system/flashtool.cpp index 6b6e6e149..d0e21c535 100644 --- a/src/system/flashtool.cpp +++ b/src/system/flashtool.cpp @@ -547,28 +547,26 @@ const char *CFlashVersionInfo::getReleaseCycle(void) const const char *CFlashVersionInfo::getType(void) const { - // TODO: localize it - switch (snapshot) { case '0': - return "Release"; + return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_RELEASE); case '1': - return "Beta"; + return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_BETA); case '2': - return "Internal"; + return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_INTERNAL); case 'L': - return "Locale"; + return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_LOCALE); case 'S': - return "Settings"; + return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_SETTINGS); case 'A': - return "Addon"; + return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_ADDON); case 'U': - return "Update"; + return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_UPDATE); case 'T': - return "Text"; + return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_TEXT); default: - return "Unknown"; + return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_UNKNOWN); } } diff --git a/src/system/locals.h b/src/system/locals.h index 860698b1e..39b776c88 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -749,6 +749,15 @@ typedef enum LOCALE_FLASHUPDATE_SETTINGS, LOCALE_FLASHUPDATE_TITLEREADFLASH, LOCALE_FLASHUPDATE_TITLEWRITEFLASH, + LOCALE_FLASHUPDATE_TYPE_ADDON, + LOCALE_FLASHUPDATE_TYPE_BETA, + LOCALE_FLASHUPDATE_TYPE_INTERNAL, + LOCALE_FLASHUPDATE_TYPE_LOCALE, + LOCALE_FLASHUPDATE_TYPE_RELEASE, + LOCALE_FLASHUPDATE_TYPE_SETTINGS, + LOCALE_FLASHUPDATE_TYPE_TEXT, + LOCALE_FLASHUPDATE_TYPE_UNKNOWN, + LOCALE_FLASHUPDATE_TYPE_UPDATE, LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_DEL_SKIPPED, LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_ERROR, LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_PROCESSED, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index af4125eef..3e4fa363f 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -749,6 +749,15 @@ const char * locale_real_names[] = "flashupdate.settings", "flashupdate.titlereadflash", "flashupdate.titlewriteflash", + "flashupdate.type_addon", + "flashupdate.type_beta", + "flashupdate.type_internal", + "flashupdate.type_locale", + "flashupdate.type_release", + "flashupdate.type_settings", + "flashupdate.type_text", + "flashupdate.type_unknown", + "flashupdate.type_update", "flashupdate.update_with_settings_del_skipped", "flashupdate.update_with_settings_error", "flashupdate.update_with_settings_processed",