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 function modulo(x,y) {
16 // Fixes modulo for negative numbers
21 articles.xml = articleViewer.feedid == "" ? "<?xml version=\"1.0\" encoding=\"utf-8\"?><xml></xml>" : controller.getArticlesXml(articleViewer.feedid);
26 if (articleView.visible) {
27 //articleView.positionViewAtIndex(modulo(articleView.currentIndex+1, articleView.count), ListView.Contain);
28 articleView.incrementCurrentIndex();
33 if (articleView.visible) {
34 //articleView.positionViewAtIndex(modulo(articleView.currentIndex-1, articleView.count), ListView.Contain);
35 articleView.decrementCurrentIndex();
39 function markAllAsRead() {
41 controller.markAllAsRead(feedid)
46 function viewArticle(articleid) {
48 for (var i=0; i<articleList.count; ++i) {
49 if (articles.get(0).articleid==articleid) {
53 articleView.positionViewAtIndex(index, ListView.Contain); articleView.visible = true;
57 id: articleList; /*model: visualModel.parts.list;*/ z: 6
61 height: updateBarFeeds.visible? parent.height-updateBarFeeds.height : parent.height;
64 flickDeceleration: 1500
65 visible: articles.status==XmlListModel.Ready
72 orientation: ListView.Horizontal
74 height: updateBarFeeds.visible? parent.height-updateBarFeeds.height : parent.height;
76 //onCurrentIndexChanged: photosGridView.positionViewAtIndex(currentIndex, GridView.Contain)
77 highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem
79 onMovementStarted: articleViewer.vertPanningEnabled=false;
80 onMovementEnded: articleViewer.vertPanningEnabled=true;
81 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.pixelSize: settings.mainTextSize
170 MouseArea { anchors.fill: listItem;
171 onClicked: { articleView.positionViewAtIndex(index, ListView.Contain); articleView.visible = true; }
181 width: articleViewer.width; height: articleViewer.height;
183 //property string url: (articleView.visible && Math.abs(articleView.currentIndex-index)<2) ? path: "";
184 property string html: controller.getArticle(articleViewer.feedid, articleid)
186 zoomEnabled: articleViewer.zoomEnabled;
187 property bool vertPanningEnabled: articleViewer.vertPanningEnabled;
190 name: 'articleIsRead';
191 when: articleView.visible && articleView.currentIndex == index;
196 controller.setEntryRead(articleViewer.feedid, articleid)
208 //source: articleViewer.feedid == "" ? "" : "http://localhost:8000/articles/" + feedid + "?onlyUnread=" + hideReadArticles
209 xml: articleViewer.feedid == "" ? "<?xml version=\"1.0\" encoding=\"utf-8\"?><xml></xml>" : controller.getArticlesXml(articleViewer.feedid)
210 query: "/xml/article"
212 XmlRole { name: "title"; query: "title/string()" }
213 XmlRole { name: "articleid"; query: "articleid/string()"; isKey: true }
214 XmlRole { name: "path"; query: "path/string()" }
215 XmlRole { name: "unread"; query: "unread/string()"; isKey: true}