Actually move sliders to Settings page
This commit is contained in:
parent
99d8aecb7a
commit
5914ff6488
2 changed files with 13 additions and 28 deletions
|
@ -33,6 +33,7 @@ DISTFILES += qml/harbour-batterybuddy.qml \
|
||||||
qml/pages/InfoPage.qml \
|
qml/pages/InfoPage.qml \
|
||||||
rpm/harbour-batterybuddy.changes \
|
rpm/harbour-batterybuddy.changes \
|
||||||
qml/components/BatteryGraph.qml \
|
qml/components/BatteryGraph.qml \
|
||||||
|
qml/pages/SettingsPage.qml \
|
||||||
qml/components/MyDetailItem.qml
|
qml/components/MyDetailItem.qml
|
||||||
|
|
||||||
SAILFISHAPP_ICONS = 86x86 108x108 128x128 172x172
|
SAILFISHAPP_ICONS = 86x86 108x108 128x128 172x172
|
||||||
|
|
|
@ -30,9 +30,11 @@ Page {
|
||||||
"unknown": qsTr("unknown", "Battery not detected, or faulty, or something")
|
"unknown": qsTr("unknown", "Battery not detected, or faulty, or something")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finally, emit the signal
|
onStatusChanged: {
|
||||||
// The effective value will be restricted by ApplicationWindow.allowedOrientations
|
if(status == PageStatus.Activating) {
|
||||||
allowedOrientations: Orientation.All
|
alertTimer.interval = settings.interval * 1000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MediaPlayer {
|
MediaPlayer {
|
||||||
id: alertLow
|
id: alertLow
|
||||||
|
@ -62,7 +64,8 @@ Page {
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
interval: 60000
|
id: alertTimer
|
||||||
|
interval: settings.interval * 1000 // sec -> msec
|
||||||
running: true
|
running: true
|
||||||
repeat: true
|
repeat: true
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
|
@ -97,6 +100,10 @@ Page {
|
||||||
text: qsTr("Background", "More to read, background information...")
|
text: qsTr("Background", "More to read, background information...")
|
||||||
onClicked: pageStack.push(Qt.resolvedUrl("InfoPage.qml"))
|
onClicked: pageStack.push(Qt.resolvedUrl("InfoPage.qml"))
|
||||||
}
|
}
|
||||||
|
MenuItem {
|
||||||
|
text: qsTr("Settings")
|
||||||
|
onClicked: pageStack.push(Qt.resolvedUrl("SettingsPage.qml"))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Place our content in a Column. The PageHeader is always placed at the top
|
// Place our content in a Column. The PageHeader is always placed at the top
|
||||||
|
@ -144,33 +151,10 @@ Page {
|
||||||
x: Theme.paddingLarge*2
|
x: Theme.paddingLarge*2
|
||||||
width: parent.width - x*2;
|
width: parent.width - x*2;
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
text: qsTr("Set the maximum and minimum target charge levels.")
|
text: qsTr("Please leave Battery Buddy running in the background in order to receive alerts.")
|
||||||
+"\n\n"+ qsTr("Please leave Battery Buddy running in the background in order to receive alerts.")
|
|
||||||
color: Theme.primaryColor
|
color: Theme.primaryColor
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
}
|
}
|
||||||
Slider {
|
|
||||||
id: highSlider
|
|
||||||
width: parent.width
|
|
||||||
label: qsTr("Charging limit")
|
|
||||||
minimumValue: 60
|
|
||||||
maximumValue: 99
|
|
||||||
stepSize: 1
|
|
||||||
value: settings.upperLimit
|
|
||||||
valueText: highSlider.value + "%"
|
|
||||||
onValueChanged: settings.upperLimit = highSlider.value
|
|
||||||
}
|
|
||||||
Slider {
|
|
||||||
id: lowSlider
|
|
||||||
width: parent.width
|
|
||||||
label: qsTr("Discharging limit")
|
|
||||||
minimumValue: 10
|
|
||||||
maximumValue: 40
|
|
||||||
stepSize: 1
|
|
||||||
value: settings.lowerLimit
|
|
||||||
valueText: lowSlider.value + "%"
|
|
||||||
onValueChanged: settings.lowerLimit = lowSlider.value
|
|
||||||
}
|
|
||||||
Label {
|
Label {
|
||||||
x: Theme.paddingLarge
|
x: Theme.paddingLarge
|
||||||
text: qsTr("Alert tests")
|
text: qsTr("Alert tests")
|
||||||
|
|
Loading…
Reference in a new issue