Warning, /education/gcompris/src/core/ChangeLog.qml is written in an unsupported language. File is not indexed.

0001 /* GCompris - ChangeLog.qml
0002  *
0003  * SPDX-FileCopyrightText: 2016 Johnny Jazeix <jazeix@gmail.com>
0004  *
0005  * Authors:
0006  *   Johnny Jazeix <jazeix@gmail.com>
0007  *
0008  *   SPDX-License-Identifier: GPL-3.0-or-later
0009  */
0010 
0011 import QtQuick 2.12
0012 import GCompris 1.0
0013 /**
0014  * Container object with a list of all the changes by version.
0015  * @ingroup infrastructure
0016  *
0017  */
0018 QtObject {
0019     /**
0020      * type: list
0021      * List of changelog objects.
0022      *
0023      * A changelog object consists of the properties @c versionCode
0024      * and an optional @c content (which changes have been added in this version).
0025      * The activities added in this version are retrieved from the ActivityInfoTree and directly displayed.
0026      *
0027      */
0028     property var changelog: [
0029             { "versionCode": 40000, "content": [
0030                 qsTr("Translations added for Bulgarian, Galician and Swahili"),
0031                 qsTr("Many usability improvements"),
0032                 qsTr("Many new images"),
0033                 qsTr("Many bug fixes"),
0034                 qsTr("New command-line option to directly start an activity at a specific level (--start-level level, to be used with --launch activity)")
0035                 ],
0036               "newDatasets": ["algebra_by", "algebra_plus", "algebra_minus", "algebra_div"]
0037             },
0038             { "versionCode": 30300, "content": [
0039                 qsTr("Translations added for Arabic and Esperanto"),
0040                 qsTr("Many translation updates"),
0041                 qsTr("Many new images"),
0042                 qsTr("Many bug fixes")
0043                 ]
0044             },
0045             { "versionCode": 30200, "content": [
0046                 qsTr("New command-line option (--difficulty {value|min-max}) to start GCompris at specific difficulty"),
0047                 qsTr("Many translation updates"),
0048                 qsTr("Many new images"),
0049                 qsTr("Many bug fixes")
0050                 ]
0051             },
0052             { "versionCode": 30100, "content": [
0053                 qsTr("Fix issue in comparator activity")
0054                 ]
0055             },
0056             { "versionCode": 30000, "content": [
0057                 qsTr("Map of Spain added for geography activity"),
0058                 qsTr("Voices added for Ukrainian"),
0059                 qsTr("New command-line option to list all the activities and start on a specific one"),
0060                 qsTr("Many usability improvements"),
0061                 qsTr("Many new images"),
0062                 qsTr("Many bug fixes")
0063                 ]
0064             },
0065             { "versionCode": 20400, "content": [
0066                 qsTr("Reduce the size of the packages for all platforms and of the external word images set"),
0067                 qsTr("Improve images quality in several activities"),
0068                 qsTr("Fix some transitions in renewable_energy/watercycle on some platforms"),
0069                 qsTr("Fix dead keys ignored on Linux for typing activities"),
0070                 qsTr("Fix level reset when changing level manually in Logical associations")
0071                 ]
0072             },
0073             { "versionCode": 20300, "content": [
0074                 qsTr("Fix Alphabet sequence, Even and odd numbers and Numbers in order activities")
0075                 ]
0076             },
0077             { "versionCode": 20200, "content": [
0078                 qsTr("Several bug fixes"),
0079                 qsTr("Many new images"),
0080                 qsTr("Translation updated for Russian"),
0081                 qsTr("New voices for Norwegian Nynorsk")
0082                 ]
0083             },
0084             { "versionCode": 20100, "content": [
0085                 qsTr("Translations added for Breton, Czech and Macedonian"),
0086                 qsTr("Several bug fixes")
0087                 ]
0088             },
0089             { "versionCode": 20000, "content": [
0090                 qsTr("Translation added for Azerbaijani"),
0091                 qsTr("New maps and update of the maps for geography activities"),
0092                 qsTr("New dataset containing loops operations for programming maze, and make tutorial images translated"),
0093                 qsTr("Addition of a level to teach voltage source loop in analog electricity activity"),
0094                 qsTr("Many new images"),
0095                 qsTr("Many usability improvements")
0096                 ]
0097             },
0098             { "versionCode": 10100, "content": [qsTr("Many usability improvements"),
0099                 qsTr("Many new images"),
0100                 qsTr("Many bug fixes")
0101                 ]
0102             },
0103             { "versionCode": 10000, "content": [qsTr("New Activity Settings menu, with dataset selection"),
0104                 qsTr("Many usability improvements"),
0105                 qsTr("Many new images"),
0106                 qsTr("Many bug fixes")
0107                 ]
0108             },
0109             { "versionCode": 9700, "content": [qsTr("New sub-categories to organize activities"),
0110                 qsTr("Translation added for Macedonian."),
0111                 qsTr("New activities Programming Maze and Baby Tangram"),
0112                 qsTr("New background music and volume settings."),
0113                 qsTr("New speed setting in several activities."),
0114                 qsTr("New option in chess to display captured pieces."),
0115                 qsTr("New images in Colors, Advanced colors and Target game."),
0116                 qsTr("New voices for US English."),
0117                 qsTr("Many little fixes and improvements.")] },
0118             { "versionCode": 9600, "content": [qsTr("Translation updated for multiple languages (Breton, Brazilian Portuguese, Finnish...)."),
0119                 qsTr("Add Russian dataset for Click on letter activity."),
0120                 qsTr("Lang activity now available in Dutch.")] },
0121             { "versionCode": 9500, "content": [qsTr("Merge Norwegian counties Nord-Trøndelag and Sør-Trøndelag into Trøndelag in geo-country activity."),
0122                 qsTr("Fix in braille activities where the cells start at 1, not 0."),
0123                 qsTr("Translation added for Basque, Hungarian and Malayalam."),
0124                 qsTr("Loading/saving of creations (Baby Wordprocessor, Balance Box and Piano Composition).")] },
0125             { "versionCode": 9100, "content": [qsTr("Many little fixes and improvements."), qsTr("Translations added for Scottish Gaelic.")] },
0126             { "versionCode": 9000, "content": [qsTr("License page added in configuration."), qsTr("Multiple changes on layouts to improve the ergonomy.")] },
0127             { "versionCode": 8000, "content": [qsTr("Lang activity now available in Polish, Swedish and Ukrainian.")] },
0128             { "versionCode": 7000, "content": [qsTr("Search feature.")] },
0129             { "versionCode": 6000, "content": [qsTr("A Changelog.")] },
0130             { "versionCode": 5200, "content": [qsTr("Many little fixes."), qsTr("Lang activity now available in French.")] },
0131             { "versionCode": 5000, "content": [qsTr("Adding a loading overlay to let the user know that some actions are taking place (loading an activity for example) and can take some seconds."), qsTr("Translations added for: Catalan (Valencian), Chinese Traditional, Finnish (92% translated), Russian (98% translated), Slovak (92% translated), Turkish.")] },
0132             { "versionCode": 4000, "content": [qsTr("Translations added for: Slovenian, German, Galician.")] }
0133         ]
0134 
0135     function isNewerVersion(previousVersion, newVersion) {
0136         return newVersion > previousVersion
0137     }
0138 
0139     function getNewDatasetsBetween(previousVersion, newVersion) {
0140         const filtered = changelog.filter(function filter(obj) {
0141             return isNewerVersion(previousVersion, obj['versionCode'])
0142         });
0143         const allDatasetChanges = new Array();
0144         const allActivities = ActivityInfoTree.menuTreeFull
0145         for(const change of filtered) {
0146             if(change["newDatasets"]) {
0147                 change["newDatasets"].forEach(function(value) {
0148                     for(var j in allActivities) {
0149                         var activity = allActivities[j];
0150                         // get the title of the activities that have new datasets
0151                         if(activity.name.startsWith(value + '/')) {
0152                             if(allDatasetChanges.find(function(newDatasetsActivity) { return newDatasetsActivity.activity == value; }) == undefined) {
0153                                 allDatasetChanges.push({
0154                                     "activityName": activity.name,
0155                                     "activityTitle": activity.title,
0156                                     "overrideExistingLevels": true
0157                                 });
0158                             }
0159                             break;
0160                         }
0161                     }
0162                 })
0163             }
0164         }
0165         return allDatasetChanges;
0166     }
0167 
0168     function getLogBetween(previousVersion, newVersion) {
0169         var filtered = changelog.filter(function filter(obj) {
0170             return isNewerVersion(previousVersion, obj['versionCode'])
0171         });
0172         var output = "";
0173         // Retrieve all the activities created between the two versions
0174         ActivityInfoTree.filterCreatedWithinVersions(previousVersion, newVersion);
0175         var activities = ActivityInfoTree.menuTree;
0176         // display for each version an optional text ("content") then the new activities
0177         filtered.map(function filter(obj) {
0178             var major = Math.floor((obj['versionCode'] / 10000));
0179             var minor = (obj['versionCode'] % 10000 / 100);
0180             var patch = (obj['versionCode'] % 100);
0181 
0182             var version = major + "." + minor;
0183             if(patch !== 0) {
0184                 version += "."+patch;
0185             }
0186             output += "<b>" + qsTr("Version %1:").arg(version) + "</b>";
0187             output += "<ul>";
0188             // display free text if exist
0189             for(const text of obj['content'])
0190                 output += "<li>" + text + "</li>";
0191             // display the activity titles
0192             for(var j in activities) {
0193                 var activity = activities[j];
0194                 if(activity.createdInVersion === obj['versionCode'] && activity.enabled) {
0195                     output += "<li>" + activity.title + "</li>";
0196                 }
0197             }
0198             output += "</ul>";
0199         });
0200 
0201         // restore menu context
0202         ActivityInfoTree.filterByTag("favorite")
0203         ActivityInfoTree.filterEnabledActivities()
0204 
0205         return output
0206     }
0207 }