diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2013-04-04 01:15:54 +0200 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2013-04-04 01:15:54 +0200 |
commit | 3c88a76b1be759d13097810877d6e990b3371726 (patch) | |
tree | dd5627700ef12be7c55d9f3ceda5a9575691a337 /qml/tapasboard | |
parent | 723e0e7f37636379f76008582dca459490b845f4 (diff) | |
download | tapasboard-3c88a76b1be759d13097810877d6e990b3371726.tar.gz tapasboard-3c88a76b1be759d13097810877d6e990b3371726.zip |
implement refresh action
Diffstat (limited to 'qml/tapasboard')
-rw-r--r-- | qml/tapasboard/BoardPage.qml | 20 | ||||
-rw-r--r-- | qml/tapasboard/ForumPage.qml | 20 | ||||
-rw-r--r-- | qml/tapasboard/TopicPage.qml | 20 |
3 files changed, 54 insertions, 6 deletions
diff --git a/qml/tapasboard/BoardPage.qml b/qml/tapasboard/BoardPage.qml index dd1bd24..7efc6db 100644 --- a/qml/tapasboard/BoardPage.qml +++ b/qml/tapasboard/BoardPage.qml @@ -14,17 +14,26 @@ Page { tools: ToolBarLayout { ToolIcon { - id: backToolIcon platformIconId: "toolbar-back" - anchors.left: parent.left onClicked: pageStack.pop() } + ToolIcon { + platformIconId: board.busy ? "toolbar-cancle" : "toolbar-refresh" + onClicked: { + if (board.busy) { + board.cancelAllActions(); + } else { + boardModel.refresh(); + } + } + } } ListView { id: forumsView anchors.fill: parent model: BoardModel { + id: boardModel board: boardPage.board forumId: boardPage.forumId } @@ -87,4 +96,11 @@ Page { ScrollDecorator { flickableItem: forumsView } + + BusyIndicator { + anchors.centerIn: parent + platformStyle: BusyIndicatorStyle { size: "large" } + visible: forumsView.count == 0 && board.busy + running: visible + } } diff --git a/qml/tapasboard/ForumPage.qml b/qml/tapasboard/ForumPage.qml index 18953cb..aed65a0 100644 --- a/qml/tapasboard/ForumPage.qml +++ b/qml/tapasboard/ForumPage.qml @@ -14,17 +14,26 @@ Page { tools: ToolBarLayout { ToolIcon { - id: backToolIcon platformIconId: "toolbar-back" - anchors.left: parent.left onClicked: pageStack.pop() } + ToolIcon { + platformIconId: board.busy ? "toolbar-cancle" : "toolbar-refresh" + onClicked: { + if (board.busy) { + board.cancelAllActions(); + } else { + forumModel.refresh(); + } + } + } } ListView { id: topicsView anchors.fill: parent model: ForumModel { + id: forumModel board: forumPage.board forumId: forumPage.forumId } @@ -66,4 +75,11 @@ Page { ScrollDecorator { flickableItem: topicsView } + + BusyIndicator { + anchors.centerIn: parent + platformStyle: BusyIndicatorStyle { size: "large" } + visible: topicsView.count == 0 && board.busy + running: visible + } } diff --git a/qml/tapasboard/TopicPage.qml b/qml/tapasboard/TopicPage.qml index ba132b5..689dce7 100644 --- a/qml/tapasboard/TopicPage.qml +++ b/qml/tapasboard/TopicPage.qml @@ -14,17 +14,26 @@ Page { tools: ToolBarLayout { ToolIcon { - id: backToolIcon platformIconId: "toolbar-back" - anchors.left: parent.left onClicked: pageStack.pop() } + ToolIcon { + platformIconId: board.busy ? "toolbar-cancle" : "toolbar-refresh" + onClicked: { + if (board.busy) { + board.cancelAllActions(); + } else { + topicModel.refresh(); + } + } + } } ListView { id: postsView anchors.fill: parent model: TopicModel { + id: topicModel board: topicPage.board topicId: topicPage.topicId } @@ -103,4 +112,11 @@ Page { ScrollDecorator { flickableItem: postsView } + + BusyIndicator { + anchors.centerIn: parent + platformStyle: BusyIndicatorStyle { size: "large" } + visible: postsView.count == 0 && board.busy + running: visible + } } |