summaryrefslogtreecommitdiff
path: root/sowatchui/qml/NewWatchSheet.qml
blob: 12eecf226de3ec36836d12d78a7274fd393dd4fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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

		header: Column {
			width: parent.width

			Label {
				text: qsTr("Pick a watch")
				font: UiConstants.HeaderFont
			}
			GroupHeader {
				width: parent.width
				text: qsTr("Nearby watches")
			}
		}

		delegate: ListDelegate {
			onClicked: {
				watches.addFoundWatch(object);
				close();
				accepted();
			}
		}

		ScrollDecorator {
			flickableItem: listView
		}
	}
}