2 import com.nokia.meego 1.0
6 //width: 480; height: 360;
7 width: parent.width; height: parent.height;
8 property string feedid: parent.feedid
9 //property string feedid: "61ac1458d761423344998dc76770e36e" //articlesItem.feedid;
10 //property string hideReadArticles: "";
11 //property alias articleShown: articleView.visible;
12 property bool zoomEnabled: false;
13 property bool vertPanningEnabled: true
15 signal openArticle(string articleid);
17 function modulo(x,y) {
18 // Fixes modulo for negative numbers
23 articles.xml = articleViewer.feedid == "" ? "<?xml version=\"1.0\" encoding=\"utf-8\"?><xml></xml>" : controller.getArticlesXml(articleViewer.feedid);
27 function markAllAsRead() {
29 controller.markAllAsRead(feedid)
34 function getCurrentArticleId() {
35 var object = articleView.model.get(articleView.currentIndex)
36 return object.articleid
40 id: articleList; /*model: visualModel.parts.list;*/ z: 6
44 height: updateBarArticles.visible? parent.height-updateBarArticles.height : parent.height;
47 flickDeceleration: 1500
48 visible: articles.status==XmlListModel.Ready
54 // property int webviewFontSize: settings.webviewFontSize
57 // orientation: ListView.Horizontal
58 // width: parent.width;
59 // height: updateBarArticles.visible? parent.height-updateBarArticles.height : parent.height;
60 // visible: false; z:8
61 // onCurrentIndexChanged: articleView.positionViewAtIndex(currentIndex, ListView.Contain)
62 // highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem
64 // onMovementStarted: articleViewer.vertPanningEnabled=false;
65 // onMovementEnded: articleViewer.vertPanningEnabled=true;
66 // highlightMoveDuration: 300;
74 value: window.updateProgressValue
75 visible: window.isUpdateInProgress
77 anchors.bottom: parent.bottom
82 //width: parent.width; height: parent.height;
86 //anchors.centerIn: parent;
91 id: noText; color: "#ffffff"; anchors.centerIn: parent; text: qsTr("No articles available");
92 font.pixelSize: settings.mainTextSize
97 anchors.centerIn: parent;
100 platformStyle: BusyIndicatorStyle { size: "large" }
104 // Disable clicks when this item is visible
106 enabled: parent.visible
110 name: "noArticle"; when: articles.count==0 && articles.status==XmlListModel.Ready
111 PropertyChanges { target: noArticle; visible: true; }
112 PropertyChanges { target: loadingImage; visible: false; }
113 PropertyChanges { target: noText; visible: true; }
115 name: "loading"; when: articles.status != XmlListModel.Ready
116 PropertyChanges { target: noArticle; visible: true; }
117 PropertyChanges { target: noText; visible: false; }
118 PropertyChanges { target: loadingIndicator; visible: true; }
125 visible: articles.status != XmlListModel.Ready
134 width: articleViewer.width; height: backRect.height + 3
138 id: backRect; color: settings.backColour; opacity: index % 2 ? 0.2 : 0.4;
139 height: articleText.height + 22; width: listItem.width;
144 anchors.verticalCenter: backRect.verticalCenter
146 width: listItem.width - 6;
149 verticalAlignment: Text.AlignVCenter;
151 color: (unread=="True") ? settings.mainTextColour : settings.secondaryTextColour;
153 wrapMode: Text.WordWrap; font.bold: false;
154 font.pointSize: settings.articleListingTextSize
156 MouseArea { anchors.fill: listItem;
158 articleViewer.openArticle(articleid)
159 //articleView.currentIndex = index; articleView.visible = true;
170 // width: articleDisplay.width;
171 // height: articleView.height;
173 // //property string url: (articleView.visible && Math.abs(articleView.currentIndex-index)<2) ? path: "";
174 // property string html: controller.getArticle(articleViewer.feedid, articleid)
176 // id: articleDisplay
177 // zoomEnabled: articleViewer.zoomEnabled;
178 // property bool vertPanningEnabled: articleViewer.vertPanningEnabled;
181 // name: 'articleIsRead';
182 // when: articleView.visible && articleView.currentIndex == index;
183 // StateChangeScript {
186 // //flipItem.url=path;
187 // controller.setEntryRead(articleViewer.feedid, articleid)
199 //source: articleViewer.feedid == "" ? "" : "http://localhost:8000/articles/" + feedid + "?onlyUnread=" + hideReadArticles
200 xml: articleViewer.feedid == "" ? "<?xml version=\"1.0\" encoding=\"utf-8\"?><xml></xml>" : controller.getArticlesXml(articleViewer.feedid)
201 query: "/xml/article"
203 XmlRole { name: "title"; query: "title/string()" }
204 XmlRole { name: "articleid"; query: "articleid/string()"; isKey: true }
205 XmlRole { name: "path"; query: "path/string()" }
206 XmlRole { name: "unread"; query: "unread/string()"; isKey: true}