Merge lp:~robert-ancell/ubuntu-netwalk/modern-ui into lp:ubuntu-netwalk

Proposed by Robert Ancell
Status: Merged
Merge reported by: Filippo Scognamiglio
Merged at revision: not available
Proposed branch: lp:~robert-ancell/ubuntu-netwalk/modern-ui
Merge into: lp:ubuntu-netwalk
Diff against target: 622 lines (+230/-291)
11 files modified
manifest.json (+1/-1)
qml/UbuntuNetwalk.qml (+101/-101)
qml/components/AboutDialog.qml (+0/-31)
qml/components/AboutPage.qml (+12/-0)
qml/components/DropdownMenu.qml (+1/-1)
qml/components/GameView.qml (+1/-2)
qml/components/HighScoresDialog.qml (+0/-90)
qml/components/HighScoresPage.qml (+69/-0)
qml/components/SettingsDialog.qml (+0/-64)
qml/components/SettingsPage.qml (+44/-0)
qml/components/TopBar.qml (+1/-1)
To merge this branch: bzr merge lp:~robert-ancell/ubuntu-netwalk/modern-ui
Reviewer Review Type Date Requested Status
Filippo Scognamiglio Approve
Review via email: mp+260907@code.launchpad.net

Description of the change

Update to modern UI as the current UI didn't seem to render properly on current phones.

To post a comment you must log in.
Revision history for this message
Filippo Scognamiglio (flscogna) wrote :

