diff options
author | Grigorii Zimin <gzimin@luxoft.com> | 2020-03-25 09:29:13 +0300 |
---|---|---|
committer | Grigorii Zimin <gzimin@luxoft.com> | 2020-03-30 08:33:37 +0000 |
commit | 7119776b24ff3249c5baad3eecd7ea177ea228cb (patch) | |
tree | 79fb295d150c7051145b0b7204d937735c4531be /apps | |
parent | 920d9f9f290a3915518da05bc5d4b9ee1de904ad (diff) |
[map] add check for opengl context
this change allows to not show a map, which requires created OpenGL
context, and so to prevent a user' interaction with the missed map content
Fixes: AUTOSUITE-1402
Change-Id: I12f3468624cff4f69edfaa748a450bd7f616eef3
Reviewed-by: Egor Nemtsev <enemtsev@luxoft.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/com.pelagicore.map/Main.qml | 1 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/proxy-CC-dark.png | 3 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/proxy-CC.png | 3 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/proxy-cluster-dark.png | 3 | ||||
-rw-r--r-- | apps/com.pelagicore.map/assets/proxy-cluster.png | 3 | ||||
-rw-r--r-- | apps/com.pelagicore.map/panels/ProxyErrorPanel.qml | 89 | ||||
-rw-r--r-- | apps/com.pelagicore.map/panels/qmldir | 1 | ||||
-rw-r--r-- | apps/com.pelagicore.map/stores/MapStore.qml | 4 | ||||
-rw-r--r-- | apps/com.pelagicore.map/views/ICMapView.qml | 13 | ||||
-rw-r--r-- | apps/com.pelagicore.map/views/MapView.qml | 10 |
10 files changed, 130 insertions, 0 deletions
diff --git a/apps/com.pelagicore.map/Main.qml b/apps/com.pelagicore.map/Main.qml index 17d6b6d4..d202d2de 100644 --- a/apps/com.pelagicore.map/Main.qml +++ b/apps/com.pelagicore.map/Main.qml @@ -147,6 +147,7 @@ QtObject { id: applicationICWindowComponent ICMapView { id: icMapView + allowMapRendering: mainMap.store.allowMapRendering anchors.fill: parent mapPlugin: mainMap.store.mapPlugin mapCenter: mainMap.mapCenter diff --git a/apps/com.pelagicore.map/assets/proxy-CC-dark.png b/apps/com.pelagicore.map/assets/proxy-CC-dark.png new file mode 100644 index 00000000..03044fd7 --- /dev/null +++ b/apps/com.pelagicore.map/assets/proxy-CC-dark.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd86430354edacd310c9320267915b5b644f42e2c1bf33ad2b45259601171196 +size 352776 diff --git a/apps/com.pelagicore.map/assets/proxy-CC.png b/apps/com.pelagicore.map/assets/proxy-CC.png new file mode 100644 index 00000000..d715ce96 --- /dev/null +++ b/apps/com.pelagicore.map/assets/proxy-CC.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce4dc9a3855e7b81e410ff81ff4dc5320cfc0cb7a2e1ed3ab3e14752c7ac386d +size 439601 diff --git a/apps/com.pelagicore.map/assets/proxy-cluster-dark.png b/apps/com.pelagicore.map/assets/proxy-cluster-dark.png new file mode 100644 index 00000000..f3212b08 --- /dev/null +++ b/apps/com.pelagicore.map/assets/proxy-cluster-dark.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac10655ea68c4f2180d36d836fae17501798ae72a538f3649e11561d11e83d81 +size 925461 diff --git a/apps/com.pelagicore.map/assets/proxy-cluster.png b/apps/com.pelagicore.map/assets/proxy-cluster.png new file mode 100644 index 00000000..dbe59581 --- /dev/null +++ b/apps/com.pelagicore.map/assets/proxy-cluster.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ccea24d5c04263cc63e8f2509b03575fd09e636101d7ec76a11e9a5aaf97d45 +size 1055668 diff --git a/apps/com.pelagicore.map/panels/ProxyErrorPanel.qml b/apps/com.pelagicore.map/panels/ProxyErrorPanel.qml new file mode 100644 index 00000000..9beec9bb --- /dev/null +++ b/apps/com.pelagicore.map/panels/ProxyErrorPanel.qml @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2020 Luxoft Sweden AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.14 +import QtQuick.Controls 2.14 + +import shared.utils 1.0 +import shared.Style 1.0 +import shared.Sizes 1.0 +import shared.animations 1.0 + +import "../helpers" 1.0 + +Item { + id: root + + property bool clusterWindow: false + property alias errorText: errorLabel.text + + clip: true + + Image { + width: root.clusterWindow + ? Sizes.dp(Config.instrumentClusterWidth) + : Sizes.dp(Config.centerConsoleWidth) + height: root.clusterWindow + ? Sizes.dp(Config.instrumentClusterWidth / Config.instrumentClusterUIAspectRatio) + : Sizes.dp(Config.centerConsoleHeight) + + anchors.centerIn: root + source: root.clusterWindow + ? Helper.localAsset("proxy-cluster", Style.theme) + : Helper.localAsset("proxy-CC", Style.theme) + } + + Image { + anchors.fill: root + source: Helper.localAsset("bg-home-navigation-overlay", Style.theme) + visible: root.clusterWindow && mainWindow.neptuneState === "Maximized" + scale: mainWindow.neptuneState === "Maximized" ? 1.2 : 1.6 + Behavior on scale { + DefaultNumberAnimation { } + } + } + + Label { + id: errorLabel + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + font.pixelSize: Sizes.fontSizeM + font.bold: true + + anchors.topMargin: root.clusterWindow + ? root.height / 2 + : mainWindow.currentHeight / 2 + + Behavior on anchors.topMargin { + DefaultNumberAnimation { } + } + } +} diff --git a/apps/com.pelagicore.map/panels/qmldir b/apps/com.pelagicore.map/panels/qmldir index eb37c5c4..b73edbb7 100644 --- a/apps/com.pelagicore.map/panels/qmldir +++ b/apps/com.pelagicore.map/panels/qmldir @@ -6,3 +6,4 @@ MapHeaderPanel 1.0 MapHeaderPanel.qml NavigationConfirmPanel 1.0 NavigationConfirmPanel.qml NavigationSearchPanel 1.0 NavigationSearchPanel.qml SearchOverlayPanel 1.0 SearchOverlayPanel.qml +ProxyErrorPanel 1.0 ProxyErrorPanel.qml diff --git a/apps/com.pelagicore.map/stores/MapStore.qml b/apps/com.pelagicore.map/stores/MapStore.qml index 33f91594..5694e867 100644 --- a/apps/com.pelagicore.map/stores/MapStore.qml +++ b/apps/com.pelagicore.map/stores/MapStore.qml @@ -36,6 +36,7 @@ import QtPositioning 5.9 import QtLocation 5.9 import Qt.labs.platform 1.0 import shared.utils 1.0 +import shared.com.pelagicore.systeminfo 1.0 QtObject { id: root @@ -55,6 +56,9 @@ QtObject { } } + readonly property SystemInfo systemInfo: SystemInfo {} + readonly property bool allowMapRendering: sysinfo.allowOpenGLContent + property var positionCoordinate: QtPositioning.coordinate(48.135771, 11.574052) // Munich property var originalPosition: positionCoordinate readonly property string defaultLightThemeId: "mapbox://styles/qtauto/cjcm1by3q12dk2sqnquu0gju9" diff --git a/apps/com.pelagicore.map/views/ICMapView.qml b/apps/com.pelagicore.map/views/ICMapView.qml index 5c9c5e1f..d13fccf8 100644 --- a/apps/com.pelagicore.map/views/ICMapView.qml +++ b/apps/com.pelagicore.map/views/ICMapView.qml @@ -40,6 +40,7 @@ import shared.Style 1.0 import shared.Sizes 1.0 import "../helpers" 1.0 +import "../panels" 1.0 Item { id: root @@ -52,6 +53,7 @@ Item { property alias activeMapType: mainMap.activeMapType property var path property var mapPlugin + property bool allowMapRendering property string nextTurnDistanceMeasuredIn @@ -113,6 +115,7 @@ Item { zoomLevel: 10 plugin: root.mapPlugin copyrightsVisible: false + visible: root.allowMapRendering MapPolyline { id: pathView @@ -184,4 +187,14 @@ Item { } } } + + Loader { + active: !root.allowMapRendering + anchors.fill: root + sourceComponent: ProxyErrorPanel { + anchors.fill: parent + clusterWindow: true + errorText: qsTr("The map is disabled in this runtime environment") + } + } } diff --git a/apps/com.pelagicore.map/views/MapView.qml b/apps/com.pelagicore.map/views/MapView.qml index e435e009..87790d03 100644 --- a/apps/com.pelagicore.map/views/MapView.qml +++ b/apps/com.pelagicore.map/views/MapView.qml @@ -101,6 +101,7 @@ Item { MapBoxPanel { id: mapBoxPanel + visible: root.store.allowMapRendering anchors.fill: parent plugin: root.store.mapPlugin center: root.store.positionCoordinate @@ -163,6 +164,15 @@ Item { onMaximizeMap: root.maximizeMap(); } + Loader { + active: !root.store.allowMapRendering + anchors.fill: root + sourceComponent: ProxyErrorPanel { + anchors.fill: parent + errorText: qsTr("The map is disabled in this runtime environment") + } + } + FastBlur { anchors.fill: mapBoxPanel source: mapBoxPanel |