Commit c2799b23 authored by Shubham Mishra's avatar Shubham Mishra

categorization, fixed displayUpdateDialogAtStart issue

parent 4ffd8857
......@@ -28,7 +28,6 @@ Item {
id: activityConfiguration
property Item background
property string mode: "easy"
property string displayUpdateDialogAtStart: "true"
width: if(background) background.width
Column {
......@@ -48,7 +47,7 @@ Item {
id: easyModeBox
width: column.width - 50
text: qsTr("Put together all the elements from a category (with score)")
checked: (mode == "easy") ? true : false
checked: (mode === "easy") ? true : false
exclusiveGroup: configOptions
onCheckedChanged: {
if(easyModeBox.checked) {
......@@ -61,7 +60,7 @@ Item {
id: mediumModeBox
width: easyModeBox.width
text: qsTr("Put together all the elements from a category (without score)")
checked: (mode == "medium") ? true : false
checked: (mode === "medium") ? true : false
exclusiveGroup: configOptions
onCheckedChanged: {
if(mediumModeBox.checked) {
......@@ -74,7 +73,7 @@ Item {
id: expertModeBox
width: easyModeBox.width
text: qsTr("Discover a category, grouping elements together")
checked: (mode == "expert") ? true : false
checked: (mode === "expert") ? true : false
exclusiveGroup: configOptions
onCheckedChanged: {
if(expertModeBox.checked) {
......@@ -91,16 +90,12 @@ Item {
dataToSave["data"] = Activity.categoriesToSavedProperties(dataToSave)
if(dataToSave["mode"]=== undefined)
dataToSave["mode"] = mode
if(dataToSave["displayUpdateDialogAtStart"] === undefined)
dataToSave["displayUpdateDialogAtStart"] = displayUpdateDialogAtStart ? "true" : "false"
}
mode = dataToSave["mode"]
displayUpdateDialogAtStart = dataToSave["displayUpdateDialogAtStart"]
}
function saveValues() {
dataToSave["data"] = Activity.categoriesToSavedProperties(dataToSave)
dataToSave["mode"] = mode;
dataToSave["displayUpdateDialogAtStart"] = displayUpdateDialogAtStart ? "true" : "false"
}
}
......@@ -102,18 +102,10 @@ ActivityBase {
}
}
Directory {
id: directory
}
CategoryReview {
id: categoryReview
}
ExclusiveGroup {
id: configOptions
}
DialogChooseLevel {
id: dialogActivityConfig
currentActivity: activity.activityInfo
......@@ -121,11 +113,12 @@ ActivityBase {
onLoadData: {
if(activityData && activityData["mode"])
items.mode = activityData["mode"]
if(activityData && activityData["displayUpdateDialogAtStart"])
items.displayUpdateDialogAtStart = (activityData["displayUpdateDialogAtStart"] == "true") ? true : false
if(activityData && activityData["displayUpdateDialogAtStart"] !== undefined)
items.displayUpdateDialogAtStart = (activityData["displayUpdateDialogAtStart"] === true) ? true : false
}
onSaveData: {
activityData["displayUpdateDialogAtStart"] = items.displayUpdateDialogAtStart
levelFolder = dialogActivityConfig.chosenLevels
currentActivity.currentLevels = dialogActivityConfig.chosenLevels
ApplicationSettings.setCurrentLevels(currentActivity.name, dialogActivityConfig.chosenLevels)
......@@ -133,8 +126,7 @@ ActivityBase {
onStartActivity: {
items.mode = activityData["mode"]
items.displayUpdateDialogAtStart = activityData["displayUpdateDialogAtStart"]
items.menuScreen.iAmReady.visible = (activityData["mode"] == "expert") ? true : false;
items.menuScreen.iAmReady.visible = (activityData["mode"] === "expert") ? true : false;
background.stop();
background.start()
}
......@@ -183,11 +175,11 @@ ActivityBase {
button2Text: qsTr("Never show this dialog later")
onClose: items.categoriesFallback = false
onButton1Hit: DownloadManager.downloadResource('data2/words/words.rcc')
onButton2Hit: { items.displayUpdateDialogAtStart = false }
onButton2Hit: { items.displayUpdateDialogAtStart = false; items.dialogActivityConfig.saveData()}
}
anchors.fill: parent
focus: true
active: items.categoriesFallback && items.displayUpdateDialogAtStart
active: items.categoriesFallback && items.displayUpdateDialogAtStart;
onStatusChanged: if (status == Loader.Ready) item.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