summaryrefslogtreecommitdiff
path: root/sowatchui/qml/AddWatchletSheet.qml
diff options
context:
space:
mode:
Diffstat (limited to 'sowatchui/qml/AddWatchletSheet.qml')
-rw-r--r--sowatchui/qml/AddWatchletSheet.qml48
1 files changed, 48 insertions, 0 deletions
diff --git a/sowatchui/qml/AddWatchletSheet.qml b/sowatchui/qml/AddWatchletSheet.qml
new file mode 100644
index 0000000..e052350
--- /dev/null
+++ b/sowatchui/qml/AddWatchletSheet.qml
@@ -0,0 +1,48 @@
+import QtQuick 1.1
+import com.nokia.meego 1.1
+import com.nokia.extras 1.1
+import com.javispedro.sowatch 1.0
+
+Sheet {
+ id: sheet
+ anchors.margins: UiConstants.DefaultMargin
+
+ property string configKey;
+
+ rejectButtonText: qsTr("Cancel")
+
+ content: ListView {
+ id: listView
+ anchors.fill: parent
+ anchors.margins: UiConstants.DefaultMargin
+
+ flickableDirection: Flickable.VerticalFlick
+
+ model: WatchletsModel {
+ id: watchletsModel
+ configKey: sheet.configKey
+ displayUnadded: true
+ }
+
+ header: Column {
+ width: parent.width
+
+ GroupHeader {
+ width: parent.width
+ text: qsTr("Available watchlets")
+ }
+ }
+
+ delegate: ListDelegate {
+ onClicked: {
+ watchletsModel.addWatchlet(model.name);
+ close();
+ accepted();
+ }
+ }
+
+ ScrollDecorator {
+ flickableItem: listView
+ }
+ }
+}