summaryrefslogtreecommitdiff
path: root/sowatchui/qml/WatchPage.qml
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2012-08-10 16:06:14 +0200
committerJavier S. Pedro <maemo@javispedro.com>2012-08-10 16:06:14 +0200
commit39fa663cd08bd2b7d46ed170d49ac794c531c42e (patch)
tree92131388053eadbfca4b8917ab1e1f87ffe30fdd /sowatchui/qml/WatchPage.qml
parentb9082fda48bb026fc4e6148efeba9aabf608373a (diff)
downloadsowatch-39fa663cd08bd2b7d46ed170d49ac794c531c42e.tar.gz
sowatch-39fa663cd08bd2b7d46ed170d49ac794c531c42e.zip
watchlet edit UI
Diffstat (limited to 'sowatchui/qml/WatchPage.qml')
-rw-r--r--sowatchui/qml/WatchPage.qml62
1 files changed, 56 insertions, 6 deletions
diff --git a/sowatchui/qml/WatchPage.qml b/sowatchui/qml/WatchPage.qml
index 21c4543..4799085 100644
--- a/sowatchui/qml/WatchPage.qml
+++ b/sowatchui/qml/WatchPage.qml
@@ -14,10 +14,55 @@ Page {
tools: ToolBarLayout {
ToolIcon {
+ id: backToolIcon
platformIconId: "toolbar-back"
anchors.left: parent.left
onClicked: pageStack.pop()
}
+ ToolIcon {
+ id: menuToolIcon
+ platformIconId: "toolbar-view-menu"
+ anchors.right: parent.right
+ onClicked: (watchMenu.status === DialogStatus.Closed) ? watchMenu.open() : watchMenu.close();
+ }
+ }
+
+ Menu {
+ id: watchMenu
+ MenuLayout {
+ MenuItem {
+ text: qsTr("Remove watch")
+ onClicked: {
+ watchMenu.close();
+ watches.removeWatch(watchPage.configKey);
+ pageStack.pop();
+ }
+ }
+ }
+ }
+
+ Menu {
+ id: watchletMenu
+ property string watchlet;
+ MenuLayout {
+ MenuItem {
+ text: qsTr("Move up")
+ onClicked: watchletsModel.moveWatchletUp(watchletMenu.watchlet)
+ }
+ MenuItem {
+ text: qsTr("Move down")
+ onClicked: watchletsModel.moveWatchletDown(watchletMenu.watchlet)
+ }
+ MenuItem {
+ text: qsTr("Remove watchlet")
+ onClicked: watchletsModel.removeWatchlet(watchletMenu.watchlet)
+ }
+ }
+ }
+
+ AddWatchletSheet {
+ id: addWatchletSheet
+ configKey: watchPage.configKey
}
GConfKey {
@@ -84,7 +129,7 @@ Page {
height: UiConstants.ListItemHeightDefault * count
model: ProvidersModel {
id: providersModel
- configKey: watchPage.configKey + "/providers"
+ configKey: watchPage.configKey
}
delegate: ListDelegate {
CheckBox {
@@ -107,19 +152,24 @@ Page {
interactive: false
width: parent.width
height: UiConstants.ListItemHeightDefault * count
- model: ListModel {
- ListElement {
- title: "Test"
- }
+ model: WatchletsModel {
+ id: watchletsModel
+ configKey: watchPage.configKey
+ displayUnadded: false
}
- delegate: ListDelegate {
+ delegate: ListDelegate {
+ onClicked: {
+ watchletMenu.watchlet = model.name;
+ watchletMenu.open();
+ }
}
}
Button {
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Add new watchlet")
+ onClicked: addWatchletSheet.open()
}
}
}