Configure page: first code
This commit is contained in:
parent
68b93e35b0
commit
ca50999bb8
3 changed files with 86 additions and 5 deletions
68
qml/ConfigurePageSailfish.qml
Normal file
68
qml/ConfigurePageSailfish.qml
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
/* Copyright 2016 (C) Louis-Joseph Fournier
|
||||||
|
* louisjoseph.fournier@gmail.com
|
||||||
|
*
|
||||||
|
* This file is part of SailTuner.
|
||||||
|
*
|
||||||
|
* SailTuner is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* SailTuner is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
import QtQuick 2.0
|
||||||
|
import Sailfish.Silica 1.0
|
||||||
|
|
||||||
|
import ".." // Config singleton
|
||||||
|
|
||||||
|
Dialog {
|
||||||
|
id: configurePage
|
||||||
|
allowedOrientations: Orientation.All
|
||||||
|
|
||||||
|
property variant la_tab: [392, 400, 415, 430, 440, 442]
|
||||||
|
|
||||||
|
Column {
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
|
DialogHeader {
|
||||||
|
id: header
|
||||||
|
}
|
||||||
|
|
||||||
|
PageHeader {
|
||||||
|
title: qsTr("Configuration")
|
||||||
|
}
|
||||||
|
|
||||||
|
TextField {
|
||||||
|
id: la
|
||||||
|
text: Config.la
|
||||||
|
label: qsTr("La")
|
||||||
|
}
|
||||||
|
|
||||||
|
/// predefined la(s)
|
||||||
|
Row {
|
||||||
|
id: pre_la_parent
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: la_tab.length
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: pre_la_parent.width / tab_la.length
|
||||||
|
border.color: Theme.primaryColor
|
||||||
|
border.width: 1
|
||||||
|
|
||||||
|
Text {
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
text: tab_la[parent.index]
|
||||||
|
onClick: la.text = text
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -35,6 +35,7 @@ ApplicationWindow {
|
||||||
property QtObject tuner
|
property QtObject tuner
|
||||||
|
|
||||||
ObjectSaver {
|
ObjectSaver {
|
||||||
|
id: saver
|
||||||
filename: "config.dat"
|
filename: "config.dat"
|
||||||
object: Config
|
object: Config
|
||||||
}
|
}
|
||||||
|
@ -43,17 +44,32 @@ ApplicationWindow {
|
||||||
Page {
|
Page {
|
||||||
id: page
|
id: page
|
||||||
allowedOrientations: Orientation.All
|
allowedOrientations: Orientation.All
|
||||||
|
|
||||||
signal togglePause()
|
signal togglePause()
|
||||||
|
|
||||||
SilicaFlickable {
|
SilicaFlickable {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
|
PullDownMenu {
|
||||||
|
MenuItem {
|
||||||
|
text: qsTr("Configuration")
|
||||||
|
onClicked: {
|
||||||
|
var confpage = pageStack.push(Qt.resolvedUrl("ConfigurePage.qml"))
|
||||||
|
confpage.accepted.connect(saver.save)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TunerScreen {
|
TunerScreen {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
theme: Theme
|
theme: Theme
|
||||||
tuner: app.tuner
|
tuner: app.tuner
|
||||||
}
|
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: togglePause()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Tuner {
|
Tuner {
|
||||||
|
@ -63,10 +79,6 @@ ApplicationWindow {
|
||||||
la: Config.la
|
la: Config.la
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: togglePause()
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
app.tuner = tunerObject
|
app.tuner = tunerObject
|
||||||
|
|
|
@ -7,5 +7,6 @@
|
||||||
<file>ScaleToise.qml</file>
|
<file>ScaleToise.qml</file>
|
||||||
<file>Toise.qml</file>
|
<file>Toise.qml</file>
|
||||||
<file>Led.qml</file>
|
<file>Led.qml</file>
|
||||||
|
<file>ConfigurePage.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
Loading…
Reference in a new issue