diff --git a/src/activities/template/ActivityInfo.qml b/src/activities/template/ActivityInfo.qml index 22e06edc3..3a556caec 100644 --- a/src/activities/template/ActivityInfo.qml +++ b/src/activities/template/ActivityInfo.qml @@ -1,35 +1,35 @@ /* GCompris - ActivityInfo.qml * - * Copyright (C) 2015 Your Name + * Copyright (C) 2016 Your Name * * 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: "template/Template.qml" difficulty: 1 icon: "template/template.svg" author: "Your Name <yy@zz.org>" demo: true title: "Template activity" description: "" //intro: "put here in comment the text for the intro voice" goal: "" prerequisite: "" manual: "" credit: "" section: "fun" createdInVersion: creationversion } diff --git a/src/activities/template/Template.qml b/src/activities/template/Template.qml index dd014d629..ed6f0d278 100644 --- a/src/activities/template/Template.qml +++ b/src/activities/template/Template.qml @@ -1,85 +1,85 @@ /* GCompris - template.qml * - * Copyright (C) 2015 YOUR NAME + * Copyright (C) 2016 YOUR NAME * * Authors: * (GTK+ version) * YOUR NAME (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 "../../core" import "template.js" as Activity ActivityBase { id: activity onStart: focus = true onStop: {} pageComponent: Rectangle { id: background anchors.fill: parent color: "#ABCDEF" 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 } onStart: { Activity.start(items) } onStop: { Activity.stop() } GCText { anchors.centerIn: parent text: "template activity" fontSize: largeSize } 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/template/template.js b/src/activities/template/template.js index 973feed6c..d5f73ea85 100644 --- a/src/activities/template/template.js +++ b/src/activities/template/template.js @@ -1,54 +1,54 @@ /* GCompris - template.js * - * Copyright (C) 2015 YOUR NAME + * Copyright (C) 2016 YOUR NAME * * Authors: * (GTK+ version) * "YOUR NAME" (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 numberOfLevel = 4 var items function start(items_) { items = items_ currentLevel = 0 initLevel() } function stop() { } function initLevel() { items.bar.level = currentLevel + 1 } function nextLevel() { if(numberOfLevel <= ++currentLevel ) { currentLevel = 0 } initLevel(); } function previousLevel() { if(--currentLevel < 0) { currentLevel = numberOfLevel - 1 } initLevel(); }