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 getCurrentArticleId() {
47 var object = articleView.model.get(articleView.currentIndex)
48 return object.articleid
52 id: articleList; /*model: visualModel.parts.list;*/ z: 6
56 height: updateBarArticles.visible? parent.height-updateBarArticles.height : parent.height;
59 flickDeceleration: 1500
60 visible: articles.status==XmlListModel.Ready
68 orientation: ListView.Horizontal
70 height: updateBarArticles.visible? parent.height-updateBarArticles.height : parent.height;
72 onCurrentIndexChanged: articlesView.positionViewAtIndex(currentIndex, ListView.Contain)
73 highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem
75 onMovementStarted: articleViewer.vertPanningEnabled=false;
76 onMovementEnded: articleViewer.vertPanningEnabled=true;
77 highlightMoveDuration: 300;
85 value: window.updateProgressValue
86 visible: window.isUpdateInProgress
88 anchors.bottom: parent.bottom
93 //width: parent.width; height: parent.height;
97 //anchors.centerIn: parent;
102 id: noText; color: "#ffffff"; anchors.centerIn: parent; text: qsTr("No articles available");
103 font.pixelSize: settings.mainTextSize
108 anchors.centerIn: parent;
111 platformStyle: BusyIndicatorStyle { size: "large" }
115 // Disable clicks when this item is visible
117 enabled: parent.visible
121 name: "noArticle"; when: articles.count==0 && articles.status==XmlListModel.Ready
122 PropertyChanges { target: noArticle; visible: true; }
123 PropertyChanges { target: loadingImage; visible: false; }
124 PropertyChanges { target: noText; visible: true; }
126 name: "loading"; when: articles.status != XmlListModel.Ready
127 PropertyChanges { target: noArticle; visible: true; }
128 PropertyChanges { target: noText; visible: false; }
129 PropertyChanges { target: loadingIndicator; visible: true; }
136 visible: articles.status != XmlListModel.Ready
145 width: articleViewer.width; height: backRect.height + 3
149 id: backRect; color: settings.backColour; opacity: index % 2 ? 0.2 : 0.4;
150 height: articleText.height + 22; width: listItem.width;
155 anchors.verticalCenter: backRect.verticalCenter
157 width: listItem.width - 6;
160 verticalAlignment: Text.AlignVCenter;
162 color: (unread=="True") ? settings.mainTextColour : settings.secondaryTextColour;
164 wrapMode: Text.WordWrap; font.bold: false;
165 font.pointSize: settings.articleListingTextSize
167 MouseArea { anchors.fill: listItem;
168 onClicked: { articleView.currentIndex = index; articleView.visible = true; }
178 width: articleDisplay.width;
179 height: articleView.height;
181 //property string url: (articleView.visible && Math.abs(articleView.currentIndex-index)<2) ? path: "";
182 property string html: controller.getArticle(articleViewer.feedid, articleid)
185 zoomEnabled: articleViewer.zoomEnabled;
186 property bool vertPanningEnabled: articleViewer.vertPanningEnabled;
189 name: 'articleIsRead';
190 when: articleView.visible && articleView.currentIndex == index;
195 controller.setEntryRead(articleViewer.feedid, articleid)
207 //source: articleViewer.feedid == "" ? "" : "http://localhost:8000/articles/" + feedid + "?onlyUnread=" + hideReadArticles
208 xml: articleViewer.feedid == "" ? "<?xml version=\"1.0\" encoding=\"utf-8\"?><xml></xml>" : controller.getArticlesXml(articleViewer.feedid)
209 query: "/xml/article"
211 XmlRole { name: "title"; query: "title/string()" }
212 XmlRole { name: "articleid"; query: "articleid/string()"; isKey: true }
213 XmlRole { name: "path"; query: "path/string()" }
214 XmlRole { name: "unread"; query: "unread/string()"; isKey: true}