X-Git-Url: https://www.flypig.org.uk/git/?p=openvpnui.git;a=blobdiff_plain;f=qml%2Ffilebrowse%2Fpages%2FSettingsPage.qml;fp=qml%2Ffilebrowse%2Fpages%2FSettingsPage.qml;h=454d1d58a18b45fcf09ae4a3035180a40869b7a1;hp=0000000000000000000000000000000000000000;hb=e24363e314aca32e7bee952f02f517a04a8dc5f2;hpb=ee3968ffa08d4e0fcbad87765efa3aeb32ff0554 diff --git a/qml/filebrowse/pages/SettingsPage.qml b/qml/filebrowse/pages/SettingsPage.qml new file mode 100644 index 0000000..454d1d5 --- /dev/null +++ b/qml/filebrowse/pages/SettingsPage.qml @@ -0,0 +1,113 @@ +import QtQuick 2.0 +import Sailfish.Silica 1.0 +import "functions.js" as Functions +import "../components" + +Page { + id: page + allowedOrientations: Orientation.All + + SilicaFlickable { + id: flickable + anchors.fill: parent + contentHeight: column.height + VerticalScrollDecorator { flickable: flickable } + + Column { + id: column + anchors.left: parent.left + anchors.right: parent.right + anchors.leftMargin: Theme.paddingLarge + anchors.rightMargin: Theme.paddingLarge + + PageHeader { title: qsTr("Settings") } + + TextSwitch { + id: showDirsFirst + text: qsTr("Show folders first") + } + TextSwitch { + id: showHiddenFiles + text: qsTr("Show hidden files") + } + + Spacer { height: 40 } + + Label { + text: qsTr("About File Browser") + anchors.left: parent.left + anchors.right: parent.right + anchors.rightMargin: Theme.paddingLarge + horizontalAlignment: Text.AlignRight + color: Theme.highlightColor + } + Spacer { height: 20 } + Row { + anchors.left: parent.left + anchors.right: parent.right + anchors.leftMargin: Theme.paddingLarge + anchors.rightMargin: Theme.paddingLarge + Label { + id: version + text: qsTr("Version")+" " + font.pixelSize: Theme.fontSizeExtraSmall + color: Theme.secondaryColor + } + Label { + text: "1.4.1" // Version number must be changed manually! + font.pixelSize: Theme.fontSizeExtraSmall + color: Theme.highlightColor + } + } + Spacer { height: 20 } + Label { + anchors.left: parent.left + anchors.right: parent.right + anchors.leftMargin: Theme.paddingLarge + anchors.rightMargin: Theme.paddingLarge + text: "File Browser is free and unencumbered software released "+ + "into the public domain.\nRead full text >>" + wrapMode: Text.Wrap + font.pixelSize: Theme.fontSizeExtraSmall + color: Theme.primaryColor + + MouseArea { + anchors.fill: parent + onClicked: pageStack.push(Qt.resolvedUrl("AboutPage.qml")) + } + } + + Spacer { height: 20 } + Label { + anchors.left: parent.left + anchors.right: parent.right + anchors.leftMargin: Theme.paddingLarge + anchors.rightMargin: Theme.paddingLarge + text: qsTr("The source code is available at\nhttps://github.com/karip/harbour-file-browser") + wrapMode: Text.Wrap + font.pixelSize: Theme.fontSizeTiny + color: Theme.secondaryColor + } + } + } + + onStatusChanged: { + // update cover + if (status === PageStatus.Activating) + coverPlaceholder.text = qsTr("Settings"); + + // read settings + if (status === PageStatus.Activating) { + showDirsFirst.checked = (engine.readSetting("show-dirs-first") === "true"); + showHiddenFiles.checked = (engine.readSetting("show-hidden-files") === "true"); + } + + // write settings + if (status === PageStatus.Deactivating) { + engine.writeSetting("show-dirs-first", showDirsFirst.checked.toString()); + engine.writeSetting("show-hidden-files", showHiddenFiles.checked.toString()); + } + } +} + +