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);
28 if (articleView.visible) {
29 //articleView.positionViewAtIndex(modulo(articleView.currentIndex+1, articleView.count), ListView.Contain);
30 articleView.incrementCurrentIndex();
35 if (articleView.visible) {
36 //articleView.positionViewAtIndex(modulo(articleView.currentIndex-1, articleView.count), ListView.Contain);
37 articleView.decrementCurrentIndex();
41 function markAllAsRead() {
43 controller.markAllAsRead(feedid)
48 function getCurrentArticleId() {
49 var object = articleView.model.get(articleView.currentIndex)
50 return object.articleid
54 id: articleList; /*model: visualModel.parts.list;*/ z: 6
58 height: updateBarArticles.visible? parent.height-updateBarArticles.height : parent.height;
61 flickDeceleration: 1500
62 visible: articles.status==XmlListModel.Ready
68 // property int webviewFontSize: settings.webviewFontSize
71 // orientation: ListView.Horizontal
72 // width: parent.width;
73 // height: updateBarArticles.visible? parent.height-updateBarArticles.height : parent.height;
74 // visible: false; z:8
75 // onCurrentIndexChanged: articleView.positionViewAtIndex(currentIndex, ListView.Contain)
76 // highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem
78 // onMovementStarted: articleViewer.vertPanningEnabled=false;
79 // onMovementEnded: articleViewer.vertPanningEnabled=true;
80 // highlightMoveDuration: 300;
88 value: window.updateProgressValue
89 visible: window.isUpdateInProgress
91 anchors.bottom: parent.bottom
96 //width: parent.width; height: parent.height;
100 //anchors.centerIn: parent;
105 id: noText; color: "#ffffff"; anchors.centerIn: parent; text: qsTr("No articles available");
106 font.pixelSize: settings.mainTextSize
111 anchors.centerIn: parent;
114 platformStyle: BusyIndicatorStyle { size: "large" }
118 // Disable clicks when this item is visible
120 enabled: parent.visible
124 name: "noArticle"; when: articles.count==0 && articles.status==XmlListModel.Ready
125 PropertyChanges { target: noArticle; visible: true; }
126 PropertyChanges { target: loadingImage; visible: false; }
127 PropertyChanges { target: noText; visible: true; }
129 name: "loading"; when: articles.status != XmlListModel.Ready
130 PropertyChanges { target: noArticle; visible: true; }
131 PropertyChanges { target: noText; visible: false; }
132 PropertyChanges { target: loadingIndicator; visible: true; }
139 visible: articles.status != XmlListModel.Ready
148 width: articleViewer.width; height: backRect.height + 3
152 id: backRect; color: settings.backColour; opacity: index % 2 ? 0.2 : 0.4;
153 height: articleText.height + 22; width: listItem.width;
158 anchors.verticalCenter: backRect.verticalCenter
160 width: listItem.width - 6;
163 verticalAlignment: Text.AlignVCenter;
165 color: (unread=="True") ? settings.mainTextColour : settings.secondaryTextColour;
167 wrapMode: Text.WordWrap; font.bold: false;
168 font.pointSize: settings.articleListingTextSize
170 MouseArea { anchors.fill: listItem;
172 articleViewer.openArticle(articleid)
173 //articleView.currentIndex = index; articleView.visible = true;
184 // width: articleDisplay.width;
185 // height: articleView.height;
187 // //property string url: (articleView.visible && Math.abs(articleView.currentIndex-index)<2) ? path: "";
188 // property string html: controller.getArticle(articleViewer.feedid, articleid)
190 // id: articleDisplay
191 // zoomEnabled: articleViewer.zoomEnabled;
192 // property bool vertPanningEnabled: articleViewer.vertPanningEnabled;
195 // name: 'articleIsRead';
196 // when: articleView.visible && articleView.currentIndex == index;
197 // StateChangeScript {
200 // //flipItem.url=path;
201 // controller.setEntryRead(articleViewer.feedid, articleid)
213 //source: articleViewer.feedid == "" ? "" : "http://localhost:8000/articles/" + feedid + "?onlyUnread=" + hideReadArticles
214 xml: articleViewer.feedid == "" ? "<?xml version=\"1.0\" encoding=\"utf-8\"?><xml></xml>" : controller.getArticlesXml(articleViewer.feedid)
215 query: "/xml/article"
217 XmlRole { name: "title"; query: "title/string()" }
218 XmlRole { name: "articleid"; query: "articleid/string()"; isKey: true }
219 XmlRole { name: "path"; query: "path/string()" }
220 XmlRole { name: "unread"; query: "unread/string()"; isKey: true}