Thank you very much Robert. This has been on my TODO list for a very long time and I'm extremely glad someone took care of it. Cheers!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'manifest.json'
2--- manifest.json 2014-03-06 10:08:44 +0000
3+++ manifest.json 2015-06-03 03:58:13 +0000
4@@ -1,6 +1,6 @@
5 {
6 "description": "Ubuntu NetWalk app",
7-"framework": "ubuntu-sdk-13.10",
8+"framework": "ubuntu-sdk-14.10",
9 "architecture": "armhf",
10 "hooks": {
11 "ubuntu-netwalk": {
12
13=== modified file 'qml/UbuntuNetwalk.qml'
14--- qml/UbuntuNetwalk.qml 2014-02-09 21:40:05 +0000
15+++ qml/UbuntuNetwalk.qml 2015-06-03 03:58:13 +0000
16@@ -1,7 +1,6 @@
17
18 import QtQuick 2.0
19-import Ubuntu.Components 0.1
20-import Ubuntu.Components.Popups 0.1
21+import Ubuntu.Components 1.1
22
23 import "components"
24
25@@ -16,6 +15,7 @@
26 // Note! applicationName needs to match the .desktop filename
27 applicationName: "com.ubuntu.developer.flscogna.ubuntu-netwalk"
28 automaticOrientation: true
29+ useDeprecatedToolbar: false
30
31 width: units.gu(100)
32 height: units.gu(75)
33@@ -23,109 +23,109 @@
34 headerColor: "#444444";
35 backgroundColor: "#333333";
36 footerColor: "#333333";
37-
38- Page {
39- id: gamepage
40- title: i18n.tr("UbuntuNetWalk")
41-
42- AboutDialog{id: aboutdialog}
43- SettingsDialog{id: settingsdialog}
44- HighScoresDialog{id: highscoredialog}
45-
46- tools: ToolbarItems {
47- ToolbarButton{
48- objectName: "about"
49- text: i18n.tr("About")
50- iconSource: Qt.resolvedUrl("imgs/png/star.png")
51-
52- onTriggered: PopupUtils.open(aboutdialog, gamepage)
53- }
54-
55- ToolbarButton{
56- objectName: "highscores"
57- text: i18n.tr("HighScores")
58- iconSource: Qt.resolvedUrl("imgs/png/star.png")
59-
60- onTriggered: {
61- PopupUtils.open(highscoredialog, gamepage)
62- }
63- }
64-
65- ToolbarButton{
66- objectName: "settings"
67- text: i18n.tr("Settings")
68-
69- iconSource: Qt.resolvedUrl("imgs/png/edit.png");
70-
71- onTriggered: {
72- PopupUtils.open(settingsdialog, gamepage);
73- }
74- }
75-
76- ToolbarButton{
77- objectName: "action"
78-
79- iconSource: Qt.resolvedUrl("imgs/png/reload.png")
80- text: i18n.tr("New Game")
81-
82- onTriggered: {
83- var params = settingsmanager.getDifficultyParams();
84- logic.newGame(params[0],params[1],params[2],params[3]);
85- }
86- }
87- }
88-
89- Timer{
90- interval: 100
91- onTriggered: logic.time += 0.1
92- running: logic.gameState === logic.GAME_RUNNING
93- repeat: true
94- }
95-
96- SettingsManager{
97- id: settingsmanager
98- }
99-
100- Rectangle{
101- id: maincontainer
102- color: "#191919";
103-
104- clip: true
105-
106- anchors.fill: parent
107-
108- DropdownMenu{
109- id: dropdownmenu
110+
111+ PageStack {
112+ id: page_stack
113+ Component.onCompleted: push (gamepage)
114+
115+ Page {
116+ id: gamepage
117+ title: i18n.tr("UbuntuNetWalk")
118+
119+ head.actions:
120+ [
121+ Action {
122+ text: i18n.tr("Settings")
123+ iconName: "settings"
124+ onTriggered: page_stack.push (settings_page)
125+ },
126+ Action {
127+ text: i18n.tr("New Game")
128+ iconName: "reload"
129+ onTriggered: {
130+ var params = settingsmanager.getDifficultyParams();
131+ logic.newGame(params[0],params[1],params[2],params[3]);
132+ }
133+ },
134+ Action {
135+ text: i18n.tr("HighScores")
136+ iconSource: Qt.resolvedUrl("imgs/png/star.png")
137+ onTriggered: page_stack.push (high_scores_page)
138+ },
139+ Action {
140+ text: i18n.tr("About")
141+ iconName: "info"
142+ onTriggered: page_stack.push (about_page)
143+ }
144+ ]
145+
146+ Timer{
147+ interval: 100
148+ onTriggered: logic.time += 0.1
149+ running: logic.gameState === logic.GAME_RUNNING
150+ repeat: true
151+ }
152+
153+ SettingsManager{
154+ id: settingsmanager
155+ }
156+
157+ Rectangle{
158+ id: maincontainer
159+ color: "#191919";
160+
161+ clip: true
162+
163+ anchors.fill: parent
164+
165+ DropdownMenu{
166+ id: dropdownmenu
167+ anchors{
168+ top: parent.top
169+ bottom: statsbar.bottom
170+ left: parent.left
171+ right: parent.right
172+ }
173+
174+ z: 5
175+ }
176+
177+ TopBar{
178+ id: statsbar
179+ }
180+
181 anchors{
182+ bottom: parent.bottom
183 top: parent.top
184- bottom: statsbar.bottom
185 left: parent.left
186 right: parent.right
187- }
188-
189- z: 5
190- }
191-
192- TopBar{
193- id: statsbar
194- }
195-
196- anchors{
197- bottom: parent.bottom
198- top: parent.top
199- left: parent.left
200- right: parent.right
201- margins: units.gu(1)
202- }
203-
204- GameView {
205- id: mainview
206- objectName: "mainview"
207-
208- anchors.fill: parent
209- anchors.topMargin: statsbar.height
210- visible: true
211- }
212+ margins: units.gu(1)
213+ }
214+
215+ GameView {
216+ id: mainview
217+ objectName: "mainview"
218+
219+ anchors.fill: parent
220+ anchors.topMargin: statsbar.height
221+ visible: true
222+ }
223+ }
224+ }
225+
226+ HighScoresPage {
227+ id: high_scores_page
228+ visible: false
229+ }
230+
231+ SettingsPage {
232+ id: settings_page
233+ visible: false
234+ }
235+
236+ AboutPage {
237+ id: about_page
238+ visible: false
239 }
240 }
241
242
243=== removed file 'qml/components/AboutDialog.qml'
244--- qml/components/AboutDialog.qml 2014-01-25 10:48:17 +0000
245+++ qml/components/AboutDialog.qml 1970-01-01 00:00:00 +0000
246@@ -1,31 +0,0 @@
247-import QtQuick 2.0
248-import Ubuntu.Components 0.1
249-import Ubuntu.Components.Popups 0.1
250-
251-
252-Component {
253- id: aboutdialog
254-
255- Dialog {
256- id: aboutdialogue
257- title: i18n.tr("About")
258- text: i18n.tr("The remake of the popular game Netwalk optimized for Ubuntu Touch! \n\n Filippo Scognamiglio (flscogna@gmail.com)")
259-
260- Image{
261- width: 128
262- height: 128
263- fillMode: Image.PreserveAspectFit
264- source: "../imgs/png/ubuntuNetwalkicon.png"
265- }
266-
267- Rectangle{
268- opacity: 0
269- height: units.gu(2)
270- }
271-
272- Button {
273- text: i18n.tr("Close")
274- onClicked: PopupUtils.close(aboutdialogue)
275- }
276- }
277-}
278
279=== added file 'qml/components/AboutPage.qml'
280--- qml/components/AboutPage.qml 1970-01-01 00:00:00 +0000
281+++ qml/components/AboutPage.qml 2015-06-03 03:58:13 +0000
282@@ -0,0 +1,12 @@
283+import QtQuick 2.0
284+import Ubuntu.Components 1.1
285+
286+Page {
287+ title: i18n.tr("About")
288+
289+ Label {
290+ anchors.fill: parent
291+ anchors.margins: units.gu (2)
292+ text: i18n.tr("The remake of the popular game Netwalk optimized for Ubuntu Touch! \n\n Filippo Scognamiglio (flscogna@gmail.com)")
293+ }
294+}
295
296=== modified file 'qml/components/DropdownMenu.qml'
297--- qml/components/DropdownMenu.qml 2014-02-09 22:41:32 +0000
298+++ qml/components/DropdownMenu.qml 2015-06-03 03:58:13 +0000
299@@ -1,5 +1,5 @@
300 import QtQuick 2.0
301-import Ubuntu.Components 0.1
302+import Ubuntu.Components 1.1
303
304 UbuntuShape {
305 id: dropdownmenu
306
307=== modified file 'qml/components/GameView.qml'
308--- qml/components/GameView.qml 2014-03-05 22:42:41 +0000
309+++ qml/components/GameView.qml 2015-06-03 03:58:13 +0000
310@@ -1,6 +1,5 @@
311 import QtQuick 2.0
312-import Ubuntu.Components 0.1
313-import Ubuntu.Components.Popups 0.1
314+import Ubuntu.Components 1.1
315
316 Item {
317 id: gameview
318
319=== removed file 'qml/components/HighScoresDialog.qml'
320--- qml/components/HighScoresDialog.qml 2014-01-25 10:48:17 +0000
321+++ qml/components/HighScoresDialog.qml 1970-01-01 00:00:00 +0000
322@@ -1,90 +0,0 @@
323-import QtQuick 2.0
324-import Ubuntu.Components 0.1
325-import Ubuntu.Components.Popups 0.1
326-import Ubuntu.Components.ListItems 0.1 as ListItem
327-
328-Component {
329- id: highscoredialog
330-
331- Dialog {
332- id: highscoredialogue
333- title: i18n.tr("HighScores")
334-
335- ListModel{
336- id: highscoremodel
337-
338- function appendAll(array){
339- for(var i = 0; i<array.length; i++){
340- highscoremodel.append(array[i]);
341- }
342- }
343- }
344-
345- OptionSelector {
346- id: difficultyselector
347- text: i18n.tr("Difficulty")
348- model: settingsmanager.difficulty_strings
349-
350- selectedIndex: settingsmanager.difficulty_index
351-
352- function loadModel(difficulty){
353- highscoremodel.clear();
354- highscoremodel.appendAll(settingsmanager.highscores[difficulty]);
355- }
356-
357- onSelectedIndexChanged: loadModel(selectedIndex)
358- Component.onCompleted: loadModel(selectedIndex);
359- }
360-
361-
362- Text{
363- Label{
364- color: "white"
365- anchors.left: parent.left
366- text: highscoremodel.count !== 0 ? i18n.tr("Name") : i18n.tr("No scores")
367- font.bold: true
368- }
369- Label{
370- color: "white"
371- font.bold: true
372- anchors.right: parent.right
373- text: highscoremodel.count !== 0 ? i18n.tr("Time") + " (" + i18n.tr("Moves") + ")" : ""
374- }
375- }
376-
377- //Divider
378- Rectangle{
379- height: units.gu(0.5)
380- opacity: 0
381- }
382-
383- Repeater{
384- model: highscoremodel
385-
386- delegate: Text{
387- Label{
388- anchors.left: parent.left
389- text: name
390- color: "white"
391- }
392- Label{
393- anchors.right: parent.right
394- color: "white"
395- font.bold: true
396- text: time.toFixed(1) + " ("+ moves + ")";
397- }
398- }
399- }
400-
401- //Divider
402- Rectangle{
403- height: units.gu(0.5)
404- opacity: 0
405- }
406-
407- Button {
408- text: i18n.tr("Close")
409- onClicked: PopupUtils.close(highscoredialogue)
410- }
411- }
412-}
413
414=== added file 'qml/components/HighScoresPage.qml'
415--- qml/components/HighScoresPage.qml 1970-01-01 00:00:00 +0000
416+++ qml/components/HighScoresPage.qml 2015-06-03 03:58:13 +0000
417@@ -0,0 +1,69 @@
418+import QtQuick 2.0
419+import Ubuntu.Components 1.1
420+
421+Page {
422+ title: i18n.tr("HighScores")
423+
424+ ListModel{
425+ id: highscoremodel
426+
427+ function appendAll(array){
428+ for(var i = 0; i<array.length; i++){
429+ highscoremodel.append(array[i]);
430+ }
431+ }
432+ }
433+
434+ Column{
435+ anchors.fill: parent
436+ anchors.margins: units.gu (2)
437+ spacing: units.gu (2)
438+
439+ OptionSelector {
440+ id: difficultyselector
441+ text: i18n.tr("Difficulty")
442+ model: settingsmanager.difficulty_strings
443+
444+ selectedIndex: settingsmanager.difficulty_index
445+
446+ function loadModel(difficulty){
447+ highscoremodel.clear();
448+ highscoremodel.appendAll(settingsmanager.highscores[difficulty]);
449+ }
450+
451+ onSelectedIndexChanged: loadModel(selectedIndex)
452+ Component.onCompleted: loadModel(selectedIndex);
453+ }
454+
455+ Label{
456+ color: "white"
457+ anchors.left: parent.left
458+ text: highscoremodel.count !== 0 ? i18n.tr("Name") : i18n.tr("No scores")
459+ font.bold: true
460+ }
461+ Label{
462+ color: "white"
463+ font.bold: true
464+ anchors.right: parent.right
465+ text: highscoremodel.count !== 0 ? i18n.tr("Time") + " (" + i18n.tr("Moves") + ")" : ""
466+ }
467+
468+ Repeater{
469+ model: highscoremodel
470+
471+ delegate: Text{
472+ Label{
473+ anchors.left: parent.left
474+ text: name
475+ color: "white"
476+ }
477+ Label{
478+ anchors.right: parent.right
479+ color: "white"
480+ font.bold: true
481+ text: time.toFixed(1) + " ("+ moves + ")";
482+ }
483+ }
484+ }
485+ }
486+}
487
488=== removed file 'qml/components/SettingsDialog.qml'
489--- qml/components/SettingsDialog.qml 2014-02-19 20:31:25 +0000
490+++ qml/components/SettingsDialog.qml 1970-01-01 00:00:00 +0000
491@@ -1,64 +0,0 @@
492-import QtQuick 2.0
493-import Ubuntu.Components 0.1
494-import Ubuntu.Components.Popups 0.1
495-import Ubuntu.Components.ListItems 0.1 as ListItem
496-
497-Component {
498- id: settingsdialog
499-
500- Dialog {
501- id: settingsdialogue
502- title: i18n.tr("Settings")
503-
504- property int initialIndex;
505-
506- Item{
507- height: childrenRect.height
508- Label{
509- text: i18n.tr("Glowing wires")
510- }
511- Switch{
512- id: glowingchecker
513- anchors.right: parent.right
514- checked: settingsmanager.glowing
515- onCheckedChanged: settingsmanager.glowing = checked;
516- }
517- }
518-
519- Item{
520- height: childrenRect.height
521- Label{
522- text: i18n.tr("Rotations")
523- }
524- Switch{
525- id: rotationchecker
526- anchors.right: parent.right
527- checked: settingsmanager.rotation
528- onCheckedChanged: settingsmanager.rotation = checked;
529- }
530- }
531-
532- OptionSelector {
533- id: difficultyselector
534- text: i18n.tr("Difficulty")
535- model: settingsmanager.difficulty_strings
536- selectedIndex: settingsmanager.difficulty_index
537-
538- Component.onCompleted: settingsdialogue.initialIndex = selectedIndex;
539- }
540-
541- Button {
542- text: i18n.tr("Close")
543- onClicked: {
544- if(difficultyselector.selectedIndex !== settingsdialogue.initialIndex){
545- settingsmanager.difficulty_index = difficultyselector.selectedIndex;
546-
547- var params = settingsmanager.getDifficultyParams();
548- logic.newGame(params[0], params[1], params[2], params[3]);
549- }
550-
551- PopupUtils.close(settingsdialogue);
552- }
553- }
554- }
555-}
556
557=== added file 'qml/components/SettingsPage.qml'
558--- qml/components/SettingsPage.qml 1970-01-01 00:00:00 +0000
559+++ qml/components/SettingsPage.qml 2015-06-03 03:58:13 +0000
560@@ -0,0 +1,44 @@
561+import QtQuick 2.0
562+import Ubuntu.Components 1.1
563+
564+Page {
565+ title: i18n.tr("Settings")
566+
567+ Column {
568+ anchors.fill: parent
569+ anchors.margins: units.gu (2)
570+ spacing: units.gu (2)
571+
572+ Row{
573+ spacing: units.gu (2)
574+ Label{
575+ text: i18n.tr("Glowing wires")
576+ }
577+ Switch{
578+ checked: settingsmanager.glowing
579+ onCheckedChanged: settingsmanager.glowing = checked;
580+ }
581+ }
582+
583+ Row{
584+ spacing: units.gu (2)
585+ Label{
586+ text: i18n.tr("Rotations")
587+ }
588+ Switch{
589+ checked: settingsmanager.rotation
590+ onCheckedChanged: settingsmanager.rotation = checked;
591+ }
592+ }
593+
594+ OptionSelector {
595+ text: i18n.tr("Difficulty")
596+ model: settingsmanager.difficulty_strings
597+ onDelegateClicked: {
598+ settingsmanager.difficulty_index = index;
599+ var params = settingsmanager.getDifficultyParams();
600+ logic.newGame(params[0], params[1], params[2], params[3]);
601+ }
602+ }
603+ }
604+}
605
606=== modified file 'qml/components/TopBar.qml'
607--- qml/components/TopBar.qml 2013-09-15 17:31:59 +0000
608+++ qml/components/TopBar.qml 2015-06-03 03:58:13 +0000
609@@ -1,5 +1,5 @@
610 import QtQuick 2.0
611-import Ubuntu.Components 0.1
612+import Ubuntu.Components 1.1
613
614 Rectangle{
615 id: statsbar
616
617=== removed file 'qml/imgs/png/edit.png'
618Binary files qml/imgs/png/edit.png 2013-09-15 17:31:59 +0000 and qml/imgs/png/edit.png 1970-01-01 00:00:00 +0000 differ
619=== removed file 'qml/imgs/png/reload.png'
620Binary files qml/imgs/png/reload.png 2013-09-15 17:31:59 +0000 and qml/imgs/png/reload.png 1970-01-01 00:00:00 +0000 differ
621=== removed file 'qml/imgs/png/ubuntuNetwalkicon.png'
622Binary files qml/imgs/png/ubuntuNetwalkicon.png 2013-09-15 17:31:59 +0000 and qml/imgs/png/ubuntuNetwalkicon.png 1970-01-01 00:00:00 +0000 differ

Subscribers

People subscribed via source and target branches