Merge lp:~nik90/sudoku-app/uc1.3-migrate into lp:sudoku-app
- uc1.3-migrate
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Dinko Osmankovic | ||||
Approved revision: | 429 | ||||
Merged at revision: | 414 | ||||
Proposed branch: | lp:~nik90/sudoku-app/uc1.3-migrate | ||||
Merge into: | lp:sudoku-app | ||||
Diff against target: |
2322 lines (+787/-922) 24 files modified
click/manifest.json.in (+2/-2) components/AboutTab.qml (+25/-19) components/AddProfileDialog.qml (+3/-3) components/BigBlock.qml (+3/-3) components/BottomEdge.qml (+1/-1) components/BottomEdgeSlide.qml (+1/-1) components/ColorSchemeDefault.qml (+2/-2) components/ColorSchemeSimple.qml (+2/-5) components/ColorSchemeUbuntu.qml (+3/-7) components/DialogButton.qml (+3/-3) components/HighscoresTab.qml (+107/-113) components/ManageProfileDialog.qml (+3/-3) components/NewGameSelectionButton.qml (+3/-3) components/RadialAction.qml (+1/-1) components/SettingsTab.qml (+359/-0) components/SingleValueListItem.qml (+22/-0) components/SudokuBlocksGrid.qml (+3/-7) components/SudokuButton.qml (+2/-2) components/SudokuButtonsGrid.qml (+4/-4) components/SudokuDialogButton.qml (+2/-2) components/TabsList.qml (+36/-0) debian/changelog (+9/-0) po/com.ubuntu.sudoku.pot (+131/-171) sudoku-app.qml (+60/-570) |
||||
To merge this branch: | bzr merge lp:~nik90/sudoku-app/uc1.3-migrate | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jenkins Bot | continuous-integration | Approve | |
Dinko Osmankovic | continuous-integration | Approve | |
Review via email: mp+287387@code.launchpad.net |
Commit message
This MP does the following,
- Migrates to Ubuntu.Components 1.3 (including Popups 1.3)
- Updated framework to 15.04.3-qml
- Updated QtQuick import to 2.4
- Migrated to PageHeaders & ListItemLayouts
- Incremented app version to 1.6
- Moved SettingsTab.qml to its own file
- Removed unnecessary comments
- Removed deprecated unity hud imports
- Removed unused actions declared in suduko-app.qml
Description of the change
This MP does the following,
- Migrates to Ubuntu.Components 1.3 (including Popups 1.3)
- Updated framework to 15.04.3-qml
- Updated QtQuick import to 2.4
- Migrated to PageHeaders & ListItemLayouts
- Incremented app version to 1.6
- Moved SettingsTab.qml to its own file
- Removed unnecessary comments
- Removed deprecated unity hud imports
- Removed unused actions declared in suduko-app.qml
@Sudoku devs, with the upcoming UITK Silo for OTA-10, Sudoku is broken badly and needs to migrate to Ubuntu.Components 1.3 asap. This MP does that along with other much needed improvements.
- 429. By Nekhelesh Ramananthan
-
Updated debian changelog
Dinko Osmankovic (dinko-metalac) wrote : | # |
Jenkins Bot (ubuntu-core-apps-jenkins-bot) : | # |
Preview Diff
1 | === modified file 'click/manifest.json.in' | |||
2 | --- click/manifest.json.in 2015-07-15 16:14:23 +0000 | |||
3 | +++ click/manifest.json.in 2016-02-28 17:36:02 +0000 | |||
4 | @@ -1,7 +1,7 @@ | |||
5 | 1 | { | 1 | { |
6 | 2 | "architecture": "all", | 2 | "architecture": "all", |
7 | 3 | "description": "Sudoku game for Ubuntu devices.", | 3 | "description": "Sudoku game for Ubuntu devices.", |
9 | 4 | "framework": "ubuntu-sdk-15.04", | 4 | "framework": "ubuntu-sdk-15.04.3-qml", |
10 | 5 | "hooks": { | 5 | "hooks": { |
11 | 6 | "sudoku": { | 6 | "sudoku": { |
12 | 7 | "apparmor": "sudoku.apparmor", | 7 | "apparmor": "sudoku.apparmor", |
13 | @@ -12,7 +12,7 @@ | |||
14 | 12 | "maintainer": "Ubuntu Core Apps Developers <ubuntu-touch-coreapps@lists.launchpad.net>", | 12 | "maintainer": "Ubuntu Core Apps Developers <ubuntu-touch-coreapps@lists.launchpad.net>", |
15 | 13 | "name": "@PROJECT_NAME@", | 13 | "name": "@PROJECT_NAME@", |
16 | 14 | "title": "Sudoku", | 14 | "title": "Sudoku", |
18 | 15 | "version": "1.1.@BZR_REVNO@", | 15 | "version": "1.6.@BZR_REVNO@", |
19 | 16 | "x-source": { | 16 | "x-source": { |
20 | 17 | "vcs-bzr": "@BZR_SOURCE@", | 17 | "vcs-bzr": "@BZR_SOURCE@", |
21 | 18 | "vcs-bzr-revno": "@BZR_REVNO@" | 18 | "vcs-bzr-revno": "@BZR_REVNO@" |
22 | 19 | 19 | ||
23 | === modified file 'components/AboutTab.qml' | |||
24 | --- components/AboutTab.qml 2015-07-16 11:29:03 +0000 | |||
25 | +++ components/AboutTab.qml 2016-02-28 17:36:02 +0000 | |||
26 | @@ -1,18 +1,26 @@ | |||
30 | 1 | import QtQuick 2.3 | 1 | import QtQuick 2.4 |
31 | 2 | import Ubuntu.Components 1.1 | 2 | import Ubuntu.Components 1.3 |
29 | 3 | import Ubuntu.Components.ListItems 1.0 as ListItem | ||
32 | 4 | import QtQuick.LocalStorage 2.0 | 3 | import QtQuick.LocalStorage 2.0 |
34 | 5 | import Ubuntu.Components.Popups 1.0 | 4 | import Ubuntu.Components.Popups 1.3 |
35 | 6 | import Ubuntu.Layouts 1.0 | 5 | import Ubuntu.Layouts 1.0 |
36 | 7 | import "../js/localStorage.js" as Settings | 6 | import "../js/localStorage.js" as Settings |
37 | 8 | import "../components" | 7 | import "../components" |
38 | 9 | //import Ubuntu.HUD 1.0 as HUD | ||
39 | 10 | import Ubuntu.Unity.Action 1.1 as UnityActions | ||
40 | 11 | import UserMetrics 0.1 | ||
41 | 12 | 8 | ||
42 | 13 | Tab { | 9 | Tab { |
43 | 10 | id: aboutTab | ||
44 | 14 | objectName: "aboutTab" | 11 | objectName: "aboutTab" |
45 | 12 | |||
46 | 15 | page: Page { | 13 | page: Page { |
47 | 14 | id: aboutPage | ||
48 | 15 | |||
49 | 16 | header: PageHeader { | ||
50 | 17 | title: i18n.tr("About") | ||
51 | 18 | leadingActionBar { | ||
52 | 19 | numberOfSlots: 0 | ||
53 | 20 | actions: tabsList.actions | ||
54 | 21 | } | ||
55 | 22 | } | ||
56 | 23 | |||
57 | 16 | Layouts { | 24 | Layouts { |
58 | 17 | id: aboutTabLayout | 25 | id: aboutTabLayout |
59 | 18 | width: mainView.width | 26 | width: mainView.width |
60 | @@ -31,14 +39,15 @@ | |||
61 | 31 | 39 | ||
62 | 32 | } | 40 | } |
63 | 33 | spacing: units.gu(5) | 41 | spacing: units.gu(5) |
64 | 42 | |||
65 | 34 | ItemLayout { | 43 | ItemLayout { |
66 | 35 | item: "icon" | 44 | item: "icon" |
67 | 36 | id: iconTabletItem | 45 | id: iconTabletItem |
68 | 37 | property real maxWidth: units.gu(80) | 46 | property real maxWidth: units.gu(80) |
69 | 38 | width: Math.min(parent.width, maxWidth)/2 | 47 | width: Math.min(parent.width, maxWidth)/2 |
70 | 39 | height: Math.min(parent.width, maxWidth)/2 | 48 | height: Math.min(parent.width, maxWidth)/2 |
71 | 49 | } | ||
72 | 40 | 50 | ||
73 | 41 | } | ||
74 | 42 | Column { | 51 | Column { |
75 | 43 | //height: iconTabletItem.height | 52 | //height: iconTabletItem.height |
76 | 44 | spacing: 1 | 53 | spacing: 1 |
77 | @@ -65,17 +74,15 @@ | |||
78 | 65 | } | 74 | } |
79 | 66 | } | 75 | } |
80 | 67 | } | 76 | } |
81 | 68 | |||
82 | 69 | |||
83 | 70 | ] | 77 | ] |
84 | 71 | 78 | ||
85 | 72 | Column { | 79 | Column { |
86 | 73 | id: aboutColumn; | 80 | id: aboutColumn; |
87 | 81 | |||
88 | 74 | spacing: units.gu(3) | 82 | spacing: units.gu(3) |
89 | 75 | //anchors.fill: parent | ||
90 | 76 | //anchors.horizontalCenter: parent.horizontalCenter; | ||
91 | 77 | width: parent.width | 83 | width: parent.width |
92 | 78 | y: units.gu(6); | 84 | y: units.gu(6); |
93 | 85 | |||
94 | 79 | Rectangle { | 86 | Rectangle { |
95 | 80 | Layouts.item: "icon" | 87 | Layouts.item: "icon" |
96 | 81 | property real maxWidth: units.gu(45) | 88 | property real maxWidth: units.gu(45) |
97 | @@ -89,15 +96,16 @@ | |||
98 | 89 | smooth: true | 96 | smooth: true |
99 | 90 | anchors.fill: parent | 97 | anchors.fill: parent |
100 | 91 | fillMode: Image.PreserveAspectFit | 98 | fillMode: Image.PreserveAspectFit |
101 | 92 | |||
102 | 93 | } | 99 | } |
103 | 94 | } | 100 | } |
104 | 101 | |||
105 | 95 | Grid { | 102 | Grid { |
106 | 96 | anchors.horizontalCenter: parent.horizontalCenter | 103 | anchors.horizontalCenter: parent.horizontalCenter |
107 | 97 | columns: 2 | 104 | columns: 2 |
108 | 98 | rowSpacing: units.gu(2) | 105 | rowSpacing: units.gu(2) |
109 | 99 | columnSpacing: mainView.width/10 | 106 | columnSpacing: mainView.width/10 |
110 | 100 | Layouts.item: "info" | 107 | Layouts.item: "info" |
111 | 108 | |||
112 | 101 | Label { | 109 | Label { |
113 | 102 | objectName: "authorLabel" | 110 | objectName: "authorLabel" |
114 | 103 | text: i18n.tr("Author(s): ") | 111 | text: i18n.tr("Author(s): ") |
115 | @@ -117,7 +125,6 @@ | |||
116 | 117 | font.bold: true; | 125 | font.bold: true; |
117 | 118 | text: "dinko.metalac@gmail.com" | 126 | text: "dinko.metalac@gmail.com" |
118 | 119 | } | 127 | } |
119 | 120 | |||
120 | 121 | } | 128 | } |
121 | 122 | 129 | ||
122 | 123 | Row { | 130 | Row { |
123 | @@ -131,6 +138,7 @@ | |||
124 | 131 | onLinkActivated: Qt.openUrlExternally(link) | 138 | onLinkActivated: Qt.openUrlExternally(link) |
125 | 132 | } | 139 | } |
126 | 133 | } | 140 | } |
127 | 141 | |||
128 | 134 | Row { | 142 | Row { |
129 | 135 | anchors.horizontalCenter: parent.horizontalCenter; | 143 | anchors.horizontalCenter: parent.horizontalCenter; |
130 | 136 | Layouts.item: "version" | 144 | Layouts.item: "version" |
131 | @@ -141,22 +149,20 @@ | |||
132 | 141 | Label { | 149 | Label { |
133 | 142 | objectName: "version" | 150 | objectName: "version" |
134 | 143 | font.bold: true; | 151 | font.bold: true; |
136 | 144 | text: "1.5" | 152 | text: "1.6" |
137 | 145 | } | 153 | } |
138 | 146 | } | 154 | } |
139 | 155 | |||
140 | 147 | Row { | 156 | Row { |
141 | 148 | Layouts.item: "year" | 157 | Layouts.item: "year" |
142 | 149 | anchors.horizontalCenter: parent.horizontalCenter; | 158 | anchors.horizontalCenter: parent.horizontalCenter; |
143 | 150 | Label { | 159 | Label { |
144 | 151 | objectName: "yearLabel" | 160 | objectName: "yearLabel" |
145 | 152 | font.bold: true; | 161 | font.bold: true; |
149 | 153 | text: "2013" | 162 | text: "2016" |
147 | 154 | |||
148 | 155 | |||
150 | 156 | } | 163 | } |
151 | 157 | } | 164 | } |
152 | 158 | } | 165 | } |
153 | 159 | |||
154 | 160 | } | 166 | } |
155 | 161 | } | 167 | } |
156 | 162 | } | 168 | } |
157 | 163 | 169 | ||
158 | === modified file 'components/AddProfileDialog.qml' | |||
159 | --- components/AddProfileDialog.qml 2014-10-06 12:41:09 +0000 | |||
160 | +++ components/AddProfileDialog.qml 2016-02-28 17:36:02 +0000 | |||
161 | @@ -1,6 +1,6 @@ | |||
165 | 1 | import QtQuick 2.3 | 1 | import QtQuick 2.4 |
166 | 2 | import Ubuntu.Components 1.1 | 2 | import Ubuntu.Components 1.3 |
167 | 3 | import Ubuntu.Components.Popups 1.0 | 3 | import Ubuntu.Components.Popups 1.3 |
168 | 4 | import "../js/localStorage.js" as Settings | 4 | import "../js/localStorage.js" as Settings |
169 | 5 | import QtQuick.LocalStorage 2.0 | 5 | import QtQuick.LocalStorage 2.0 |
170 | 6 | 6 | ||
171 | 7 | 7 | ||
172 | === modified file 'components/BigBlock.qml' | |||
173 | --- components/BigBlock.qml 2015-07-16 11:29:03 +0000 | |||
174 | +++ components/BigBlock.qml 2016-02-28 17:36:02 +0000 | |||
175 | @@ -1,6 +1,6 @@ | |||
179 | 1 | import QtQuick 2.3 | 1 | import QtQuick 2.4 |
180 | 2 | import Ubuntu.Components 1.1 | 2 | import Ubuntu.Components 1.3 |
181 | 3 | import Ubuntu.Components.Popups 1.0 | 3 | import Ubuntu.Components.Popups 1.3 |
182 | 4 | import "../js/SudokuCU.js" as SudokuCU | 4 | import "../js/SudokuCU.js" as SudokuCU |
183 | 5 | import QtFeedback 5.0 | 5 | import QtFeedback 5.0 |
184 | 6 | 6 | ||
185 | 7 | 7 | ||
186 | === modified file 'components/BottomEdge.qml' | |||
187 | --- components/BottomEdge.qml 2015-07-16 11:29:03 +0000 | |||
188 | +++ components/BottomEdge.qml 2016-02-28 17:36:02 +0000 | |||
189 | @@ -1,6 +1,6 @@ | |||
190 | 1 | import QtQuick 2.2 | 1 | import QtQuick 2.2 |
191 | 2 | import QtFeedback 5.0 | 2 | import QtFeedback 5.0 |
193 | 3 | import Ubuntu.Components 1.1 | 3 | import Ubuntu.Components 1.3 |
194 | 4 | 4 | ||
195 | 5 | Item { | 5 | Item { |
196 | 6 | id: bottomEdge | 6 | id: bottomEdge |
197 | 7 | 7 | ||
198 | === modified file 'components/BottomEdgeSlide.qml' | |||
199 | --- components/BottomEdgeSlide.qml 2015-07-16 11:29:03 +0000 | |||
200 | +++ components/BottomEdgeSlide.qml 2016-02-28 17:36:02 +0000 | |||
201 | @@ -1,6 +1,6 @@ | |||
202 | 1 | import QtQuick 2.2 | 1 | import QtQuick 2.2 |
203 | 2 | import QtFeedback 5.0 | 2 | import QtFeedback 5.0 |
205 | 3 | import Ubuntu.Components 1.1 | 3 | import Ubuntu.Components 1.3 |
206 | 4 | 4 | ||
207 | 5 | Item { | 5 | Item { |
208 | 6 | id: bottomEdge | 6 | id: bottomEdge |
209 | 7 | 7 | ||
210 | === modified file 'components/ColorSchemeDefault.qml' | |||
211 | --- components/ColorSchemeDefault.qml 2015-02-23 07:44:43 +0000 | |||
212 | +++ components/ColorSchemeDefault.qml 2016-02-28 17:36:02 +0000 | |||
213 | @@ -1,5 +1,5 @@ | |||
216 | 1 | import QtQuick 2.3 | 1 | import QtQuick 2.4 |
217 | 2 | import Ubuntu.Components 1.1 | 2 | import Ubuntu.Components 1.3 |
218 | 3 | 3 | ||
219 | 4 | Item { | 4 | Item { |
220 | 5 | 5 | ||
221 | 6 | 6 | ||
222 | === modified file 'components/ColorSchemeSimple.qml' | |||
223 | --- components/ColorSchemeSimple.qml 2014-11-08 11:58:23 +0000 | |||
224 | +++ components/ColorSchemeSimple.qml 2016-02-28 17:36:02 +0000 | |||
225 | @@ -1,5 +1,5 @@ | |||
228 | 1 | import QtQuick 2.3 | 1 | import QtQuick 2.4 |
229 | 2 | import Ubuntu.Components 1.1 | 2 | import Ubuntu.Components 1.3 |
230 | 3 | 3 | ||
231 | 4 | Item { | 4 | Item { |
232 | 5 | 5 | ||
233 | @@ -15,8 +15,5 @@ | |||
234 | 15 | property color dialogButtonColor2: "white" | 15 | property color dialogButtonColor2: "white" |
235 | 16 | property color dialogButtonColor3: "white" | 16 | property color dialogButtonColor3: "white" |
236 | 17 | property color dialogButtonTextColor: UbuntuColors.orange | 17 | property color dialogButtonTextColor: UbuntuColors.orange |
237 | 18 | property color headerColor: "#2C001E" | ||
238 | 19 | property color backgroundColor: "#2C001E" | 18 | property color backgroundColor: "#2C001E" |
239 | 20 | property color footerColor: "#5E2750" | ||
240 | 21 | |||
241 | 22 | } | 19 | } |
242 | 23 | 20 | ||
243 | === modified file 'components/ColorSchemeUbuntu.qml' | |||
244 | --- components/ColorSchemeUbuntu.qml 2015-02-23 07:44:43 +0000 | |||
245 | +++ components/ColorSchemeUbuntu.qml 2016-02-28 17:36:02 +0000 | |||
246 | @@ -1,8 +1,7 @@ | |||
249 | 1 | import QtQuick 2.3 | 1 | import QtQuick 2.4 |
250 | 2 | import Ubuntu.Components 1.1 | 2 | import Ubuntu.Components 1.3 |
251 | 3 | 3 | ||
252 | 4 | Item { | 4 | Item { |
253 | 5 | |||
254 | 6 | property color defaultColor: "transparent" // "#F5F5F5"; | 5 | property color defaultColor: "transparent" // "#F5F5F5"; |
255 | 7 | property color defaultStartingColor : UbuntuColors.lightAubergine; | 6 | property color defaultStartingColor : UbuntuColors.lightAubergine; |
256 | 8 | property color defaultNotAllowedColor : UbuntuColors.darkAubergine; | 7 | property color defaultNotAllowedColor : UbuntuColors.darkAubergine; |
257 | @@ -15,8 +14,5 @@ | |||
258 | 15 | property color dialogButtonColor2: UbuntuColors.orange | 14 | property color dialogButtonColor2: UbuntuColors.orange |
259 | 16 | property color dialogButtonColor3: "black" | 15 | property color dialogButtonColor3: "black" |
260 | 17 | property color dialogButtonTextColor: "white" | 16 | property color dialogButtonTextColor: "white" |
265 | 18 | property color headerColor: "#F5F5F5" | 17 | property color backgroundColor: "#FFFFFF" |
262 | 19 | property color backgroundColor: "#F5F5F5" | ||
263 | 20 | property color footerColor: "#F5F5F5" | ||
264 | 21 | |||
266 | 22 | } | 18 | } |
267 | 23 | 19 | ||
268 | === modified file 'components/DialogButton.qml' | |||
269 | --- components/DialogButton.qml 2014-10-06 12:41:09 +0000 | |||
270 | +++ components/DialogButton.qml 2016-02-28 17:36:02 +0000 | |||
271 | @@ -1,5 +1,5 @@ | |||
274 | 1 | import QtQuick 2.3 | 1 | import QtQuick 2.4 |
275 | 2 | import Ubuntu.Components 1.1 | 2 | import Ubuntu.Components 1.3 |
276 | 3 | 3 | ||
277 | 4 | UbuntuShape { | 4 | UbuntuShape { |
278 | 5 | id: button | 5 | id: button |
279 | @@ -14,7 +14,7 @@ | |||
280 | 14 | height: size; | 14 | height: size; |
281 | 15 | width: size; | 15 | width: size; |
282 | 16 | radius: "medium" | 16 | radius: "medium" |
284 | 17 | color: buttonColor | 17 | backgroundColor: buttonColor |
285 | 18 | //border.color: Qt.darker(buttonColor,1.5) | 18 | //border.color: Qt.darker(buttonColor,1.5) |
286 | 19 | 19 | ||
287 | 20 | Text { | 20 | Text { |
288 | 21 | 21 | ||
289 | === modified file 'components/HighscoresTab.qml' | |||
290 | --- components/HighscoresTab.qml 2015-07-17 11:48:07 +0000 | |||
291 | +++ components/HighscoresTab.qml 2016-02-28 17:36:02 +0000 | |||
292 | @@ -1,16 +1,13 @@ | |||
296 | 1 | import QtQuick 2.3 | 1 | import QtQuick 2.4 |
297 | 2 | import Ubuntu.Components 1.2 | 2 | import Ubuntu.Components 1.3 |
295 | 3 | //import Ubuntu.Components.ListItems 1.0 as ListItem | ||
298 | 4 | import QtQuick.LocalStorage 2.0 | 3 | import QtQuick.LocalStorage 2.0 |
300 | 5 | import Ubuntu.Components.Popups 1.0 | 4 | import Ubuntu.Components.Popups 1.3 |
301 | 6 | import Ubuntu.Layouts 1.0 | 5 | import Ubuntu.Layouts 1.0 |
302 | 7 | import "../js/localStorage.js" as Settings | 6 | import "../js/localStorage.js" as Settings |
303 | 8 | import "../components" | 7 | import "../components" |
304 | 9 | //import Ubuntu.HUD 1.0 as HUD | ||
305 | 10 | import Ubuntu.Unity.Action 1.1 as UnityActions | ||
306 | 11 | import UserMetrics 0.1 | ||
307 | 12 | 8 | ||
309 | 13 | Page { | 9 | Tab { |
310 | 10 | id: highScoresTab | ||
311 | 14 | 11 | ||
312 | 15 | function appendModel(item) | 12 | function appendModel(item) |
313 | 16 | { | 13 | { |
314 | @@ -27,40 +24,94 @@ | |||
315 | 27 | for (var i = 0; i < highscoresModel.count; i++) | 24 | for (var i = 0; i < highscoresModel.count; i++) |
316 | 28 | { | 25 | { |
317 | 29 | if (highscoresModel.get(i).firstname === firstName && | 26 | if (highscoresModel.get(i).firstname === firstName && |
319 | 30 | highscoresModel.get(i).lastname === lastName ) | 27 | highscoresModel.get(i).lastname === lastName ) |
320 | 31 | highscoresModel.remove(i); | 28 | highscoresModel.remove(i); |
321 | 32 | } | 29 | } |
322 | 33 | } | 30 | } |
323 | 34 | 31 | ||
343 | 35 | BottomEdge { | 32 | Page { |
344 | 36 | z:2 | 33 | id: highScoresPage |
345 | 37 | hintIconName: "delete" | 34 | |
346 | 38 | actions: [ | 35 | header: PageHeader { |
347 | 39 | RadialAction { | 36 | title: i18n.tr("About") |
348 | 40 | iconName: "contact" | 37 | leadingActionBar { |
349 | 41 | iconColor: UbuntuColors.orange | 38 | numberOfSlots: 0 |
350 | 42 | onTriggered: { | 39 | actions: tabsList.actions |
332 | 43 | Settings.deleteScoresWithProfileId(currentUserId) | ||
333 | 44 | highscoresModel.clearModelProfileId(currentUserId); | ||
334 | 45 | } | ||
335 | 46 | }, | ||
336 | 47 | RadialAction { | ||
337 | 48 | iconName: "contact-group" | ||
338 | 49 | iconColor: UbuntuColors.orange | ||
339 | 50 | onTriggered: { | ||
340 | 51 | Settings.deleteAllScores(); | ||
341 | 52 | highscoresModel.clear(); | ||
342 | 53 | } | ||
351 | 54 | } | 40 | } |
361 | 55 | ] | 41 | |
362 | 56 | } | 42 | trailingActionBar.actions: [ |
363 | 57 | 43 | Action { | |
364 | 58 | head.actions: [ | 44 | objectName: "allusersbutton" |
365 | 59 | Action { | 45 | text: "All\nusers" |
366 | 60 | objectName: "allusersbutton" | 46 | iconSource: Qt.resolvedUrl("../icons/all-users.svg") |
367 | 61 | text: "All\nusers" | 47 | onTriggered: { |
368 | 62 | iconSource: Qt.resolvedUrl("../icons/all-users.svg") | 48 | var allScores = Settings.getAllScores() |
369 | 63 | onTriggered: { | 49 | highscoresModel.clear(); |
370 | 50 | highscoresHeaderText = i18n.tr("<b>Best scores for all players</b>"); | ||
371 | 51 | for(var i = 0; i < allScores.length; i++) { | ||
372 | 52 | var rowItem = allScores[i]; | ||
373 | 53 | //print("ROW ",rowItem) | ||
374 | 54 | var firstName = Settings.getUserFirstName(rowItem[1]); | ||
375 | 55 | var lastName = Settings.getUserLastName(rowItem[1]); | ||
376 | 56 | //res.push([dbItem.first_name, dbItem.last_name, dbItem.score]) | ||
377 | 57 | highscoresModel.append({ 'id': rowItem[0], | ||
378 | 58 | 'firstname': firstName, | ||
379 | 59 | 'lastname': lastName, | ||
380 | 60 | 'score': rowItem[2] }); | ||
381 | 61 | } | ||
382 | 62 | } | ||
383 | 63 | }, | ||
384 | 64 | Action { | ||
385 | 65 | text: "Current\nuser" | ||
386 | 66 | objectName: "currentuserbutton" | ||
387 | 67 | iconSource: Qt.resolvedUrl("../icons/single-user.svg") | ||
388 | 68 | onTriggered: { | ||
389 | 69 | var firstName = Settings.getUserFirstName(currentUserId); | ||
390 | 70 | var lastName = Settings.getUserLastName(currentUserId); | ||
391 | 71 | //print(firstName, lastName) | ||
392 | 72 | // TRANSLATORS: %1 is user's first name and %2 is last name | ||
393 | 73 | highscoresHeaderText = "<b>" + i18n.tr("Best scores for %1 %2").arg(firstName).arg(lastName) + "</b>" | ||
394 | 74 | var allScores = Settings.getAllScoresForUser(currentUserId) | ||
395 | 75 | highscoresModel.clear(); | ||
396 | 76 | for(var i = 0; i < allScores.length; i++) { | ||
397 | 77 | var rowItem = allScores[i]; | ||
398 | 78 | //res.push([dbItem.first_name, dbItem.last_name, dbItem.score]) | ||
399 | 79 | highscoresModel.append({'firstname': firstName, | ||
400 | 80 | 'lastname': lastName, | ||
401 | 81 | 'score': rowItem[1] }); | ||
402 | 82 | } | ||
403 | 83 | } | ||
404 | 84 | } | ||
405 | 85 | ] | ||
406 | 86 | } | ||
407 | 87 | |||
408 | 88 | BottomEdge { | ||
409 | 89 | z:2 | ||
410 | 90 | hintIconName: "delete" | ||
411 | 91 | actions: [ | ||
412 | 92 | RadialAction { | ||
413 | 93 | iconName: "contact" | ||
414 | 94 | iconColor: UbuntuColors.orange | ||
415 | 95 | onTriggered: { | ||
416 | 96 | Settings.deleteScoresWithProfileId(currentUserId) | ||
417 | 97 | highscoresModel.clearModelProfileId(currentUserId); | ||
418 | 98 | } | ||
419 | 99 | }, | ||
420 | 100 | RadialAction { | ||
421 | 101 | iconName: "contact-group" | ||
422 | 102 | iconColor: UbuntuColors.orange | ||
423 | 103 | onTriggered: { | ||
424 | 104 | Settings.deleteAllScores(); | ||
425 | 105 | highscoresModel.clear(); | ||
426 | 106 | } | ||
427 | 107 | } | ||
428 | 108 | ] | ||
429 | 109 | } | ||
430 | 110 | |||
431 | 111 | ListModel { | ||
432 | 112 | id: highscoresModel | ||
433 | 113 | |||
434 | 114 | onDataChanged: { | ||
435 | 64 | var allScores = Settings.getAllScores() | 115 | var allScores = Settings.getAllScores() |
436 | 65 | highscoresModel.clear(); | 116 | highscoresModel.clear(); |
437 | 66 | highscoresHeaderText = i18n.tr("<b>Best scores for all players</b>"); | 117 | highscoresHeaderText = i18n.tr("<b>Best scores for all players</b>"); |
438 | @@ -76,91 +127,37 @@ | |||
439 | 76 | 'score': rowItem[2] }); | 127 | 'score': rowItem[2] }); |
440 | 77 | } | 128 | } |
441 | 78 | } | 129 | } |
504 | 79 | }, | 130 | } |
505 | 80 | Action { | 131 | |
444 | 81 | text: "Current\nuser" | ||
445 | 82 | objectName: "currentuserbutton" | ||
446 | 83 | iconSource: Qt.resolvedUrl("../icons/single-user.svg") | ||
447 | 84 | onTriggered: { | ||
448 | 85 | var firstName = Settings.getUserFirstName(currentUserId); | ||
449 | 86 | var lastName = Settings.getUserLastName(currentUserId); | ||
450 | 87 | //print(firstName, lastName) | ||
451 | 88 | // TRANSLATORS: %1 is user's first name and %2 is last name | ||
452 | 89 | highscoresHeaderText = "<b>" + i18n.tr("Best scores for %1 %2").arg(firstName).arg(lastName) + "</b>" | ||
453 | 90 | var allScores = Settings.getAllScoresForUser(currentUserId) | ||
454 | 91 | highscoresModel.clear(); | ||
455 | 92 | for(var i = 0; i < allScores.length; i++) { | ||
456 | 93 | var rowItem = allScores[i]; | ||
457 | 94 | //res.push([dbItem.first_name, dbItem.last_name, dbItem.score]) | ||
458 | 95 | highscoresModel.append({'firstname': firstName, | ||
459 | 96 | 'lastname': lastName, | ||
460 | 97 | 'score': rowItem[1] }); | ||
461 | 98 | } | ||
462 | 99 | } | ||
463 | 100 | } | ||
464 | 101 | |||
465 | 102 | //locked: true | ||
466 | 103 | //opened: true | ||
467 | 104 | ] | ||
468 | 105 | |||
469 | 106 | |||
470 | 107 | ListModel { | ||
471 | 108 | id: highscoresModel | ||
472 | 109 | |||
473 | 110 | onDataChanged: { | ||
474 | 111 | var allScores = Settings.getAllScores() | ||
475 | 112 | highscoresModel.clear(); | ||
476 | 113 | highscoresHeaderText = i18n.tr("<b>Best scores for all players</b>"); | ||
477 | 114 | for(var i = 0; i < allScores.length; i++) { | ||
478 | 115 | var rowItem = allScores[i]; | ||
479 | 116 | //print("ROW ",rowItem) | ||
480 | 117 | var firstName = Settings.getUserFirstName(rowItem[1]); | ||
481 | 118 | var lastName = Settings.getUserLastName(rowItem[1]); | ||
482 | 119 | //res.push([dbItem.first_name, dbItem.last_name, dbItem.score]) | ||
483 | 120 | highscoresModel.append({ 'id': rowItem[0], | ||
484 | 121 | 'firstname': firstName, | ||
485 | 122 | 'lastname': lastName, | ||
486 | 123 | 'score': rowItem[2] }); | ||
487 | 124 | } | ||
488 | 125 | } | ||
489 | 126 | |||
490 | 127 | /*ListElement { | ||
491 | 128 | firstname: "Bill" | ||
492 | 129 | lastname: "Smith" | ||
493 | 130 | score: "120" | ||
494 | 131 | } | ||
495 | 132 | ListElement { | ||
496 | 133 | firstname: "John" | ||
497 | 134 | lastname: "Brown" | ||
498 | 135 | score: "130" | ||
499 | 136 | }*/ | ||
500 | 137 | } | ||
501 | 138 | Column { | ||
502 | 139 | anchors.fill: parent | ||
503 | 140 | clip: true | ||
506 | 141 | UbuntuListView { | 132 | UbuntuListView { |
507 | 142 | id: highScoresListView | 133 | id: highScoresListView |
508 | 134 | |||
509 | 135 | anchors { | ||
510 | 136 | top: highScoresPage.header.bottom | ||
511 | 137 | topMargin: units.gu(2) | ||
512 | 138 | left: parent.left | ||
513 | 139 | right: parent.right | ||
514 | 140 | bottom: parent.bottom | ||
515 | 141 | } | ||
516 | 142 | |||
517 | 143 | model: highscoresModel | 143 | model: highscoresModel |
518 | 144 | width: parent.width | ||
519 | 145 | height:parent.height | ||
520 | 146 | 144 | ||
521 | 147 | header: Label { | 145 | header: Label { |
522 | 148 | id: highscoresHeader | 146 | id: highscoresHeader |
523 | 149 | objectName: "highscoreslabel" | 147 | objectName: "highscoreslabel" |
524 | 150 | text: highscoresHeaderText | 148 | text: highscoresHeaderText |
525 | 151 | height: units.gu(5) | 149 | height: units.gu(5) |
526 | 150 | anchors.left: parent.left | ||
527 | 151 | anchors.leftMargin: units.gu(2) | ||
528 | 152 | } | 152 | } |
529 | 153 | 153 | ||
530 | 154 | delegate: ListItem { | 154 | delegate: ListItem { |
540 | 155 | Label { | 155 | ListItemLayout { |
541 | 156 | anchors.left: parent.left | 156 | title.text: "%1. %2 %3".arg(index+1).arg(firstname).arg(lastname) |
542 | 157 | anchors.leftMargin: units.gu(1) | 157 | Label { |
543 | 158 | text: (index+1) + ". " + firstname + " " + lastname | 158 | SlotsLayout.position: SlotsLayout.Last |
544 | 159 | } | 159 | text: score |
545 | 160 | Label { | 160 | } |
537 | 161 | anchors.right: parent.right | ||
538 | 162 | anchors.rightMargin: units.gu(1) | ||
539 | 163 | text: score | ||
546 | 164 | } | 161 | } |
547 | 165 | 162 | ||
548 | 166 | leadingActions: ListItemActions { | 163 | leadingActions: ListItemActions { |
549 | @@ -168,17 +165,14 @@ | |||
550 | 168 | Action { | 165 | Action { |
551 | 169 | iconName: "delete" | 166 | iconName: "delete" |
552 | 170 | onTriggered: { | 167 | onTriggered: { |
553 | 171 | //print(index, id, firstname); | ||
554 | 172 | Settings.deleteScoreWithId(id); | 168 | Settings.deleteScoreWithId(id); |
555 | 173 | highscoresModel.remove(index,1); | 169 | highscoresModel.remove(index,1); |
556 | 174 | } | 170 | } |
557 | 175 | } | 171 | } |
558 | 176 | ] | 172 | ] |
559 | 177 | } | 173 | } |
560 | 178 | //value: score | ||
561 | 179 | } | 174 | } |
562 | 180 | } | 175 | } |
563 | 181 | } | 176 | } |
564 | 182 | } | 177 | } |
565 | 183 | 178 | ||
566 | 184 | |||
567 | 185 | 179 | ||
568 | === modified file 'components/ManageProfileDialog.qml' | |||
569 | --- components/ManageProfileDialog.qml 2014-10-06 12:41:09 +0000 | |||
570 | +++ components/ManageProfileDialog.qml 2016-02-28 17:36:02 +0000 | |||
571 | @@ -1,6 +1,6 @@ | |||
575 | 1 | import QtQuick 2.3 | 1 | import QtQuick 2.4 |
576 | 2 | import Ubuntu.Components 1.1 | 2 | import Ubuntu.Components 1.3 |
577 | 3 | import Ubuntu.Components.Popups 1.0 | 3 | import Ubuntu.Components.Popups 1.3 |
578 | 4 | import "../js/localStorage.js" as Settings | 4 | import "../js/localStorage.js" as Settings |
579 | 5 | import QtQuick.LocalStorage 2.0 | 5 | import QtQuick.LocalStorage 2.0 |
580 | 6 | 6 | ||
581 | 7 | 7 | ||
582 | === modified file 'components/NewGameSelectionButton.qml' | |||
583 | --- components/NewGameSelectionButton.qml 2014-10-06 12:41:09 +0000 | |||
584 | +++ components/NewGameSelectionButton.qml 2016-02-28 17:36:02 +0000 | |||
585 | @@ -1,6 +1,6 @@ | |||
589 | 1 | import QtQuick 2.3 | 1 | import QtQuick 2.4 |
590 | 2 | import Ubuntu.Components 1.1 | 2 | import Ubuntu.Components 1.3 |
591 | 3 | import Ubuntu.Components.Popups 1.0 | 3 | import Ubuntu.Components.Popups 1.3 |
592 | 4 | 4 | ||
593 | 5 | UbuntuShape { | 5 | UbuntuShape { |
594 | 6 | id: gameDifficultyButton | 6 | id: gameDifficultyButton |
595 | 7 | 7 | ||
596 | === modified file 'components/RadialAction.qml' | |||
597 | --- components/RadialAction.qml 2015-07-16 11:29:03 +0000 | |||
598 | +++ components/RadialAction.qml 2016-02-28 17:36:02 +0000 | |||
599 | @@ -1,5 +1,5 @@ | |||
600 | 1 | import QtQuick 2.0 | 1 | import QtQuick 2.0 |
602 | 2 | import Ubuntu.Components 1.1 | 2 | import Ubuntu.Components 1.3 |
603 | 3 | 3 | ||
604 | 4 | Action { | 4 | Action { |
605 | 5 | property string iconName: "add" | 5 | property string iconName: "add" |
606 | 6 | 6 | ||
607 | === added file 'components/SettingsTab.qml' | |||
608 | --- components/SettingsTab.qml 1970-01-01 00:00:00 +0000 | |||
609 | +++ components/SettingsTab.qml 2016-02-28 17:36:02 +0000 | |||
610 | @@ -0,0 +1,359 @@ | |||
611 | 1 | import QtQuick 2.4 | ||
612 | 2 | import Ubuntu.Components 1.3 | ||
613 | 3 | import QtQuick.LocalStorage 2.0 | ||
614 | 4 | import Ubuntu.Components.Popups 1.3 | ||
615 | 5 | import Ubuntu.Layouts 1.0 | ||
616 | 6 | import "../js/localStorage.js" as Settings | ||
617 | 7 | |||
618 | 8 | Tab { | ||
619 | 9 | id: settingsTab; | ||
620 | 10 | objectName: "settingsTab" | ||
621 | 11 | |||
622 | 12 | property alias disableHintsChecked: disableHints.checked; | ||
623 | 13 | property alias disableVibrationsChecked: disableVibrations.checked; | ||
624 | 14 | property alias difficultyIndex: difficultySelector.selectedIndex; | ||
625 | 15 | property alias themeIndex: themeSelector.selectedIndex; | ||
626 | 16 | |||
627 | 17 | page: Page { | ||
628 | 18 | id: settingsPage | ||
629 | 19 | objectName: "settingsPage" | ||
630 | 20 | |||
631 | 21 | anchors.fill: parent | ||
632 | 22 | |||
633 | 23 | header: PageHeader { | ||
634 | 24 | flickable: flickableSettings | ||
635 | 25 | title: i18n.tr("Settings") | ||
636 | 26 | leadingActionBar { | ||
637 | 27 | numberOfSlots: 0 | ||
638 | 28 | actions: tabsList.actions | ||
639 | 29 | } | ||
640 | 30 | } | ||
641 | 31 | |||
642 | 32 | Component { | ||
643 | 33 | id: profileSelector | ||
644 | 34 | Dialog { | ||
645 | 35 | objectName: "selectProfileDialog" | ||
646 | 36 | title: i18n.tr("Select profile") | ||
647 | 37 | |||
648 | 38 | Column{ | ||
649 | 39 | height: mainColumnSettings.height*2/3 | ||
650 | 40 | ListView { | ||
651 | 41 | |||
652 | 42 | id: profileListView | ||
653 | 43 | objectName: "profileListView" | ||
654 | 44 | clip: true | ||
655 | 45 | width: parent.width | ||
656 | 46 | height: parent.height - units.gu(12) | ||
657 | 47 | model: profilesModel | ||
658 | 48 | |||
659 | 49 | delegate: ListItem { | ||
660 | 50 | height: selectProfileLayout.height + divider.height | ||
661 | 51 | ListItemLayout { | ||
662 | 52 | id: selectProfileLayout | ||
663 | 53 | title.text: firstname + " " + lastname | ||
664 | 54 | ProgressionSlot {} | ||
665 | 55 | } | ||
666 | 56 | onClicked: { | ||
667 | 57 | currentUserId = profileId; | ||
668 | 58 | hide() | ||
669 | 59 | } | ||
670 | 60 | } | ||
671 | 61 | } | ||
672 | 62 | |||
673 | 63 | SudokuDialogButton{ | ||
674 | 64 | anchors.horizontalCenter: parent.horizontalCenter | ||
675 | 65 | id:cancelButton | ||
676 | 66 | buttonText: i18n.tr("Cancel") | ||
677 | 67 | width: parent.width/2; | ||
678 | 68 | size: units.gu(5) | ||
679 | 69 | buttonColor: sudokuBlocksGrid.dialogButtonColor1 | ||
680 | 70 | textColor: sudokuBlocksGrid.dialogButtonTextColor | ||
681 | 71 | //border.color: "transparent" | ||
682 | 72 | onTriggered: { | ||
683 | 73 | hide() | ||
684 | 74 | } | ||
685 | 75 | } | ||
686 | 76 | |||
687 | 77 | } | ||
688 | 78 | } | ||
689 | 79 | } | ||
690 | 80 | |||
691 | 81 | Component { | ||
692 | 82 | id: manageProfileSelector | ||
693 | 83 | Dialog { | ||
694 | 84 | objectName: "manageProfileDialog" | ||
695 | 85 | title: i18n.tr("Select profile") | ||
696 | 86 | |||
697 | 87 | Column{ | ||
698 | 88 | height: mainColumnSettings.height*2/3 | ||
699 | 89 | ListView { | ||
700 | 90 | id: manageProfileListView | ||
701 | 91 | objectName: "manageProfileListView" | ||
702 | 92 | clip: true | ||
703 | 93 | width: parent.width | ||
704 | 94 | height: parent.height - units.gu(12) | ||
705 | 95 | model: profilesModel | ||
706 | 96 | |||
707 | 97 | delegate:ListItem { | ||
708 | 98 | height: manageProfileLayout.height + divider.height | ||
709 | 99 | ListItemLayout { | ||
710 | 100 | id: manageProfileLayout | ||
711 | 101 | title.text: firstname + " " + lastname | ||
712 | 102 | ProgressionSlot {} | ||
713 | 103 | } | ||
714 | 104 | onClicked: { | ||
715 | 105 | hide() | ||
716 | 106 | editUserId = profileId | ||
717 | 107 | PopupUtils.open(manageProfileDialog, selectorProfile) | ||
718 | 108 | } | ||
719 | 109 | } | ||
720 | 110 | } | ||
721 | 111 | SudokuDialogButton{ | ||
722 | 112 | |||
723 | 113 | anchors.horizontalCenter: parent.horizontalCenter | ||
724 | 114 | id:cancelButton | ||
725 | 115 | objectName: "cancelButton" | ||
726 | 116 | buttonText: i18n.tr("Cancel") | ||
727 | 117 | width: parent.width/2; | ||
728 | 118 | size: units.gu(5) | ||
729 | 119 | buttonColor: sudokuBlocksGrid.dialogButtonColor1 | ||
730 | 120 | textColor: sudokuBlocksGrid.dialogButtonTextColor | ||
731 | 121 | //border.color: "transparent" | ||
732 | 122 | onTriggered: { | ||
733 | 123 | hide() | ||
734 | 124 | } | ||
735 | 125 | } | ||
736 | 126 | } | ||
737 | 127 | } | ||
738 | 128 | } | ||
739 | 129 | |||
740 | 130 | ListModel{ | ||
741 | 131 | id: profilesModel | ||
742 | 132 | } | ||
743 | 133 | |||
744 | 134 | Flickable { | ||
745 | 135 | id: flickableSettings | ||
746 | 136 | objectName: "settingsContainer" | ||
747 | 137 | |||
748 | 138 | anchors.fill: parent | ||
749 | 139 | contentHeight: mainColumnSettings.height | ||
750 | 140 | |||
751 | 141 | Column { | ||
752 | 142 | id: mainColumnSettings; | ||
753 | 143 | |||
754 | 144 | height: childrenRect.height | ||
755 | 145 | width: parent.width | ||
756 | 146 | spacing: units.gu(1) | ||
757 | 147 | |||
758 | 148 | ListItem { | ||
759 | 149 | height: sudokuSettingsLayout.height + divider.height | ||
760 | 150 | ListItemLayout { | ||
761 | 151 | id: sudokuSettingsLayout | ||
762 | 152 | title.text: i18n.tr("Sudoku settings") | ||
763 | 153 | title.font.weight: Font.DemiBold | ||
764 | 154 | } | ||
765 | 155 | } | ||
766 | 156 | |||
767 | 157 | OptionSelector { | ||
768 | 158 | objectName: "difficultySelector" | ||
769 | 159 | id: difficultySelector | ||
770 | 160 | text: i18n.tr("Default Difficulty") | ||
771 | 161 | width: parent.width - units.gu(4) | ||
772 | 162 | anchors.horizontalCenter: parent.horizontalCenter | ||
773 | 163 | model: [i18n.tr("Easy"), i18n.tr("Moderate"), i18n.tr("Hard"), i18n.tr("Ultra Hard"), i18n.tr("Always ask")] | ||
774 | 164 | onSelectedIndexChanged: { | ||
775 | 165 | //print(difficultySelector.selectedIndex) | ||
776 | 166 | switch(difficultySelector.selectedIndex) { | ||
777 | 167 | case 0: | ||
778 | 168 | var randomnumber = Math.floor(Math.random()*9); | ||
779 | 169 | randomnumber += 31; | ||
780 | 170 | sudokuBlocksGrid.createNewGame(81 - randomnumber); | ||
781 | 171 | Settings.setSetting("Difficulty", selectedIndex) | ||
782 | 172 | sudokuBlocksGrid.gameDifficulty = 0 | ||
783 | 173 | break; | ||
784 | 174 | case 1: | ||
785 | 175 | var randomnumber = Math.floor(Math.random()*4); | ||
786 | 176 | randomnumber += 26; | ||
787 | 177 | sudokuBlocksGrid.createNewGame(81 - randomnumber); | ||
788 | 178 | Settings.setSetting("Difficulty", selectedIndex) | ||
789 | 179 | sudokuBlocksGrid.gameDifficulty = 1 | ||
790 | 180 | break; | ||
791 | 181 | case 2: | ||
792 | 182 | var randomnumber = Math.floor(Math.random()*4); | ||
793 | 183 | randomnumber += 21; | ||
794 | 184 | sudokuBlocksGrid.createNewGame(81 - randomnumber); | ||
795 | 185 | Settings.setSetting("Difficulty", selectedIndex) | ||
796 | 186 | sudokuBlocksGrid.gameDifficulty = 2 | ||
797 | 187 | break; | ||
798 | 188 | case 3: | ||
799 | 189 | var randomnumber = Math.floor(Math.random()*3); | ||
800 | 190 | randomnumber += 17; | ||
801 | 191 | sudokuBlocksGrid.createNewGame(81 - randomnumber); | ||
802 | 192 | Settings.setSetting("Difficulty", selectedIndex) | ||
803 | 193 | sudokuBlocksGrid.gameDifficulty = 3 | ||
804 | 194 | break; | ||
805 | 195 | case 4: | ||
806 | 196 | Settings.setSetting("Difficulty", selectedIndex) | ||
807 | 197 | break; | ||
808 | 198 | } | ||
809 | 199 | } | ||
810 | 200 | |||
811 | 201 | } | ||
812 | 202 | |||
813 | 203 | OptionSelector { | ||
814 | 204 | objectName: "themeSelector" | ||
815 | 205 | id: themeSelector | ||
816 | 206 | text: i18n.tr("Theme") | ||
817 | 207 | model: ["UbuntuColours", "Simple"] | ||
818 | 208 | width: parent.width - units.gu(4) | ||
819 | 209 | anchors.horizontalCenter: parent.horizontalCenter | ||
820 | 210 | onSelectedIndexChanged: { | ||
821 | 211 | var newColorScheme = null; | ||
822 | 212 | if (selectedIndex == 0) | ||
823 | 213 | { | ||
824 | 214 | //print("Ubuntu") | ||
825 | 215 | var result = Settings.setSetting("ColorTheme", selectedIndex); | ||
826 | 216 | //print(result); | ||
827 | 217 | sudokuBlocksGrid.changeColorScheme("ColorSchemeUbuntu.qml"); | ||
828 | 218 | } | ||
829 | 219 | if (selectedIndex == 1) | ||
830 | 220 | { | ||
831 | 221 | //print("Simple") | ||
832 | 222 | var result = Settings.setSetting("ColorTheme", selectedIndex); | ||
833 | 223 | //print(result); | ||
834 | 224 | sudokuBlocksGrid.changeColorScheme("ColorSchemeSimple.qml"); | ||
835 | 225 | } | ||
836 | 226 | } | ||
837 | 227 | Component.onCompleted: selectedIndex = 0 | ||
838 | 228 | } | ||
839 | 229 | |||
840 | 230 | ListItem { | ||
841 | 231 | objectName: "hintsSwitchClickable" | ||
842 | 232 | height: hintsSettingsLayout.height + divider.height | ||
843 | 233 | |||
844 | 234 | ListItemLayout { | ||
845 | 235 | id: hintsSettingsLayout | ||
846 | 236 | title.text: i18n.tr("Hints") | ||
847 | 237 | |||
848 | 238 | Switch { | ||
849 | 239 | id: disableHints | ||
850 | 240 | objectName: "hintsSwitch" | ||
851 | 241 | checked: disableHintsChecked | ||
852 | 242 | SlotsLayout.position: SlotsLayout.Last | ||
853 | 243 | onCheckedChanged: { | ||
854 | 244 | Settings.setSetting("DisableHints", checked ? "true":"false") | ||
855 | 245 | } | ||
856 | 246 | } | ||
857 | 247 | } | ||
858 | 248 | } | ||
859 | 249 | |||
860 | 250 | ListItem { | ||
861 | 251 | objectName: "vibrationsSwitchClickable" | ||
862 | 252 | height: vibrationsSettingsLayout.height + divider.height | ||
863 | 253 | |||
864 | 254 | ListItemLayout { | ||
865 | 255 | id: vibrationsSettingsLayout | ||
866 | 256 | title.text: i18n.tr("Vibration Alerts") | ||
867 | 257 | |||
868 | 258 | Switch { | ||
869 | 259 | id: disableVibrations | ||
870 | 260 | objectName: "vibrationsSwitch" | ||
871 | 261 | checked: disableVibrationsChecked | ||
872 | 262 | SlotsLayout.position: SlotsLayout.Last | ||
873 | 263 | onCheckedChanged: { | ||
874 | 264 | Settings.setSetting("DisableVibrations", checked ? "true":"false") | ||
875 | 265 | } | ||
876 | 266 | } | ||
877 | 267 | } | ||
878 | 268 | } | ||
879 | 269 | |||
880 | 270 | ListItem { | ||
881 | 271 | height: profileSettingsLayout.height + divider.height | ||
882 | 272 | ListItemLayout { | ||
883 | 273 | id: profileSettingsLayout | ||
884 | 274 | title.text: i18n.tr("Profiles settings") | ||
885 | 275 | title.font.weight: Font.DemiBold | ||
886 | 276 | } | ||
887 | 277 | } | ||
888 | 278 | |||
889 | 279 | SingleValueListItem { | ||
890 | 280 | id: selectorProfile | ||
891 | 281 | objectName: "Current profile" | ||
892 | 282 | title.text: i18n.tr("Current profile") | ||
893 | 283 | value: { | ||
894 | 284 | if(currentUserId==-1) | ||
895 | 285 | return i18n.tr("None") | ||
896 | 286 | else | ||
897 | 287 | return Settings.getUserFirstName(currentUserId)+" "+Settings.getUserLastName(currentUserId); | ||
898 | 288 | |||
899 | 289 | } | ||
900 | 290 | Component.onCompleted: currentUserId = Settings.getSetting("currentUserId") | ||
901 | 291 | |||
902 | 292 | onClicked: { | ||
903 | 293 | var allProfiles = new Array(); | ||
904 | 294 | allProfiles = Settings.getAllProfiles() | ||
905 | 295 | |||
906 | 296 | profilesModel.clear() | ||
907 | 297 | |||
908 | 298 | for(var i = 0; i < allProfiles.length; i++) | ||
909 | 299 | { | ||
910 | 300 | profilesModel.append({"profileId":allProfiles[i].id,"lastname":allProfiles[i].lastname, "firstname":allProfiles[i].firstname}) | ||
911 | 301 | } | ||
912 | 302 | PopupUtils.open(profileSelector, selectorProfile) | ||
913 | 303 | } | ||
914 | 304 | } | ||
915 | 305 | |||
916 | 306 | AddProfileDialog{ | ||
917 | 307 | id:addProfileDialog | ||
918 | 308 | } | ||
919 | 309 | |||
920 | 310 | ManageProfileDialog{ | ||
921 | 311 | id:manageProfileDialog | ||
922 | 312 | } | ||
923 | 313 | |||
924 | 314 | ListItem { | ||
925 | 315 | id: addSingleValue | ||
926 | 316 | objectName: "Add profile" | ||
927 | 317 | height: addSingleValueLayout.height + divider.height | ||
928 | 318 | ListItemLayout { | ||
929 | 319 | id: addSingleValueLayout | ||
930 | 320 | title.text: i18n.tr("Add profile") | ||
931 | 321 | ProgressionSlot {} | ||
932 | 322 | } | ||
933 | 323 | onClicked: { | ||
934 | 324 | PopupUtils.open(addProfileDialog, addSingleValue); | ||
935 | 325 | } | ||
936 | 326 | } | ||
937 | 327 | |||
938 | 328 | ListItem { | ||
939 | 329 | id: manageProfileSingleValue | ||
940 | 330 | objectName: "Manage profiles" | ||
941 | 331 | height: manageProfileSingleValueLayout.height + divider.height | ||
942 | 332 | ListItemLayout { | ||
943 | 333 | id: manageProfileSingleValueLayout | ||
944 | 334 | title.text: i18n.tr("Manage profiles") | ||
945 | 335 | ProgressionSlot {} | ||
946 | 336 | } | ||
947 | 337 | onClicked: { | ||
948 | 338 | var allProfiles = new Array(); | ||
949 | 339 | allProfiles = Settings.getAllProfiles() | ||
950 | 340 | |||
951 | 341 | profilesModel.clear() | ||
952 | 342 | |||
953 | 343 | for(var i = 0; i < allProfiles.length; i++) | ||
954 | 344 | { | ||
955 | 345 | profilesModel.append({"profileId":allProfiles[i].id,"lastname":allProfiles[i].lastname, "firstname":allProfiles[i].firstname}) | ||
956 | 346 | } | ||
957 | 347 | |||
958 | 348 | PopupUtils.open(manageProfileSelector, manageProfileSingleValue) | ||
959 | 349 | } | ||
960 | 350 | } | ||
961 | 351 | } | ||
962 | 352 | } | ||
963 | 353 | |||
964 | 354 | Scrollbar { | ||
965 | 355 | flickableItem: flickableSettings | ||
966 | 356 | align: Qt.AlignTrailing | ||
967 | 357 | } | ||
968 | 358 | } | ||
969 | 359 | } | ||
970 | 0 | 360 | ||
971 | === added file 'components/SingleValueListItem.qml' | |||
972 | --- components/SingleValueListItem.qml 1970-01-01 00:00:00 +0000 | |||
973 | +++ components/SingleValueListItem.qml 2016-02-28 17:36:02 +0000 | |||
974 | @@ -0,0 +1,22 @@ | |||
975 | 1 | import QtQuick 2.4 | ||
976 | 2 | import Ubuntu.Components 1.3 | ||
977 | 3 | |||
978 | 4 | ListItem { | ||
979 | 5 | id: customListItem | ||
980 | 6 | |||
981 | 7 | property alias title: customItemLayout.title | ||
982 | 8 | property alias value: _value.text | ||
983 | 9 | |||
984 | 10 | ListItemLayout { | ||
985 | 11 | id: customItemLayout | ||
986 | 12 | |||
987 | 13 | title.text: " " | ||
988 | 14 | |||
989 | 15 | Label { | ||
990 | 16 | id: _value | ||
991 | 17 | SlotsLayout.position: SlotsLayout.Trailing; | ||
992 | 18 | } | ||
993 | 19 | |||
994 | 20 | ProgressionSlot {} | ||
995 | 21 | } | ||
996 | 22 | } | ||
997 | 0 | 23 | ||
998 | === modified file 'components/SudokuBlocksGrid.qml' | |||
999 | --- components/SudokuBlocksGrid.qml 2015-07-16 15:00:01 +0000 | |||
1000 | +++ components/SudokuBlocksGrid.qml 2016-02-28 17:36:02 +0000 | |||
1001 | @@ -1,6 +1,6 @@ | |||
1005 | 1 | import QtQuick 2.3 | 1 | import QtQuick 2.4 |
1006 | 2 | import Ubuntu.Components 1.1 | 2 | import Ubuntu.Components 1.3 |
1007 | 3 | import Ubuntu.Components.Popups 1.0 | 3 | import Ubuntu.Components.Popups 1.3 |
1008 | 4 | import "../js/SudokuCU.js" as SudokuCU | 4 | import "../js/SudokuCU.js" as SudokuCU |
1009 | 5 | import QtFeedback 5.0 | 5 | import QtFeedback 5.0 |
1010 | 6 | 6 | ||
1011 | @@ -120,13 +120,9 @@ | |||
1012 | 120 | colorScheme.dialogButtonColor2 = temp.dialogButtonColor2; | 120 | colorScheme.dialogButtonColor2 = temp.dialogButtonColor2; |
1013 | 121 | colorScheme.dialogButtonTextColor = temp.dialogButtonTextColor; | 121 | colorScheme.dialogButtonTextColor = temp.dialogButtonTextColor; |
1014 | 122 | 122 | ||
1015 | 123 | colorScheme.headerColor = temp.headerColor; | ||
1016 | 124 | colorScheme.backgroundColor = temp.backgroundColor; | 123 | colorScheme.backgroundColor = temp.backgroundColor; |
1017 | 125 | colorScheme.footerColor = temp.footerColor; | ||
1018 | 126 | 124 | ||
1019 | 127 | mainView.headerColor = colorScheme.headerColor; | ||
1020 | 128 | mainView.backgroundColor = colorScheme.backgroundColor; | 125 | mainView.backgroundColor = colorScheme.backgroundColor; |
1021 | 129 | mainView.footerColor = colorScheme.footerColor; | ||
1022 | 130 | 126 | ||
1023 | 131 | for (var i = 0; i < 9; i++) { | 127 | for (var i = 0; i < 9; i++) { |
1024 | 132 | for (var j = 0; j < 9; j++) { | 128 | for (var j = 0; j < 9; j++) { |
1025 | 133 | 129 | ||
1026 | === modified file 'components/SudokuButton.qml' | |||
1027 | --- components/SudokuButton.qml 2014-10-06 12:41:09 +0000 | |||
1028 | +++ components/SudokuButton.qml 2016-02-28 17:36:02 +0000 | |||
1029 | @@ -1,5 +1,5 @@ | |||
1032 | 1 | import QtQuick 2.3 | 1 | import QtQuick 2.4 |
1033 | 2 | import Ubuntu.Components 1.1 | 2 | import Ubuntu.Components 1.3 |
1034 | 3 | 3 | ||
1035 | 4 | Rectangle { | 4 | Rectangle { |
1036 | 5 | id: button | 5 | id: button |
1037 | 6 | 6 | ||
1038 | === modified file 'components/SudokuButtonsGrid.qml' | |||
1039 | --- components/SudokuButtonsGrid.qml 2015-07-16 15:00:01 +0000 | |||
1040 | +++ components/SudokuButtonsGrid.qml 2016-02-28 17:36:02 +0000 | |||
1041 | @@ -1,6 +1,6 @@ | |||
1045 | 1 | import QtQuick 2.3 | 1 | import QtQuick 2.4 |
1046 | 2 | import Ubuntu.Components 1.1 | 2 | import Ubuntu.Components 1.3 |
1047 | 3 | import Ubuntu.Components.Popups 1.0 | 3 | import Ubuntu.Components.Popups 1.3 |
1048 | 4 | 4 | ||
1049 | 5 | Repeater { | 5 | Repeater { |
1050 | 6 | 6 | ||
1051 | @@ -132,7 +132,7 @@ | |||
1052 | 132 | } | 132 | } |
1053 | 133 | 133 | ||
1054 | 134 | Component.onCompleted: { | 134 | Component.onCompleted: { |
1056 | 135 | switch(difficultySelector.selectedIndex) { | 135 | switch(settingsTab.difficultyIndex) { |
1057 | 136 | case 0: | 136 | case 0: |
1058 | 137 | var randomnumber = Math.floor(Math.random()*9); | 137 | var randomnumber = Math.floor(Math.random()*9); |
1059 | 138 | randomnumber += 31; | 138 | randomnumber += 31; |
1060 | 139 | 139 | ||
1061 | === modified file 'components/SudokuDialogButton.qml' | |||
1062 | --- components/SudokuDialogButton.qml 2014-10-06 12:41:09 +0000 | |||
1063 | +++ components/SudokuDialogButton.qml 2016-02-28 17:36:02 +0000 | |||
1064 | @@ -1,5 +1,5 @@ | |||
1067 | 1 | import QtQuick 2.3 | 1 | import QtQuick 2.4 |
1068 | 2 | import Ubuntu.Components 1.1 | 2 | import Ubuntu.Components 1.3 |
1069 | 3 | 3 | ||
1070 | 4 | DialogButton { | 4 | DialogButton { |
1071 | 5 | id: dialogButton | 5 | id: dialogButton |
1072 | 6 | 6 | ||
1073 | === added file 'components/TabsList.qml' | |||
1074 | --- components/TabsList.qml 1970-01-01 00:00:00 +0000 | |||
1075 | +++ components/TabsList.qml 2016-02-28 17:36:02 +0000 | |||
1076 | @@ -0,0 +1,36 @@ | |||
1077 | 1 | import QtQuick 2.4 | ||
1078 | 2 | import Ubuntu.Components 1.3 | ||
1079 | 3 | |||
1080 | 4 | ActionList { | ||
1081 | 5 | id: tabsList | ||
1082 | 6 | |||
1083 | 7 | children: [ | ||
1084 | 8 | Action { | ||
1085 | 9 | text: i18n.tr("Sudoku") | ||
1086 | 10 | onTriggered: { | ||
1087 | 11 | tabs.selectedTabIndex = 0 | ||
1088 | 12 | } | ||
1089 | 13 | }, | ||
1090 | 14 | |||
1091 | 15 | Action { | ||
1092 | 16 | text: i18n.tr("Scores") | ||
1093 | 17 | onTriggered: { | ||
1094 | 18 | tabs.selectedTabIndex = 1 | ||
1095 | 19 | } | ||
1096 | 20 | }, | ||
1097 | 21 | |||
1098 | 22 | Action { | ||
1099 | 23 | text: i18n.tr("Settings") | ||
1100 | 24 | onTriggered: { | ||
1101 | 25 | tabs.selectedTabIndex = 2 | ||
1102 | 26 | } | ||
1103 | 27 | }, | ||
1104 | 28 | |||
1105 | 29 | Action { | ||
1106 | 30 | text: i18n.tr("About") | ||
1107 | 31 | onTriggered: { | ||
1108 | 32 | tabs.selectedTabIndex = 3 | ||
1109 | 33 | } | ||
1110 | 34 | } | ||
1111 | 35 | ] | ||
1112 | 36 | } | ||
1113 | 0 | 37 | ||
1114 | === modified file 'debian/changelog' | |||
1115 | --- debian/changelog 2014-05-02 10:20:04 +0000 | |||
1116 | +++ debian/changelog 2016-02-28 17:36:02 +0000 | |||
1117 | @@ -1,3 +1,12 @@ | |||
1118 | 1 | sudoku-app (1.6) UNRELEASED; urgency=medium | ||
1119 | 2 | |||
1120 | 3 | * Migrated to Ubuntu.Components 1.3 | ||
1121 | 4 | * Updated framework to 15.04.3-qml | ||
1122 | 5 | * Updated to QtQuick 2.4 | ||
1123 | 6 | * Removed unused comments, deprecated imports and unused actions | ||
1124 | 7 | |||
1125 | 8 | -- Nekhelesh <krnekhelesh@nik90-laptop> Sun, 28 Feb 2016 18:34:26 +0100 | ||
1126 | 9 | |||
1127 | 1 | sudoku-app (1.1) raring; urgency=medium | 10 | sudoku-app (1.1) raring; urgency=medium |
1128 | 2 | 11 | ||
1129 | 3 | * Add -qt5 command line option (LP: #1288885) | 12 | * Add -qt5 command line option (LP: #1288885) |
1130 | 4 | 13 | ||
1131 | === modified file 'po/com.ubuntu.sudoku.pot' | |||
1132 | --- po/com.ubuntu.sudoku.pot 2015-07-17 11:48:07 +0000 | |||
1133 | +++ po/com.ubuntu.sudoku.pot 2016-02-28 17:36:02 +0000 | |||
1134 | @@ -8,7 +8,7 @@ | |||
1135 | 8 | msgstr "" | 8 | msgstr "" |
1136 | 9 | "Project-Id-Version: sudoku-app\n" | 9 | "Project-Id-Version: sudoku-app\n" |
1137 | 10 | "Report-Msgid-Bugs-To: \n" | 10 | "Report-Msgid-Bugs-To: \n" |
1139 | 11 | "POT-Creation-Date: 2015-07-17 13:47+0200\n" | 11 | "POT-Creation-Date: 2016-02-28 22:53+0530\n" |
1140 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
1141 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
1142 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
1143 | @@ -18,15 +18,20 @@ | |||
1144 | 18 | "Content-Transfer-Encoding: 8bit\n" | 18 | "Content-Transfer-Encoding: 8bit\n" |
1145 | 19 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" | 19 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" |
1146 | 20 | 20 | ||
1148 | 21 | #: ../components/AboutTab.qml:103 | 21 | #: ../components/AboutTab.qml:17 ../components/HighscoresTab.qml:36 |
1149 | 22 | #: ../components/TabsList.qml:30 | ||
1150 | 23 | msgid "About" | ||
1151 | 24 | msgstr "" | ||
1152 | 25 | |||
1153 | 26 | #: ../components/AboutTab.qml:111 | ||
1154 | 22 | msgid "Author(s): " | 27 | msgid "Author(s): " |
1155 | 23 | msgstr "" | 28 | msgstr "" |
1156 | 24 | 29 | ||
1158 | 25 | #: ../components/AboutTab.qml:113 | 30 | #: ../components/AboutTab.qml:121 |
1159 | 26 | msgid "Contact: " | 31 | msgid "Contact: " |
1160 | 27 | msgstr "" | 32 | msgstr "" |
1161 | 28 | 33 | ||
1163 | 29 | #: ../components/AboutTab.qml:139 | 34 | #: ../components/AboutTab.qml:147 |
1164 | 30 | msgid "Version: " | 35 | msgid "Version: " |
1165 | 31 | msgstr "" | 36 | msgstr "" |
1166 | 32 | 37 | ||
1167 | @@ -43,7 +48,7 @@ | |||
1168 | 43 | msgstr "" | 48 | msgstr "" |
1169 | 44 | 49 | ||
1170 | 45 | #: ../components/AddProfileDialog.qml:53 | 50 | #: ../components/AddProfileDialog.qml:53 |
1172 | 46 | #: ../components/ManageProfileDialog.qml:69 ../sudoku-app.qml:354 | 51 | #: ../components/ManageProfileDialog.qml:69 ../sudoku-app.qml:192 |
1173 | 47 | msgid "OK" | 52 | msgid "OK" |
1174 | 48 | msgstr "" | 53 | msgstr "" |
1175 | 49 | 54 | ||
1176 | @@ -62,9 +67,9 @@ | |||
1177 | 62 | msgstr "" | 67 | msgstr "" |
1178 | 63 | 68 | ||
1179 | 64 | #: ../components/AddProfileDialog.qml:85 | 69 | #: ../components/AddProfileDialog.qml:85 |
1183 | 65 | #: ../components/ManageProfileDialog.qml:127 | 70 | #: ../components/ManageProfileDialog.qml:127 ../components/SettingsTab.qml:66 |
1184 | 66 | #: ../components/SudokuBlocksGrid.qml:492 ../sudoku-app.qml:507 | 71 | #: ../components/SettingsTab.qml:116 ../components/SudokuBlocksGrid.qml:488 |
1185 | 67 | #: ../sudoku-app.qml:881 ../sudoku-app.qml:933 | 72 | #: ../sudoku-app.qml:343 |
1186 | 68 | msgid "Cancel" | 73 | msgid "Cancel" |
1187 | 69 | msgstr "" | 74 | msgstr "" |
1188 | 70 | 75 | ||
1189 | @@ -89,14 +94,13 @@ | |||
1190 | 89 | msgid "Hinted blocks" | 94 | msgid "Hinted blocks" |
1191 | 90 | msgstr "" | 95 | msgstr "" |
1192 | 91 | 96 | ||
1196 | 92 | #: ../components/HighscoresTab.qml:66 ../components/HighscoresTab.qml:113 | 97 | #: ../components/HighscoresTab.qml:50 ../components/HighscoresTab.qml:117 |
1197 | 93 | #: ../sudoku-app.qml:24 ../sudoku-app.qml:153 ../sudoku-app.qml:207 | 98 | #: ../sudoku-app.qml:21 ../sudoku-app.qml:49 ../sudoku-app.qml:82 |
1195 | 94 | #: ../sudoku-app.qml:244 | ||
1198 | 95 | msgid "<b>Best scores for all players</b>" | 99 | msgid "<b>Best scores for all players</b>" |
1199 | 96 | msgstr "" | 100 | msgstr "" |
1200 | 97 | 101 | ||
1201 | 98 | #. TRANSLATORS: %1 is user's first name and %2 is last name | 102 | #. TRANSLATORS: %1 is user's first name and %2 is last name |
1203 | 99 | #: ../components/HighscoresTab.qml:89 ../sudoku-app.qml:176 | 103 | #: ../components/HighscoresTab.qml:73 |
1204 | 100 | #, qt-format | 104 | #, qt-format |
1205 | 101 | msgid "Best scores for %1 %2" | 105 | msgid "Best scores for %1 %2" |
1206 | 102 | msgstr "" | 106 | msgstr "" |
1207 | @@ -109,215 +113,171 @@ | |||
1208 | 109 | msgid "Delete" | 113 | msgid "Delete" |
1209 | 110 | msgstr "" | 114 | msgstr "" |
1210 | 111 | 115 | ||
1212 | 112 | #: ../components/SudokuBlocksGrid.qml:334 | 116 | #: ../components/SettingsTab.qml:25 ../components/TabsList.qml:23 |
1213 | 117 | msgid "Settings" | ||
1214 | 118 | msgstr "" | ||
1215 | 119 | |||
1216 | 120 | #: ../components/SettingsTab.qml:36 ../components/SettingsTab.qml:85 | ||
1217 | 121 | msgid "Select profile" | ||
1218 | 122 | msgstr "" | ||
1219 | 123 | |||
1220 | 124 | #: ../components/SettingsTab.qml:152 | ||
1221 | 125 | msgid "Sudoku settings" | ||
1222 | 126 | msgstr "" | ||
1223 | 127 | |||
1224 | 128 | #: ../components/SettingsTab.qml:160 | ||
1225 | 129 | msgid "Default Difficulty" | ||
1226 | 130 | msgstr "" | ||
1227 | 131 | |||
1228 | 132 | #: ../components/SettingsTab.qml:163 ../sudoku-app.qml:272 | ||
1229 | 133 | msgid "Easy" | ||
1230 | 134 | msgstr "" | ||
1231 | 135 | |||
1232 | 136 | #: ../components/SettingsTab.qml:163 ../sudoku-app.qml:291 | ||
1233 | 137 | msgid "Moderate" | ||
1234 | 138 | msgstr "" | ||
1235 | 139 | |||
1236 | 140 | #: ../components/SettingsTab.qml:163 ../sudoku-app.qml:308 | ||
1237 | 141 | msgid "Hard" | ||
1238 | 142 | msgstr "" | ||
1239 | 143 | |||
1240 | 144 | #: ../components/SettingsTab.qml:163 | ||
1241 | 145 | msgid "Ultra Hard" | ||
1242 | 146 | msgstr "" | ||
1243 | 147 | |||
1244 | 148 | #: ../components/SettingsTab.qml:163 | ||
1245 | 149 | msgid "Always ask" | ||
1246 | 150 | msgstr "" | ||
1247 | 151 | |||
1248 | 152 | #: ../components/SettingsTab.qml:206 | ||
1249 | 153 | msgid "Theme" | ||
1250 | 154 | msgstr "" | ||
1251 | 155 | |||
1252 | 156 | #: ../components/SettingsTab.qml:236 | ||
1253 | 157 | msgid "Hints" | ||
1254 | 158 | msgstr "" | ||
1255 | 159 | |||
1256 | 160 | #: ../components/SettingsTab.qml:256 | ||
1257 | 161 | msgid "Vibration Alerts" | ||
1258 | 162 | msgstr "" | ||
1259 | 163 | |||
1260 | 164 | #: ../components/SettingsTab.qml:274 | ||
1261 | 165 | msgid "Profiles settings" | ||
1262 | 166 | msgstr "" | ||
1263 | 167 | |||
1264 | 168 | #: ../components/SettingsTab.qml:282 | ||
1265 | 169 | msgid "Current profile" | ||
1266 | 170 | msgstr "" | ||
1267 | 171 | |||
1268 | 172 | #: ../components/SettingsTab.qml:285 | ||
1269 | 173 | msgid "None" | ||
1270 | 174 | msgstr "" | ||
1271 | 175 | |||
1272 | 176 | #: ../components/SettingsTab.qml:320 | ||
1273 | 177 | msgid "Add profile" | ||
1274 | 178 | msgstr "" | ||
1275 | 179 | |||
1276 | 180 | #: ../components/SettingsTab.qml:334 | ||
1277 | 181 | msgid "Manage profiles" | ||
1278 | 182 | msgstr "" | ||
1279 | 183 | |||
1280 | 184 | #: ../components/SudokuBlocksGrid.qml:330 | ||
1281 | 113 | msgid "Please pick a number" | 185 | msgid "Please pick a number" |
1282 | 114 | msgstr "" | 186 | msgstr "" |
1283 | 115 | 187 | ||
1285 | 116 | #: ../components/SudokuBlocksGrid.qml:395 | 188 | #: ../components/SudokuBlocksGrid.qml:391 |
1286 | 117 | msgid "Clear" | 189 | msgid "Clear" |
1287 | 118 | msgstr "" | 190 | msgstr "" |
1288 | 119 | 191 | ||
1316 | 120 | #: ../components/SudokuBlocksGrid.qml:465 | 192 | #: ../components/SudokuBlocksGrid.qml:461 |
1317 | 121 | #, qt-format | 193 | #, qt-format |
1318 | 122 | msgid "" | 194 | msgid "" |
1319 | 123 | "You are a cheat...\n" | 195 | "You are a cheat...\n" |
1320 | 124 | "But we give you\n" | 196 | "But we give you\n" |
1321 | 125 | "%1 point." | 197 | "%1 point." |
1322 | 126 | msgid_plural "" | 198 | msgid_plural "" |
1323 | 127 | "You are a cheat...\n" | 199 | "You are a cheat...\n" |
1324 | 128 | "But we give you\n" | 200 | "But we give you\n" |
1325 | 129 | "%1 points." | 201 | "%1 points." |
1326 | 130 | msgstr[0] "" | 202 | msgstr[0] "" |
1327 | 131 | msgstr[1] "" | 203 | msgstr[1] "" |
1328 | 132 | 204 | ||
1329 | 133 | #: ../components/SudokuBlocksGrid.qml:472 | 205 | #: ../components/SudokuBlocksGrid.qml:468 |
1330 | 134 | #, qt-format | 206 | #, qt-format |
1331 | 135 | msgid "" | 207 | msgid "" |
1332 | 136 | "Congratulations!\n" | 208 | "Congratulations!\n" |
1333 | 137 | "We give you\n" | 209 | "We give you\n" |
1334 | 138 | "%1 point." | 210 | "%1 point." |
1335 | 139 | msgid_plural "" | 211 | msgid_plural "" |
1336 | 140 | "Congratulations!\n" | 212 | "Congratulations!\n" |
1337 | 141 | "We give you\n" | 213 | "We give you\n" |
1338 | 142 | "%1 points." | 214 | "%1 points." |
1339 | 143 | msgstr[0] "" | 215 | msgstr[0] "" |
1340 | 144 | msgstr[1] "" | 216 | msgstr[1] "" |
1341 | 145 | 217 | ||
1342 | 146 | #: ../js/localStorage.js:11 ../sudoku-app.qml:688 | 218 | #: ../components/TabsList.qml:9 ../js/localStorage.js:11 ../sudoku-app.qml:590 |
1343 | 147 | #: com.ubuntu.sudoku_sudoku.desktop.in.in.h:1 | 219 | #: com.ubuntu.sudoku_sudoku.desktop.in.in.h:1 |
1344 | 148 | msgid "Sudoku" | 220 | msgid "Sudoku" |
1345 | 149 | msgstr "" | 221 | msgstr "" |
1346 | 150 | 222 | ||
1347 | 223 | #: ../components/TabsList.qml:16 | ||
1348 | 224 | msgid "Scores" | ||
1349 | 225 | msgstr "" | ||
1350 | 226 | |||
1351 | 151 | #: ../js/localStorage.js:12 | 227 | #: ../js/localStorage.js:12 |
1352 | 152 | msgid "User" | 228 | msgid "User" |
1353 | 153 | msgstr "" | 229 | msgstr "" |
1354 | 154 | 230 | ||
1400 | 155 | #: ../sudoku-app.qml:50 ../sudoku-app.qml:51 ../sudoku-app.qml:763 | 231 | #: ../sudoku-app.qml:75 |
1356 | 156 | msgid "New game" | ||
1357 | 157 | msgstr "" | ||
1358 | 158 | |||
1359 | 159 | #: ../sudoku-app.qml:58 ../sudoku-app.qml:59 | ||
1360 | 160 | msgid "Reveal hint" | ||
1361 | 161 | msgstr "" | ||
1362 | 162 | |||
1363 | 163 | #: ../sudoku-app.qml:67 ../sudoku-app.qml:68 | ||
1364 | 164 | msgid "Show settings" | ||
1365 | 165 | msgstr "" | ||
1366 | 166 | |||
1367 | 167 | #: ../sudoku-app.qml:75 ../sudoku-app.qml:76 | ||
1368 | 168 | msgid "Change difficulty to Easy" | ||
1369 | 169 | msgstr "" | ||
1370 | 170 | |||
1371 | 171 | #: ../sudoku-app.qml:88 ../sudoku-app.qml:89 | ||
1372 | 172 | msgid "Change difficulty to Moderate" | ||
1373 | 173 | msgstr "" | ||
1374 | 174 | |||
1375 | 175 | #: ../sudoku-app.qml:101 ../sudoku-app.qml:102 | ||
1376 | 176 | msgid "Change difficulty to Hard" | ||
1377 | 177 | msgstr "" | ||
1378 | 178 | |||
1379 | 179 | #: ../sudoku-app.qml:114 ../sudoku-app.qml:115 | ||
1380 | 180 | msgid "Change difficulty to Ultra Hard" | ||
1381 | 181 | msgstr "" | ||
1382 | 182 | |||
1383 | 183 | #: ../sudoku-app.qml:127 ../sudoku-app.qml:128 | ||
1384 | 184 | msgid "Change theme to Simple" | ||
1385 | 185 | msgstr "" | ||
1386 | 186 | |||
1387 | 187 | #: ../sudoku-app.qml:137 ../sudoku-app.qml:138 | ||
1388 | 188 | msgid "Change theme to UbuntuColors" | ||
1389 | 189 | msgstr "" | ||
1390 | 190 | |||
1391 | 191 | #: ../sudoku-app.qml:147 ../sudoku-app.qml:148 | ||
1392 | 192 | msgid "Show scores for all users" | ||
1393 | 193 | msgstr "" | ||
1394 | 194 | |||
1395 | 195 | #: ../sudoku-app.qml:168 ../sudoku-app.qml:169 | ||
1396 | 196 | msgid "Show scores for current user" | ||
1397 | 197 | msgstr "" | ||
1398 | 198 | |||
1399 | 199 | #: ../sudoku-app.qml:233 | ||
1401 | 200 | msgid "" | 232 | msgid "" |
1402 | 201 | "You are a cheat... \n" | 233 | "You are a cheat... \n" |
1403 | 202 | "But we give you\n" | 234 | "But we give you\n" |
1404 | 203 | msgstr "" | 235 | msgstr "" |
1405 | 204 | 236 | ||
1407 | 205 | #: ../sudoku-app.qml:235 | 237 | #: ../sudoku-app.qml:77 |
1408 | 206 | msgid "point." | 238 | msgid "point." |
1409 | 207 | msgid_plural "points." | 239 | msgid_plural "points." |
1410 | 208 | msgstr[0] "" | 240 | msgstr[0] "" |
1411 | 209 | msgstr[1] "" | 241 | msgstr[1] "" |
1412 | 210 | 242 | ||
1414 | 211 | #: ../sudoku-app.qml:341 | 243 | #: ../sudoku-app.qml:179 |
1415 | 212 | msgid "Sudoku games played today" | 244 | msgid "Sudoku games played today" |
1416 | 213 | msgstr "" | 245 | msgstr "" |
1417 | 214 | 246 | ||
1419 | 215 | #: ../sudoku-app.qml:342 | 247 | #: ../sudoku-app.qml:180 |
1420 | 216 | msgid "No Sudoku games played today" | 248 | msgid "No Sudoku games played today" |
1421 | 217 | msgstr "" | 249 | msgstr "" |
1422 | 218 | 250 | ||
1424 | 219 | #: ../sudoku-app.qml:371 | 251 | #: ../sudoku-app.qml:209 |
1425 | 220 | msgid "New Game" | 252 | msgid "New Game" |
1426 | 221 | msgstr "" | 253 | msgstr "" |
1427 | 222 | 254 | ||
1429 | 223 | #: ../sudoku-app.qml:372 | 255 | #: ../sudoku-app.qml:210 |
1430 | 224 | msgid "Select difficulty level" | 256 | msgid "Select difficulty level" |
1431 | 225 | msgstr "" | 257 | msgstr "" |
1432 | 226 | 258 | ||
1446 | 227 | #: ../sudoku-app.qml:436 ../sudoku-app.qml:982 | 259 | #: ../sudoku-app.qml:325 |
1434 | 228 | msgid "Easy" | ||
1435 | 229 | msgstr "" | ||
1436 | 230 | |||
1437 | 231 | #: ../sudoku-app.qml:455 ../sudoku-app.qml:982 | ||
1438 | 232 | msgid "Moderate" | ||
1439 | 233 | msgstr "" | ||
1440 | 234 | |||
1441 | 235 | #: ../sudoku-app.qml:472 ../sudoku-app.qml:982 | ||
1442 | 236 | msgid "Hard" | ||
1443 | 237 | msgstr "" | ||
1444 | 238 | |||
1445 | 239 | #: ../sudoku-app.qml:489 | ||
1447 | 240 | msgid "" | 260 | msgid "" |
1448 | 241 | "Ultra\n" | 261 | "Ultra\n" |
1449 | 242 | "Hard" | 262 | "Hard" |
1450 | 243 | msgstr "" | 263 | msgstr "" |
1451 | 244 | 264 | ||
1453 | 245 | #: ../sudoku-app.qml:744 | 265 | #: ../sudoku-app.qml:577 |
1454 | 246 | msgid "You are a cheat..." | 266 | msgid "You are a cheat..." |
1455 | 247 | msgstr "" | 267 | msgstr "" |
1456 | 248 | 268 | ||
1458 | 249 | #: ../sudoku-app.qml:744 | 269 | #: ../sudoku-app.qml:577 |
1459 | 250 | msgid "Congratulations!" | 270 | msgid "Congratulations!" |
1460 | 251 | msgstr "" | 271 | msgstr "" |
1461 | 252 | 272 | ||
1463 | 253 | #: ../sudoku-app.qml:780 | 273 | #: ../sudoku-app.qml:600 |
1464 | 274 | msgid "New game" | ||
1465 | 275 | msgstr "" | ||
1466 | 276 | |||
1467 | 277 | #: ../sudoku-app.qml:616 | ||
1468 | 254 | msgid "Show hint" | 278 | msgid "Show hint" |
1469 | 255 | msgstr "" | 279 | msgstr "" |
1470 | 256 | 280 | ||
1471 | 257 | #: ../sudoku-app.qml:820 | ||
1472 | 258 | msgid "Scores" | ||
1473 | 259 | msgstr "" | ||
1474 | 260 | |||
1475 | 261 | #: ../sudoku-app.qml:830 | ||
1476 | 262 | msgid "Settings" | ||
1477 | 263 | msgstr "" | ||
1478 | 264 | |||
1479 | 265 | #: ../sudoku-app.qml:852 ../sudoku-app.qml:900 | ||
1480 | 266 | msgid "Select profile" | ||
1481 | 267 | msgstr "" | ||
1482 | 268 | |||
1483 | 269 | #: ../sudoku-app.qml:973 | ||
1484 | 270 | msgid "<b>Sudoku settings</b>" | ||
1485 | 271 | msgstr "" | ||
1486 | 272 | |||
1487 | 273 | #: ../sudoku-app.qml:979 | ||
1488 | 274 | msgid "Default Difficulty" | ||
1489 | 275 | msgstr "" | ||
1490 | 276 | |||
1491 | 277 | #: ../sudoku-app.qml:982 | ||
1492 | 278 | msgid "Ultra Hard" | ||
1493 | 279 | msgstr "" | ||
1494 | 280 | |||
1495 | 281 | #: ../sudoku-app.qml:982 | ||
1496 | 282 | msgid "Always ask" | ||
1497 | 283 | msgstr "" | ||
1498 | 284 | |||
1499 | 285 | #: ../sudoku-app.qml:1024 | ||
1500 | 286 | msgid "Theme" | ||
1501 | 287 | msgstr "" | ||
1502 | 288 | |||
1503 | 289 | #: ../sudoku-app.qml:1050 | ||
1504 | 290 | msgid "Hints" | ||
1505 | 291 | msgstr "" | ||
1506 | 292 | |||
1507 | 293 | #: ../sudoku-app.qml:1066 | ||
1508 | 294 | msgid "Vibration Alerts" | ||
1509 | 295 | msgstr "" | ||
1510 | 296 | |||
1511 | 297 | #: ../sudoku-app.qml:1083 | ||
1512 | 298 | msgid "<b>Profiles settings</b>" | ||
1513 | 299 | msgstr "" | ||
1514 | 300 | |||
1515 | 301 | #: ../sudoku-app.qml:1087 | ||
1516 | 302 | msgid "Current profile" | ||
1517 | 303 | msgstr "" | ||
1518 | 304 | |||
1519 | 305 | #: ../sudoku-app.qml:1091 | ||
1520 | 306 | msgid "None" | ||
1521 | 307 | msgstr "" | ||
1522 | 308 | |||
1523 | 309 | #: ../sudoku-app.qml:1127 | ||
1524 | 310 | msgid "Add profile" | ||
1525 | 311 | msgstr "" | ||
1526 | 312 | |||
1527 | 313 | #: ../sudoku-app.qml:1136 | ||
1528 | 314 | msgid "Manage profiles" | ||
1529 | 315 | msgstr "" | ||
1530 | 316 | |||
1531 | 317 | #: ../sudoku-app.qml:1168 | ||
1532 | 318 | msgid "About" | ||
1533 | 319 | msgstr "" | ||
1534 | 320 | |||
1535 | 321 | #: com.ubuntu.sudoku_sudoku.desktop.in.in.h:2 | 281 | #: com.ubuntu.sudoku_sudoku.desktop.in.in.h:2 |
1536 | 322 | msgid "Sudoku Game for Ubuntu Touch." | 282 | msgid "Sudoku Game for Ubuntu Touch." |
1537 | 323 | msgstr "" | 283 | msgstr "" |
1538 | 324 | 284 | ||
1539 | === modified file 'sudoku-app.qml' | |||
1540 | --- sudoku-app.qml 2015-07-17 11:48:07 +0000 | |||
1541 | +++ sudoku-app.qml 2016-02-28 17:36:02 +0000 | |||
1542 | @@ -1,14 +1,11 @@ | |||
1546 | 1 | import QtQuick 2.3 | 1 | import QtQuick 2.4 |
1547 | 2 | import Ubuntu.Components 1.1 | 2 | import UserMetrics 0.1 |
1548 | 3 | import Ubuntu.Components.ListItems 1.0 as ListItem | 3 | import Ubuntu.Layouts 1.0 |
1549 | 4 | import Ubuntu.Components 1.3 | ||
1550 | 4 | import QtQuick.LocalStorage 2.0 | 5 | import QtQuick.LocalStorage 2.0 |
1553 | 5 | import Ubuntu.Components.Popups 1.0 | 6 | import Ubuntu.Components.Popups 1.3 |
1552 | 6 | import Ubuntu.Layouts 1.0 | ||
1554 | 7 | import "js/localStorage.js" as Settings | 7 | import "js/localStorage.js" as Settings |
1555 | 8 | import "components" | 8 | import "components" |
1556 | 9 | //import Ubuntu.HUD 1.0 as HUD | ||
1557 | 10 | import Ubuntu.Unity.Action 1.1 as UnityActions | ||
1558 | 11 | import UserMetrics 0.1 | ||
1559 | 12 | 9 | ||
1560 | 13 | MainView { | 10 | MainView { |
1561 | 14 | id: mainView | 11 | id: mainView |
1562 | @@ -32,163 +29,8 @@ | |||
1563 | 32 | 29 | ||
1564 | 33 | width: units.gu(41); | 30 | width: units.gu(41); |
1565 | 34 | height: units.gu(70); | 31 | height: units.gu(70); |
1566 | 35 | |||
1567 | 36 | //headerColor: sudokuBlocksGrid.headerColor | ||
1568 | 37 | //backgroundColor: sudokuBlocksGrid.backgroundColor | ||
1569 | 38 | //footerColor: sudokuBlocksGrid.footerColor | ||
1570 | 39 | |||
1571 | 40 | /*HUD.HUD { | ||
1572 | 41 | applicationIdentifier: "sudoku-app" // this has to match the .desktop file! | ||
1573 | 42 | HUD.Context {*/ | ||
1574 | 43 | |||
1575 | 44 | StateSaver.properties: "width, height" | 32 | StateSaver.properties: "width, height" |
1576 | 45 | 33 | ||
1577 | 46 | useDeprecatedToolbar: false | ||
1578 | 47 | |||
1579 | 48 | actions: [ | ||
1580 | 49 | Action { | ||
1581 | 50 | text: i18n.tr("New game") | ||
1582 | 51 | keywords: i18n.tr("New game") | ||
1583 | 52 | onTriggered: { | ||
1584 | 53 | tabs.selectedTabIndex = 0 | ||
1585 | 54 | createNewGame() | ||
1586 | 55 | } | ||
1587 | 56 | }, | ||
1588 | 57 | Action { | ||
1589 | 58 | text: i18n.tr("Reveal hint") | ||
1590 | 59 | keywords: i18n.tr("Reveal hint") | ||
1591 | 60 | enabled: disableHints.checked | ||
1592 | 61 | onTriggered: { | ||
1593 | 62 | tabs.selectedTabIndex = 0 | ||
1594 | 63 | revealHint() | ||
1595 | 64 | } | ||
1596 | 65 | }, | ||
1597 | 66 | Action { | ||
1598 | 67 | text: i18n.tr("Show settings") | ||
1599 | 68 | keywords: i18n.tr("Show settings") | ||
1600 | 69 | onTriggered: { | ||
1601 | 70 | tabs.selectedTabIndex = 2 | ||
1602 | 71 | revealHint() | ||
1603 | 72 | } | ||
1604 | 73 | }, | ||
1605 | 74 | Action { | ||
1606 | 75 | text: i18n.tr("Change difficulty to Easy") | ||
1607 | 76 | keywords: i18n.tr("Change difficulty to Easy") | ||
1608 | 77 | onTriggered: { | ||
1609 | 78 | tabs.selectedTabIndex = 0 | ||
1610 | 79 | difficultySelector.selectedIndex = 0 | ||
1611 | 80 | var randomnumber = Math.floor(Math.random()*9); | ||
1612 | 81 | randomnumber += 31; | ||
1613 | 82 | sudokuBlocksGrid.createNewGame(81 - randomnumber); | ||
1614 | 83 | Settings.setSetting("Difficulty", 0) | ||
1615 | 84 | createNewGame() | ||
1616 | 85 | } | ||
1617 | 86 | }, | ||
1618 | 87 | Action { | ||
1619 | 88 | text: i18n.tr("Change difficulty to Moderate") | ||
1620 | 89 | keywords: i18n.tr("Change difficulty to Moderate") | ||
1621 | 90 | onTriggered: { | ||
1622 | 91 | tabs.selectedTabIndex = 0 | ||
1623 | 92 | difficultySelector.selectedIndex = 1 | ||
1624 | 93 | var randomnumber = Math.floor(Math.random()*4); | ||
1625 | 94 | randomnumber += 26; | ||
1626 | 95 | sudokuBlocksGrid.createNewGame(81 - randomnumber); | ||
1627 | 96 | Settings.setSetting("Difficulty", 1) | ||
1628 | 97 | createNewGame() | ||
1629 | 98 | } | ||
1630 | 99 | }, | ||
1631 | 100 | Action { | ||
1632 | 101 | text: i18n.tr("Change difficulty to Hard") | ||
1633 | 102 | keywords: i18n.tr("Change difficulty to Hard") | ||
1634 | 103 | onTriggered: { | ||
1635 | 104 | tabs.selectedTabIndex = 0 | ||
1636 | 105 | difficultySelector.selectedIndex = 2 | ||
1637 | 106 | var randomnumber = Math.floor(Math.random()*4); | ||
1638 | 107 | randomnumber += 21; | ||
1639 | 108 | sudokuBlocksGrid.createNewGame(81 - randomnumber); | ||
1640 | 109 | Settings.setSetting("Difficulty", 2) | ||
1641 | 110 | createNewGame() | ||
1642 | 111 | } | ||
1643 | 112 | }, | ||
1644 | 113 | Action { | ||
1645 | 114 | text: i18n.tr("Change difficulty to Ultra Hard") | ||
1646 | 115 | keywords: i18n.tr("Change difficulty to Ultra Hard") | ||
1647 | 116 | onTriggered: { | ||
1648 | 117 | tabs.selectedTabIndex = 0 | ||
1649 | 118 | difficultySelector.selectedIndex = 3 | ||
1650 | 119 | var randomnumber = Math.floor(Math.random()*3); | ||
1651 | 120 | randomnumber += 17; | ||
1652 | 121 | sudokuBlocksGrid.createNewGame(81 - randomnumber); | ||
1653 | 122 | Settings.setSetting("Difficulty", 3) | ||
1654 | 123 | createNewGame() | ||
1655 | 124 | } | ||
1656 | 125 | }, | ||
1657 | 126 | Action { | ||
1658 | 127 | text: i18n.tr("Change theme to Simple") | ||
1659 | 128 | keywords: i18n.tr("Change theme to Simple") | ||
1660 | 129 | onTriggered: { | ||
1661 | 130 | //print("Simple") | ||
1662 | 131 | var result = Settings.setSetting("ColorTheme", 1); | ||
1663 | 132 | //print(result); | ||
1664 | 133 | sudokuBlocksGrid.changeColorScheme("ColorSchemeSimple.qml"); | ||
1665 | 134 | } | ||
1666 | 135 | }, | ||
1667 | 136 | Action { | ||
1668 | 137 | text: i18n.tr("Change theme to UbuntuColors") | ||
1669 | 138 | keywords: i18n.tr("Change theme to UbuntuColors") | ||
1670 | 139 | onTriggered: { | ||
1671 | 140 | print("UbuntuColors") | ||
1672 | 141 | var result = Settings.setSetting("ColorTheme", 0); | ||
1673 | 142 | //print(result); | ||
1674 | 143 | sudokuBlocksGrid.changeColorScheme("ColorSchemeUbuntu.qml"); | ||
1675 | 144 | } | ||
1676 | 145 | }, | ||
1677 | 146 | Action { | ||
1678 | 147 | text: i18n.tr("Show scores for all users") | ||
1679 | 148 | keywords: i18n.tr("Show scores for all users") | ||
1680 | 149 | onTriggered: { | ||
1681 | 150 | tabs.selectedTabIndex = 1 | ||
1682 | 151 | var allScores = Settings.getAllScores() | ||
1683 | 152 | highscoresModel.clear(); | ||
1684 | 153 | highscoresHeaderText = i18n.tr("<b>Best scores for all players</b>"); | ||
1685 | 154 | for(var i = 0; i < allScores.length; i++) { | ||
1686 | 155 | var rowItem = allScores[i]; | ||
1687 | 156 | //print("ROW ",rowItem) | ||
1688 | 157 | var firstName = Settings.getUserFirstName(rowItem[1]); | ||
1689 | 158 | var lastName = Settings.getUserLastName(rowItem[1]); | ||
1690 | 159 | //res.push([dbItem.first_name, dbItem.last_name, dbItem.score]) | ||
1691 | 160 | highscoresModel.append({ 'id': rowItem[0], | ||
1692 | 161 | 'firstname': firstName, | ||
1693 | 162 | 'lastname': lastName, | ||
1694 | 163 | 'score': rowItem[2] }); | ||
1695 | 164 | } | ||
1696 | 165 | } | ||
1697 | 166 | }, | ||
1698 | 167 | Action { | ||
1699 | 168 | text: i18n.tr("Show scores for current user") | ||
1700 | 169 | keywords: i18n.tr("Show scores for current user") | ||
1701 | 170 | onTriggered: { | ||
1702 | 171 | tabs.selectedTabIndex = 1 | ||
1703 | 172 | var firstName = Settings.getUserFirstName(currentUserId); | ||
1704 | 173 | var lastName = Settings.getUserLastName(currentUserId); | ||
1705 | 174 | //print(firstName, lastName) | ||
1706 | 175 | // TRANSLATORS: %1 is user's first name and %2 is last name | ||
1707 | 176 | highscoresHeaderText = "<b>" + i18n.tr("Best scores for %1 %2").arg(firstName).arg(lastName) + "</b>" | ||
1708 | 177 | var allScores = Settings.getAllScoresForUser(currentUserId) | ||
1709 | 178 | highscoresModel.clear(); | ||
1710 | 179 | for(var i = 0; i < allScores.length; i++) { | ||
1711 | 180 | var rowItem = allScores[i]; | ||
1712 | 181 | //res.push([dbItem.first_name, dbItem.last_name, dbItem.score]) | ||
1713 | 182 | highscoresModel.append({'firstname': firstName, | ||
1714 | 183 | 'lastname': lastName, | ||
1715 | 184 | 'score': rowItem[1] }); | ||
1716 | 185 | } | ||
1717 | 186 | } | ||
1718 | 187 | } | ||
1719 | 188 | ] | ||
1720 | 189 | //} | ||
1721 | 190 | //} | ||
1722 | 191 | |||
1723 | 192 | onCurrentUserIdChanged: { | 34 | onCurrentUserIdChanged: { |
1724 | 193 | Settings.setSetting("currentUserId", currentUserId) | 35 | Settings.setSetting("currentUserId", currentUserId) |
1725 | 194 | } | 36 | } |
1726 | @@ -214,7 +56,7 @@ | |||
1727 | 214 | /*highscoresModel.append({'firstname': firstName, | 56 | /*highscoresModel.append({'firstname': firstName, |
1728 | 215 | 'lastname': lastName, | 57 | 'lastname': lastName, |
1729 | 216 | 'score': rowItem[1] });*/ | 58 | 'score': rowItem[1] });*/ |
1731 | 217 | hsPage.appendModel({ 'id': rowItem[0], | 59 | highscoresTab.appendModel({ 'id': rowItem[0], |
1732 | 218 | 'firstname': firstName, | 60 | 'firstname': firstName, |
1733 | 219 | 'lastname': lastName, | 61 | 'lastname': lastName, |
1734 | 220 | 'score': rowItem[2] }); | 62 | 'score': rowItem[2] }); |
1735 | @@ -223,7 +65,7 @@ | |||
1736 | 223 | } | 65 | } |
1737 | 224 | 66 | ||
1738 | 225 | function revealHint() { | 67 | function revealHint() { |
1740 | 226 | if(disableHints.checked) | 68 | if(settingsTab.disableHintsChecked) |
1741 | 227 | { | 69 | { |
1742 | 228 | sudokuBlocksGrid.revealHint(); | 70 | sudokuBlocksGrid.revealHint(); |
1743 | 229 | sudokuBlocksGrid.checkIfCheating = true; | 71 | sudokuBlocksGrid.checkIfCheating = true; |
1744 | @@ -234,13 +76,9 @@ | |||
1745 | 234 | + sudokuBlocksGrid.calculateScore() | 76 | + sudokuBlocksGrid.calculateScore() |
1746 | 235 | + " " + i18n.tr("point.","points.",1) | 77 | + " " + i18n.tr("point.","points.",1) |
1747 | 236 | 78 | ||
1748 | 237 | // print (sudokuBlocksGrid.numberOfActions) | ||
1749 | 238 | // print (sudokuBlocksGrid.numberOfHints) | ||
1750 | 239 | // print (sudokuBlocksGrid.gameSeconds) | ||
1751 | 240 | // print (sudokuBlocksGrid.gameDifficulty) | ||
1752 | 241 | var allScores = Settings.getAllScores() | 79 | var allScores = Settings.getAllScores() |
1753 | 242 | //highscoresModel.clear(); | 80 | //highscoresModel.clear(); |
1755 | 243 | hsPage.clearModel() | 81 | highscoresTab.clearModel() |
1756 | 244 | highscoresHeaderText = i18n.tr("<b>Best scores for all players</b>"); | 82 | highscoresHeaderText = i18n.tr("<b>Best scores for all players</b>"); |
1757 | 245 | for(var i = 0; i < allScores.length; i++) { | 83 | for(var i = 0; i < allScores.length; i++) { |
1758 | 246 | var rowItem = allScores[i]; | 84 | var rowItem = allScores[i]; |
1759 | @@ -251,7 +89,7 @@ | |||
1760 | 251 | /*highscoresModel.append({'firstname': firstName, | 89 | /*highscoresModel.append({'firstname': firstName, |
1761 | 252 | 'lastname': lastName, | 90 | 'lastname': lastName, |
1762 | 253 | 'score': rowItem[1] });*/ | 91 | 'score': rowItem[1] });*/ |
1764 | 254 | hsPage.appendModel({ 'id': rowItem[0], | 92 | highscoresTab.appendModel({ 'id': rowItem[0], |
1765 | 255 | 'firstname': firstName, | 93 | 'firstname': firstName, |
1766 | 256 | 'lastname': lastName, | 94 | 'lastname': lastName, |
1767 | 257 | 'score': rowItem[2] }); | 95 | 'score': rowItem[2] }); |
1768 | @@ -263,7 +101,7 @@ | |||
1769 | 263 | } | 101 | } |
1770 | 264 | 102 | ||
1771 | 265 | function createNewGame() { | 103 | function createNewGame() { |
1773 | 266 | switch(difficultySelector.selectedIndex) { | 104 | switch(settingsTab.difficultyIndex) { |
1774 | 267 | case 0: | 105 | case 0: |
1775 | 268 | var randomnumber = Math.floor(Math.random()*9); | 106 | var randomnumber = Math.floor(Math.random()*9); |
1776 | 269 | randomnumber += 31; | 107 | randomnumber += 31; |
1777 | @@ -419,8 +257,6 @@ | |||
1778 | 419 | } | 257 | } |
1779 | 420 | } | 258 | } |
1780 | 421 | 259 | ||
1781 | 422 | |||
1782 | 423 | |||
1783 | 424 | Column { | 260 | Column { |
1784 | 425 | spacing: units.gu(5) | 261 | spacing: units.gu(5) |
1785 | 426 | 262 | ||
1786 | @@ -624,7 +460,7 @@ | |||
1787 | 624 | if (settingsTab.difficultyIndex < 0) | 460 | if (settingsTab.difficultyIndex < 0) |
1788 | 625 | settingsTab.difficultyIndex = 0 | 461 | settingsTab.difficultyIndex = 0 |
1789 | 626 | //print(settingsTab.difficultyIndex) | 462 | //print(settingsTab.difficultyIndex) |
1791 | 627 | //print(Settings.getSetting("DisableHints")); | 463 | //print(Settings.getSetting("settingsTab.disableHints")); |
1792 | 628 | settingsTab.disableHintsChecked = Settings.getSetting("DisableHints") == "true" ? true : false; | 464 | settingsTab.disableHintsChecked = Settings.getSetting("DisableHints") == "true" ? true : false; |
1793 | 629 | settingsTab.disableVibrationsChecked = Settings.getSetting("DisableVibrations") == "true" ? true : false; | 465 | settingsTab.disableVibrationsChecked = Settings.getSetting("DisableVibrations") == "true" ? true : false; |
1794 | 630 | settingsTab.themeIndex = parseInt(Settings.getSetting("ColorTheme")); | 466 | settingsTab.themeIndex = parseInt(Settings.getSetting("ColorTheme")); |
1795 | @@ -658,7 +494,7 @@ | |||
1796 | 658 | /*highscoresModel.append({'firstname': firstName, | 494 | /*highscoresModel.append({'firstname': firstName, |
1797 | 659 | 'lastname': lastName, | 495 | 'lastname': lastName, |
1798 | 660 | 'score': rowItem[1] });*/ | 496 | 'score': rowItem[1] });*/ |
1800 | 661 | hsPage.appendModel({ 'id': rowItem[0], | 497 | highscoresTab.appendModel({ 'id': rowItem[0], |
1801 | 662 | 'firstname': firstName, | 498 | 'firstname': firstName, |
1802 | 663 | 'lastname': lastName, | 499 | 'lastname': lastName, |
1803 | 664 | 'score': rowItem[2] }) | 500 | 'score': rowItem[2] }) |
1804 | @@ -670,7 +506,7 @@ | |||
1805 | 670 | { | 506 | { |
1806 | 671 | currentUserId = Settings.getSetting("currentUserId") | 507 | currentUserId = Settings.getSetting("currentUserId") |
1807 | 672 | } | 508 | } |
1809 | 673 | if (difficultySelector.selectedIndex == 4) { | 509 | if (settingsTab.difficultyIndex === 4) { |
1810 | 674 | PopupUtils.open(newGameComponent) | 510 | PopupUtils.open(newGameComponent) |
1811 | 675 | } | 511 | } |
1812 | 676 | 512 | ||
1813 | @@ -680,13 +516,15 @@ | |||
1814 | 680 | id: tabs | 516 | id: tabs |
1815 | 681 | anchors.fill: parent | 517 | anchors.fill: parent |
1816 | 682 | 518 | ||
1817 | 519 | TabsList { | ||
1818 | 520 | id: tabsList | ||
1819 | 521 | } | ||
1820 | 522 | |||
1821 | 683 | // First tab begins here | 523 | // First tab begins here |
1822 | 684 | Tab { | 524 | Tab { |
1823 | 685 | id: mainTab; | 525 | id: mainTab; |
1824 | 686 | objectName: "MainTab" | 526 | objectName: "MainTab" |
1825 | 687 | 527 | ||
1826 | 688 | title: i18n.tr("Sudoku") | ||
1827 | 689 | |||
1828 | 690 | Timer { | 528 | Timer { |
1829 | 691 | id: winTimer; | 529 | id: winTimer; |
1830 | 692 | interval: 2000; | 530 | interval: 2000; |
1831 | @@ -694,7 +532,7 @@ | |||
1832 | 694 | repeat: false; | 532 | repeat: false; |
1833 | 695 | onTriggered: { | 533 | onTriggered: { |
1834 | 696 | gameFinishedRectangle.visible = false; | 534 | gameFinishedRectangle.visible = false; |
1836 | 697 | switch(difficultySelector.selectedIndex) { | 535 | switch(settingsTab.difficultyIndex) { |
1837 | 698 | case 0: | 536 | case 0: |
1838 | 699 | var randomnumber = Math.floor(Math.random()*9); | 537 | var randomnumber = Math.floor(Math.random()*9); |
1839 | 700 | randomnumber += 31; | 538 | randomnumber += 31; |
1840 | @@ -725,18 +563,13 @@ | |||
1841 | 725 | 563 | ||
1842 | 726 | UbuntuShape { | 564 | UbuntuShape { |
1843 | 727 | id: gameFinishedRectangle; | 565 | id: gameFinishedRectangle; |
1845 | 728 | color: "black"; | 566 | backgroundColor: "black"; |
1846 | 729 | opacity: 0.8 | 567 | opacity: 0.8 |
1847 | 730 | //border.color: sudokuBlocksGrid.defaultBorderColor; | ||
1848 | 731 | width: mainView.width | 568 | width: mainView.width |
1849 | 732 | radius: "medium" | 569 | radius: "medium" |
1850 | 733 | height: mainView.height*1.3 | 570 | height: mainView.height*1.3 |
1851 | 734 | z: 100; | 571 | z: 100; |
1852 | 735 | visible: false; | 572 | visible: false; |
1853 | 736 | //x: mainView.width / 2 - width/2; | ||
1854 | 737 | //y: mainView.weight / 2 - height/2; | ||
1855 | 738 | //anchors.verticalCenter: mainView.verticalCenter; | ||
1856 | 739 | //anchors.horizontalCenter: mainView.verticalCenter; | ||
1857 | 740 | anchors.centerIn: parent; | 573 | anchors.centerIn: parent; |
1858 | 741 | //y: units.gu(5); | 574 | //y: units.gu(5); |
1859 | 742 | Label { | 575 | Label { |
1860 | @@ -751,421 +584,78 @@ | |||
1861 | 751 | } | 584 | } |
1862 | 752 | 585 | ||
1863 | 753 | page: Page { | 586 | page: Page { |
1864 | 587 | id: mainPage | ||
1865 | 588 | |||
1866 | 589 | header: PageHeader { | ||
1867 | 590 | title: i18n.tr("Sudoku") | ||
1868 | 591 | |||
1869 | 592 | leadingActionBar { | ||
1870 | 593 | numberOfSlots: 0 | ||
1871 | 594 | actions: tabsList.actions | ||
1872 | 595 | } | ||
1873 | 596 | |||
1874 | 597 | trailingActionBar.actions: [ | ||
1875 | 598 | Action { | ||
1876 | 599 | objectName: "newgamebutton" | ||
1877 | 600 | text: i18n.tr("New game"); | ||
1878 | 601 | iconSource: Qt.resolvedUrl("icons/new_game_ubuntu.svg") | ||
1879 | 602 | onTriggered: { | ||
1880 | 603 | if(gameFinishedRectangle.visible) gameFinishedRectangle.visible = false; | ||
1881 | 604 | //createNewGame() | ||
1882 | 605 | if (settingsTab.difficultyIndex == 4) | ||
1883 | 606 | PopupUtils.open(newGameComponent) | ||
1884 | 607 | else { | ||
1885 | 608 | createNewGame() | ||
1886 | 609 | } | ||
1887 | 610 | } | ||
1888 | 611 | }, | ||
1889 | 612 | Action { | ||
1890 | 613 | objectName: "hintbutton" | ||
1891 | 614 | id: revealHintAction | ||
1892 | 615 | iconSource: Qt.resolvedUrl("icons/hint.svg") | ||
1893 | 616 | text: i18n.tr("Show hint"); | ||
1894 | 617 | enabled: settingsTab.disableHintsChecked | ||
1895 | 618 | onTriggered: { | ||
1896 | 619 | revealHint() | ||
1897 | 620 | } | ||
1898 | 621 | } | ||
1899 | 622 | ] | ||
1900 | 623 | } | ||
1901 | 754 | 624 | ||
1902 | 755 | BottomEdgeSlide { | 625 | BottomEdgeSlide { |
1903 | 756 | z:2 | 626 | z:2 |
1904 | 757 | hintIconName: "help-contents" | 627 | hintIconName: "help-contents" |
1905 | 758 | } | 628 | } |
1906 | 759 | 629 | ||
1907 | 760 | head.actions: [ | ||
1908 | 761 | Action { | ||
1909 | 762 | objectName: "newgamebutton" | ||
1910 | 763 | text: i18n.tr("New game"); | ||
1911 | 764 | iconSource: Qt.resolvedUrl("icons/new_game_ubuntu.svg") | ||
1912 | 765 | onTriggered: { | ||
1913 | 766 | if(gameFinishedRectangle.visible) gameFinishedRectangle.visible = false; | ||
1914 | 767 | //print("new block distance:", blockDistance); | ||
1915 | 768 | //createNewGame() | ||
1916 | 769 | if (settingsTab.difficultyIndex == 4) | ||
1917 | 770 | PopupUtils.open(newGameComponent) | ||
1918 | 771 | else { | ||
1919 | 772 | createNewGame() | ||
1920 | 773 | } | ||
1921 | 774 | } | ||
1922 | 775 | }, | ||
1923 | 776 | Action { | ||
1924 | 777 | objectName: "hintbutton" | ||
1925 | 778 | id: revealHintAction | ||
1926 | 779 | iconSource: Qt.resolvedUrl("icons/hint.svg") | ||
1927 | 780 | text: i18n.tr("Show hint"); | ||
1928 | 781 | enabled: disableHints.checked; | ||
1929 | 782 | onTriggered: { | ||
1930 | 783 | revealHint() | ||
1931 | 784 | } | ||
1932 | 785 | } | ||
1933 | 786 | ] | ||
1934 | 787 | |||
1935 | 788 | //Column { | ||
1936 | 789 | // id: mainColumn; | ||
1937 | 790 | //width: mainView.width; | ||
1938 | 791 | //height: mainView.height; | ||
1939 | 792 | //anchors.left: parent.left; | ||
1940 | 793 | //anchors.leftMargin: units.dp(3) | ||
1941 | 794 | //anchors.fill: parent | ||
1942 | 795 | //spacing: units.gu(5) | ||
1943 | 796 | |||
1944 | 797 | SudokuBlocksGrid { | 630 | SudokuBlocksGrid { |
1945 | 798 | id: sudokuBlocksGrid; | 631 | id: sudokuBlocksGrid; |
1946 | 799 | objectName: "blockgrid" | 632 | objectName: "blockgrid" |
1947 | 800 | //x: units.dp(3) | ||
1948 | 801 | x: !mainView.wideAspect() ? 0.5*(mainView.width-9*sudokuBlocksGrid.blockSize- | 633 | x: !mainView.wideAspect() ? 0.5*(mainView.width-9*sudokuBlocksGrid.blockSize- |
1949 | 802 | 22*sudokuBlocksGrid.blockDistance) : | 634 | 22*sudokuBlocksGrid.blockDistance) : |
1950 | 803 | 0.25*(mainView.width-9*sudokuBlocksGrid.blockSize- | 635 | 0.25*(mainView.width-9*sudokuBlocksGrid.blockSize- |
1951 | 804 | 22*sudokuBlocksGrid.blockDistance) | 636 | 22*sudokuBlocksGrid.blockDistance) |
1952 | 805 | 637 | ||
1954 | 806 | y: !mainView.wideAspect() ? units.gu(1) : mainView.height*0.05 | 638 | y: !mainView.wideAspect() ? mainPage.header.height : mainView.height*0.05 |
1955 | 807 | 639 | ||
1956 | 808 | } | 640 | } |
1957 | 809 | |||
1958 | 810 | //} | ||
1959 | 811 | } | 641 | } |
1960 | 812 | |||
1961 | 813 | } | 642 | } |
1962 | 814 | 643 | ||
1963 | 815 | // Highscores Tab | 644 | // Highscores Tab |
1966 | 816 | 645 | HighscoresTab { | |
1965 | 817 | Tab { | ||
1967 | 818 | id: highscoresTab | 646 | id: highscoresTab |
1968 | 819 | objectName: "highscoresTab" | 647 | objectName: "highscoresTab" |
1969 | 820 | title: i18n.tr("Scores") | ||
1970 | 821 | page: HighscoresTab{ id: hsPage } | ||
1971 | 822 | } | 648 | } |
1972 | 823 | 649 | ||
1973 | 824 | |||
1974 | 825 | |||
1975 | 826 | // settingsTab | 650 | // settingsTab |
1978 | 827 | Tab { | 651 | SettingsTab { |
1979 | 828 | id: settingsTab; | 652 | id: settingsTab |
1980 | 829 | objectName: "settingsTab" | 653 | objectName: "settingsTab" |
1981 | 830 | title: i18n.tr("Settings") | ||
1982 | 831 | |||
1983 | 832 | property alias disableHintsChecked: disableHints.checked; | ||
1984 | 833 | property alias disableVibrationsChecked: disableVibrations.checked; | ||
1985 | 834 | property alias difficultyIndex: difficultySelector.selectedIndex; | ||
1986 | 835 | property alias themeIndex: themeSelector.selectedIndex; | ||
1987 | 836 | |||
1988 | 837 | page: Page { | ||
1989 | 838 | objectName: "settingsPage" | ||
1990 | 839 | |||
1991 | 840 | anchors { | ||
1992 | 841 | left: parent.left | ||
1993 | 842 | right: parent.right | ||
1994 | 843 | top: parent.top | ||
1995 | 844 | } | ||
1996 | 845 | height: mainView.height | ||
1997 | 846 | |||
1998 | 847 | |||
1999 | 848 | Component { | ||
2000 | 849 | id: profileSelector | ||
2001 | 850 | Dialog { | ||
2002 | 851 | objectName: "selectProfileDialog" | ||
2003 | 852 | title: i18n.tr("Select profile") | ||
2004 | 853 | |||
2005 | 854 | Column{ | ||
2006 | 855 | height: mainColumnSettings.height*2/3 | ||
2007 | 856 | ListView { | ||
2008 | 857 | |||
2009 | 858 | id: profileListView | ||
2010 | 859 | objectName: "profileListView" | ||
2011 | 860 | clip: true | ||
2012 | 861 | width: parent.width | ||
2013 | 862 | height: parent.height - units.gu(12) | ||
2014 | 863 | model: profilesModel | ||
2015 | 864 | |||
2016 | 865 | delegate: | ||
2017 | 866 | ListItem.Standard { | ||
2018 | 867 | text: firstname + " " + lastname | ||
2019 | 868 | progression: true | ||
2020 | 869 | onTriggered: { | ||
2021 | 870 | //console.log("clicked "+index) | ||
2022 | 871 | currentUserId = profileId; | ||
2023 | 872 | hide() | ||
2024 | 873 | } | ||
2025 | 874 | } | ||
2026 | 875 | |||
2027 | 876 | } | ||
2028 | 877 | |||
2029 | 878 | SudokuDialogButton{ | ||
2030 | 879 | anchors.horizontalCenter: parent.horizontalCenter | ||
2031 | 880 | id:cancelButton | ||
2032 | 881 | buttonText: i18n.tr("Cancel") | ||
2033 | 882 | width: parent.width/2; | ||
2034 | 883 | size: units.gu(5) | ||
2035 | 884 | buttonColor: sudokuBlocksGrid.dialogButtonColor1 | ||
2036 | 885 | textColor: sudokuBlocksGrid.dialogButtonTextColor | ||
2037 | 886 | //border.color: "transparent" | ||
2038 | 887 | onTriggered: { | ||
2039 | 888 | hide() | ||
2040 | 889 | } | ||
2041 | 890 | } | ||
2042 | 891 | |||
2043 | 892 | } | ||
2044 | 893 | } | ||
2045 | 894 | } | ||
2046 | 895 | |||
2047 | 896 | Component { | ||
2048 | 897 | id: manageProfileSelector | ||
2049 | 898 | Dialog { | ||
2050 | 899 | objectName: "manageProfileDialog" | ||
2051 | 900 | title: i18n.tr("Select profile") | ||
2052 | 901 | |||
2053 | 902 | Column{ | ||
2054 | 903 | height: mainColumnSettings.height*2/3 | ||
2055 | 904 | ListView { | ||
2056 | 905 | id: manageProfileListView | ||
2057 | 906 | objectName: "manageProfileListView" | ||
2058 | 907 | clip: true | ||
2059 | 908 | width: parent.width | ||
2060 | 909 | height: parent.height - units.gu(12) | ||
2061 | 910 | model: profilesModel | ||
2062 | 911 | |||
2063 | 912 | delegate: | ||
2064 | 913 | |||
2065 | 914 | ListItem.Standard { | ||
2066 | 915 | text: firstname + " " + lastname | ||
2067 | 916 | |||
2068 | 917 | progression: true | ||
2069 | 918 | onTriggered: { | ||
2070 | 919 | hide() | ||
2071 | 920 | editUserId = profileId | ||
2072 | 921 | PopupUtils.open(manageProfileDialog, selectorProfile) | ||
2073 | 922 | } | ||
2074 | 923 | } | ||
2075 | 924 | |||
2076 | 925 | |||
2077 | 926 | |||
2078 | 927 | } | ||
2079 | 928 | SudokuDialogButton{ | ||
2080 | 929 | |||
2081 | 930 | anchors.horizontalCenter: parent.horizontalCenter | ||
2082 | 931 | id:cancelButton | ||
2083 | 932 | objectName: "cancelButton" | ||
2084 | 933 | buttonText: i18n.tr("Cancel") | ||
2085 | 934 | width: parent.width/2; | ||
2086 | 935 | size: units.gu(5) | ||
2087 | 936 | buttonColor: sudokuBlocksGrid.dialogButtonColor1 | ||
2088 | 937 | textColor: sudokuBlocksGrid.dialogButtonTextColor | ||
2089 | 938 | //border.color: "transparent" | ||
2090 | 939 | onTriggered: { | ||
2091 | 940 | hide() | ||
2092 | 941 | } | ||
2093 | 942 | } | ||
2094 | 943 | } | ||
2095 | 944 | } | ||
2096 | 945 | } | ||
2097 | 946 | |||
2098 | 947 | ListModel{ | ||
2099 | 948 | id: profilesModel | ||
2100 | 949 | } | ||
2101 | 950 | |||
2102 | 951 | //id: mainColumnSettings; | ||
2103 | 952 | //width: settingsTab.width; | ||
2104 | 953 | //height: settingsTab.height; | ||
2105 | 954 | //anchors.fill: parent | ||
2106 | 955 | //anchors.horizontalCenter: parent.horizontalCenter; | ||
2107 | 956 | //spacing: units.gu(1) | ||
2108 | 957 | Flickable { | ||
2109 | 958 | id: flickableSettings | ||
2110 | 959 | anchors.fill: parent | ||
2111 | 960 | //height: parent.height - units.gu(10) | ||
2112 | 961 | //width: parent.width | ||
2113 | 962 | flickableDirection: Flickable.VerticalFlick | ||
2114 | 963 | //clip: true | ||
2115 | 964 | objectName: "settingsContainer" | ||
2116 | 965 | Column { | ||
2117 | 966 | id: mainColumnSettings; | ||
2118 | 967 | //anchors.fill: parent | ||
2119 | 968 | height: parent.height | ||
2120 | 969 | width: parent.width | ||
2121 | 970 | spacing: units.gu(1) | ||
2122 | 971 | |||
2123 | 972 | ListItem.Header { | ||
2124 | 973 | text: i18n.tr("<b>Sudoku settings</b>") | ||
2125 | 974 | } | ||
2126 | 975 | |||
2127 | 976 | OptionSelector { | ||
2128 | 977 | objectName: "difficultySelector" | ||
2129 | 978 | id: difficultySelector | ||
2130 | 979 | text: i18n.tr("Default Difficulty") | ||
2131 | 980 | width: parent.width - units.gu(4) | ||
2132 | 981 | anchors.horizontalCenter: parent.horizontalCenter | ||
2133 | 982 | model: [i18n.tr("Easy"), i18n.tr("Moderate"), i18n.tr("Hard"), i18n.tr("Ultra Hard"), i18n.tr("Always ask")] | ||
2134 | 983 | onSelectedIndexChanged: { | ||
2135 | 984 | //print(difficultySelector.selectedIndex) | ||
2136 | 985 | switch(difficultySelector.selectedIndex) { | ||
2137 | 986 | case 0: | ||
2138 | 987 | var randomnumber = Math.floor(Math.random()*9); | ||
2139 | 988 | randomnumber += 31; | ||
2140 | 989 | sudokuBlocksGrid.createNewGame(81 - randomnumber); | ||
2141 | 990 | Settings.setSetting("Difficulty", selectedIndex) | ||
2142 | 991 | sudokuBlocksGrid.gameDifficulty = 0 | ||
2143 | 992 | break; | ||
2144 | 993 | case 1: | ||
2145 | 994 | var randomnumber = Math.floor(Math.random()*4); | ||
2146 | 995 | randomnumber += 26; | ||
2147 | 996 | sudokuBlocksGrid.createNewGame(81 - randomnumber); | ||
2148 | 997 | Settings.setSetting("Difficulty", selectedIndex) | ||
2149 | 998 | sudokuBlocksGrid.gameDifficulty = 1 | ||
2150 | 999 | break; | ||
2151 | 1000 | case 2: | ||
2152 | 1001 | var randomnumber = Math.floor(Math.random()*4); | ||
2153 | 1002 | randomnumber += 21; | ||
2154 | 1003 | sudokuBlocksGrid.createNewGame(81 - randomnumber); | ||
2155 | 1004 | Settings.setSetting("Difficulty", selectedIndex) | ||
2156 | 1005 | sudokuBlocksGrid.gameDifficulty = 2 | ||
2157 | 1006 | break; | ||
2158 | 1007 | case 3: | ||
2159 | 1008 | var randomnumber = Math.floor(Math.random()*3); | ||
2160 | 1009 | randomnumber += 17; | ||
2161 | 1010 | sudokuBlocksGrid.createNewGame(81 - randomnumber); | ||
2162 | 1011 | Settings.setSetting("Difficulty", selectedIndex) | ||
2163 | 1012 | sudokuBlocksGrid.gameDifficulty = 3 | ||
2164 | 1013 | break; | ||
2165 | 1014 | case 4: | ||
2166 | 1015 | Settings.setSetting("Difficulty", selectedIndex) | ||
2167 | 1016 | break; | ||
2168 | 1017 | } | ||
2169 | 1018 | } | ||
2170 | 1019 | |||
2171 | 1020 | } | ||
2172 | 1021 | OptionSelector { | ||
2173 | 1022 | objectName: "themeSelector" | ||
2174 | 1023 | id: themeSelector | ||
2175 | 1024 | text: i18n.tr("Theme") | ||
2176 | 1025 | model: ["UbuntuColours", "Simple"] | ||
2177 | 1026 | width: parent.width - units.gu(4) | ||
2178 | 1027 | anchors.horizontalCenter: parent.horizontalCenter | ||
2179 | 1028 | onSelectedIndexChanged: { | ||
2180 | 1029 | var newColorScheme = null; | ||
2181 | 1030 | if (selectedIndex == 0) | ||
2182 | 1031 | { | ||
2183 | 1032 | //print("Ubuntu") | ||
2184 | 1033 | var result = Settings.setSetting("ColorTheme", selectedIndex); | ||
2185 | 1034 | //print(result); | ||
2186 | 1035 | sudokuBlocksGrid.changeColorScheme("ColorSchemeUbuntu.qml"); | ||
2187 | 1036 | } | ||
2188 | 1037 | if (selectedIndex == 1) | ||
2189 | 1038 | { | ||
2190 | 1039 | //print("Simple") | ||
2191 | 1040 | var result = Settings.setSetting("ColorTheme", selectedIndex); | ||
2192 | 1041 | //print(result); | ||
2193 | 1042 | sudokuBlocksGrid.changeColorScheme("ColorSchemeSimple.qml"); | ||
2194 | 1043 | } | ||
2195 | 1044 | } | ||
2196 | 1045 | Component.onCompleted: selectedIndex = 0 | ||
2197 | 1046 | } | ||
2198 | 1047 | |||
2199 | 1048 | ListItem.Standard { | ||
2200 | 1049 | objectName: "hintsSwitchClickable" | ||
2201 | 1050 | text: i18n.tr("Hints") | ||
2202 | 1051 | width: parent.width | ||
2203 | 1052 | control: Switch { | ||
2204 | 1053 | objectName: "hintsSwitch" | ||
2205 | 1054 | id: disableHints | ||
2206 | 1055 | anchors.horizontalCenter: parent.horizontalCenter | ||
2207 | 1056 | anchors.verticalCenter: parent.verticalCenter | ||
2208 | 1057 | checked: disableHintsChecked | ||
2209 | 1058 | onCheckedChanged: { | ||
2210 | 1059 | var result = Settings.setSetting("DisableHints", checked ? "true":"false"); | ||
2211 | 1060 | //print(result); | ||
2212 | 1061 | } | ||
2213 | 1062 | } | ||
2214 | 1063 | } | ||
2215 | 1064 | ListItem.Standard { | ||
2216 | 1065 | objectName: "vibrationsSwitchClickable" | ||
2217 | 1066 | text: i18n.tr("Vibration Alerts") | ||
2218 | 1067 | width: parent.width | ||
2219 | 1068 | control: Switch { | ||
2220 | 1069 | objectName: "vibrationsSwitch" | ||
2221 | 1070 | id: disableVibrations | ||
2222 | 1071 | anchors.horizontalCenter: parent.horizontalCenter | ||
2223 | 1072 | anchors.verticalCenter: parent.verticalCenter | ||
2224 | 1073 | checked: disableVibrationsChecked | ||
2225 | 1074 | onCheckedChanged: { | ||
2226 | 1075 | var result = Settings.setSetting("DisableVibrations", checked ? "true":"false"); | ||
2227 | 1076 | //print(result); | ||
2228 | 1077 | } | ||
2229 | 1078 | } | ||
2230 | 1079 | } | ||
2231 | 1080 | ListItem.Divider {} | ||
2232 | 1081 | |||
2233 | 1082 | ListItem.Header { | ||
2234 | 1083 | text: i18n.tr("<b>Profiles settings</b>") | ||
2235 | 1084 | } | ||
2236 | 1085 | ListItem.SingleValue { | ||
2237 | 1086 | objectName: "Current profile" | ||
2238 | 1087 | text: i18n.tr("Current profile") | ||
2239 | 1088 | id: selectorProfile | ||
2240 | 1089 | value: { | ||
2241 | 1090 | if(currentUserId==-1) | ||
2242 | 1091 | return i18n.tr("None") | ||
2243 | 1092 | else | ||
2244 | 1093 | return Settings.getUserFirstName(currentUserId)+" "+Settings.getUserLastName(currentUserId); | ||
2245 | 1094 | |||
2246 | 1095 | } | ||
2247 | 1096 | |||
2248 | 1097 | Component.onCompleted: | ||
2249 | 1098 | currentUserId = Settings.getSetting("currentUserId") | ||
2250 | 1099 | |||
2251 | 1100 | onClicked: { | ||
2252 | 1101 | |||
2253 | 1102 | var allProfiles = new Array(); | ||
2254 | 1103 | allProfiles = Settings.getAllProfiles() | ||
2255 | 1104 | |||
2256 | 1105 | profilesModel.clear() | ||
2257 | 1106 | |||
2258 | 1107 | for(var i = 0; i < allProfiles.length; i++) | ||
2259 | 1108 | { | ||
2260 | 1109 | profilesModel.append({"profileId":allProfiles[i].id,"lastname":allProfiles[i].lastname, "firstname":allProfiles[i].firstname}) | ||
2261 | 1110 | } | ||
2262 | 1111 | PopupUtils.open(profileSelector, selectorProfile) | ||
2263 | 1112 | } | ||
2264 | 1113 | } | ||
2265 | 1114 | |||
2266 | 1115 | AddProfileDialog{ | ||
2267 | 1116 | id:addProfileDialog | ||
2268 | 1117 | } | ||
2269 | 1118 | |||
2270 | 1119 | ManageProfileDialog{ | ||
2271 | 1120 | id:manageProfileDialog | ||
2272 | 1121 | } | ||
2273 | 1122 | |||
2274 | 1123 | |||
2275 | 1124 | ListItem.SingleValue { | ||
2276 | 1125 | objectName: "Add profile" | ||
2277 | 1126 | id:addSingleValue | ||
2278 | 1127 | text: i18n.tr("Add profile") | ||
2279 | 1128 | onClicked: { | ||
2280 | 1129 | PopupUtils.open(addProfileDialog, addSingleValue); | ||
2281 | 1130 | } | ||
2282 | 1131 | } | ||
2283 | 1132 | |||
2284 | 1133 | ListItem.SingleValue { | ||
2285 | 1134 | objectName: "Manage profiles" | ||
2286 | 1135 | id:manageProfileSingleValue | ||
2287 | 1136 | text: i18n.tr("Manage profiles") | ||
2288 | 1137 | onClicked: { | ||
2289 | 1138 | |||
2290 | 1139 | var allProfiles = new Array(); | ||
2291 | 1140 | allProfiles = Settings.getAllProfiles() | ||
2292 | 1141 | |||
2293 | 1142 | profilesModel.clear() | ||
2294 | 1143 | |||
2295 | 1144 | for(var i = 0; i < allProfiles.length; i++) | ||
2296 | 1145 | { | ||
2297 | 1146 | profilesModel.append({"profileId":allProfiles[i].id,"lastname":allProfiles[i].lastname, "firstname":allProfiles[i].firstname}) | ||
2298 | 1147 | } | ||
2299 | 1148 | |||
2300 | 1149 | PopupUtils.open(manageProfileSelector, manageProfileSingleValue) | ||
2301 | 1150 | } | ||
2302 | 1151 | } | ||
2303 | 1152 | } | ||
2304 | 1153 | } | ||
2305 | 1154 | |||
2306 | 1155 | Scrollbar { | ||
2307 | 1156 | flickableItem: flickableSettings | ||
2308 | 1157 | align: Qt.AlignTrailing | ||
2309 | 1158 | } | ||
2310 | 1159 | } | ||
2311 | 1160 | |||
2312 | 1161 | |||
2313 | 1162 | } | 654 | } |
2314 | 1163 | 655 | ||
2315 | 1164 | |||
2316 | 1165 | AboutTab { | 656 | AboutTab { |
2317 | 1166 | id: aboutTab | 657 | id: aboutTab |
2318 | 1167 | objectName: "aboutTab" | 658 | objectName: "aboutTab" |
2319 | 1168 | title: i18n.tr("About") | ||
2320 | 1169 | } | 659 | } |
2321 | 1170 | } | 660 | } |
2322 | 1171 | } | 661 | } |
Thanks nik90.