Changeset View
Changeset View
Standalone View
Standalone View
src/activities/calendar/Calendar.qml
Show All 37 Lines | 37 | pageComponent: Image { | |||
---|---|---|---|---|---|
38 | id: background | 38 | id: background | ||
39 | signal start | 39 | signal start | ||
40 | signal stop | 40 | signal stop | ||
41 | fillMode: Image.PreserveAspectCrop | 41 | fillMode: Image.PreserveAspectCrop | ||
42 | source: "qrc:/gcompris/src/activities/fifteen/resource/background.svg" | 42 | source: "qrc:/gcompris/src/activities/fifteen/resource/background.svg" | ||
43 | sourceSize.width: Math.max(parent.width, parent.height) | 43 | sourceSize.width: Math.max(parent.width, parent.height) | ||
44 | 44 | | |||
45 | Component.onCompleted: { | 45 | Component.onCompleted: { | ||
46 | dialogActivityConfig.initialize() | ||||
46 | activity.start.connect(start) | 47 | activity.start.connect(start) | ||
47 | activity.stop.connect(stop) | 48 | activity.stop.connect(stop) | ||
48 | } | 49 | } | ||
49 | 50 | | |||
50 | // Add here the QML items you need to access in javascript | 51 | // Add here the QML items you need to access in javascript | ||
51 | QtObject { | 52 | QtObject { | ||
52 | id: items | 53 | id: items | ||
53 | property Item main: activity.main | 54 | property Item main: activity.main | ||
54 | property alias background: background | 55 | property alias background: background | ||
55 | property alias bar: bar | 56 | property alias bar: bar | ||
56 | property alias bonus: bonus | 57 | property alias bonus: bonus | ||
57 | property alias calendar: calendar | 58 | property alias calendar: calendar | ||
58 | property alias okButton: okButton | 59 | property alias okButton: okButton | ||
59 | property alias questionItem: questionItem | 60 | property alias questionItem: questionItem | ||
61 | property var levels: activity.datasetLoader.item.data | ||||
60 | property alias score: score | 62 | property alias score: score | ||
61 | property alias answerChoices: answerChoices | 63 | property alias answerChoices: answerChoices | ||
62 | property alias questionDelay: questionDelay | 64 | property alias questionDelay: questionDelay | ||
63 | property alias okButtonParticles: okButtonParticles | 65 | property alias okButtonParticles: okButtonParticles | ||
64 | property bool horizontalLayout: background.width >= background.height * 1.5 | 66 | property bool horizontalLayout: background.width >= background.height * 1.5 | ||
65 | property alias daysOfTheWeekModel: daysOfTheWeekModel | 67 | property alias daysOfTheWeekModel: daysOfTheWeekModel | ||
66 | } | 68 | } | ||
67 | 69 | | |||
68 | onStart: { Activity.start(items, dataset) } | 70 | onStart: { Activity.start(items) } | ||
69 | onStop: { Activity.stop() } | 71 | onStop: { Activity.stop() } | ||
70 | Keys.onPressed: (answerChoices.visible) ? answerChoices.handleKeys(event) : handleKeys(event); | 72 | Keys.onPressed: (answerChoices.visible) ? answerChoices.handleKeys(event) : handleKeys(event); | ||
71 | 73 | | |||
72 | // Question time delay | 74 | // Question time delay | ||
73 | Timer { | 75 | Timer { | ||
74 | id: questionDelay | 76 | id: questionDelay | ||
75 | repeat: false | 77 | repeat: false | ||
76 | interval: 1600 | 78 | interval: 1600 | ||
▲ Show 20 Lines • Show All 315 Lines • ▼ Show 20 Line(s) | 393 | MouseArea { | |||
392 | id: okButtonMouseArea | 394 | id: okButtonMouseArea | ||
393 | anchors.fill: parent | 395 | anchors.fill: parent | ||
394 | onClicked: { | 396 | onClicked: { | ||
395 | Activity.checkAnswer() | 397 | Activity.checkAnswer() | ||
396 | } | 398 | } | ||
397 | } | 399 | } | ||
398 | } | 400 | } | ||
399 | 401 | | |||
402 | DialogChooseLevel { | ||||
403 | id: dialogActivityConfig | ||||
404 | currentActivity: activity.activityInfo | ||||
405 | | ||||
406 | onSaveData: { | ||||
407 | levelFolder = dialogActivityConfig.chosenLevel | ||||
408 | currentActivity.currentLevel = dialogActivityConfig.chosenLevel | ||||
409 | ApplicationSettings.setCurrentLevel(currentActivity.name, dialogActivityConfig.chosenLevel) | ||||
410 | background.start() | ||||
411 | home() | ||||
412 | } | ||||
413 | onClose: { | ||||
414 | home() | ||||
415 | } | ||||
416 | onStartActivity: { | ||||
417 | background.start() | ||||
418 | } | ||||
419 | } | ||||
420 | | ||||
400 | DialogHelp { | 421 | DialogHelp { | ||
401 | id: dialogHelp | 422 | id: dialogHelp | ||
402 | onClose: home() | 423 | onClose: home() | ||
403 | } | 424 | } | ||
404 | 425 | | |||
405 | Bar { | 426 | Bar { | ||
406 | id: bar | 427 | id: bar | ||
407 | content: BarEnumContent { value: help | home | level } | 428 | content: BarEnumContent { value: help | home | level | activityConfig } | ||
408 | onHelpClicked: { | 429 | onHelpClicked: { | ||
409 | displayDialog(dialogHelp) | 430 | displayDialog(dialogHelp) | ||
410 | } | 431 | } | ||
432 | onActivityConfigClicked: { | ||||
433 | displayDialog(dialogActivityConfig) | ||||
434 | } | ||||
411 | onPreviousLevelClicked: Activity.previousLevel() | 435 | onPreviousLevelClicked: Activity.previousLevel() | ||
412 | onNextLevelClicked: Activity.nextLevel() | 436 | onNextLevelClicked: Activity.nextLevel() | ||
413 | onHomeClicked: activity.home() | 437 | onHomeClicked: activity.home() | ||
414 | } | 438 | } | ||
415 | 439 | | |||
416 | Bonus { | 440 | Bonus { | ||
417 | id: bonus | 441 | id: bonus | ||
418 | Component.onCompleted: win.connect(Activity.nextLevel) | 442 | Component.onCompleted: win.connect(Activity.nextLevel) | ||
Show All 16 Lines |