summaryrefslogtreecommitdiff
path: root/sowatchui/qml/NewWatchSheet.qml
blob: 1028bd537c2c9e983f56e3a8e6238efaa4637a91 (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
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
		}
	}
}