+import QtQuick 1.0
+import com.nokia.meego 1.0
+import "feedSearch.js" as FeedJS
+
+Page {
+ id: addFeedPage
+ tools: tabTools
+ anchors.margins: UiConstants.DefaultMargin
+ anchors.fill: parent
+
+ TabGroup {
+ id: tabGroup
+ anchors.fill: parent
+ currentTab: searchTab
+
+ Item {
+ id: searchTab
+ anchors.fill: parent
+
+ Column {
+ spacing: 10
+
+ Text {
+ id: searchText
+ font.pixelSize: 22
+ color: "white"
+ text: "Search for feeds"
+ }
+
+ TextInputClear {
+ id: searchInput
+ placeHolder: "Enter a search term"
+ }
+
+ Button {
+ id: searchButton
+ text: "Search"
+ onClicked: FeedJS.keywordSearch(searchInput.text)
+ }
+ }
+
+ SelectionDialog {
+ id: searchDialog
+ titleText: "Select feed:"
+ //model: []
+ onSelectedIndexChanged: {
+ if (selectedIndex>=0) {
+ var feedTitle = searchDialog.model.get(searchDialog.selectedIndex).name;
+ var feedUrl = searchDialog.model.get(searchDialog.selectedIndex).url;
+ container.addFeed(feedTitle,feedUrl,1);
+ console.log("Adding feed "+feedTitle+" at " +feedUrl);
+ }
+ }
+ }
+
+ } //searchTab
+
+ Item {
+ id: urlTab
+
+ Column {
+ Text {
+ id: urlText
+ font.pixelSize: 22
+ color: "white"
+ text: "Enter the feed URL"
+ }
+
+ TextInputClear {
+ id: urlInput
+ placeHolder: "Feed URL"
+
+ }
+
+ Button {
+ id: urlButton
+ text: "Add"
+ checkable: true
+ onClicked: {
+ console.log("Adding "+urlInput.text)
+ container.addFeed("",urlInput.text,1);
+ }
+ }
+ }
+
+ } //searchTab
+
+ ToolBarLayout {
+ id: tabTools
+ ToolIcon {
+ iconId: "toolbar-back"
+ onClicked: tabGroup.currentTab.depth > 1 ? tabGroup.currentTab.pop() : pageStack.pop()
+ }
+ ButtonRow {
+ TabButton {
+ text: "Search"
+ tab: searchTab
+ }
+ TabButton {
+ text: "URL"
+ tab: urlTab
+ }
+ }
+ }
+ }
+}
+
+
+//Dialog {
+// id: myDialog
+
+// title: Item {
+// height: myDialog.platformStyle.titleBarHeight
+// width: parent.width
+// Label {
+// id: titleLabel
+// anchors.left: supplement.right
+// anchors.verticalCenter: titleField.verticalCenter
+// font.capitalization: Font.MixedCase
+// color: "white"
+// text: "Add A Feed"
+// }
+
+// }
+
+// content:Item {
+// id: name
+// //height: childrenRect.height
+
+
+
+// TextInputClear {
+// id: urlInput
+// placeHolder: "Enter a feed URL"
+// }
+
+// }
+
+// buttons: ButtonRow {
+// platformStyle: ButtonStyle { }
+// anchors.horizontalCenter: parent.horizontalCenter
+// Button {id: b1; text: "OK"; onClicked: myDialog.accept()}
+// Button {id: b2; text: "Cancel"; onClicked: myDialog.reject()}
+// }
+//}