diff --git a/src/activities/activities.txt b/src/activities/activities.txt index be6b07605..f1beb889f 100644 --- a/src/activities/activities.txt +++ b/src/activities/activities.txt @@ -1,125 +1,126 @@ # The list of activities that will be loaded at GCompris start. # Keep it sorted advanced_colors algebra_by algebra_div algebra_minus algebra_plus algorithm align4 align4-2players alphabet-sequence babymatch babyshapes baby_wordprocessor balancebox ballcatch braille_alphabets braille_fun canal_lock chess chess_2players chess_partyend chronos clickanddraw clickgame click_on_letter click_on_letter_up clockgame color_mix color_mix_light colors details drawnumber enumerate erase erase_2clic erase_clic explore_farm_animals explore_monuments explore_world_animals explore_world_music +family fifteen followline football geo-country geography gletters gnumch-equality gnumch-factors gnumch-inequality gnumch-multiples gnumch-primes graph-coloring guessnumber hangman hanoi hanoi_real hexagon imagename instruments intro_gravity land_safe lang leftright lightsoff louis-braille magic-hat-minus magic-hat-plus maze mazeinvisible mazerelative melody memory memory-enumerate memory-math-add memory-math-add-minus memory-math-add-minus-mult-div memory-math-add-minus-mult-div-tux memory-math-add-minus-tux memory-math-add-tux memory-math-div memory-math-div-tux memory-math-minus memory-math-minus-tux memory-math-mult memory-math-mult-div memory-math-mult-div-tux memory-math-mult-tux memory-sound memory-sound-tux memory-tux memory-wordnumber mining missing-letter money money_back money_back_cents money_cents mosaic numbers-odd-even paintings penalty photo_hunter planegame readingh readingv redraw redraw_symmetrical renewable_energy reversecount scalesboard scalesboard_weight scalesboard_weight_avoirdupois simplepaint smallnumbers smallnumbers2 sudoku superbrain tangram target tic_tac_toe tic_tac_toe_2players traffic watercycle wordsgame diff --git a/src/activities/family/ActivityInfo.qml b/src/activities/family/ActivityInfo.qml new file mode 100644 index 000000000..0b0642764 --- /dev/null +++ b/src/activities/family/ActivityInfo.qml @@ -0,0 +1,35 @@ +/* GCompris - ActivityInfo.qml + * + * Copyright (C) 2016 RAJDEEP KAUR + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +import GCompris 1.0 + +ActivityInfo { + name: "family/Family.qml" + difficulty: 1 + icon: "family/family.svg" + author: "Rajdeep Kaur <rajdeep.kaur@kde.org>" + demo: true + title: "Family" + description: "This activity will give teach about who we are related to our relatives" + //intro: "Let us understand what to call our relatives" + goal: "To get an idea about Relationships in the family" + prerequisite: "Reading Skills" + manual: "" + credit: "" + section: "fun" + createdInVersion:6 +} diff --git a/src/activities/family/CMakeLists.txt b/src/activities/family/CMakeLists.txt new file mode 100644 index 000000000..2b0a48fff --- /dev/null +++ b/src/activities/family/CMakeLists.txt @@ -0,0 +1 @@ +GCOMPRIS_ADD_RCC(activities/family *.qml *.svg *.js resource/*) diff --git a/src/activities/family/Family.qml b/src/activities/family/Family.qml new file mode 100644 index 000000000..833d507ea --- /dev/null +++ b/src/activities/family/Family.qml @@ -0,0 +1,154 @@ +/* GCompris - family.qml + * + * Copyright (C) 2016 RAJDEEP KAUR + * + * Authors: + * + * RAJDEEP KAUR (Qt Quick port) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +import QtQuick 2.1 +import GCompris 1.0 +import "../../core" +import "family.js" as Activity + +ActivityBase { + id: activity + + onStart: focus = true + onStop: {} + + pageComponent: Image { + id: background + anchors.fill: parent + source:"qrc:/gcompris/src/activities/lang/resource/imageid-bg.svg" + sourceSize.width: parent.width + fillMode: Image.PreserveAspectCrop + + signal start + signal stop + + Component.onCompleted: { + activity.start.connect(start) + activity.stop.connect(stop) + } + + // Add here the QML items you need to access in javascript + QtObject { + id: items + property Item main: activity.main + property alias background: background + property alias bar: bar + property alias bonus: bonus + property alias nodecreator:nodecreator + property alias answerschoice: answerschoice + } + + onStart: { Activity.start(items) } + onStop: { Activity.stop() } + + Item{ + id:partition + width:background.width + height:background.height + Rectangle{ + id:tree + color: "transparent" + width: background.width*0.65 + height: background.height + Item{ + id:treestructure + Repeater{ + id:nodecreator + model:ListModel{} + delegate: + Tree{ + id: currentpointer + x: xx*tree.width + y: yy*tree.height + width: ApplicationInfo.ratio*55 + height: ApplicationInfo.ratio*55 + recwidth: currentpointer.width + recheight: currentpointer.height + searchitem: 3 + nodeimagesource: Activity.url+nodee + nodetextvalue: "sad" + bordercolor: "black" + borderwidth:4 + colorr: "transparent" + radius:recwidth/2 + + } + + } + } + } + + Rectangle { + id: answers + color: "transparent" + width: background.width*0.35 + height: background.height + anchors.left: tree.right + border.color:"black" + border.width:5 + Grid{ + columns:1 + rowSpacing:10 + Repeater{ + id:answerschoice + model:ListModel{} + delegate: + AnswerButton { + id:options + width:answers.width*0.80 + height:answers.width*0.25 + textLabel:hh + onPressed:{ + if(textLabel === answer){ + bonus.good("") + } else { + bonus.bad("") + } + } + } + } + } + } + } + + DialogHelp { + id: dialogHelp + onClose: home() + } + + Bar { + id: bar + content: BarEnumContent { value: help | home | level } + onHelpClicked: { + displayDialog(dialogHelp) + } + onPreviousLevelClicked: Activity.previousLevel() + onNextLevelClicked: Activity.nextLevel() + onHomeClicked: activity.home() + } + + Bonus { + id: bonus + Component.onCompleted: win.connect(Activity.nextLevel) + } + } + +} diff --git a/src/activities/family/Tree.qml b/src/activities/family/Tree.qml new file mode 100644 index 000000000..8f07391a4 --- /dev/null +++ b/src/activities/family/Tree.qml @@ -0,0 +1,63 @@ +/* GCompris - family.qml + * + * Copyright (C) Holger Kaelberer + * + * Authors: + * Holger Kaelberer + * RAJDEEP KAUR (Qt Quick port) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +import QtQuick 2.0 +import GCompris 1.0 +import "../../core" +import "family.js" as Activity + +Item { + id:tree + property int searchitem:-1 + property alias recwidth:content.width + property alias recheight:content.height + property string nodeimagesource:nodeimage.source + property string nodetextvalue:nodetext.text + property string bordercolor:content.border.color + property real borderwidth: content.border.width + property string colorr:content.color + property alias radius:content.radius + Rectangle{ + id:content + color:colorr + width:recwidth + height:recheight + border.color:bordercolor + border.width:borderwidth + radius:radius + Image{ + id:nodeimage + source:searchitem===-1 ? "qrc:/gcompris/src/activities/lang/resource/imageid-bg.svg":nodeimagesource + anchors.horizontalCenter:parent.horizontalCenter + anchors.verticalCenter:parent.verticalCenter + width:ApplicationInfo.ratio*45 + height:ApplicationInfo.ratio*45 + + } + GCText { + id:nodetext + visible:false + text:nodetextvalue + anchors.verticalCenter:parent.verticalCenter + anchors.horizontalCenter:parent.horizontalCenter + } + } +} diff --git a/src/activities/family/family.js b/src/activities/family/family.js new file mode 100644 index 000000000..44832fa5d --- /dev/null +++ b/src/activities/family/family.js @@ -0,0 +1,139 @@ +/* GCompris - family.js + * + * Copyright (C) 2016 RAJDEEP KAUR + * + * Authors: + * "RAJDEEP KAUR" (Qt Quick port) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +.pragma library +.import QtQuick 2.0 as Quick + +var currentLevel = 0 +var items +var url = "qrc:/gcompris/src/activities/family/resource/" +var treestructure = [ + { edgelist:[], + nodePositions:[ + [0.180,0.09], + [0.55,0.09], + [0.08,0.35], + [0.30,0.35], + [0.50,0.35], + [0.70,0.35], + [0.01,0.65], + [.21,0.65], + [.41,0.65], + [.61,0.65], + [.81,0.65] + ] + } + /*{ edgelist:[], + nodePositions:[] + }, + { edgelist:[], + nodePositions:[] + }, + { edgelist:[], + nodePositions:[] + }, + { edgelist:[], + nodePositions:[] + }, + { edgelist:[], + nodePositions:[] + }, + { edgelist:[], + nodePositions:[] + }, + { edgelist:[], + nodePositions:[] + }, + { edgelist:[], + nodePositions:[] + }, + { edgelist:[], + nodePositions:[] + }, + { edgelist:[], + nodePositions:[] + }, + { edgelist:[], + nodePositions:[] + }, + { edgelist:[], + nodePositions:[] + }, + { edgelist:[], + nodePositions:[] + }, + { edgelist:[], + nodePositions:[] + }, + { edgelist:[], + nodePositions:[] + }, + { edgelist:[], + nodepositions:[] + }*/ +] + +var dataset = [ + { nodeleave:["grandpa.svg","old-lady.svg","man1.svg","lady2.svg","man2.svg","lady1.svg", + "boy1.svg","boy2.svg","girl2.svg","girl3.svg","girl4.svg"] + + } + +] + +var mode = "image"; + +function start(items_) { + items = items_ + currentLevel = 0 + initLevel() +} + +function stop() { +} + +function initLevel() { + items.bar.level = currentLevel + 1 + var test = treestructure[0] + var test1 = dataset[0] + items.nodecreator.model.clear(); + for(var i =0;i<11;i++){ + items.nodecreator.model.append({ + "xx":test.nodePositions[i][0], + "yy":test.nodePositions[i][1], + "nodee":test1.nodeleave[i] + }); + } + +} + +function nextLevel() { + if(numberOfLevel <= ++currentLevel ) { + currentLevel = 0 + } + initLevel(); +} + +function previousLevel() { + if(--currentLevel < 0) { + currentLevel = numberOfLevel - 1 + } + initLevel(); +} diff --git a/src/activities/family/family.svg b/src/activities/family/family.svg new file mode 100644 index 000000000..90761d7e9 --- /dev/null +++ b/src/activities/family/family.svg @@ -0,0 +1,428 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Open Clip Art Library + + + People + 2008-02-27T13:01:34 + people symbol + http://openclipart.org/detail/15048/people-by-nicubunu + + + nicubunu + + + + + abstract + abstract + clip art + clipart + image + media + people + people + png + public domain + svg + symbol + symbol + + + + + + + + + + + + + + Clipart by Nicu Buculei - head1 + + + Nicu Buculei + + + + + + + + + + + + + diff --git a/src/activities/family/resource/boy1.svg b/src/activities/family/resource/boy1.svg new file mode 100644 index 000000000..54ca8a15d --- /dev/null +++ b/src/activities/family/resource/boy1.svg @@ -0,0 +1,178 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/src/activities/family/resource/boy2.svg b/src/activities/family/resource/boy2.svg new file mode 100644 index 000000000..9694b957a --- /dev/null +++ b/src/activities/family/resource/boy2.svg @@ -0,0 +1,210 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/src/activities/family/resource/circle_node.svg b/src/activities/family/resource/circle_node.svg new file mode 100644 index 000000000..13e40d0d1 --- /dev/null +++ b/src/activities/family/resource/circle_node.svg @@ -0,0 +1,70 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/src/activities/family/resource/girl1.svg b/src/activities/family/resource/girl1.svg new file mode 100644 index 000000000..2be1350fe --- /dev/null +++ b/src/activities/family/resource/girl1.svg @@ -0,0 +1,93 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/src/activities/family/resource/girl2.svg b/src/activities/family/resource/girl2.svg new file mode 100644 index 000000000..b10248cc2 --- /dev/null +++ b/src/activities/family/resource/girl2.svg @@ -0,0 +1,167 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/src/activities/family/resource/girl3.svg b/src/activities/family/resource/girl3.svg new file mode 100644 index 000000000..61d5d63f6 --- /dev/null +++ b/src/activities/family/resource/girl3.svg @@ -0,0 +1,175 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/src/activities/family/resource/girl4.svg b/src/activities/family/resource/girl4.svg new file mode 100644 index 000000000..b68b5fa33 --- /dev/null +++ b/src/activities/family/resource/girl4.svg @@ -0,0 +1,818 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Openclipart + + + Redhead anime girl + 2007-04-15T07:35:14 + My first work in Inkscape, face of an anime style girl + https://openclipart.org/detail/3942/redhead-anime-girl-by-gopher + + + gopher + + + + + anime + cartoon + color + editorial pick + face + girl + how i did it + manga + orange + redhaired + redhead + remix problem + + + + + + + + + + + diff --git a/src/activities/family/resource/grandmother1.svg b/src/activities/family/resource/grandmother1.svg new file mode 100644 index 000000000..14c4ef64e --- /dev/null +++ b/src/activities/family/resource/grandmother1.svg @@ -0,0 +1,137 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/src/activities/family/resource/grandpa.svg b/src/activities/family/resource/grandpa.svg new file mode 100644 index 000000000..23a15ae93 --- /dev/null +++ b/src/activities/family/resource/grandpa.svg @@ -0,0 +1,227 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/src/activities/family/resource/lady.svg b/src/activities/family/resource/lady.svg new file mode 100644 index 000000000..498b784ce --- /dev/null +++ b/src/activities/family/resource/lady.svg @@ -0,0 +1,239 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/src/activities/family/resource/lady1.svg b/src/activities/family/resource/lady1.svg new file mode 100644 index 000000000..2726123d5 --- /dev/null +++ b/src/activities/family/resource/lady1.svg @@ -0,0 +1,319 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/src/activities/family/resource/lady2.svg b/src/activities/family/resource/lady2.svg new file mode 100644 index 000000000..078360f2d --- /dev/null +++ b/src/activities/family/resource/lady2.svg @@ -0,0 +1,391 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Openclipart + + + Colored Student Girl + 2012-04-04T23:13:22 + + https://openclipart.org/detail/169346/colored-student-girl-by-cliparteles + + + cliparteles + + + + + Colored + Girl + Student + + + + + + + + + + + diff --git a/src/activities/family/resource/man1.svg b/src/activities/family/resource/man1.svg new file mode 100644 index 000000000..41ed0b1e4 --- /dev/null +++ b/src/activities/family/resource/man1.svg @@ -0,0 +1,263 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/src/activities/family/resource/man2.svg b/src/activities/family/resource/man2.svg new file mode 100644 index 000000000..57637dadb --- /dev/null +++ b/src/activities/family/resource/man2.svg @@ -0,0 +1,255 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/src/activities/family/resource/man3.svg b/src/activities/family/resource/man3.svg new file mode 100644 index 000000000..577732165 --- /dev/null +++ b/src/activities/family/resource/man3.svg @@ -0,0 +1,191 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/src/activities/family/resource/old-lady.svg b/src/activities/family/resource/old-lady.svg new file mode 100644 index 000000000..c80efcc30 --- /dev/null +++ b/src/activities/family/resource/old-lady.svg @@ -0,0 +1,322 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Openclipart + + + Old Lady + 2011-02-25T10:59:25 + + https://openclipart.org/detail/122563/old-lady-by-ricardomaia + + + ricardomaia + + + + + aged + ancient + elderly + old + + + + + + + + + + + diff --git a/src/activities/family/resource/questionmark.svg b/src/activities/family/resource/questionmark.svg new file mode 100644 index 000000000..117067a44 --- /dev/null +++ b/src/activities/family/resource/questionmark.svg @@ -0,0 +1,288 @@ + + + + + Question Mark + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Question Mark + + + + + + + + + + + + + + +