summaryrefslogtreecommitdiff
path: root/sowatchui/qml
diff options
context:
space:
mode:
Diffstat (limited to 'sowatchui/qml')
-rw-r--r--sowatchui/qml/MainPage.qml79
-rw-r--r--sowatchui/qml/NewWatchSheet.qml43
-rw-r--r--sowatchui/qml/WatchPage.qml36
-rw-r--r--sowatchui/qml/main.qml22
4 files changed, 107 insertions, 73 deletions
diff --git a/sowatchui/qml/MainPage.qml b/sowatchui/qml/MainPage.qml
index a7ba7d7..b660161 100644
--- a/sowatchui/qml/MainPage.qml
+++ b/sowatchui/qml/MainPage.qml
@@ -1,67 +1,38 @@
import QtQuick 1.1
-import com.nokia.meego 1.0
+import com.nokia.meego 1.1
+import com.nokia.extras 1.1
Page {
id: mainPage
- tools: commonTools
+ anchors.leftMargin: UiConstants.DefaultMargin
+ anchors.rightMargin: UiConstants.DefaultMargin
- ListModel {
- id: testModel
- ListElement {
- name: "one"
- }
- ListElement {
- name: "two"
+ tools: ToolBarLayout {
+ ToolIcon {
+ platformIconId: "toolbar-add"
+ anchors.right: parent.right
+ onClicked: newWatchSheet.open()
}
}
- Flickable {
- anchors.fill: parent
- contentWidth: mainPage.width
- contentHeight: mainColumn.height + 100
-
- Column {
- id: mainColumn
+ NewWatchSheet {
+ id: newWatchSheet
+ }
- width: mainPage.width
- height: childrenRect.height
- spacing: 8
+ ListView {
+ id: watchesListView
+ anchors.fill: parent
+ model: watches
- 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()
- }
+ delegate: ListDelegate {
+ Image {
+ source: "image://theme/icon-m-common-drilldown-arrow" + (theme.inverted ? "-inverse" : "")
+ anchors.right: parent.right;
+ anchors.verticalCenter: parent.verticalCenter
+ }
}
}
+ ScrollDecorator {
+ flickableItem: watchesListView
+ }
}
diff --git a/sowatchui/qml/NewWatchSheet.qml b/sowatchui/qml/NewWatchSheet.qml
new file mode 100644
index 0000000..1028bd5
--- /dev/null
+++ b/sowatchui/qml/NewWatchSheet.qml
@@ -0,0 +1,43 @@
+import QtQuick 1.1
+import com.nokia.meego 1.1
+import com.nokia.extras 1.1
+
+Sheet {
+ id: sheet
+ anchors.margins: UiConstants.DefaultMargin
+
+ rejectButtonText: qsTr("Cancel")
+
+ title: BusyIndicator {
+ anchors.centerIn: parent;
+ running: watchScanner.active
+ }
+
+ Binding {
+ target: watchScanner
+ property: "enabled"
+ value: sheet.status === DialogStatus.Open
+ }
+
+ content: ListView {
+ id: listView
+ anchors.fill: parent
+ anchors.margins: UiConstants.DefaultMargin
+
+ flickableDirection: Flickable.VerticalFlick
+
+ model: watchScanner
+
+ delegate: ListDelegate {
+ onClicked: {
+ watches.addFoundWatch(object);
+ close();
+ accepted();
+ }
+ }
+
+ ScrollDecorator {
+ flickableItem: listView
+ }
+ }
+}
diff --git a/sowatchui/qml/WatchPage.qml b/sowatchui/qml/WatchPage.qml
new file mode 100644
index 0000000..fb7011c
--- /dev/null
+++ b/sowatchui/qml/WatchPage.qml
@@ -0,0 +1,36 @@
+import QtQuick 1.1
+import com.nokia.meego 1.1
+import com.nokia.extras 1.1
+
+Page {
+ id: watchPage
+ anchors.leftMargin: UiConstants.DefaultMargin
+ anchors.rightMargin: UiConstants.DefaultMargin
+
+ tools: ToolBarLayout {
+ ToolIcon {
+ platformIconId: "toolbar-back"
+ anchors.left: parent.left
+ onClicked: pageStack.pop()
+ }
+ }
+
+ ListView {
+ id: emptyListView
+ anchors.fill: parent
+ model: ListModel {
+
+ }
+
+ delegate: ListDelegate {
+ Image {
+ source: "image://theme/icon-m-common-drilldown-arrow" + (theme.inverted ? "-inverse" : "")
+ anchors.right: parent.right;
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ }
+ }
+ ScrollDecorator {
+ flickableItem: watchesListView
+ }
+}
diff --git a/sowatchui/qml/main.qml b/sowatchui/qml/main.qml
index eb4c081..ca838a2 100644
--- a/sowatchui/qml/main.qml
+++ b/sowatchui/qml/main.qml
@@ -1,5 +1,5 @@
import QtQuick 1.1
-import com.nokia.meego 1.0
+import com.nokia.meego 1.1
PageStackWindow {
id: appWindow
@@ -10,30 +10,14 @@ PageStackWindow {
id: mainPage
}
- ToolBarLayout {
- id: commonTools
- visible: true
- ToolIcon {
- platformIconId: "toolbar-view-menu"
- anchors.right: (parent === undefined) ? undefined : parent.right
- onClicked: (myMenu.status === DialogStatus.Closed) ? myMenu.open() : myMenu.close()
- }
- }
-
Menu {
id: myMenu
visualParent: pageStack
MenuLayout {
MenuItem {
- text: qsTr("Start service")
- onClicked: {
- Sowatch.start();
- }
- }
- MenuItem {
- text: qsTr("Stop service")
+ text: qsTr("Crap")
onClicked: {
- Sowatch.stop();
+ console.log("Crap")
}
}
}