summaryrefslogtreecommitdiff
path: root/qml/tapasboard
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2013-04-04 15:49:31 +0200
committerJavier S. Pedro <maemo@javispedro.com>2013-04-04 15:49:31 +0200
commitd8fcff1a2d6eb61c97c44790dbdb920ba9f52980 (patch)
tree49df7f1e07e34061301ad5944a1807feba24b526 /qml/tapasboard
parent11b4152301b408c7a4f02a8b202fed9f5e1ee1e7 (diff)
downloadtapasboard-d8fcff1a2d6eb61c97c44790dbdb920ba9f52980.tar.gz
tapasboard-d8fcff1a2d6eb61c97c44790dbdb920ba9f52980.zip
add showing unread posts
Diffstat (limited to 'qml/tapasboard')
-rw-r--r--qml/tapasboard/BoardPage.qml106
-rw-r--r--qml/tapasboard/EmptyListDelegate.qml29
-rw-r--r--qml/tapasboard/ForumPage.qml93
-rw-r--r--qml/tapasboard/GroupHeader.qml26
-rw-r--r--qml/tapasboard/MainPage.qml39
-rw-r--r--qml/tapasboard/TopicPage.qml122
-rw-r--r--qml/tapasboard/main.qml12
7 files changed, 0 insertions, 427 deletions
diff --git a/qml/tapasboard/BoardPage.qml b/qml/tapasboard/BoardPage.qml
deleted file mode 100644
index 7efc6db..0000000
--- a/qml/tapasboard/BoardPage.qml
+++ /dev/null
@@ -1,106 +0,0 @@
-import QtQuick 1.1
-import com.nokia.meego 1.1
-import com.nokia.extras 1.1
-import com.javispedro.tapasboard 1.0
-
-Page {
- id: boardPage
-
- anchors.leftMargin: UiConstants.DefaultMargin
- anchors.rightMargin: UiConstants.DefaultMargin
-
- property Board board : null;
- property int forumId;
-
- tools: ToolBarLayout {
- ToolIcon {
- platformIconId: "toolbar-back"
- 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
- }
- section.criteria: ViewSection.FullString
- section.property: "category"
- section.delegate: GroupHeader {
- width: parent.width
- text: section
- }
-
- delegate: EmptyListDelegate {
- id: forumItem
-
- height: Math.max(forumItemColumn.height + UiConstants.ButtonSpacing * 2, UiConstants.ListItemHeightDefault)
-
- Column {
- id: forumItemColumn
- anchors.left: parent.left
- anchors.right: forumItemImage.left
- anchors.verticalCenter: parent.verticalCenter
-
- Text {
- text: model.title
- width: parent.width
- font: UiConstants.TitleFont
- }
-
- Text {
- text: model.description
- width: parent.width
- font: UiConstants.SubtitleFont
- wrapMode: Text.Wrap
- visible: text != ""
- }
- }
-
- Image {
- id: forumItemImage
- source: "image://theme/icon-m-common-drilldown-arrow" + (theme.inverted ? "-inverse" : "")
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
- }
-
- onClicked: {
- if (model.subOnly) {
- pageStack.push(Qt.resolvedUrl("BoardPage.qml"), {
- board: boardPage.board,
- forumId: model.forumId
- });
- } else {
- pageStack.push(Qt.resolvedUrl("ForumPage.qml"), {
- board: boardPage.board,
- forumId: model.forumId
- });
- }
- }
- }
- }
-
- ScrollDecorator {
- flickableItem: forumsView
- }
-
- BusyIndicator {
- anchors.centerIn: parent
- platformStyle: BusyIndicatorStyle { size: "large" }
- visible: forumsView.count == 0 && board.busy
- running: visible
- }
-}
diff --git a/qml/tapasboard/EmptyListDelegate.qml b/qml/tapasboard/EmptyListDelegate.qml
deleted file mode 100644
index 9a9d63d..0000000
--- a/qml/tapasboard/EmptyListDelegate.qml
+++ /dev/null
@@ -1,29 +0,0 @@
-import QtQuick 1.1
-import com.nokia.meego 1.1
-
-Item {
- id: listItem
-
- signal clicked
- property alias pressed: mouseArea.pressed
-
- height: UiConstants.ListItemHeightDefault
- width: parent.width
-
- BorderImage {
- id: background
- anchors.fill: parent
- anchors.leftMargin: -UiConstants.DefaultMargin
- anchors.rightMargin: -UiConstants.DefaultMargin
- visible: pressed
- source: theme.inverted ? "image://theme/meegotouch-panel-inverted-background-pressed" : "image://theme/meegotouch-panel-background-pressed"
- }
-
- MouseArea {
- id: mouseArea;
- anchors.fill: parent
- onClicked: {
- listItem.clicked();
- }
- }
-}
diff --git a/qml/tapasboard/ForumPage.qml b/qml/tapasboard/ForumPage.qml
deleted file mode 100644
index 96b8082..0000000
--- a/qml/tapasboard/ForumPage.qml
+++ /dev/null
@@ -1,93 +0,0 @@
-import QtQuick 1.1
-import com.nokia.meego 1.1
-import com.nokia.extras 1.1
-import com.javispedro.tapasboard 1.0
-
-Page {
- id: forumPage
-
- anchors.leftMargin: UiConstants.DefaultMargin
- anchors.rightMargin: UiConstants.DefaultMargin
-
- property Board board: null;
- property int forumId;
-
- tools: ToolBarLayout {
- ToolIcon {
- platformIconId: "toolbar-back"
- 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
- }
- delegate: EmptyListDelegate {
- id: topicItem
-
- height: Math.max(topicItemColumn.height + UiConstants.ButtonSpacing * 2, UiConstants.ListItemHeightDefault)
-
- Column {
- id: topicItemColumn
- anchors.left: parent.left
- anchors.right: topicRepliesCount.left
- anchors.verticalCenter: parent.verticalCenter
-
- Text {
- text: model.title
- width: parent.width
- font: UiConstants.TitleFont
- wrapMode: Text.Wrap
- }
- }
-
- CountBubble {
- id: topicRepliesCount
- anchors.right: topicItemImage.left
- anchors.verticalCenter: parent.verticalCenter
- value: model.numReplies
- visible: value > 0
- }
-
- Image {
- id: topicItemImage
- source: "image://theme/icon-m-common-drilldown-arrow" + (theme.inverted ? "-inverse" : "")
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
- }
-
- onClicked: {
- pageStack.push(Qt.resolvedUrl("TopicPage.qml"), {
- board: forumPage.board,
- topicId: model.topicId
- });
- }
- }
- }
-
- ScrollDecorator {
- flickableItem: topicsView
- }
-
- BusyIndicator {
- anchors.centerIn: parent
- platformStyle: BusyIndicatorStyle { size: "large" }
- visible: topicsView.count == 0 && board.busy
- running: visible
- }
-}
diff --git a/qml/tapasboard/GroupHeader.qml b/qml/tapasboard/GroupHeader.qml
deleted file mode 100644
index 0350ee0..0000000
--- a/qml/tapasboard/GroupHeader.qml
+++ /dev/null
@@ -1,26 +0,0 @@
-import QtQuick 1.1
-import com.nokia.meego 1.1
-
-Item {
- id: header
- height: 40
-
- property alias text: headerLabel.text
-
- Text {
- id: headerLabel
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- anchors.rightMargin: 8
- anchors.bottomMargin: 2
- font: UiConstants.GroupHeaderFont
- color: theme.inverted ? "#4D4D4D" : "#3C3C3C";
- }
- Image {
- anchors.right: headerLabel.left
- anchors.left: parent.left
- anchors.verticalCenter: headerLabel.verticalCenter
- anchors.rightMargin: 24
- source: "image://theme/meegotouch-groupheader" + (theme.inverted ? "-inverted" : "") + "-background"
- }
-}
diff --git a/qml/tapasboard/MainPage.qml b/qml/tapasboard/MainPage.qml
deleted file mode 100644
index e0e8fb8..0000000
--- a/qml/tapasboard/MainPage.qml
+++ /dev/null
@@ -1,39 +0,0 @@
-import QtQuick 1.1
-import com.nokia.meego 1.1
-import com.nokia.extras 1.1
-import com.javispedro.tapasboard 1.0
-
-Page {
- id: mainPage
-
- anchors.leftMargin: UiConstants.DefaultMargin
- anchors.rightMargin: UiConstants.DefaultMargin
-
- ListView {
- id: favoritesView
- anchors.fill: parent
- model: FavoritesModel {
-
- }
- delegate: ListDelegate {
- id: favoriteItem
-
- Image {
- id: topicItemImage
- source: "image://theme/icon-m-common-drilldown-arrow" + (theme.inverted ? "-inverse" : "")
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
- }
-
- onClicked: {
- var board = boardManager.getBoard(model.boardUrl,
- model.loginUsername,
- model.loginPassword);
- pageStack.push(Qt.resolvedUrl("BoardPage.qml"), {
- board: board,
- forumId: board.rootForumId
- });
- }
- }
- }
-}
diff --git a/qml/tapasboard/TopicPage.qml b/qml/tapasboard/TopicPage.qml
deleted file mode 100644
index 689dce7..0000000
--- a/qml/tapasboard/TopicPage.qml
+++ /dev/null
@@ -1,122 +0,0 @@
-import QtQuick 1.1
-import com.nokia.meego 1.1
-import com.nokia.extras 1.1
-import com.javispedro.tapasboard 1.0
-
-Page {
- id: topicPage
-
- anchors.leftMargin: UiConstants.DefaultMargin
- anchors.rightMargin: UiConstants.DefaultMargin
-
- property Board board;
- property int topicId;
-
- tools: ToolBarLayout {
- ToolIcon {
- platformIconId: "toolbar-back"
- 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
- }
- section.property: "humanDate"
- section.criteria: ViewSection.FullString
- section.delegate: GroupHeader {
- width: parent.width
- text: section
- }
-
- delegate: Item {
- id: postItem
-
- height: postItemRectangle.height + UiConstants.ButtonSpacing * 2
- width: parent.width
-
- Rectangle {
- id: postItemRectangle
- width: parent.width
- height: postItemColumn.height + UiConstants.DefaultMargin
- anchors.centerIn: parent
-
- color: "white"
- radius: 20
-
- Column {
- id: postItemColumn
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: UiConstants.DefaultMargin
- anchors.verticalCenter: parent.verticalCenter
- spacing: 2
-
- Item {
- width: parent.width
- height: childrenRect.height
-
- Text {
- anchors.top: parent.top
- anchors.left: parent.left
- text: model.userName
- font: UiConstants.SmallTitleFont
- textFormat: Text.PlainText
- }
- Text {
- anchors.top: parent.top
- anchors.right: parent.right
- text: model.humanTime
- font: UiConstants.SubtitleFont
- textFormat: Text.PlainText
- }
- }
-
- Text {
- text: model.title
- width: parent.width
- font: UiConstants.TitleFont
- visible: text != ""
- textFormat: Text.PlainText
- wrapMode: Text.Wrap
- }
-
- Text {
- text: model.content
- width: parent.width
- font: UiConstants.SubtitleFont
- textFormat: Text.RichText
- wrapMode: Text.Wrap
- onLinkActivated: Qt.openUrlExternally(link)
- }
- }
- }
- }
- }
-
- ScrollDecorator {
- flickableItem: postsView
- }
-
- BusyIndicator {
- anchors.centerIn: parent
- platformStyle: BusyIndicatorStyle { size: "large" }
- visible: postsView.count == 0 && board.busy
- running: visible
- }
-}
diff --git a/qml/tapasboard/main.qml b/qml/tapasboard/main.qml
deleted file mode 100644
index 11a7e44..0000000
--- a/qml/tapasboard/main.qml
+++ /dev/null
@@ -1,12 +0,0 @@
-import QtQuick 1.1
-import com.nokia.meego 1.0
-
-PageStackWindow {
- id: appWindow
-
- initialPage: mainPage
-
- MainPage {
- id: mainPage
- }
-}