c0dd4091403ccd22fe5919c6e4add9e76eff9446
[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: cat})
53             }
54         }
55     }
56
57     Component {
58         id: feedsPage
59         Page {
60             tools: commonTools
61             property string catid
62             Feeds {
63                 id: feedsItem
64                 onFeedClicked: pageStack.push(articlesPage, {feedid: feedid})
65             }
66         }
67     }
68
69     Component {
70         id: articlesPage
71         Page {
72             tools: articleTools
73             property string feedid
74             ArticleViewer {
75                 id: flipper
76             }
77         }
78
79         ToolBarLayout {
80             id: articleTools
81             visible: false
82             ToolIcon { iconId: "toolbar-back"; onClicked: {
83                     myMenu.close();
84                     if (flipper.articleShown) {
85                         flipper.articleShown = false;
86                         flipper.reload()
87                     } else {
88                         pageStack.pop();
89                     }
90                 }
91                 visible: pageStack.depth>1
92             }
93             ToolIcon {
94                 platformIconId: "toolbar-view-menu"
95                 anchors.right: (parent === undefined) ? undefined : parent.right
96                 onClicked: (myMenu.status == DialogStatus.Closed) ? myMenu.open() : myMenu.close()
97             }
98         }
99     }
100 }