anchors.margins: UiConstants.DefaultMargin
anchors.fill: parent
+ function addFileToDialog(fullname, filename) {
+ fileDialog.model.append({name: filename,
+ fullname: fullname})
+ }
+
TabGroup {
id: tabGroup
anchors.fill: parent
Column {
spacing: 10
+ width: parent.width
Text {
id: searchText
font.pixelSize: 22
color: "white"
- text: "Search for feeds"
+ text: qsTr("Add a feed by URL, or search by keyword")
}
TextInputClear {
id: searchInput
- placeHolder: "Enter a search term"
+ placeHolder: qsTr("Enter a URL or keywords")
}
Button {
id: searchButton
text: "Search"
- onClicked: FeedJS.keywordSearch(searchInput.text)
+ onClicked: {
+ var key = searchInput.text
+ if (key.substring(0, 4) === "http") {
+ categoryDialog.confirmCategory("", urlInput.text);
+ } else {
+ FeedJS.keywordSearch(searchInput.text)
+ }
+ }
}
}
SelectionDialog {
id: searchDialog
- titleText: "Select feed:"
+ titleText: qsTr("Select feed:")
//model: []
onSelectedIndexChanged: {
if (selectedIndex>=0) {
} //searchTab
Item {
- id: urlTab
-
- Column {
- Text {
- id: urlText
- font.pixelSize: 22
- color: "white"
- text: "Enter the feed URL"
- }
-
- TextInputClear {
- id: urlInput
- placeHolder: "Feed URL"
- width: parent.width
- }
-
- Button {
- id: urlButton
- text: "Add"
- onClicked: {
- console.log("Adding "+urlInput.text)
- //controller.addFeed("",urlInput.text,1);
- categoryDialog.confirmCategory("", urlInput.text);
- }
- width: 150
- }
- }
-
- } //urlTab
-
- Item {
- id: opmlTab
-
- Column {
- Text {
- id: opmlText
- font.pixelSize: 22
- color: "white"
- text: "Enter the OPML filename in MyDocs folder"
- }
-
- TextInputClear {
- id: opmlInput
- placeHolder: "OPML filename"
- width: parent.width
- }
-
- Button {
- id: opmlButton
- text: "Import"
- onClicked: {
- console.log("Importing "+opmlInput.text)
- //controller.addFeed("",urlInput.text,1);
- var num = controller.importOpml(opmlInput.text)
- banner.text=qsTr("Successfully imported "+num+" feeds.")
- banner.open()
- }
- width: 150
- }
- }
-
- } //opmlTab
-
- Item {
id: categoryTab
+ anchors.fill: parent
Column {
+ width: parent.width
+ spacing: 10
Text {
id: categoryText
font.pixelSize: 22
Button {
id: categoryButton
- text: "Add"
+ text: "Add Category"
onClicked: {
if (categoryInput.text != "") {
controller.addCategory(categoryInput.text)
window.categoryReloadRequest()
}
}
- width: 150
+ //width: 150
}
}
tab: searchTab
}
TabButton {
- text: "URL"
- tab: urlTab
- }
- TabButton {
- text: "Import"
- tab: opmlTab
- }
- TabButton {
text: "Categories"
tab: categoryTab
}
}
+ ToolIcon {
+ platformIconId: "toolbar-view-menu"
+ anchors.right: (parent === undefined) ? undefined : parent.right
+ onClicked: (manageFeedsMenu.status == DialogStatus.Closed) ? manageFeedsMenu.open() : manageFeedsMenu.close()
+ }
+ }
+ }
+
+ Menu {
+ id: manageFeedsMenu
+ visualParent: pageStack
+ MenuLayout {
+ MenuItem { text: qsTr("Import Feeds From File"); onClicked: {
+ fileDialog.model.clear()
+ controller.populateFileDialog("/home/user/MyDocs/","*.*ml")
+ fileDialog.open()
+ } }
+ MenuItem {
+ text: qsTr("Export Feeds");
+ onClicked: { var file=controller.exportOpml("/home/user/MyDocs/feedingit-export.opml"); banner.show(qsTr("Feeds exported as %1").arg(file)) }
+ }
}
}
SelectionDialog {
id: categoryDialog
- titleText: "Select category:"
+ titleText: qsTr("Select category:")
property string feedTitle
property string feedUrl
categoryDialog.selectedIndex = -1;
}
}
+
+ SelectionDialog {
+ id: fileDialog
+ titleText: qsTr("Select a file to import")
+ model: ListModel {
+ id: fileList
+ }
+
+ onSelectedIndexChanged: {
+ var num = controller.importOpml(fileDialog.model.get(fileDialog.selectedIndex).fullname);
+ console.log("Import "+fileDialog.model.get(fileDialog.selectedIndex).fullname)
+ banner.show(qsTr("Successfully imported %1 feeds.").args(num));
+ }
+ }
}