diff options
author | Robert Griebl <robert.griebl@pelagicore.com> | 2016-04-26 12:46:07 +0200 |
---|---|---|
committer | Robert Griebl <robert.griebl@pelagicore.com> | 2016-04-26 16:33:42 +0000 |
commit | 4dce2c9cd78fab068567cb9d0b3733c1c54d4989 (patch) | |
tree | 2957e9bafe83dd09f8ebb0d9c5e646c0c0ffa0de | |
parent | c405b322d773068521855e048f215c6ec59e965f (diff) | |
download | neptune-ui-4dce2c9cd78fab068567cb9d0b3733c1c54d4989.tar.gz |
Updated to work with the lastest ApplicationManager
There have been a few changes in the AM due to API reviews:
1) The API naming in WindowManager singleton was made more consistent (Window
vs. View vs. Surface)
2) The import was changed from io.qt.ApplicationManager / ApplicationInstaller
to QtApplicationManager
Apart from that, we decided that having (incompatible) AM dummy-imports in
every system-ui project does not scale: the current Neptune version was merged
into the AM repo and the copy here was removed.
Change-Id: I176d66de4071deff02533a3f6fdc811bca5c2e7c
Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com>
22 files changed, 65 insertions, 393 deletions
diff --git a/MainWithCluster.qml b/MainWithCluster.qml index ba7abf8..057141d 100644 --- a/MainWithCluster.qml +++ b/MainWithCluster.qml @@ -31,7 +31,7 @@ import QtQuick 2.1 import QtQuick.Window 2.1 -import io.qt.ApplicationManager 1.0 +import QtApplicationManager 1.0 import com.pelagicore.ScreenManager 1.0 import utils 1.0 import "sysui/Cluster" @@ -51,7 +51,7 @@ Main { Cluster {} Component.onCompleted: { - WindowManager.registerOutputWindow(cluster) + WindowManager.registerCompositorView(cluster) Style.withCluster = true ScreenManager.setScreen(cluster, 1) cluster.show() @@ -8,9 +8,12 @@ Unix system * modules - QML modules and assets to be imported (e.g. import controls 1.0) * boards - visual ui tests for easier development * apps - container for the different applications used within the system UI -* am-dummyimports - Application Manager dummy imports for running within qmlscene * plugins - QML and other plugins needed for fully functional UI (e.g. reading the media from database) +Please note that am-dummyimports - the Application Manager dummy imports for running within +qmlscene/qmllive - have been moved to the application-manager repository. + + # Preparation * You need to have Source Sans Pro font installed (see assets folder within the modules) @@ -27,7 +30,7 @@ Unix system # Run entire UI - $ qmlscene -I modules/ -I am-dummyimports/ DimAndCsd.qml + $ qmlscene -I modules/ -I /path/to/application-manager/dummyimports/ MainWithCluster.qml or with the Application Manager diff --git a/am-dummyimports/io/qt/ApplicationInstaller/ApplicationInstaller.js b/am-dummyimports/io/qt/ApplicationInstaller/ApplicationInstaller.js deleted file mode 100644 index 5911557..0000000 --- a/am-dummyimports/io/qt/ApplicationInstaller/ApplicationInstaller.js +++ /dev/null @@ -1,35 +0,0 @@ -/**************************************************************************** -** -** 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 -** -****************************************************************************/ - -function removePackage(id) { - print("Dummy implementation of removePackage was called for ", id) - return "" -} diff --git a/am-dummyimports/io/qt/ApplicationInstaller/qmldir b/am-dummyimports/io/qt/ApplicationInstaller/qmldir deleted file mode 100644 index d4725ce..0000000 --- a/am-dummyimports/io/qt/ApplicationInstaller/qmldir +++ /dev/null @@ -1 +0,0 @@ -ApplicationInstaller 1.0 ApplicationInstaller.js diff --git a/am-dummyimports/io/qt/ApplicationManager/ApplicationManager.qml b/am-dummyimports/io/qt/ApplicationManager/ApplicationManager.qml deleted file mode 100644 index a46e9b7..0000000 --- a/am-dummyimports/io/qt/ApplicationManager/ApplicationManager.qml +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** -** -** 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 -** -****************************************************************************/ -pragma Singleton -import QtQuick 2.2 - -ListModel { - id: root - - property int count: 3 - property bool dummy: true - - property var applibrary : [ - ["com.pelagicore.browser","icon.png", "Browser", "browser", "Browser.qml"], - ["com.pelagicore.movies","icon.png", "Movies", "media", "Movies.qml"], - ["com.pelagicore.music","icon.png", "Music", "media", "Music.qml"], - ] - - signal emitSurface(int index, Item item) - - - - function setApplicationAudioFocus(appId, appFocus) - { - print("setApplicationAudioFocus(" + appId + ", " + appFocus + ")") - } - - function qmltypeof(obj, className) { // QtObject, string -> bool - // className plus "(" is the class instance without modification - // className plus "_QML" is the class instance with user-defined properties - var str = obj.toString(); - return str.indexOf(className + "(") == 0 || str.indexOf(className + "_QML") == 0; - } - - function startApplication(id) { - print("Starting the application. ") - var component - var item - for (var i = 0; i < root.count; i++) { - var entry - print("ApplicationManager: " + createAppEntry(i).applicationId + " given app id to open: " + id) - if (root.get(i).applicationId === id) { - component = Qt.createComponent("../../../../apps/" + createAppEntry(i).applicationId + "/" + createAppEntry(i).qml); - if (component.status === Component.Ready) { - item = component.createObject() - if (!item) - console.log("Failed to create an Object.") - else { - print("Starting the application. Sending a signal", i, item, item.children.length) - root.setProperty(i, "surfaceItem", item) - root.emitSurface(i, item) - } - } - else - console.log("Component creation failed " + createAppEntry(i).qml + " Error: " + component.errorString()) - } - } - } - - - - function createAppEntry(i) { - - var entry = { - applicationId: applibrary[i][0], - icon: "../../apps/" + applibrary[i][0] + "/" + applibrary[i][1], - name: applibrary[i][2], - isRunning: false, - isStarting: false, - isActive: false, - isBlocked: false, - isUpdating: false, - isRemovable: false, - updateProgress: 0, - codeFilePath: "", - categories: applibrary[i][3], - qml: applibrary[i][4], - surfaceItem: null - } - return entry - } - Component.onCompleted: { - clear() - for (var i = 0; i < root.count; i++) { - append(createAppEntry(i)) - } - } - -} diff --git a/am-dummyimports/io/qt/ApplicationManager/ApplicationManagerWindow.qml b/am-dummyimports/io/qt/ApplicationManager/ApplicationManagerWindow.qml deleted file mode 100644 index 470588e..0000000 --- a/am-dummyimports/io/qt/ApplicationManager/ApplicationManagerWindow.qml +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** 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.0 -import io.qt.ApplicationManager 1.0 - -Item { - id: root - width: 768 - height: 860 - property color color - - signal windowPropertyChanged(string name, var value) - signal close() - //function showFullScreen() {} - function showMaximized() {} - function showNormal() {} - function setWindowProperty(status, value) { - WindowManager.surfaceWindowPropertyChanged(root, status, value) - windowPropertyChanged(status, value) - } -} diff --git a/am-dummyimports/io/qt/ApplicationManager/SystemMonitor.qml b/am-dummyimports/io/qt/ApplicationManager/SystemMonitor.qml deleted file mode 100644 index a10ceec..0000000 --- a/am-dummyimports/io/qt/ApplicationManager/SystemMonitor.qml +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB) -** 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 -** -****************************************************************************/ - -pragma Singleton - -import QtQml 2.0 - -QtObject { - property int reportingInterval - property int reportingRange - property bool cpuLoadReportingEnabled - property bool fpsReportingEnabled - signal fpsReportingChanged(real average, real minimum, real maximum, real jitter) -} diff --git a/am-dummyimports/io/qt/ApplicationManager/WindowManager.qml b/am-dummyimports/io/qt/ApplicationManager/WindowManager.qml deleted file mode 100644 index 69516cd..0000000 --- a/am-dummyimports/io/qt/ApplicationManager/WindowManager.qml +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** 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 -** -****************************************************************************/ - -pragma Singleton -import QtQuick 2.2 -import io.qt.ApplicationManager 1.0 - -QtObject { - id: root - property int count: ApplicationManager.count - property var surfaceItems: [] - property Connections conn: Connections { - target: ApplicationManager - onEmitSurface: { - surfaceItems[index] = item - root.surfaceItemReady(index, item) - } - } - - signal surfaceItemReady(int index, Item item) - signal surfaceItemClosing() - signal surfaceItemLost() - signal raiseApplicationWindow() - signal surfaceWindowPropertyChanged(Item surfaceItem, string name, var value) - - function setSurfaceWindowProperty(appItem, type, status) { - appItem.windowPropertyChanged(type, status) - } - - function surfaceWindowProperty(item, type) { - return false - } - - function get(index) { - var entry = ApplicationManager.get(index) - entry.surfaceItem = surfaceItems[index] - return entry - } - - Component.onCompleted: { - for (var i = 0; i < root.count; i++) { - surfaceItems.push(null) - } - } - -} diff --git a/am-dummyimports/io/qt/ApplicationManager/qmldir b/am-dummyimports/io/qt/ApplicationManager/qmldir deleted file mode 100644 index 9f54be7..0000000 --- a/am-dummyimports/io/qt/ApplicationManager/qmldir +++ /dev/null @@ -1,4 +0,0 @@ -singleton ApplicationManager 1.0 ApplicationManager.qml -ApplicationManagerWindow 1.0 ApplicationManagerWindow.qml -singleton WindowManager 1.0 WindowManager.qml -singleton SystemMonitor 1.0 SystemMonitor.qml diff --git a/apps/com.pelagicore.music/MusicProvider.qml b/apps/com.pelagicore.music/MusicProvider.qml index 27a9d28..4089ee4 100644 --- a/apps/com.pelagicore.music/MusicProvider.qml +++ b/apps/com.pelagicore.music/MusicProvider.qml @@ -31,7 +31,7 @@ pragma Singleton import QtQuick 2.1 -import io.qt.ApplicationManager 1.0 +import QtApplicationManager 1.0 import com.pelagicore.datasource 1.0 import service.music 1.0 diff --git a/modules/utils/AppUIScreen.qml b/modules/utils/AppUIScreen.qml index 950d9d6..62ab428 100644 --- a/modules/utils/AppUIScreen.qml +++ b/modules/utils/AppUIScreen.qml @@ -31,7 +31,7 @@ import QtQuick 2.1 -import io.qt.ApplicationManager 1.0 +import QtApplicationManager 1.0 import controls 1.0 import utils 1.0 diff --git a/modules/utils/Style.qml b/modules/utils/Style.qml index d197646..a23c3b0 100644 --- a/modules/utils/Style.qml +++ b/modules/utils/Style.qml @@ -31,7 +31,7 @@ pragma Singleton import QtQuick 2.1 -import io.qt.ApplicationManager 1.0 +import QtApplicationManager 1.0 QtObject { id: root diff --git a/neptuneui.pro b/neptuneui.pro index d877abc..fc83b8c 100644 --- a/neptuneui.pro +++ b/neptuneui.pro @@ -3,6 +3,6 @@ TEMPLATE = subdirs SUBDIRS = plugins/datasource \ plugins/screenManager -qml.files = apps modules sysui i18n am-config.yaml DimAndCsd.qml Main* +qml.files = apps modules sysui i18n am-config.yaml Main*.qml INSTALLS += qml diff --git a/neptuneui.qmlproject b/neptuneui.qmlproject index 970c72c..d5ccee5 100644 --- a/neptuneui.qmlproject +++ b/neptuneui.qmlproject @@ -3,7 +3,7 @@ import QmlProject 1.1 Project { - mainFile: "DimAndCsd.qml" + mainFile: "MainWithCluser.qml" /* Include .qml, .js, and image files from current directory and subdirectories */ QmlFiles { @@ -21,5 +21,5 @@ Project { } /* List of plugin directories passed to QML runtime */ - importPaths: [ "modules", "am-dummyimports", "dummyimports" ] + importPaths: [ "modules", "../application-manager/dummyimports", "dummyimports" ] } diff --git a/sysui/Cloud/Store/AppStore.qml b/sysui/Cloud/Store/AppStore.qml index 099862e..72f22a3 100644 --- a/sysui/Cloud/Store/AppStore.qml +++ b/sysui/Cloud/Store/AppStore.qml @@ -31,7 +31,7 @@ import QtQuick 2.0 import "JSONBackend.js" as JSONBackend -import io.qt.ApplicationManager 1.0 +import QtApplicationManager 1.0 Item { diff --git a/sysui/Cloud/Store/AppStoreController.qml b/sysui/Cloud/Store/AppStoreController.qml index 54300de..107e779 100644 --- a/sysui/Cloud/Store/AppStoreController.qml +++ b/sysui/Cloud/Store/AppStoreController.qml @@ -37,7 +37,7 @@ import utils 1.0 import service.apps 1.0 import "JSONBackend.js" as JSONBackend -import io.qt.ApplicationInstaller 1.0 +import QtApplicationManager 1.0 Item { id: root diff --git a/sysui/Cluster/WidgetContainer.qml b/sysui/Cluster/WidgetContainer.qml index 643670b..4752780 100644 --- a/sysui/Cluster/WidgetContainer.qml +++ b/sysui/Cluster/WidgetContainer.qml @@ -31,7 +31,7 @@ import QtQuick 2.0 import utils 1.0 -import io.qt.ApplicationManager 1.0 +import QtApplicationManager 1.0 Item { id: root @@ -43,8 +43,8 @@ Item { Keys.onPressed: { if (container.children[0]) { - WindowManager.setSurfaceWindowProperty(container.children[0], "keyPressed", event.key) - WindowManager.setSurfaceWindowProperty(container.children[0], "keyPressed", 0) + WindowManager.setWindowProperty(container.children[0], "keyPressed", event.key) + WindowManager.setWindowProperty(container.children[0], "keyPressed", 0) } } diff --git a/sysui/FpsMonitor.qml b/sysui/FpsMonitor.qml index 98161c4..80f08b4 100644 --- a/sysui/FpsMonitor.qml +++ b/sysui/FpsMonitor.qml @@ -30,7 +30,7 @@ ****************************************************************************/ import QtQuick 2.1 -import io.qt.ApplicationManager 1.0 +import QtApplicationManager 1.0 Rectangle { diff --git a/sysui/Home/HomePage.qml b/sysui/Home/HomePage.qml index 0ed4838..3c0d440 100644 --- a/sysui/Home/HomePage.qml +++ b/sysui/Home/HomePage.qml @@ -35,7 +35,7 @@ import QtQuick.Layouts 1.0 import controls 1.0 import utils 1.0 import service.music 1.0 -import io.qt.ApplicationManager 1.0 +import QtApplicationManager 1.0 UIPage { id: root diff --git a/sysui/Home/MusicWidget.qml b/sysui/Home/MusicWidget.qml index 30e6416..252ab85 100644 --- a/sysui/Home/MusicWidget.qml +++ b/sysui/Home/MusicWidget.qml @@ -31,7 +31,7 @@ import QtQuick 2.1 import QtQuick.Layouts 1.0 -import io.qt.ApplicationManager 1.0 +import QtApplicationManager 1.0 import controls 1.0 import utils 1.0 diff --git a/sysui/LaunchController.qml b/sysui/LaunchController.qml index b8c0987..469fd3a 100644 --- a/sysui/LaunchController.qml +++ b/sysui/LaunchController.qml @@ -33,7 +33,7 @@ import QtQuick 2.5 import QtQuick.Controls 1.0 import controls 1.0 import utils 1.0 -import io.qt.ApplicationManager 1.0 +import QtApplicationManager 1.0 import service.navigation 1.0 import service.music 1.0 import service.apps 1.0 @@ -126,23 +126,23 @@ StackView { } } - function surfaceItemReadyHandler(index, item) { - print(":::LaunchController::: WindowManager:surfaceItemReadyHandler", index, item) - var isWidget = (WindowManager.surfaceWindowProperty(item, "windowType") === "widgetMap") + function windowReadyHandler(index, item) { + print(":::LaunchController::: WindowManager:windowReadyHandler", index, item) + var isWidget = (WindowManager.windowProperty(item, "windowType") === "widgetMap") print(":::LaunchController:::isWidget", isWidget) - var isClusterWidget = (WindowManager.surfaceWindowProperty(item, "windowType") === "clusterWidget") + var isClusterWidget = (WindowManager.windowProperty(item, "windowType") === "clusterWidget") print(":::LaunchController:::isClusterWidget", isClusterWidget) - var isPopup = (WindowManager.surfaceWindowProperty(item, "windowType") === "popup") + var isPopup = (WindowManager.windowProperty(item, "windowType") === "popup") print(":::LaunchController:::isPopup", isPopup) - var acceptSurface = true; + var acceptWindow = true; var appID = WindowManager.get(index).applicationId; if (isWidget) { if (ApplicationManager.get(appID).categories[0] === "navigation") { NavigationService.mapWidget = item } - acceptSurface = false + acceptWindow = false } else if (isClusterWidget) { if (ApplicationManager.get(appID).categories[0] === "navigation") { @@ -151,35 +151,35 @@ StackView { else if (ApplicationManager.get(appID).categories[0] === "media") { AppsService.clusterWidgetReady("media", item) } - acceptSurface = false + acceptWindow = false } else if (isPopup) { if (ApplicationManager.get(appID).categories[0] === "navigation") AppsService.sendNavigationPopup(item) - acceptSurface = false + acceptWindow = false } else { for (var i = 0; i < root.blackListItems.length; ++i) { if (appID === root.blackListItems[i]) - acceptSurface = false; + acceptWindow = false; } for (i = 0; i < root.minimizedItems.length; ++i) { if (appID === root.minimizedItems[i]) { - acceptSurface = false; + acceptWindow = false; // For now we assume that only navigation has a widget - WindowManager.setSurfaceWindowProperty(item, "windowType", "widget") + WindowManager.setWindowProperty(item, "windowType", "widget") root.minimizedItems.pop(appID) break } } } - if (acceptSurface) { + if (acceptWindow) { root.windowItem = item - WindowManager.setSurfaceWindowProperty(item, "windowType", "fullScreen") - WindowManager.setSurfaceWindowProperty(item, "visibility", true) + WindowManager.setWindowProperty(item, "windowType", "fullScreen") + WindowManager.setWindowProperty(item, "visibility", true) root.push(item) } @@ -202,47 +202,38 @@ StackView { visible: false } - function surfaceItemClosingHandler(index, item) { + function windowClosingHandler(index, item) { if (item === root.windowItem) { // start close animation root.pop() } } - function surfaceItemLostHandler(index, item) { - WindowManager.releaseSurfaceItem(index, item) // immediately close anything which is not handled by this container - } - - function getSurfaceIndex(item) { - for (var i = 0; i < WindowManager.count; i++) { - if (WindowManager.get(i).surfaceItem === item) { - return i - } - } - return -1 + function windowLostHandler(index, item) { + WindowManager.releasewindow(item) // immediately close anything which is not handled by this container } Connections { target: WindowManager - onSurfaceWindowPropertyChanged: { - //print(":::LaunchController::: WindowManager:surfaceWindowPropertyChanged", surfaceItem, name, value) + onWindowPropertyChanged: { + //print(":::LaunchController::: WindowManager:windowPropertyChanged", window, name, value) if (name === "visibility" && value === false) { root.pop(null) - var index = root.getSurfaceIndex(root.windowItem) + var index = WindowManager.indexOfWindow(root.windowItem) if (ApplicationManager.dummy) { if (WindowManager.get(index).categories === "navigation") - WindowManager.setSurfaceWindowProperty(root.windowItem, "windowType", "widget") + WindowManager.setWindowProperty(root.windowItem, "windowType", "widget") } else { if (ApplicationManager.get(WindowManager.get(index).applicationId).categories[0] === "navigation") { // Sending after pop transition is done - WindowManager.setSurfaceWindowProperty(root.windowItem, "windowType", "widget") + WindowManager.setWindowProperty(root.windowItem, "windowType", "widget") } } } else if (name === "windowType" && value === "widgetMap") { // Workaround for qmlscene if (ApplicationManager.dummy) { - NavigationService.mapWidget = surfaceItem + NavigationService.mapWidget = window } } else if (name === "liveDrivePopupVisible") { @@ -254,20 +245,20 @@ StackView { else if (name === "windowType" && value === "clusterWidget") { // Workaround for qmlscene if (ApplicationManager.dummy) { - AppsService.clusterWidgetReady("other", surfaceItem) + AppsService.clusterWidgetReady("other", window) } } else if (name === "windowType" && value === "popup") { // Workaround for qmlscene if (ApplicationManager.dummy) { - AppsService.sendNavigationPopup(surfaceItem) + AppsService.sendNavigationPopup(window) } } else if (name === "goTo" && value === "fullScreen") { - index = root.getSurfaceIndex(surfaceItem) + index = WindowManager.indexOfWindow(window) //print(":::LaunchController::: App found. Going to full screen the app ", index, WindowManager.get(index).applicationId) ApplicationManager.startApplication(WindowManager.get(index).applicationId) - WindowManager.setSurfaceWindowProperty(surfaceItem, "goTo", "") + WindowManager.setWindowProperty(window, "goTo", "") } else if (name === "liveDriveEvent") { NavigationService.liveDriveEvent = value @@ -278,21 +269,21 @@ StackView { } onRaiseApplicationWindow: { - //print(":::LaunchController::: WindowManager:raiseApplicaitonWindow" + id + " " + WindowManager.count) + //print(":::LaunchController::: WindowManager:raiseApplicaitonWindow" + applicationId + " " + WindowManager.count) for (var i = 0; i < WindowManager.count; i++) { - if (WindowManager.get(i).applicationId === id) { - var item = WindowManager.get(i).surfaceItem - print(":::LaunchController::: App found. Running the app " + id + " Item: " + item) - var isWidget = (WindowManager.surfaceWindowProperty(item, "windowType") === "widget") - var isMapWidget = (WindowManager.surfaceWindowProperty(item, "windowType") === "widgetMap") - var isClusterWidget = (WindowManager.surfaceWindowProperty(item, "windowType") === "clusterWidget") - var isPopup = (WindowManager.surfaceWindowProperty(item, "windowType") === "popup") + if (WindowManager.get(i).applicationId === applicationId) { + var item = WindowManager.get(i).windowItem + print(":::LaunchController::: App found. Running the app " + applicationId + " Item: " + item) + var isWidget = (WindowManager.windowProperty(item, "windowType") === "widget") + var isMapWidget = (WindowManager.windowProperty(item, "windowType") === "widgetMap") + var isClusterWidget = (WindowManager.windowProperty(item, "windowType") === "clusterWidget") + 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.setSurfaceWindowProperty(item, "visibility", true) - WindowManager.setSurfaceWindowProperty(item, "windowType", "fullScreen") + WindowManager.setWindowProperty(item, "visibility", true) + WindowManager.setWindowProperty(item, "windowType", "fullScreen") root.windowItem = item root.push(item) break @@ -303,9 +294,9 @@ StackView { } Component.onCompleted: { - WindowManager.surfaceItemReady.connect(surfaceItemReadyHandler) - WindowManager.surfaceItemClosing.connect(surfaceItemClosingHandler) - WindowManager.surfaceItemLost.connect(surfaceItemLostHandler) + WindowManager.windowReady.connect(windowReadyHandler) + WindowManager.windowClosing.connect(windowClosingHandler) + WindowManager.windowLost.connect(windowLostHandler) if (NavigationService.defaultNavApp) { root.minimizedItems.push(NavigationService.defaultNavApp) ApplicationManager.startApplication(NavigationService.defaultNavApp) diff --git a/sysui/Launcher/LauncherPage.qml b/sysui/Launcher/LauncherPage.qml index 1673521..956bc07 100644 --- a/sysui/Launcher/LauncherPage.qml +++ b/sysui/Launcher/LauncherPage.qml @@ -36,8 +36,8 @@ import controls 1.0 import utils 1.0 import service.apps 1.0 -import io.qt.ApplicationManager 1.0 -import io.qt.ApplicationInstaller 1.0 +import QtApplicationManager 1.0 + UIPage { id: root |