psa: Moved harmattand code to Qt project with sync option
[feedingit] / FeedingIt-Sync / qml / qmlDev / AddFeed.qml
1 import QtQuick 1.0
2 import com.nokia.meego 1.0
3
4 Page {
5     id: root
6     tools: tabTools
7     anchors.margins: UiConstants.DefaultMargin
8
9     TabGroup {
10         id: tabGroup
11         anchors.fill: parent
12         currentTab: showcaseTab
13
14         Item {
15             id: searchTab
16
17             Text {
18                 id: searchText
19                 font.pixelSize: 22
20                 color: "white"
21                 text: "Search for feeds"
22             }
23
24             TextInputClear {
25                 id: searchInput
26                 placeHolder: "Enter a search term"
27             }
28
29             Button {
30                 id: searchButton
31                 text: "Search"
32                 checkable: true
33                 onClicked: feedJS.search(searchInput.text)
34             }
35
36             SelectionDialog {
37                      id: searchDialog
38                      titleText: "Select feed:"
39                      //model: []
40                      onSelectedIndexChanged: {
41                          if (selectedIndex>=0) {
42                              var feedTitle = singleSelectionDialog.model.get(singleSelectionDialog.selectedIndex).name;
43                              var feedUrl = singleSelectionDialog.model.get(singleSelectionDialog.selectedIndex).url;
44                              console.log("Adding feed "+title+" at " +url);
45                          }
46                      }
47             }
48
49         } //searchTab
50
51         Item {
52             id: urlTab
53
54             Text {
55                 id: urlText
56                 font.pixelSize: 22
57                 color: "white"
58                 text: "Enter the feed URL"
59             }
60
61             TextInputClear {
62                 id: urlInput
63                 placeHolder: "Feed URL"
64
65             }
66
67             Button {
68                 id: urlButton
69                 text: "Add"
70                 checkable: true
71                 onClicked: {
72                     console.log("Adding "+urlInput.text)
73                 }
74             }
75
76         } //searchTab
77
78         ToolBarLayout {
79             id: tabTools
80             ToolIcon {
81                 iconId: "toolbar-back"
82                 onClicked: tabGroup.currentTab.depth > 1 ? tabGroup.currentTab.pop() : pageStack.pop()
83             }
84             ButtonRow {
85                 TabButton {
86                     text: "Search"
87                     tab: showcaseTab
88                 }
89                 TabButton {
90                     text: "URL"
91                     tab: specialFieldsTab
92                 }
93             }
94         }
95     }
96 }
97
98
99 //Dialog {
100 //    id: myDialog
101
102 //    title: Item {
103 //        height: myDialog.platformStyle.titleBarHeight
104 //        width: parent.width
105 //        Label {
106 //            id: titleLabel
107 //            anchors.left: supplement.right
108 //            anchors.verticalCenter: titleField.verticalCenter
109 //            font.capitalization: Font.MixedCase
110 //            color: "white"
111 //            text: "Add A Feed"
112 //        }
113
114 //    }
115
116 //    content:Item {
117 //        id: name
118 //        //height: childrenRect.height
119
120
121
122 //        TextInputClear {
123 //            id: urlInput
124 //            placeHolder: "Enter a feed URL"
125 //        }
126
127 //    }
128
129 //    buttons: ButtonRow {
130 //                    platformStyle: ButtonStyle { }
131 //                    anchors.horizontalCenter: parent.horizontalCenter
132 //                    Button {id: b1; text: "OK"; onClicked: myDialog.accept()}
133 //                    Button {id: b2; text: "Cancel"; onClicked: myDialog.reject()}
134 //                }
135 //}