Home_Menu historyHomeFocus = getEnv("historyHomeFocus"); if (historyHomeFocus != null) { setFocusItemIndex(historyHomeFocus); unsetEnv("historyHomeFocus"); } if (MeleIMSFeature("LOOKANDFEEL", "STATUS") == "enabled") { IsDisplaySysStatus = "true"; } else { IsDisplaySysStatus = "false"; } /* home menu will be lined a circle */ curFocusIdx = 0; prevFocusIdx = 0; cityinfo = loadXMLFile("/usr/local/etc/dvdplayer/accucity.xml"); if(cityinfo == null) cityinfo = loadXMLFile("/system/rtk_rootfs/usr/local/bin/accuweather/defaultcity.xml"); if(cityinfo != null) { cityid = getXMLText("cities","currentcity"); unit = getXMLText("cities","unit"); weatherURL = "http://realtek.accu-weather.com/widget/realtek/weather-data.asp?location="+cityid; if(unit == "0") weatherURL += "&metric=1"; print(weatherURL); } else { weatherURL = "http://realtek.accu-weather.com/widget/realtek/weather-data.asp?location=cityId:294459&metric=1"; } filename = "/tmp/cached/async_tmp.txt"; getURL(weatherURL,"async",filename); gettingurl = "true"; setRefreshTime(scantimer); DBReady = IsDBReady(); DBSlowScanning = IsDBSlowScanning(); CurScanDisk = GetScanningDisk(); AndroidReadyFlag = IsAndroidSystemReady(); curphase = null; if(IsScanning != 0){ curphase = getScanningPhase(); print("XXXXXXXXXXXX curphase: ", curphase, " last: ",LastCurphase); } curpath = null; if(IsScanning != 0){ curpath = GetScanningPath(); } IsRedraw = 0; if(curphase != LastCurphase){ IsRedraw = 1; } if(curpath != LastCurScanPath){ IsRedraw = 1; } if(IsRedraw == 0){ if(CurScanDisk != LastCurScanDisk){ IsRedraw = 1; }else{ if(DBReady != LastDBReady){ IsRedraw = 1; } else if(AndroidReadyFlag != LastAndroidReadyFlag){ IsRedraw = 1; } else { if(DBSlowScanning != LastDBSlowScanning) { IsRedraw = 1; } } } } if(IsRedraw == 1){ redrawDisplay(); IsRedraw = 0; } if(CurScanDisk != LastCurScanDisk){ if(LastCurScanDisk == null){ if( DBSlowScanning == "false" ) { showIdle("true"); IsScanning = 1; } }else{ if(CurScanDisk == null){ cancelIdle(); IsScanning = 0; } } } else { if( DBSlowScanning == "true" ) { cancelIdle(); IsScanning = 0; } } LastDBReady = DBReady; LastDBSlowScanning = DBSlowScanning; LastCurScanDisk = CurScanDisk; LastCurScanPath = curpath; LastCurphase = curphase; LastAndroidReadyFlag = AndroidReadyFlag; if(IsScanning == 0){ scantimer = 1000; }else{ scantimer = 1000; } if (serviceEnabled("accuweather") != null) { weathertimer_counter = (weathertimer_counter-1); if(weathertimer_counter == 0) { weathertimer_counter = 60; executeScript("getWeatherInfo"); } } if(gettingurl == "true") { print("11111"); print("=="+weatherURL); completed = getURLCompleted(weatherURL); if(completed == "TRUE") { state = loadXMLFile(filename); if (state != null) { weather_bg = "./home_menu/image/home_aceweather_bg.png"; cityName = getXMLText("adc_database", "local", "city"); cityUnit = getXMLText("adc_database", "units", "temp"); cityCountry = getXMLText("adc_database", "local", "country"); cityTime = getXMLText("adc_database", "local", "time"); cityTemp = getXMLText("adc_database", "currentconditions", "temperature"); cityTemp = cityTemp+"°"; cityIcon = getXMLText("adc_database", "currentconditions", "weathericon"); cityIcon = "./accuweather/images/icons/" + cityIcon + ".png"; cityDate = getXMLText("adc_database", "forecast", "day", "obsdate"); writeStringToFile("/tmp/cityDate.tmp", cityDate); dlok=getURL("http://127.0.0.1/cgi-bin/date.cgi"); } redrawDisplay(); gettingurl = "false"; } } setRefreshTime(-1); cancelIdle(); IsScanning = 0; SetScreenSaverStatus("no"); historyHomeFocus = getFocusItemIndex(); setEnv("historyHomeFocus", historyHomeFocus); popupHeader = "$[IMS_ANDROID]"; popupOptionSize = 1; popupOptions = pushBackStringArray(popupOptions, "$[OK]"); popupMessageSize = 1; popupOptionWide = 1; popupMessages = "$[LOADING_ANDROID]"; popupOptionFocus = "$[OK]" popupHeader = "$[IMS_ANDROID]"; popupOptionSize = 1; popupOptions = pushBackStringArray(popupOptions, "$[OK]"); popupMessageSize = 1; popupOptionWide = 1; popupMessages = "$[LOAD_ANDROID_FAILED]"; popupOptionFocus = "$[OK]" popupHeader = "$[IMS_ANDROID]"; popupOptionSize = 1; popupOptions = pushBackStringArray(popupOptions, "$[OK]"); popupMessageSize = 1; popupOptionWide = 1; popupMessages = "$[ANDROID_INFO_NOTSTARTED]"; popupOptionFocus = "$[OK]" image/POPUP_LOADING_01.png image/POPUP_LOADING_02.png image/POPUP_LOADING_03.png image/POPUP_LOADING_04.png image/POPUP_LOADING_05.png image/POPUP_LOADING_06.png image/POPUP_LOADING_07.png image/POPUP_LOADING_08.png MeleVFDShow("HOME"); executeScript("UpgradeCheck"); CurAPName = getCurrentAPName(); image_type = ".fsp"; print("skin 4: CurAPName:", CurAPName, "===> FS PNG"); CurrentAP = getEnv("EntryStatusString1"); CurrentType = getEnv("EntryStatusString2"); PlayMusic = getEnv("EntryStatusString3"); CurrentSubType = getEnv("EntryStatusString4"); CurrentSubType5 = getEnv("EntryStatusString5"); CurrentSubType6 = getEnv("EntryStatusString6"); CurrentSubType7 = getEnv("EntryStatusString7"); print("CurStatus:" , CurrentAP, CurrentType, PlayMusic, CurrentSubType, CurrentSubType5, CurrentSubType6, CurrentSubType7); SetScreenSaverStatus("yes"); IsAVinDisable = "yes"; IsDtvDisable = "yes"; FavoritesDisable = "yes"; IMSDisable = "yes"; WebBrowserDisable = "yes"; WebKitDisable = "yes"; IsAndroidDisable = "yes"; if(IsItemDisasble("IsAVinDisable") == "false"){ IsAVinDisable = "no"; } if(IsItemDisasble("DtvDisable") == "false"){ IsDtvDisable = "no"; } if(IsItemDisasble("IsFavoritesDisable") == "false"){ FavoritesDisable = "no"; } if(IsItemDisasble("NetworkDisable") == "false"){ IMSDisable = "no"; } if(IsItemDisasble("WebBrowserDisable") == "false"){ WebBrowserDisable = "no"; } if(IsItemDisasble("IsAndroidDisable") == "false"){ IsAndroidDisable = "no"; } if(IsItemDisasble("WebKitDisable") == "false"){ WebKitDisable = "no"; } FocusCnt = 2; DtvFocus = FocusCnt; if(IsDtvDisable == "no"){ FocusCnt = FocusCnt + 1; } AVinFocus = FocusCnt; if(IsAVinDisable == "no"){ FocusCnt = FocusCnt + 1; } FavoritesFocus = FocusCnt; if(FavoritesDisable == "no"){ FocusCnt = FocusCnt + 1; } FileFocus = FocusCnt; FocusCnt = FocusCnt + 1; MovieFocus = FocusCnt; FocusCnt = FocusCnt + 1; MusicFocus = FocusCnt; FocusCnt = FocusCnt + 1; PhotoFocus = FocusCnt; FocusCnt = FocusCnt + 1; IMSFocus = FocusCnt; if(IMSDisable == "no"){ FocusCnt = FocusCnt + 1; } /* Android */ AndroidFocus = FocusCnt; if(IsAndroidDisable == "no"){ FocusCnt = FocusCnt + 1; } WebKitFocus = FocusCnt; /* current Web browser use Android web, so we need use Android condition to count this item */ /*if(WebKitDisable == "no"){ */ if(IsAndroidDisable == "no"){ FocusCnt = FocusCnt + 1; } else { /* if android is disable,we will open WebKitAP for web browser, so must increase FocusCnt to avoid UI problem */ FocusCnt = FocusCnt + 1; } SetupFocus = FocusCnt; FocusCnt = FocusCnt + 1; CurrentSel = 0; if(CurrentAP=="IMSAP"){ if (CurrentType == "MyFavorites") { CurrentSel = FavoritesFocus; } else { CurrentSel = IMSFocus; } }else if(CurrentAP=="SetupMenuAP"){ CurrentSel = SetupFocus; }else if(CurrentAP=="VideoPlayback"){ CurrentSel = MovieFocus; }else if(CurrentAP=="PhotoPlaybackAP"){ CurrentSel = PhotoFocus; }else if(CurrentAP=="WebBrowserAP"){ CurrentSel = OperaFocus; }else if(CurrentAP=="WebKitAP"){ CurrentSel = WebKitFocus; }else if(CurrentAP=="GBrowserSelectAP"){ CurrentSel = PhotoFocus; }else if(CurrentAP=="AudioPlaybackAP"){ CurrentSel = MusicFocus; }else if(CurrentAP=="SearchViewAP"){ if(CurrentType=="Video"){ CurrentSel = MovieFocus; }else if(CurrentType=="Photo"){ CurrentSel = PhotoFocus; }else if(CurrentType=="Music"){ CurrentSel = MusicFocus; }else{ CurrentSel = FileFocus; } }else if(CurrentAP=="GBrowserGridViewAP"){ if(CurrentType=="Video"){ CurrentSel = MovieFocus; }else if(CurrentType=="Photo"){ CurrentSel = PhotoFocus; }else if(CurrentType=="Music"){ CurrentSel = MusicFocus; }else{ CurrentSel = FileFocus; } } print("3Sel: ",CurrentSel, CurrentAP, CurrentType, MarketDisable, FocusCnt); setItemFocus(CurrentSel); /* curFocusIdx = getFocusItemIndex(); prevFocusIdx = curFocusIdx; */ redrawDisplay(); EntryTimes = 1; BltType = "NoBitBlt"; DBReady = IsDBReady(); CurScanDisk = GetScanningDisk(); IsScanning = 0; AndroidReadyFlag = IsAndroidSystemReady(); if(CurScanDisk != null){ if( IsDBSlowScanning() == "false" ) { showIdle("true"); IsScanning = 1; } } curphase = null; if(IsScanning != 0){ curphase = getScanningPhase(); print("XXXXXXXXXXXX curphase: ", curphase, " last: ",LastCurphase); } curpath = null; if(IsScanning != 0){ curpath = GetScanningPath(); } print("DBReady:", DBReady, "CurScanDisk:", CurScanDisk); LastDBReady = DBReady; LastCurScanDisk = CurScanDisk; LastCurScanPath = curpath; LastCurphase = curphase; LastAndroidReadyFlag = AndroidReadyFlag; if(IsScanning == 0){ scantimer = 1000; }else{ scantimer = 1000; } setRefreshTime(scantimer); userInput = currentUserInput(); if (backdoor == "five") { backdoor = "null"; "false"; } else if ("guide" == userInput){ print("====== ignore guide key ======"); backdoor = "null"; "true"; }else if("up" == userInput){ backdoor = "null"; "true"; }else if("video_stop" == userInput){ backdoor = "null"; if(CurScanDisk != null){ StopCurDiskScan(); "true"; }else{ print("====== process key: ", userInput); "false"; } } else if (userInput == "edit") { backdoor = "null"; print("ignore edit key"); "true"; } else if ("option_green" == userInput) { backdoor = "null"; if (DBReady == "true") { if (CurScanDisk == null) { RescanDisk(); IsScanning = 1; "true"; } else { "false"; } } else { "false"; } } else if (userInput == "left") { /* add by Reacher */ /* curFocusIdx = getFocusItemIndex(); if ((curFocusIdx == 0 && prevFocusIdx == 1) || (curFocusIdx == 0 && prevFocusIdx == 0) || (curFocusIdx < 0 || prevFocusIdx < 0)) { curFocusIdx = FocusCnt - 1; setFocusItemIndex(curFocusIdx); setItemFocus(curFocusIdx); } prevFocusIdx = curFocusIdx; */ tmp_title = null; tmp_title = getItemInfo(getFocusItemIndex(), "title"); left_enable = "no"; if(IsDtvDisable == "no") { if (tmp_title == "$[DTV]") { left_enable = "yes"; } } else { if (tmp_title == "$[ims_vt_FAV]") { left_enable = "yes"; } } if (left_enable == "yes") { curFocusIdx = FocusCnt; setFocusItemIndex(curFocusIdx); setItemFocus(curFocusIdx); left_enable = "no"; } tmp_title = null; backdoor = "null"; redrawDisplay(); print("---------------------------------------------- left key"); "false"; } else if (userInput == "right") { /* add by Reacher */ /* curFocusIdx = getFocusItemIndex(); idx1 = FocusCnt - 3; idx2 = FocusCnt - 2; if ((curFocusIdx == idx2 && prevFocusIdx == idx2) || (curFocusIdx == idx2 && prevFocusIdx == idx1) || (curFocusIdx > idx2 || prevFocusIdx > idx2)) { curFocusIdx = -1; setFocusItemIndex(curFocusIdx); setItemFocus(curFocusIdx); } prevFocusIdx = curFocusIdx; */ tmp_title = getItemInfo(getFocusItemIndex(), "title"); if (tmp_title == "$[SETUP_MENU]") { curFocusIdx = -1; setFocusItemIndex(curFocusIdx); setItemFocus(curFocusIdx); } tmp_title = null; backdoor = "null"; redrawDisplay(); print("---------------------------------------------- right key"); "false"; } else if ("one" == userInput) { backdoor = "one"; } else if ("zero" == userInput) { if (backdoor == "one") backdoor = "zero"; else backdoor = "null"; } else if ("two" == userInput) { if (backdoor == "zero") backdoor = "two"; else backdoor = "null"; } else if ("five" == userInput) { if (backdoor == "two") { backdoor = "five"; MeleFirmwareRevision(); "false"; } else backdoor = "null"; } else{ backdoor = "null"; print("====== process key: ", userInput); "false"; } HomeMenu ./home_menu/skin4/scripts/HomeMenu.rss $[DTV] ./home_menu/skin4/image/Home_DTV $[ims_vt_FAV] ./home_menu/skin4/image/Home_Favorites $[IMS_FILE_MANAGER] ./home_menu/skin4/image/Home_FileManager $[GBROWSER_MOVIE] ./home_menu/skin4/image/Home_Movie DB $[GBROWSER_MUSIC] ./home_menu/skin4/image/Home_Music DB $[GBROWSER_PICTURE] ./home_menu/skin4/image/Home_Photo DB Karaoke ./home_menu/skin4/image/Home_Karaoke $[IMS_APP] ./home_menu/skin4/image/Home_Internet moServices ./home_menu/skin4/image/mos Просмотр IPTV, интернет-радио ./home_menu/skin4/image/iptv $[IMS_ANDROID] ANDROID home_menu/skin4/image/Home_Android $[IMS_WEB_BROWSER] ANDROID home_menu/skin4/image/Home_Android_WebBrowser $[IMS_WEB_BROWSER] home_menu/skin4/image/Home_Android_WebBrowser $[SETUP_MENU] ./home_menu/skin4/image/Home_Setup VersionNum = "0"; UpgStoragePath = getStoragePath("key") + "UpgradeVersion.dat"; VersionArray = readStringFromFile(UpgStoragePath); StrVersion = null; if (VersionArray == null){ executeScript("UpdateVersion"); }else{ StrVersion = getStringArrayAt(VersionArray, 0); if(StrVersion != VersionNum){ executeScript("UpdateVersion"); } } print("========================== UpgradeCheck", VersionNum ," ================"); print(" original:", StrVersion); print(" new:", VersionNum); VersionArray = null; VersionArray = pushBackStringArray(VersionArray, VersionNum); writeStringToFile(UpgStoragePath, VersionArray); print("delete setting files"); print("============================================================="); DelPath = getStoragePath("key") + "MoviesSelects.dat"; DeleteFile(DelPath); DelPath = getStoragePath("key") + "MusicSelects.dat"; DeleteFile(DelPath); DelPath = getStoragePath("key") + "PicturePlayingSelects.dat"; DeleteFile(DelPath); DelPath = getStoragePath("key") + "PictureSelects.dat"; DeleteFile(DelPath); DelPath = getStoragePath("key") + "DeviceSelects.dat"; DeleteFile(DelPath);