New version. Fixed BUG with inner timer generation. Fixed BUG in about page

This commit is contained in:
2017-09-07 10:28:50 +02:00
parent 0f1f9734f1
commit b91ea9f768
6 changed files with 32 additions and 17 deletions

View File

@ -17,6 +17,8 @@ function addSliderForInnerTime() {
newArray.push(5)
settingsPage.mListOfInnerTimers = newArray
generateSlidersForInnerTimers()
}
function removeLastSliderFromInnerTimers() {
@ -24,6 +26,8 @@ function removeLastSliderFromInnerTimers() {
newArray.pop()
settingsPage.mListOfInnerTimers = newArray
generateSlidersForInnerTimers()
}
function getListOfInnerTimers() {
@ -37,6 +41,13 @@ function getListOfInnerTimers() {
return list;
}
function updateValueInnerTimer(i, value) {
var newArray = settingsPage.mListOfInnerTimers
newArray[i] = value
settingsPage.mListOfInnerTimers = newArray
}
function generateSlidersForInnerTimers() {
for (var i = 0; i < settingsColumn.children.length; i++) {
if (settingsColumn.children[i].objectName === 'innerSlider') {
@ -50,12 +61,12 @@ function generateSlidersForInnerTimers() {
var newArray = []
for (i = 0; i < numberOfInnerTimers; i++) {
value = settings.getInnerTimer(i)
value = settingsPage.mListOfInnerTimers[i]
if (value === undefined) {
value = 5
}
remainingTimeForInner -= settings.getInnerTimer(i)
remainingTimeForInner -= value
var enabled = "true"
if ((i + 1) < numberOfInnerTimers) {
@ -66,6 +77,7 @@ function generateSlidersForInnerTimers() {
"import QtQuick 2.2;" +
"import Sailfish.Silica 1.0;" +
"import 'converter.js' as Converter;" +
"import 'helpers.js' as Helper;" +
"Slider {" +
"objectName: 'innerSlider';" +
"enabled: "+ enabled +"; "+
@ -80,12 +92,14 @@ function generateSlidersForInnerTimers() {
"valueText: Converter.msToTime(value);" +
"label: qsTr('"+ (i + 1) +"° inner time');" +
"onValueChanged: Helper.updateValueInnerTimer("+ i +", value);" +
"}",
settingsColumn,
"dynamicInnerTimerSlider"
);
newArray.push(newSlider);
newArray.push(value);
}
settingsPage.mListOfInnerTimers = newArray;