Commit b95fd4cb authored by kempe's avatar kempe

Refactored Settings page. This closes #6

* Divided in .qml and .ui.qml
parent c29438f1
......@@ -64,10 +64,11 @@ DISTFILES += \
qml/pages/StationsPage.qml \
qml/components/StationsListContextMenu.qml \
qml/components/CustomSearchField.qml \
qml/pages/Settings2.qml \
qml/components/RecivedUpgrader.qml \
qml/pages/BrowsePageForm.ui.qml \
qml/pages/BrowsePage.qml \
qml/pages/BrowseByCategoryPageForm.ui.qml \
qml/pages/BrowseByCategoryPage.qml
qml/pages/BrowseByCategoryPage.qml \
qml/pages/SettingsPageForm.ui.qml \
qml/pages/SettingsPage.qml
......@@ -2,7 +2,7 @@ import QtQuick 2.6
import "../components/js/Utils.js" as Utils
NavigationMenuForm {
property var settingsAction: function() { pageStack.push(Qt.resolvedUrl("Settings.qml")); }
property var settingsAction: function() { pageStack.push(Qt.resolvedUrl("SettingsPage.qml")); }
property var showPlayerAction: function() { player.open = true; }
property var browseAction: function() { pageStack.push(Qt.resolvedUrl("BrowsePage.qml"), {listType: Utils.Top100}); }
property var searchAction: function() { pageStack.push(Qt.resolvedUrl("StationsPage.qml"), {listType: Utils.Search}); }
......
import QtQuick 2.6
import "../components/js/Storage.js" as DB
SettingsPageForm {
aboutAction.onClicked: console.log("TODO")
buttonResetDb.onClicked: {
remorse.execute("Droping DB",function() {
DB.dropDB();
Favorites.updateFavorites()});
}
}
import QtQuick 2.6
import Sailfish.Silica 1.0
import "../components/js/Favorites.js" as Favorites
import "../components/js/Storage.js" as DB
Page {
id: settingsPage
property alias aboutAction: aboutAction
property alias buttonResetDb: buttonResetDb
SilicaFlickable {
id: settingsPageFlickable
anchors.fill: parent
......@@ -14,10 +15,8 @@ Page {
PullDownMenu {
MenuItem {
id: aboutAction
text: "About"
onClicked: {
console.log("TODO")
}
}
}
RemorsePopup { id: remorse }
......@@ -40,13 +39,8 @@ Page {
}
ValueButton {
id: buttonResetDb
value: "Reset DB"
onClicked: {
remorse.execute("Droping DB", function() {
DB.dropDB();
Favorites.updateFavorites()
});
}
}
Text {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment