diff options
author | Nedim Hadzic <nedim.hadzic@pelagicore.com> | 2016-07-20 15:58:46 +0200 |
---|---|---|
committer | Nedim Hadzic <nedim.hadzic@pelagicore.com> | 2016-07-21 11:00:47 +0000 |
commit | 9b58bf335a9e0b23315339f5b333a8f84bd4b12d (patch) | |
tree | f5dedd1db1c0482ac850944ac44253a9a29c8bce | |
parent | 3d36a7b8e53770c91db60cec9586ef572a2f2814 (diff) | |
download | neptune-ui-9b58bf335a9e0b23315339f5b333a8f84bd4b12d.tar.gz |
Added special base screen for navigation app
Since navigation app takes the widget part on the
home screen, it has additional surface. Another
base was created so other apps do not initialize
surfaces and properties which they wont use.
Change-Id: Ie1bace5dcf47f8a6ec0fecc722e25d83ecc70a3c
Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
-rw-r--r-- | README.md | 7 | ||||
-rw-r--r-- | modules/utils/AppUIScreen.qml | 65 | ||||
-rw-r--r-- | modules/utils/NavigationUIScreen.qml | 90 | ||||
-rw-r--r-- | sysui/LaunchController.qml | 40 |
4 files changed, 103 insertions, 99 deletions
@@ -2,6 +2,7 @@ Qt >= 5.5 Unix system +Application Manager # Folder Structure @@ -28,11 +29,7 @@ qmlscene/qmllive - have been moved to the application-manager repository. * Run scripts within the plugins/scripts folder to scan the media on the system -# Run entire UI - - $ qmlscene -I modules/ -I /path/to/application-manager/dummyimports/ MainWithCluster.qml - -or with the Application Manager +# Run entire UI with the Application Manager $ appman --recreate-database -c $AM_CONFIG_FILE -c am-config.yaml diff --git a/modules/utils/AppUIScreen.qml b/modules/utils/AppUIScreen.qml index 62ab428..5d4ddf9 100644 --- a/modules/utils/AppUIScreen.qml +++ b/modules/utils/AppUIScreen.qml @@ -41,17 +41,12 @@ ApplicationManagerWindow { height: Style.cellHeight * 24 default property alias content: content.children - property alias widget: widgetContainer.children property alias cluster: clusterContainer.children property alias popup: popupContainer.children - property bool _widgetSet: false property bool _clusterSet: false property bool _popupSet: false - property bool isWidget: false - - onWidgetChanged: _widgetSet = true onClusterChanged: _clusterSet = true onPopupChanged: _popupSet = true @@ -62,66 +57,16 @@ ApplicationManagerWindow { pelagicoreWindow.setWindowProperty("visibility", false) } - function sendWidget() { - widget.setWindowProperty("windowType", "widgetMap") - widget.visible = true - } - function sendClusterWidget() { cluster.setWindowProperty("windowType", "clusterWidget") cluster.visible = true } - function sendPopupWidget() { - popup.setWindowProperty("windowType", "popup") - popup.visible = true - } - - function startFullScreen() { - pelagicoreWindow.setWindowProperty("goTo", "fullScreen") - } - - function showPopup() { - pelagicoreWindow.setWindowProperty("liveDrivePopupVisible", true) - } - - function hidePopup() { - pelagicoreWindow.setWindowProperty("liveDrivePopupVisible", false) - } - - function sendLiveDriveEvent(event) { - cluster.setWindowProperty("liveDriveEvent", event) - } - - function sendRouteUpdate(update) { - cluster.setWindowProperty("routeUpdate", update) - } - DisplayBackground { anchors.fill: parent } ApplicationManagerWindow { - id: widget - width: Style.cellWidth * 12 - height: Style.cellHeight * 19 - visible: false - Item { - id: widgetContainer - anchors.fill: parent - - Component.onCompleted: { - if (pelagicoreWindow._widgetSet) { - pelagicoreWindow.sendWidget() - } - else { - widget.setWindowProperty("windowType", "widgetMap") - } - } - } - } - - ApplicationManagerWindow { id: cluster width: typeof parent !== 'undefined' ? parent.width : Style.cellWidth * 24 height: typeof parent !== 'undefined' ? parent.height : Style.cellHeight * 24 @@ -181,14 +126,8 @@ ApplicationManagerWindow { onWindowPropertyChanged: { //print(":::AppUIScreen::: Window property changed", name, value) - if (name === "windowType" && value === "widget") { - pelagicoreWindow.isWidget = true - } - else if (name === "windowType" && value === "fullScreen") { - pelagicoreWindow.isWidget = false - } - else if (name === "visibility" && value === true) { - root.raiseApp() + if (name === "visibility" && value === true) { + pelagicoreWindow.raiseApp() } } } diff --git a/modules/utils/NavigationUIScreen.qml b/modules/utils/NavigationUIScreen.qml new file mode 100644 index 0000000..f2ac7aa --- /dev/null +++ b/modules/utils/NavigationUIScreen.qml @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Pelagicore AG +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune IVI 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.1 + +import QtApplicationManager 1.0 +import controls 1.0 +import utils 1.0 + +AppUIScreen { + id: root + + property alias widget: widgetContainer.children + + property bool _widgetSet: false + + property bool isInWidgetState: false + + onWidgetChanged: _widgetSet = true + + function sendWidget() { + widget.setWindowProperty("windowType", "widgetMap") + widget.visible = true + } + + + function startFullScreen() { + root.setWindowProperty("goTo", "fullScreen") + } + + ApplicationManagerWindow { + id: widget + width: Style.cellWidth * 12 + height: Style.cellHeight * 19 + visible: false + parent: root + + Item { + id: widgetContainer + anchors.fill: parent + + Component.onCompleted: { + if (root._widgetSet) { + root.sendWidget() + } + else { + widget.setWindowProperty("windowType", "widgetMap") + } + } + } + } + + onWindowPropertyChanged: { + //print(":::AppUIScreen::: Window property changed", name, value) + if (name === "windowType" && value === "widget") { + root.isInWidgetState = true + } + else if (name === "windowType" && value === "fullScreen") { + root.isInWidgetState = false + } + } +} diff --git a/sysui/LaunchController.qml b/sysui/LaunchController.qml index 603beb1..2db80eb 100644 --- a/sysui/LaunchController.qml +++ b/sysui/LaunchController.qml @@ -128,8 +128,8 @@ StackView { function windowReadyHandler(index, item) { print(":::LaunchController::: WindowManager:windowReadyHandler", index, item) - var isWidget = (WindowManager.windowProperty(item, "windowType") === "widgetMap") - print(":::LaunchController:::isWidget", isWidget) + var isInWidgetState = (WindowManager.windowProperty(item, "windowType") === "widgetMap") + print(":::LaunchController:::isWidget", isInWidgetState) var isClusterWidget = (WindowManager.windowProperty(item, "windowType") === "clusterWidget") print(":::LaunchController:::isClusterWidget", isClusterWidget) var isPopup = (WindowManager.windowProperty(item, "windowType") === "popup") @@ -138,7 +138,7 @@ StackView { var acceptWindow = true; var appID = WindowManager.get(index).applicationId; - if (isWidget) { + if (isInWidgetState) { if (ApplicationManager.get(appID).categories[0] === "navigation") { NavigationService.mapWidget = item } @@ -224,33 +224,11 @@ StackView { if (name === "visibility" && value === false) { root.pop(null) var index = WindowManager.indexOfWindow(root.windowItem) - if (ApplicationManager.dummy) { - if (WindowManager.get(index).categories === "navigation") - WindowManager.setWindowProperty(root.windowItem, "windowType", "widget") - } - else { - if (ApplicationManager.get(WindowManager.get(index).applicationId).categories[0] === "navigation") { - // Sending after pop transition is done - WindowManager.setWindowProperty(root.windowItem, "windowType", "widget") - } - } - } - else if (name === "windowType" && value === "widgetMap") { - // Workaround for qmlscene - if (ApplicationManager.dummy) { - NavigationService.mapWidget = window - } - } - else if (name === "liveDrivePopupVisible") { - AppsService.liveDrivePopup = value - if (value) { - VehicleService.fuelTimer.start() - } - } - else if (name === "windowType" && value === "clusterWidget") { - // Workaround for qmlscene - if (ApplicationManager.dummy) { - AppsService.clusterWidgetReady("other", window) + + if (ApplicationManager.get(WindowManager.get(index).applicationId).categories[0] === "navigation") { + // Sending after pop transition is done + WindowManager.setWindowProperty(root.windowItem, "windowType", "widget") + } } else if (name === "windowType" && value === "popup") { @@ -285,7 +263,7 @@ StackView { var isPopup = (WindowManager.windowProperty(item, "windowType") === "popup") print(":::LaunchController:::isClusterWidget", isClusterWidget) print(":::LaunchController:::isWidget", isWidget, isMapWidget) - print(":::LaunchController:::isPopup", isPopup) + if (!isMapWidget && !isClusterWidget && !isPopup) { WindowManager.setWindowProperty(item, "visibility", true) WindowManager.setWindowProperty(item, "windowType", "fullScreen") |