Changeset View
Changeset View
Standalone View
Standalone View
src/activities/memory/MemoryCommon.qml
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | 40 | pageComponent: Image { | |||
---|---|---|---|---|---|
46 | 46 | | |||
47 | signal start | 47 | signal start | ||
48 | signal stop | 48 | signal stop | ||
49 | 49 | | |||
50 | property alias items: items | 50 | property alias items: items | ||
51 | property bool keyNavigationVisible: false | 51 | property bool keyNavigationVisible: false | ||
52 | 52 | | |||
53 | Component.onCompleted: { | 53 | Component.onCompleted: { | ||
54 | dialogActivityConfig.initialize() | ||||
54 | activity.start.connect(start) | 55 | activity.start.connect(start) | ||
55 | activity.stop.connect(stop) | 56 | activity.stop.connect(stop) | ||
56 | } | 57 | } | ||
57 | 58 | | |||
58 | QtObject { | 59 | QtObject { | ||
59 | id: items | 60 | id: items | ||
60 | property alias bar: bar | 61 | property alias bar: bar | ||
61 | property alias bonus: bonus | 62 | property alias bonus: bonus | ||
62 | property GCSfx audioEffects: activity.audioEffects | 63 | property GCSfx audioEffects: activity.audioEffects | ||
63 | property bool withTux: activity.withTux | 64 | property bool withTux: activity.withTux | ||
64 | property bool tuxTurn: false | 65 | property bool tuxTurn: false | ||
65 | property var playQueue | 66 | property var playQueue | ||
66 | property int selectionCount | 67 | property int selectionCount | ||
67 | property int tuxScore: tuxScore.text | 68 | property int tuxScore: tuxScore.text | ||
68 | property int playerScore: playerScore.text | 69 | property int playerScore: playerScore.text | ||
69 | property var dataset: activity.dataset | 70 | property var levels: activity.datasetLoader.data != 0 ? activity.datasetLoader.data : activity.dataset | ||
70 | property alias containerModel: containerModel | 71 | property alias containerModel: containerModel | ||
71 | property alias grid: grid | 72 | property alias grid: grid | ||
72 | property bool blockClicks: false | 73 | property bool blockClicks: false | ||
73 | property int columns | 74 | property int columns | ||
74 | property int rows | 75 | property int rows | ||
75 | property int spacing: 5 * ApplicationInfo.ratio | 76 | property int spacing: 5 * ApplicationInfo.ratio | ||
77 | property bool isMultipleDatasetMode: activity.datasetLoader.data != 0 | ||||
76 | } | 78 | } | ||
77 | 79 | | |||
78 | onStart: Activity.start(items) | 80 | onStart: Activity.start(items) | ||
79 | 81 | | |||
80 | onStop: Activity.stop() | 82 | onStop: Activity.stop() | ||
81 | 83 | | |||
82 | ListModel { | 84 | ListModel { | ||
83 | id: containerModel | 85 | id: containerModel | ||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | 89 | GridView { | |||
138 | } | 140 | } | ||
139 | } | 141 | } | ||
140 | 142 | | |||
141 | DialogHelp { | 143 | DialogHelp { | ||
142 | id: dialogHelp | 144 | id: dialogHelp | ||
143 | onClose: home() | 145 | onClose: home() | ||
144 | } | 146 | } | ||
145 | 147 | | |||
148 | DialogChooseLevel { | ||||
149 | id: dialogActivityConfig | ||||
150 | currentActivity: activity.activityInfo | ||||
151 | | ||||
152 | onSaveData: { | ||||
153 | levelFolder = dialogActivityConfig.chosenLevels | ||||
154 | currentActivity.currentLevels = dialogActivityConfig.chosenLevels | ||||
155 | ApplicationSettings.setCurrentLevels(currentActivity.name, dialogActivityConfig.chosenLevels) | ||||
156 | } | ||||
157 | onClose: { | ||||
158 | home() | ||||
159 | } | ||||
160 | onStartActivity: { | ||||
161 | background.stop() | ||||
162 | background.start() | ||||
163 | } | ||||
164 | } | ||||
165 | | ||||
166 | | ||||
146 | Bar { | 167 | Bar { | ||
147 | id: bar | 168 | id: bar | ||
148 | content: BarEnumContent { value: help | home | level } | 169 | content: BarEnumContent { value: items.isMultipleDatasetMode ? (help | home | level | activityConfig) : (help | home | level) } | ||
149 | onHelpClicked: { | 170 | onHelpClicked: { | ||
150 | displayDialog(dialogHelp) | 171 | displayDialog(dialogHelp) | ||
151 | } | 172 | } | ||
152 | onPreviousLevelClicked: Activity.previousLevel() | 173 | onPreviousLevelClicked: Activity.previousLevel() | ||
174 | onActivityConfigClicked: { | ||||
175 | displayDialog(dialogActivityConfig) | ||||
176 | } | ||||
153 | onNextLevelClicked: Activity.nextLevel() | 177 | onNextLevelClicked: Activity.nextLevel() | ||
154 | onHomeClicked: home() | 178 | onHomeClicked: home() | ||
155 | } | 179 | } | ||
156 | 180 | | |||
157 | Image { | 181 | Image { | ||
158 | id: player | 182 | id: player | ||
159 | source: 'qrc:/gcompris/src/activities/memory/resource/children.svg' | 183 | source: 'qrc:/gcompris/src/activities/memory/resource/children.svg' | ||
160 | anchors { | 184 | anchors { | ||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |