function reload() {
feeds.xml = catid == "" ? "<?xml version=\"1.0\" encoding=\"utf-8\"?><xml></xml>" : controller.getFeedsXml(catid);
//feeds.reload()
- console.log(feeds.xml)
+ //console.log(feeds.xml)
}
- Component.onCompleted: { console.log(catid + "/" + parent.catid) }
+ //Component.onCompleted: { console.log(catid + "/" + parent.catid); console.log(feeds.xml) }
+
+ //onCatidChanged: console.log("catid changed: "+catid)
ListView {
id: feedList; model: feeds; delegate: feedDelegate; z: 6
Item {
- Component.onCompleted: console.log("item:"+feedid)
- id: wrapper; width: wrapper.ListView.view.width;
+ //Component.onCompleted: console.log("item:"+feedid + " "+ visible + " "+ height + " " + width)
+ id: wrapper;
+ //width: wrapper.ListView.view.width;
visible: (unread == "0" && feedsItem.hideReadFeeds=="True") ? false : true
+ //visible: true
height: (visible) ? 86 : 0
+ width: parent.width
Item {
id: moveMe
Text { text: updatedDate + " / " + qsTr("%1 unread items").arg(unread); color: (unread=="0") ? "white" : "#7b97fd"; width: parent.width; font.bold: false; elide: Text.ElideRight; style: Text.Raised; styleColor: "black" }
//Text { text: feedname; width: parent.width; elide: Text.ElideLeft; color: "#cccccc"; style: Text.Raised; styleColor: "black" }
}
+//// Item {
+//// x: wrapper.ListView.view.width - 128; y: 12
+//// height: 58; width: 58;
+//// //anchors.horizontalCenter: parent.horizontalCenter;
+//// Image { source: "common/images/wmEditIcon.png" }
+//// MouseArea {
+//// anchors.fill: parent; onClicked: { container.feedEdit(feedname, feedid, url); }
+//// }
+//// visible: inEditMode
+//// }
// Item {
-// x: wrapper.ListView.view.width - 128; y: 12
+// x: wrapper.ListView.view.width - 64; y: 12
// height: 58; width: 58;
// //anchors.horizontalCenter: parent.horizontalCenter;
-// Image { source: "common/images/wmEditIcon.png" }
+// Image { source: "common/images/delete.png" }
// MouseArea {
-// anchors.fill: parent; onClicked: { container.feedEdit(feedname, feedid, url); }
+// anchors.fill: parent; onClicked: { container.feedDeleted(feedid); }
// }
// visible: inEditMode
// }
- Item {
- x: wrapper.ListView.view.width - 64; y: 12
- height: 58; width: 58;
- //anchors.horizontalCenter: parent.horizontalCenter;
- Image { source: "common/images/delete.png" }
- MouseArea {
- anchors.fill: parent; onClicked: { container.feedDeleted(feedid); }
- }
- visible: inEditMode
- }
}
MouseArea {
anchors.fill: wrapper;
PageStackWindow {
+ id: window
initialPage: categoryPage
+ signal articleClosed()
+ property string feedid
+ property string catid
+
ToolBarLayout {
id: commonTools
visible: false
id: myMenu
visualParent: pageStack
MenuLayout {
+ MenuItem { text: qsTr("Settings"); onClicked: {} }
+ MenuItem { text: qsTr("Update All Categories"); visible: pageStack.depth==3; onClicked: controller.updateAll(); }
+ MenuItem { text: qsTr("About FeedingIt"); onClicked: query.open(); }
+ }
+ }
+
+ Menu {
+ id: myFeedsMenu
+ visualParent: pageStack
+ MenuLayout {
+ MenuItem { text: qsTr("Update All Feeds"); onClicked: controller.updateAll(); }
+ MenuItem { text: qsTr("About FeedingIt"); onClicked: query.open(); }
+ }
+ }
+
+ Menu {
+ id: myArticlesMenu
+ visualParent: pageStack
+ MenuLayout {
+ MenuItem { text: qsTr("Mark All As Read"); onClicked: controller.markAllAsRead(feedid); }
+ MenuItem { text: qsTr("Update Feed"); onClicked: controller.updateFeed(feedid); }
MenuItem { text: qsTr("About FeedingIt"); onClicked: query.open(); }
}
}
Page {
tools: commonTools
Categories {
- onCategoryClicked: pageStack.push(feedsPage, {catid: cat})
+ onCategoryClicked: {
+ window.catid = cat
+ pageStack.push(feedsPage)
+ }
}
}
}
Component {
id: feedsPage
+
Page {
- tools: commonTools
- property string catid
+ tools: feedsTools
+ anchors.fill: parent
+ property string catid: window.catid
Feeds {
id: feedsItem
- onFeedClicked: pageStack.push(articlesPage, {feedid: feedid})
+ onFeedClicked: {
+ window.feedid = feedid
+ pageStack.push(articlesPage)
+ }
+ }
+ ToolBarLayout {
+ id: feedsTools
+ visible: false
+ ToolIcon { iconId: "toolbar-back";
+ onClicked: {
+ myArticlesMenu.close();
+ pageStack.pop();
+ }
+ }
+ ToolIcon {
+ platformIconId: "toolbar-view-menu"
+ anchors.right: (parent === undefined) ? undefined : parent.right
+ onClicked: (myFeedsMenu.status == DialogStatus.Closed) ? myFeedsMenu.open() : myFeedsMenu.close()
+ }
}
+ Connections {
+ target: window
+ onArticleClosed: feedsItem.reload()
+ }
}
}
id: articlesPage
Page {
tools: articleTools
- property string feedid
+ property string feedid: window.feedid
ArticleViewer {
id: flipper
}
- }
- ToolBarLayout {
- id: articleTools
- visible: false
- ToolIcon { iconId: "toolbar-back"; onClicked: {
- myMenu.close();
- if (flipper.articleShown) {
- flipper.articleShown = false;
- flipper.reload()
- } else {
- pageStack.pop();
+ ToolBarLayout {
+ id: articleTools
+ visible: false
+ ToolIcon { iconId: "toolbar-back";
+ onClicked: {
+ myArticlesMenu.close();
+ if (flipper.articleShown) {
+ flipper.articleShown = false;
+ flipper.reload()
+ } else {
+ window.articleClosed();
+ pageStack.pop();
+ }
}
}
- visible: pageStack.depth>1
- }
- ToolIcon {
- platformIconId: "toolbar-view-menu"
- anchors.right: (parent === undefined) ? undefined : parent.right
- onClicked: (myMenu.status == DialogStatus.Closed) ? myMenu.open() : myMenu.close()
+
+ ToolIcon {
+ platformIconId: "toolbar-prev"
+ //anchors.right: (parent === undefined) ? undefined : parent.right
+ onClicked: flipper.prev();
+ }
+
+ ToolIcon {
+ platformIconId: "toolbar-next"
+ //anchors.right: (parent === undefined) ? undefined : parent.right
+ onClicked: flipper.next()
+ }
+
+ ToolIcon {
+ platformIconId: "toolbar-view-menu"
+ anchors.right: (parent === undefined) ? undefined : parent.right
+ onClicked: (myArticlesMenu.status == DialogStatus.Closed) ? myArticlesMenu.open() : myArticlesMenu.close()
+ }
}
}
}