diff options
author | Robert Griebl <robert.griebl@pelagicore.com> | 2016-04-22 16:49:59 +0200 |
---|---|---|
committer | Robert Griebl <robert.griebl@pelagicore.com> | 2016-04-23 14:07:48 +0000 |
commit | 28684c2432ff90f1e38a6bfa0eac2987f66a6f95 (patch) | |
tree | 38dfb7b0f99054dd6549c0901f60cbd14d8175f1 /dummyimports | |
parent | e3174778c41d6ba9cac94f11fe8a91a2911e00a0 (diff) | |
download | qtapplicationmanager-28684c2432ff90f1e38a6bfa0eac2987f66a6f95.tar.gz |
Updated the dummyimports with the more recent code from Neptune
Change-Id: Ib7ddb766f6677731b81e9fe5ffe6006084e90a1b
Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
Diffstat (limited to 'dummyimports')
-rw-r--r-- | dummyimports/QtApplicationManager/ApplicationInstaller.js (renamed from dummyimports/io/qt/ApplicationInstaller/ApplicationInstaller.js) | 0 | ||||
-rw-r--r-- | dummyimports/QtApplicationManager/ApplicationManager.qml | 117 | ||||
-rw-r--r-- | dummyimports/QtApplicationManager/ApplicationManagerWindow.qml (renamed from dummyimports/io/qt/ApplicationManager/PelagicoreWindow.qml) | 6 | ||||
-rw-r--r-- | dummyimports/QtApplicationManager/SystemMonitor.qml | 42 | ||||
-rw-r--r-- | dummyimports/QtApplicationManager/WindowManager.qml (renamed from dummyimports/io/qt/ApplicationManager/WindowManager.qml) | 10 | ||||
-rw-r--r-- | dummyimports/QtApplicationManager/qmldir | 5 | ||||
-rw-r--r-- | dummyimports/io/qt/ApplicationInstaller/qmldir | 1 | ||||
-rw-r--r-- | dummyimports/io/qt/ApplicationManager/ApplicationManager.js | 131 | ||||
-rw-r--r-- | dummyimports/io/qt/ApplicationManager/qmldir | 3 |
9 files changed, 176 insertions, 139 deletions
diff --git a/dummyimports/io/qt/ApplicationInstaller/ApplicationInstaller.js b/dummyimports/QtApplicationManager/ApplicationInstaller.js index f56f3664..f56f3664 100644 --- a/dummyimports/io/qt/ApplicationInstaller/ApplicationInstaller.js +++ b/dummyimports/QtApplicationManager/ApplicationInstaller.js diff --git a/dummyimports/QtApplicationManager/ApplicationManager.qml b/dummyimports/QtApplicationManager/ApplicationManager.qml new file mode 100644 index 00000000..b4dee0ae --- /dev/null +++ b/dummyimports/QtApplicationManager/ApplicationManager.qml @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Pelagicore AG +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Pelagicore Application Manager. +** +** $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/dummyimports/io/qt/ApplicationManager/PelagicoreWindow.qml b/dummyimports/QtApplicationManager/ApplicationManagerWindow.qml index 823a4e32..a92d7c37 100644 --- a/dummyimports/io/qt/ApplicationManager/PelagicoreWindow.qml +++ b/dummyimports/QtApplicationManager/ApplicationManagerWindow.qml @@ -30,7 +30,7 @@ ****************************************************************************/ import QtQuick 2.0 -import com.pelagicore.ApplicationManager 0.1 +import QtApplicationManager 1.0 Item { id: root @@ -39,8 +39,8 @@ Item { property color color signal windowPropertyChanged(string name, var value) - function close() {} - function showFullScreen() {} + signal close() + //function showFullScreen() {} function showMaximized() {} function showNormal() {} function setWindowProperty(status, value) { diff --git a/dummyimports/QtApplicationManager/SystemMonitor.qml b/dummyimports/QtApplicationManager/SystemMonitor.qml new file mode 100644 index 00000000..60a83f69 --- /dev/null +++ b/dummyimports/QtApplicationManager/SystemMonitor.qml @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB) +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Pelagicore Application Manager. +** +** $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/dummyimports/io/qt/ApplicationManager/WindowManager.qml b/dummyimports/QtApplicationManager/WindowManager.qml index a74da138..4135ae4d 100644 --- a/dummyimports/io/qt/ApplicationManager/WindowManager.qml +++ b/dummyimports/QtApplicationManager/WindowManager.qml @@ -31,12 +31,20 @@ pragma Singleton import QtQuick 2.2 -import "ApplicationManager.js" as ApplicationManager +import QtApplicationManager 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() diff --git a/dummyimports/QtApplicationManager/qmldir b/dummyimports/QtApplicationManager/qmldir new file mode 100644 index 00000000..088e3b00 --- /dev/null +++ b/dummyimports/QtApplicationManager/qmldir @@ -0,0 +1,5 @@ +singleton ApplicationManager 1.0 ApplicationManager.qml +ApplicationManagerWindow 1.0 ApplicationManagerWindow.qml +ApplicationInstaller 1.0 ApplicationInstaller.js +singleton WindowManager 1.0 WindowManager.qml +singleton SystemMonitor 1.0 SystemMonitor.qml diff --git a/dummyimports/io/qt/ApplicationInstaller/qmldir b/dummyimports/io/qt/ApplicationInstaller/qmldir deleted file mode 100644 index d4725ce1..00000000 --- a/dummyimports/io/qt/ApplicationInstaller/qmldir +++ /dev/null @@ -1 +0,0 @@ -ApplicationInstaller 1.0 ApplicationInstaller.js diff --git a/dummyimports/io/qt/ApplicationManager/ApplicationManager.js b/dummyimports/io/qt/ApplicationManager/ApplicationManager.js deleted file mode 100644 index 43f7ebd0..00000000 --- a/dummyimports/io/qt/ApplicationManager/ApplicationManager.js +++ /dev/null @@ -1,131 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Pelagicore AG -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Pelagicore Application Manager. -** -** $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 -** -****************************************************************************/ - -var count = 3 -var dummy = true - -var additionalConfiguration = { } - -function get(index) { -// print("Type of the index " + typeof index) - if (typeof index === 'number') - return createAppEntry(index) - else if (typeof index === 'string') { - for (var i = 0; i < applibrary.length; i++) { -// print(":::ApplicationManager::: running through the loop: " + index + " applibrary " + applibrary[i][0]) - if (applibrary[i][0] === index) { - return createAppEntry(i) - } - } - } -} - - -function setApplicationAudioFocus(appId, appFocus) -{ - print("setApplicationAudioFocus(" + appId + ", " + appFocus + ")") -} - - - -function startApplication(id) { - print("Starting the application. ") - var component - var item - for (var i = 0; i < applibrary.length; i++) { - var entry - //print("ApplicationManager: " + createAppEntry(i).applicationId + " given app id to open: " + id) - if (createAppEntry(i).applicationId == id) { - component = Qt.createComponent("../../../../ui/apps/" + createAppEntry(i).name + "/" + 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) - WindowManager.surfaceItems[i] = item - WindowManager.surfaceItemReady(i, item) - } - } - else - console.log("Component creation failed " + createAppEntry(i).qml + " Error: " + component.errorString()) - } - } -} - -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"], - ["","", "", ""], - ["","", "", ""], - ["","", "", ""], - ["","", "", ""], - ["","", "", ""], - ["","", "", ""], - ["","", "", ""], - ["","", "", ""], - ["","", "", ""], - ["","", "", ""], - ["","", "", ""], - ["","", "", ""], - ["","", "", ""], - ["","", "", ""], - ["","", "", ""], - ["","", "", ""], - ["","", "", ""], - ["","", "", ""], - ["","", "", ""], - - ]; - -function createAppEntry(i) { - - - var entry = { - applicationId: applibrary[i][0], - icon: "/path/to/icon/" + applibrary[i][2] + "/" + 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 -} diff --git a/dummyimports/io/qt/ApplicationManager/qmldir b/dummyimports/io/qt/ApplicationManager/qmldir deleted file mode 100644 index fbea2e88..00000000 --- a/dummyimports/io/qt/ApplicationManager/qmldir +++ /dev/null @@ -1,3 +0,0 @@ -ApplicationManager 1.0 ApplicationManager.js -ApplicationManagerWindow 1.0 ApplicationManagerWindow.qml -singleton WindowManager 1.0 WindowManager.qml |