Changeset View
Changeset View
Standalone View
Standalone View
src/activities/sudoku/Sudoku.qml
Show All 38 Lines | 36 | pageComponent: Image { | |||
---|---|---|---|---|---|
39 | source: Activity.url + "background.svg" | 39 | source: Activity.url + "background.svg" | ||
40 | sourceSize.width: Math.max(parent.width, parent.height) | 40 | sourceSize.width: Math.max(parent.width, parent.height) | ||
41 | fillMode: Image.PreserveAspectCrop | 41 | fillMode: Image.PreserveAspectCrop | ||
42 | 42 | | |||
43 | signal start | 43 | signal start | ||
44 | signal stop | 44 | signal stop | ||
45 | 45 | | |||
46 | Component.onCompleted: { | 46 | Component.onCompleted: { | ||
47 | dialogActivityConfig.initialize() | ||||
47 | activity.start.connect(start) | 48 | activity.start.connect(start) | ||
48 | activity.stop.connect(stop) | 49 | activity.stop.connect(stop) | ||
49 | focus = true | 50 | focus = true | ||
50 | } | 51 | } | ||
51 | 52 | | |||
52 | property int nbRegions | 53 | property int nbRegions | ||
53 | 54 | | |||
54 | QtObject { | 55 | QtObject { | ||
55 | id: items | 56 | id: items | ||
56 | property alias background: background | 57 | property alias background: background | ||
57 | property alias bar: bar | 58 | property alias bar: bar | ||
58 | property alias bonus: bonus | 59 | property alias bonus: bonus | ||
59 | property alias score: score | 60 | property alias score: score | ||
60 | property GCSfx audioEffects: activity.audioEffects | 61 | property GCSfx audioEffects: activity.audioEffects | ||
61 | property alias availablePiecesModel: availablePieces | 62 | property alias availablePiecesModel: availablePieces | ||
62 | property alias columns: sudoColumn.columns | 63 | property alias columns: sudoColumn.columns | ||
63 | property alias rows: sudoColumn.rows | 64 | property alias rows: sudoColumn.rows | ||
64 | property alias sudokuModel: sudokuModel | 65 | property alias sudokuModel: sudokuModel | ||
66 | property var levels: activity.datasetLoader.data | ||||
65 | } | 67 | } | ||
66 | onStart: Activity.start(items) | 68 | onStart: Activity.start(items) | ||
67 | 69 | | |||
68 | onStop: { Activity.stop() } | 70 | onStop: { Activity.stop() } | ||
69 | 71 | | |||
70 | DialogHelp { | 72 | DialogHelp { | ||
71 | id: dialogHelp | 73 | id: dialogHelp | ||
72 | onClose: home() | 74 | onClose: home() | ||
73 | } | 75 | } | ||
74 | 76 | | |||
77 | DialogChooseLevel { | ||||
78 | id: dialogActivityConfig | ||||
79 | currentActivity: activity.activityInfo | ||||
80 | onClose: { | ||||
81 | home() | ||||
82 | } | ||||
83 | | ||||
84 | onSaveData: { | ||||
85 | levelFolder = dialogActivityConfig.chosenLevels | ||||
86 | currentActivity.currentLevels = dialogActivityConfig.chosenLevels | ||||
87 | ApplicationSettings.setCurrentLevels(currentActivity.name, dialogActivityConfig.chosenLevels) | ||||
88 | } | ||||
89 | | ||||
90 | onStartActivity: { | ||||
91 | background.stop() | ||||
92 | background.start() | ||||
93 | } | ||||
94 | } | ||||
95 | | ||||
75 | Bar { | 96 | Bar { | ||
76 | id: bar | 97 | id: bar | ||
77 | content: BarEnumContent { value: help | home | level | reload } | 98 | content: BarEnumContent { value: help | home | level | reload | activityConfig } | ||
78 | onHelpClicked: { | 99 | onHelpClicked: { | ||
79 | displayDialog(dialogHelp) | 100 | displayDialog(dialogHelp) | ||
80 | } | 101 | } | ||
102 | onActivityConfigClicked: { | ||||
103 | displayDialog(dialogActivityConfig) | ||||
104 | } | ||||
81 | onPreviousLevelClicked: Activity.previousLevel() | 105 | onPreviousLevelClicked: Activity.previousLevel() | ||
82 | onNextLevelClicked: Activity.nextLevel() | 106 | onNextLevelClicked: Activity.nextLevel() | ||
83 | onReloadClicked: Activity.initLevel() | 107 | onReloadClicked: Activity.initLevel() | ||
84 | onHomeClicked: activity.home() | 108 | onHomeClicked: activity.home() | ||
85 | } | 109 | } | ||
86 | 110 | | |||
87 | Bonus { | 111 | Bonus { | ||
88 | id: bonus | 112 | id: bonus | ||
▲ Show 20 Lines • Show All 124 Lines • Show Last 20 Lines |