From 93f3acd128d6b349efe14e97b12c2703ca4f81f3 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Thu, 26 Apr 2012 01:36:20 +0200 Subject: Moved the core framework to GConf & D-Bus --- sowatchui/qml/MainPage.qml | 62 +++++++++++++++++++++++++++++++++++++++-- sowatchui/qml/ServiceLoader.qml | 7 ----- sowatchui/qml/main.qml | 4 +-- sowatchui/qml/sowatch.js | 29 ------------------- 4 files changed, 61 insertions(+), 41 deletions(-) delete mode 100644 sowatchui/qml/ServiceLoader.qml delete mode 100644 sowatchui/qml/sowatch.js (limited to 'sowatchui/qml') diff --git a/sowatchui/qml/MainPage.qml b/sowatchui/qml/MainPage.qml index 45b72f3..a7ba7d7 100644 --- a/sowatchui/qml/MainPage.qml +++ b/sowatchui/qml/MainPage.qml @@ -1,9 +1,67 @@ import QtQuick 1.1 import com.nokia.meego 1.0 -import "sowatch.js" as Sowatch - Page { + id: mainPage tools: commonTools + ListModel { + id: testModel + ListElement { + name: "one" + } + ListElement { + name: "two" + } + } + + Flickable { + anchors.fill: parent + contentWidth: mainPage.width + contentHeight: mainColumn.height + 100 + + Column { + id: mainColumn + + width: mainPage.width + height: childrenRect.height + spacing: 8 + + ListView { + model: testModel + width: mainPage.width + height: 50*model.count + clip: true + interactive: false + delegate: Rectangle { + height: 50 + width: mainPage.width + color: "red" + Text { + text: name + } + } + } + ListView { + model: testModel + width: mainPage.width + height: 50*model.count + clip: true + interactive: false + delegate: Rectangle { + height: 50 + width: mainPage.width + color: "green" + Text { + text: name + } + } + } + Button { + anchors.horizontalCenter: parent.horizontalCenter + text: qsTr("Refresh") + onClicked: Sowatch.refreshWatches() + } + } + } } diff --git a/sowatchui/qml/ServiceLoader.qml b/sowatchui/qml/ServiceLoader.qml deleted file mode 100644 index 8128ca7..0000000 --- a/sowatchui/qml/ServiceLoader.qml +++ /dev/null @@ -1,7 +0,0 @@ -import QtQuick 1.1 -import QtMobility.serviceframework 1.1 - -Service { - id: sowatch - interfaceName: "com.javispedro.sowatch.service" -} diff --git a/sowatchui/qml/main.qml b/sowatchui/qml/main.qml index 8697b6d..eb4c081 100644 --- a/sowatchui/qml/main.qml +++ b/sowatchui/qml/main.qml @@ -1,8 +1,6 @@ import QtQuick 1.1 import com.nokia.meego 1.0 -import "sowatch.js" as Sowatch - PageStackWindow { id: appWindow @@ -18,7 +16,7 @@ PageStackWindow { ToolIcon { platformIconId: "toolbar-view-menu" anchors.right: (parent === undefined) ? undefined : parent.right - onClicked: (myMenu.status == DialogStatus.Closed) ? myMenu.open() : myMenu.close() + onClicked: (myMenu.status === DialogStatus.Closed) ? myMenu.open() : myMenu.close() } } diff --git a/sowatchui/qml/sowatch.js b/sowatchui/qml/sowatch.js deleted file mode 100644 index f2d48dd..0000000 --- a/sowatchui/qml/sowatch.js +++ /dev/null @@ -1,29 +0,0 @@ -var service = null; - -function getService() { - var component = Qt.createComponent("ServiceLoader.qml"); - if (component.status == Component.Ready) { - var loader = component.createObject(null); - service = loader.serviceObject; - } -} - -function checkService() { - if (service === null) { - getService(); - } -} - -function start() { - getService(); -} - -function stop() { - checkService(); - service.terminate(); -} - -function restart() { - stop(); - start(); -} -- cgit v1.2.3