Commit b1da8995 authored by Timothée Giet's avatar Timothée Giet

algebra, smallnumbers, fix Cancel Options change

parent f72c13df
......@@ -56,13 +56,21 @@ Item {
property var dataToSave
function setDefaultValues() {
speedSlider.value = Qt.binding(function() {return activityConfiguration.speedSetting;})
if(dataToSave && dataToSave.speedSetting) {
activityConfiguration.speedSetting = dataToSave.speedSetting
}
activityConfiguration.speedSetting = dataToSave.speedSetting
}
function saveValues() {
var configHasChanged = false
var oldSpeed = activityConfiguration.speedSetting
speedSetting = speedSlider.value
dataToSave = {"speedSetting": speedSetting}
if (oldSpeed !== speedSetting) {
configHasChanged = true
}
// Restart the activity with new information
if(configHasChanged) {
background.stop();
background.start();
}
}
}
......@@ -55,13 +55,22 @@ Item {
property var dataToSave
function setDefaultValues() {
if(dataToSave && dataToSave.speedSetting) {
activityConfiguration.speedSetting = dataToSave.speedSetting
}
speedSlider.value = Qt.binding(function() {return activityConfiguration.speedSetting;})
activityConfiguration.speedSetting = dataToSave.speedSetting
}
function saveValues() {
var configHasChanged = false
var oldSpeed = activityConfiguration.speedSetting
speedSetting = speedSlider.value
dataToSave = {"speedSetting": speedSetting}
if (oldSpeed !== speedSetting) {
configHasChanged = true
}
// Restart the activity with new information
if(configHasChanged) {
background.stop();
background.start();
}
}
}
......@@ -56,13 +56,22 @@ Item {
property var dataToSave
function setDefaultValues() {
if(dataToSave && dataToSave.speedSetting) {
activityConfiguration.speedSetting = dataToSave.speedSetting
}
speedSlider.value = Qt.binding(function() {return activityConfiguration.speedSetting;})
activityConfiguration.speedSetting = dataToSave.speedSetting
}
function saveValues() {
var configHasChanged = false
var oldSpeed = activityConfiguration.speedSetting
speedSetting = speedSlider.value
dataToSave = {"speedSetting": speedSetting}
if (oldSpeed !== speedSetting) {
configHasChanged = true
}
// Restart the activity with new information
if(configHasChanged) {
background.stop();
background.start();
}
}
}
......@@ -56,13 +56,22 @@ Item {
property var dataToSave
function setDefaultValues() {
if(dataToSave && dataToSave.speedSetting) {
activityConfiguration.speedSetting = dataToSave.speedSetting
}
speedSlider.value = Qt.binding(function() {return activityConfiguration.speedSetting;})
activityConfiguration.speedSetting = dataToSave.speedSetting
}
function saveValues() {
var configHasChanged = false
var oldSpeed = activityConfiguration.speedSetting
speedSetting = speedSlider.value
dataToSave = {"speedSetting": speedSetting}
if (oldSpeed !== speedSetting) {
configHasChanged = true
}
// Restart the activity with new information
if(configHasChanged) {
background.stop();
background.start();
}
}
}
......@@ -56,16 +56,22 @@ Item {
property var dataToSave
function setDefaultValues() {
if(dataToSave && dataToSave.speedSetting) {
activityConfiguration.speedSetting = dataToSave.speedSetting
}
else {
activityConfiguration.speedSetting = 10
}
speedSlider.value = Qt.binding(function() {return activityConfiguration.speedSetting;})
activityConfiguration.speedSetting = dataToSave.speedSetting
}
function saveValues() {
var configHasChanged = false
var oldSpeed = activityConfiguration.speedSetting
speedSetting = speedSlider.value
dataToSave = {"speedSetting": speedSetting}
if (oldSpeed !== speedSetting) {
configHasChanged = true
}
// Restart the activity with new information
if(configHasChanged) {
background.stop();
background.start();
}
}
}
......@@ -74,23 +74,22 @@ Item {
property var dataToSave
function setDefaultValues() {
for(var i = 0 ; i < availableModes.length ; i++) {
if(availableModes[i].value === dataToSave["mode"]) {
modeBox.currentIndex = i;
break;
}
}
if(dataToSave.speedSetting) {
activityConfiguration.speedSetting = dataToSave.speedSetting
}
else {
activityConfiguration.speedSetting = 10
}
speedSlider.value = Qt.binding(function() {return activityConfiguration.speedSetting;})
activityConfiguration.speedSetting = dataToSave.speedSetting
}
function saveValues() {
var newMode = availableModes[modeBox.currentIndex].value;
var configHasChanged = false
var oldSpeed = activityConfiguration.speedSetting
speedSetting = speedSlider.value
dataToSave = {"mode": newMode, "speedSetting": speedSetting}
dataToSave = {"speedSetting": speedSetting}
if (oldSpeed !== speedSetting) {
configHasChanged = true
}
// Restart the activity with new information
if(configHasChanged) {
background.stop();
background.start();
}
}
}
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