Adding PageStack support in qml
[feedingit] / psa_harmattan / feedingit / qml / main.qml
1 import QtQuick 1.0
2 import com.nokia.meego 1.0
3
4
5 PageStackWindow {
6     initialPage: categoryPage
7
8     ToolBarLayout {
9         id: commonTools
10         visible: false
11         ToolIcon { iconId: "toolbar-back"; onClicked: { myMenu.close(); pageStack.pop(); }
12             visible: pageStack.depth>1 }
13         ToolIcon {
14             platformIconId: "toolbar-view-menu"
15             anchors.right: (parent === undefined) ? undefined : parent.right
16             onClicked: (myMenu.status == DialogStatus.Closed) ? myMenu.open() : myMenu.close()
17         }
18     }
19
20     Menu {
21         id: myMenu
22         visualParent: pageStack
23         MenuLayout {
24             MenuItem { text: qsTr("About FeedingIt"); onClicked: query.open(); }
25         }
26     }
27
28     QueryDialog {
29         id: query
30         icon: "common/images/feedingit.png"
31         titleText: "Feedingit RSS Reader"
32         message: "Version: 0.0.9"
33         +"<br><br>FeedingIt RSS Reader.<br>"
34         +"<br>&copy; 2011 feedingit.marcoz.org"
35         +"<br>http://feedingit.marcoz.org"
36         acceptButtonText: "OK"
37     }
38
39 //    Page{
40 //        id: mainPage
41 //        Component.onCompleted: {
42 //            var main = Qt.createComponent("FeedingIt.qml");
43 //            main.createObject(mainPage);
44 //        }
45 //    }
46
47     Component {
48         id: categoryPage
49         Page {
50             tools: commonTools
51             Categories {
52                 onCategoryClicked: pageStack.push(feedsPage, {catid: catid})
53             }
54         }
55     }
56
57     Component {
58         id: feedsPage
59         Page {
60             tools: commonTools
61             Feeds {
62                 id: feedsItem
63
64                 onFeedClicked: pageStack.push(articlesPage, {feedid: feedid})
65             }
66         }
67     }
68
69     Component {
70         id: articlesPage
71         Page {
72             tools: commonTools
73             ArticleViewer {
74                 id: flipper
75             }
76         }
77     }
78 }