import QtQuick 2.0 import Label 2.0 import "../AppLink/Com" import "../windowsList.js" as WindowsList import "../layoutList.js" as Layout Image{ id: app_home x: 0 y: 0 width: 960 height: 960 property string imagePath: "/usr/bin/qml_link/images/AppLink/" source: systemCtrlLink.getBackGroundType() property bool bConnected : true property bool bPackageInPhone:false property bool bInstalling: false property string localVersion: "" //Ver0.100.00-V4.00.001" property string upgradeVersion: "" property bool bcheckdone: false property bool bCloseUpgrade:false property int listCurIndex: 0 property bool bSetPayInfo: false Component.onCompleted:{ applinkControl.QML_NotifyStartOK() delay_connect_status_timer.start(); } onVisibleChanged:{ if(visible){ if(!bCloseUpgrade) { wait_timer.start() } bConnected = applinkControl.QML_GetSppLinkStatus(); if (!bcheckdone) { //upgrade_timer.start() if (bConnected) { localVersion = applinkControl.GetLocalVersion() applinkControl.QML_NIF_Ver_CheckUpgradePkg(localVersion) } } applinkControl.QML_ChangeLinkMapShowStatus(0) applinkControl.QML_NotifyFlickForbidFlag(0) } } ListModel { id: instructionModelCn ListElement{ col0: "1.iPhone手机可进入App Store,下载“九州行地图【互联版】”,并安装;" col1: "/usr/bin/qml_link/images/AppLink/Type_I_Home/I_02_Home/M8X_Instructions_01-1_iPhone.png" col2: "" } ListElement{ col0: "或者扫描该二维码,下载“九州行地图【互联版】”,并安装。" col1: "/usr/bin/qml_link/images/AppLink/Type_I_Home/I_02_Home/M8X_Instructions_01-2_iPhone.png" col2: "" } ListElement{ col0: "2.安卓手机可进入应用宝,下载“九州行地图互联版”,并安装。" col1: "/usr/bin/qml_link/images/AppLink/Type_I_Home/I_02_Home/M8X_Instructions_01-2_Android.png" col2: "" } ListElement{ col0: "或者扫描该二维码,下载“九州行地图【互联版】”,并安装。" col1: "/usr/bin/qml_link/images/AppLink/Type_I_Home/I_02_Home/M8X_Instructions_02-2_Android.png" col2: "" } ListElement{ col0: "3.使用USB数据线连接手机和车机后,可进入智能互联界面。" col1: "/usr/bin/qml_link/images/AppLink/Type_I_Home/I_02_Home/M8X_Instructions_03_Android.png" col2: "/usr/bin/qml_link/images/AppLink/Type_I_Home/I_02_Home/M8X_Instructions_USB.png" } ListElement{ col0: "备注:车机和手机通过蓝牙建立连接后,车机端才能够播放手机端声音。" col1: "/usr/bin/qml_link/images/AppLink/Type_I_Home/I_02_Home/M8X_Instructions_Notes_02.png" col2: "/usr/bin/qml_link/images/AppLink/Type_I_Home/I_02_Home/M8X_Instructions_BT.png" } } ListModel { id: instructionModelEn ListElement{ col0: "1.IPhone users can enter App Store to download and install \"九州行地图【互联版】\" APP by phone side." col1: "/usr/bin/qml_link/images/AppLink/Type_I_Home/I_02_Home/M8X_Instructions_01-1_iPhone.png" col2: "" } ListElement{ col0: "Users can scan the QR code to download and install \"九州行地图【互联版】\" APP also." col1: "/usr/bin/qml_link/images/AppLink/Type_I_Home/I_02_Home/M8X_Instructions_01-2_iPhone.png" col2: "" } ListElement{ col0: "2.Android users can enter \"应用宝\" to download and install \"九州行地图互联版\" APP by phone side." col1: "/usr/bin/qml_link/images/AppLink/Type_I_Home/I_02_Home/M8X_Instructions_01-2_Android.png" col2: "" } ListElement{ col0: "Users can scan the QR code to download and install \"九州行地图【互联版】\" APP also." col1: "/usr/bin/qml_link/images/AppLink/Type_I_Home/I_02_Home/M8X_Instructions_02-2_Android.png" col2: "" } ListElement{ col0: "3.Use the USB data cable to connect the phone and car, and then entry i-Link APP interface." col1: "/usr/bin/qml_link/images/AppLink/Type_I_Home/I_02_Home/M8X_Instructions_03_Android.png" col2: "/usr/bin/qml_link/images/AppLink/Type_I_Home/I_02_Home/M8X_Instructions_USB.png" } ListElement{ col0: "Note:When the phone and car are connected via BT, car side play mobile phone voice." col1: "/usr/bin/qml_link/images/AppLink/Type_I_Home/I_02_Home/M8X_Instructions_Notes_02.png" col2: "/usr/bin/qml_link/images/AppLink/Type_I_Home/I_02_Home/M8X_Instructions_BT.png" } } ListView{ id:disconnectInstruction visible:!bConnected y:73 width:parent.width height:804 model:applinkControl.getLanguageType()==true?instructionModelCn:instructionModelEn delegate:instructionDelegate snapMode:ListView.SnapToItem clip:true boundsBehavior: Flickable.StopAtBounds //highlightRangeMode: ListView.StrictlyEnforceRange onMovementStarted: { refreshList.restart() } onMovementEnded:{ refreshList.stop() disconnectInstruction.currentIndex = disconnectInstruction.indexAt(disconnectInstruction.contentX,disconnectInstruction.contentY); if(listCurIndex != disconnectInstruction.currentIndex){ listCurIndex = disconnectInstruction.currentIndex; applinkControl.QML_NotifyDisconnectTextIndex(disconnectInstruction.currentIndex); } } onFlickEnded:{ refreshList.stop() } onFlickStarted:{ refreshList.restart() } // onCurrentIndexChanged:{ // console.log("---[applink]-----disconnect text index is "+disconnectInstruction.currentIndex) // applinkControl.QML_NotifyDisconnectTextIndex(disconnectInstruction.currentIndex); // } Timer{ id:refreshList interval: 800 repeat: true running: false onTriggered: { if(disconnectInstruction.visible) { disconnectInstruction.visible = false disconnectInstruction.visible = true } } } } Component{ id:instructionDelegate Item{ x:0 y:73 width:960 height: 402 visible:!bConnected Text{ id:instructionText font.pixelSize: 30 wrapMode: Text.WordWrap color: "white" anchors.left: parent.left anchors.leftMargin: 120 anchors.top: parent.top anchors.topMargin: 32 horizontalAlignment:Text.AlignLeft width:420 height:270 lineHeightMode:Text.FixedHeight lineHeight:60.0 font.family:applinkControl.getLanguageType()? "方正兰亭黑简体":"Arial" text:col0 } Image{ id:instructionImg1 anchors.right: parent.right anchors.rightMargin: 114 anchors.top: parent.top anchors.topMargin: 0 source:col1 } Image{ id:instructionImg2 anchors.left: parent.left anchors.leftMargin: 177 anchors.bottom: parent.bottom anchors.bottomMargin: 93 source:col2 } Connections{ target:applinkControl onSignalLanguageChanged:{ console.log("----[applink]----home disconnect delegate language changed--") instructionText.font.family = applinkControl.getLanguageType()? "方正兰亭黑简体":"Arial" } } } } HMIButton{ id: naviBtn visible:bConnected x:158 y:238-160 btnImg: imagePath+"Type_I_Home/I_02_Home/M8X_icon_Navi.png" btnImgOnPressed: imagePath+"Type_I_Home/I_02_Home/M8X_icon_Navi_p.png" onClicked:{ if(applinkControl.QML_GetSppLinkWarningStatus()==1){ ScreenManager.forward(Layout.APPLINK,WindowsList.APP_LOCATION); }else{ ScreenManager.forward(Layout.APPLINK,WindowsList.APP_NAVI_WARNING); } applinkControl.QML_NotifyNaviEnterned(); } } HMILabel{ x:152 y:417-160 font.pixelSize:26 width:156 height:28 text: qsTr("导航") + applinkControl.qsEmptyString clip:true visible:bConnected } HMIButton{ id: weatherBtn visible:bConnected x:408 y:238-160 btnImg: imagePath+"Type_I_Home/I_02_Home/M8X_icon_Weather.png" btnImgOnPressed: imagePath+"Type_I_Home/I_02_Home/M8X_icon_Weather_p.png" onClicked:{ ScreenManager.forward(Layout.APPLINK,WindowsList.APP_WEATHERINFOR); } } HMILabel{ x:402 y:417-160 font.pixelSize:26 width:156 height:28 text: qsTr("天气") + applinkControl.qsEmptyString color: "white" clip:true visible:bConnected } HMIButton{ id: newsBtn visible:bConnected x:658 y:238-160 btnImg: imagePath+"Type_I_Home/I_02_Home/M8X_icon_News.png" btnImgOnPressed: imagePath+"Type_I_Home/I_02_Home/M8X_icon_News_p.png" onClicked:{ applinkControl.QML_RemoveNewsChannel() applinkControl.QML_RemoveNewsTitle() applinkControl.QML_NIF_NEWS_RequestNewsChannels() ScreenManager.forward(Layout.APPLINK,WindowsList.APP_NEWSCLASS); } } HMILabel{ x:652 y:417-160 font.pixelSize:26 width:156 height:28 text: qsTr("新闻") + applinkControl.qsEmptyString color: "white" clip:true visible:bConnected } HMIButton{ id: fmBtn visible:bConnected x:158 y:508-160 btnImg: imagePath+"Type_I_Home/I_02_Home/M8X_icon_Himalayan.png" btnImgOnPressed: imagePath+"Type_I_Home/I_02_Home/M8X_icon_Himalayan_p.png" onClicked:{ applinkControl.RemoveXMsSrhAlbumsListModel() applinkControl.RemoveXMsSrhSoundListModel() applinkControl.QML_RemoveRadioChannel() // if(2 != applinkControl.QML_GetSourceCtrlType()){ // applinkControl.QML_NIF_XM_RequesResumeTrackPlay(); // applinkControl.QML_NIF_XM_RequestResumeRadioPlay(); // } ScreenManager.forward(Layout.APPLINK,WindowsList.APP_HIMALAYAN_FUNCTIONLIST); } } HMILabel{ x:152 y:687-160 font.pixelSize:26 width:156 height:28 text: qsTr("电台") + applinkControl.qsEmptyString color: "white" clip:true visible:bConnected } HMIButton{ id: bdBtn visible:bConnected x:408 y:508-160 btnImg: imagePath+"Type_I_Home/I_02_Home/M8X_icon_baidumusic.png" btnImgOnPressed: imagePath+"Type_I_Home/I_02_Home/M8X_icon_baidumusic_p.png" onClicked:{ applinkControl.QML_NIF_Baidu_LoadSearchKeywordList() applinkControl.QML_NIF_Baidu_RequestSongList() ScreenManager.forward(Layout.APPLINK,WindowsList.APP_BAIDUMUSIC_SEARCHMAIN) } } HMILabel{ x:402 y:687-160 font.pixelSize:26 width:156 height:28 text: qsTr("音乐") + applinkControl.qsEmptyString color: "white" clip:true visible:bConnected } Text{ id:disconnectTitle font.pixelSize: 30 visible:!bConnected color: "white" y:25 anchors.horizontalCenter: parent.horizontalCenter font.family:applinkControl.getLanguageType()? "方正兰亭黑简体":"Arial" text:qsTr("连接说明") + applinkControl.qsEmptyString } App_Com_Popup2msg2btn{ id:popMsg_checkVer newspopText1: qsTr("发现新版本,是否升级?") + applinkControl.qsEmptyString newspopText2: qsTr("新版本: XXXXXXXXX") + applinkControl.qsEmptyString btnTextLeft: qsTr("是") + applinkControl.qsEmptyString btnTextRight: qsTr("否") + applinkControl.qsEmptyString onSignal_btnLeftClick:{ popMsg_checkVer.visible = false applinkControl.QML_NIF_Ver_GetUpgradePkg(upgradeVersion) if (bPackageInPhone) { bInstalling = true } popMsg_doInstall.visible = true loadingIcon.visible = true } } App_Com_Popup2btn{ id:popMsg_upgradeFailed newspopText: qsTr("下载失败,是否重试?") + applinkControl.qsEmptyString btnTextLeft: qsTr("是") + applinkControl.qsEmptyString btnTextRight: qsTr("否") + applinkControl.qsEmptyString onSignal_btnLeftClick:{ popMsg_upgradeFailed.visible=false popMsg_doInstall.visible = true loadingIcon.visible = true applinkControl.QML_NIF_Ver_GetUpgradePkg(upgradeVersion) } } App_Com_Newspopup{ id:popMsg_doInstall z: 3 labelCount: 2 newspopText1: qsTr("升级包下载中...") + applinkControl.qsEmptyString newspopText2: qsTr("请不要进行其他操作!") + applinkControl.qsEmptyString visible:false bIsTouchClear:false bHasBackgroundImage : false yOffset : -75 } App_Loading{ id:loadingIcon z: 4 loadingPath: imagePath+"Common/Loading_60/" surname: "M8X_Loading_60_" anchors.horizontalCenter:parent.horizontalCenter anchors.top: parent.top anchors.topMargin: 450 visible:false } Timer{ id:wait_timer interval: 5000 onTriggered: { applinkControl.closeApplinkupgrade() bCloseUpgrade = true } } Timer{ id:delay_connect_status_timer interval:3000 onTriggered:{ bConnected = applinkControl.QML_GetSppLinkStatus() bdBtn.visible = bConnected naviBtn.visible = bConnected weatherBtn.visible = bConnected newsBtn.visible = bConnected fmBtn.visible = bConnected if (bConnected) { applinkControl.QML_NotifyConnectStatus() setpayinfo_timer.start() applinkControl.QML_NIF_Tmcpay_SetPayInfo(applinkControl.QML_GetTmcPaySetStr()) } } } Timer{ id:setpayinfo_timer interval: 2000 repeat: true onTriggered: { if (!bSetPayInfo) { applinkControl.QML_NIF_Tmcpay_SetPayInfo(applinkControl.QML_GetTmcPaySetStr()) } else { setpayinfo_timer.stop() } } } //底部动能栏 Row{ id: functionArea y:1041-160 HMIButton{ id: quitBtn btnImgOnPressed: imagePath +"Common/M8X_Function_close_Button_p.png" btnImg: imagePath+"Common/M8X_Function_close_Button.png" btnIcon: imagePath+"Common/M8X_icon_close.png" onClicked:{ applinkControl.QML_CloseAppLink() } } HMIButton{ id: nosw enabled: false btnImgOnPressed: imagePath +"M8X_Function_1_Button_p.png" btnImg: imagePath+"M8X_Function_1_Button.png" } HMIButton{ id: halfBtn btnImgOnPressed: imagePath +"Common/M8X_Function_close_Button_p.png" btnImg: imagePath+"Common/M8X_Function_close_Button.png" btnIcon: imagePath+"Type_I_Home/I_02_Home/M8X_icon_shrink.png" onClicked:{ applinkControl.QML_ChangeToHalfMode(); } } } HMIWindowLine{ } Connections{ target:applinkControl onSignal_sspLinkStatusChanged:{ //bConnected = bIsConnectPhone; if(bIsConnectPhone){ bcheckdone = false delay_connect_status_timer.start(); }else{ bConnected = false bdBtn.visible = bConnected naviBtn.visible = bConnected weatherBtn.visible = bConnected newsBtn.visible = bConnected fmBtn.visible = bConnected popMsg_checkVer.visible = false popMsg_upgradeFailed.visible = false popMsg_doInstall.visible = false loadingIcon.visible = false bSetPayInfo = false applinkControl.QML_SetPlayType(2) applinkControl.QML_Baidu_SetIsPlay(false) applinkControl.QML_setSearchSoundPlay(false) applinkControl.QML_SetCurrentPlayApp(0) } } onSignal_TMC_SetPayInfo_Success:{ bSetPayInfo = true if (!bcheckdone) { localVersion = applinkControl.GetLocalVersion() applinkControl.QML_NIF_Ver_CheckUpgradePkg(localVersion) } applinkControl.QML_NotifyConnectStatus() } onSignalLanguageChanged:{ popMsg_checkVer.newspopText2 = qsTr("新版本: ") + upgradeVersion + applinkControl.qsEmptyString console.log("-------[applink]---[home]------onSignalLanguageChanged") disconnectInstruction.model = (applinkControl.getLanguageType()?instructionModelCn:instructionModelEn) disconnectTitle.font.family = applinkControl.getLanguageType()? "方正兰亭黑简体":"Arial" } onSignal_Ver_DownloadComplete:{ bcheckdone = false localVersion = applinkControl.GetLocalVersion() applinkControl.QML_NIF_Ver_CheckUpgradePkg(localVersion) } onSignal_Ver_CheckUpgradePkgEnd:{ console.log("onSignal_Ver_CheckUpgradePkgEnd") bcheckdone = true if (bIsLocal) { if (bHasUpgradePkg) { bPackageInPhone = bIsLocal upgradeVersion = upgradeVerNo popMsg_checkVer.newspopText2 = qsTr("新版本: ") + upgradeVersion + applinkControl.qsEmptyString popMsg_checkVer.visible = true } } } onSignal_Ver_GetUpgradePkgEnd:{ console.log("onSignal_Ver_GetUpgradePkgEnd") if (!bSucc) { popMsg_doInstall.visible = false loadingIcon.visible = false if (bConnected) { popMsg_upgradeFailed.visible = true } } else { if (bFinish) { applinkControl.QML_Save_Version() applinkControl.startApplinkupgrade(); } } } onSignal_Sys_StartLinkUpgrade:{ console.log("-------------applink----------start upgrade----------------------------") popMsg_doInstall.visible = false loadingIcon.visible = false applinkControl.QML_ShowAppLinkUpgrade() } onSignalChangeToFullMode:{ console.log("------[applink]--------change to Full Mode-------------------------") switch(uiAppID) { case 1: if(applinkControl.QML_GetSppLinkWarningStatus()==1){ ScreenManager.forward(Layout.APPLINK,WindowsList.APP_LOCATION); }else{ ScreenManager.forward(Layout.APPLINK,WindowsList.APP_NAVI_WARNING); } applinkControl.QML_NotifyNaviEnterned(); break; case 2: ScreenManager.forward(Layout.APPLINK,WindowsList.APP_WEATHERINFOR); break; case 3: applinkControl.QML_RemoveNewsChannel() applinkControl.QML_RemoveNewsTitle() applinkControl.QML_NIF_NEWS_RequestNewsChannels() ScreenManager.forward(Layout.APPLINK,WindowsList.APP_NEWSCLASS); break; case 4: applinkControl.RemoveXMsSrhAlbumsListModel() applinkControl.RemoveXMsSrhSoundListModel() applinkControl.QML_RemoveRadioChannel() ScreenManager.forward(Layout.APPLINK,WindowsList.APP_HIMALAYAN_FUNCTIONLIST); break; case 5: applinkControl.QML_NIF_Baidu_LoadSearchKeywordList() applinkControl.QML_NIF_Baidu_RequestSongList() ScreenManager.forward(Layout.APPLINK,WindowsList.APP_BAIDUMUSIC_SEARCHMAIN) break; default: break; } } onSignalChangeBackground:{ app_home.source = qstrPath } onSignalLinkAppVisibleStatus:{ if(visible && (1 === iShowStatus)){ app_home.source = systemCtrlLink.getBackGroundType() } } onSignalDisconnectTextIndexChanged:{ console.log("-----[applink]----onSignalDisconnectTextIndexChanged---") //disconnectInstruction.currentIndex = iTextIndex; disconnectInstruction.positionViewAtIndex(iTextIndex,ListView.Beginning) listCurIndex = iTextIndex; } } }