Warning, /education/gcompris/src/activities/categorization/ActivityConfig.qml is written in an unsupported language. File is not indexed.

0001 /* GCompris - ActivityConfig.qml
0002  *
0003  * SPDX-FileCopyrightText: 2020 Shubham Mishra <shivam828787@gmail.com>
0004  *
0005  * Authors:
0006  *   Shubham Mishra <shivam828787@gmail.com>
0007  *
0008  *   SPDX-License-Identifier: GPL-3.0-or-later
0009  */
0010 import QtQuick 2.12
0011 import "../../core"
0012 import "categorization.js" as Activity
0013 import QtQuick.Controls 2.12
0014 import GCompris 1.0
0015 
0016 Item {
0017     id: activityConfiguration
0018     property Item background
0019     property string mode: "easy"
0020     width: flick.width
0021     height: column.childrenRect.height
0022 
0023     Column {
0024         id: column
0025         spacing: 5
0026         width: parent.width
0027         height: parent.height
0028         property alias easyModeBox: easyModeBox
0029         property alias mediumModeBox: mediumModeBox
0030         property alias expertModeBox: expertModeBox
0031 
0032         ButtonGroup {
0033             id: childGroup
0034         }
0035 
0036         GCDialogCheckBox {
0037             id: easyModeBox
0038             text: qsTr("Put together all the items from a category (with score)")
0039             checked: (mode === "easy") ? true : false
0040             ButtonGroup.group: childGroup
0041             onCheckedChanged: {
0042                 if(easyModeBox.checked) {
0043                     mode = "easy"
0044                 }
0045             }
0046         }
0047 
0048         GCDialogCheckBox {
0049             id: mediumModeBox
0050             text: qsTr("Put together all the items from a category (without score)")
0051             checked: (mode === "medium") ? true : false
0052             ButtonGroup.group: childGroup
0053             onCheckedChanged: {
0054                 if(mediumModeBox.checked) {
0055                     mode = "medium"
0056                 }
0057             }
0058         }
0059 
0060         GCDialogCheckBox {
0061             id: expertModeBox
0062             text: qsTr("Discover a category, grouping items together")
0063             checked: (mode === "expert") ? true : false
0064             ButtonGroup.group: childGroup
0065             onCheckedChanged: {
0066                 if(expertModeBox.checked) {
0067                     mode = "expert"
0068                 }
0069             }
0070         }
0071     }
0072 
0073     property var dataToSave
0074 
0075     function setDefaultValues() {
0076         if( dataToSave["data"] === undefined) {
0077             dataToSave["data"] = Activity.categoriesToSavedProperties(dataToSave)
0078           if(dataToSave["mode"] === undefined)
0079             dataToSave["mode"] = mode
0080         }
0081         mode = dataToSave["mode"]
0082     }
0083 
0084     function saveValues() {
0085         dataToSave["data"] = Activity.categoriesToSavedProperties(dataToSave)
0086         dataToSave["mode"] = mode;
0087     }
0088 }