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
=== modified file 'manifest.json'
--- manifest.json 2014-03-06 10:08:44 +0000
+++ manifest.json 2015-06-03 03:58:13 +0000
@@ -1,6 +1,6 @@
1{1{
2"description": "Ubuntu NetWalk app",2"description": "Ubuntu NetWalk app",
3"framework": "ubuntu-sdk-13.10",3"framework": "ubuntu-sdk-14.10",
4"architecture": "armhf",4"architecture": "armhf",
5"hooks": {5"hooks": {
6"ubuntu-netwalk": {6"ubuntu-netwalk": {
77
=== modified file 'qml/UbuntuNetwalk.qml'
--- qml/UbuntuNetwalk.qml 2014-02-09 21:40:05 +0000
+++ qml/UbuntuNetwalk.qml 2015-06-03 03:58:13 +0000
@@ -1,7 +1,6 @@
11
2import QtQuick 2.02import QtQuick 2.0
3import Ubuntu.Components 0.13import Ubuntu.Components 1.1
4import Ubuntu.Components.Popups 0.1
54
6import "components"5import "components"
76
@@ -16,6 +15,7 @@
16 // Note! applicationName needs to match the .desktop filename15 // Note! applicationName needs to match the .desktop filename
17 applicationName: "com.ubuntu.developer.flscogna.ubuntu-netwalk"16 applicationName: "com.ubuntu.developer.flscogna.ubuntu-netwalk"
18 automaticOrientation: true17 automaticOrientation: true
18 useDeprecatedToolbar: false
19 19
20 width: units.gu(100)20 width: units.gu(100)
21 height: units.gu(75)21 height: units.gu(75)
@@ -23,109 +23,109 @@
23 headerColor: "#444444";23 headerColor: "#444444";
24 backgroundColor: "#333333";24 backgroundColor: "#333333";
25 footerColor: "#333333";25 footerColor: "#333333";
2626
27 Page {27 PageStack {
28 id: gamepage28 id: page_stack
29 title: i18n.tr("UbuntuNetWalk")29 Component.onCompleted: push (gamepage)
3030
31 AboutDialog{id: aboutdialog}31 Page {
32 SettingsDialog{id: settingsdialog}32 id: gamepage
33 HighScoresDialog{id: highscoredialog}33 title: i18n.tr("UbuntuNetWalk")
3434
35 tools: ToolbarItems {35 head.actions:
36 ToolbarButton{36 [
37 objectName: "about"37 Action {
38 text: i18n.tr("About")38 text: i18n.tr("Settings")
39 iconSource: Qt.resolvedUrl("imgs/png/star.png")39 iconName: "settings"
4040 onTriggered: page_stack.push (settings_page)
41 onTriggered: PopupUtils.open(aboutdialog, gamepage)41 },
42 }42 Action {
4343 text: i18n.tr("New Game")
44 ToolbarButton{44 iconName: "reload"
45 objectName: "highscores"45 onTriggered: {
46 text: i18n.tr("HighScores")46 var params = settingsmanager.getDifficultyParams();
47 iconSource: Qt.resolvedUrl("imgs/png/star.png")47 logic.newGame(params[0],params[1],params[2],params[3]);
4848 }
49 onTriggered: {49 },
50 PopupUtils.open(highscoredialog, gamepage)50 Action {
51 }51 text: i18n.tr("HighScores")
52 }52 iconSource: Qt.resolvedUrl("imgs/png/star.png")
5353 onTriggered: page_stack.push (high_scores_page)
54 ToolbarButton{54 },
55 objectName: "settings"55 Action {
56 text: i18n.tr("Settings")56 text: i18n.tr("About")
5757 iconName: "info"
58 iconSource: Qt.resolvedUrl("imgs/png/edit.png");58 onTriggered: page_stack.push (about_page)
5959 }
60 onTriggered: {60 ]
61 PopupUtils.open(settingsdialog, gamepage);61
62 }62 Timer{
63 }63 interval: 100
6464 onTriggered: logic.time += 0.1
65 ToolbarButton{65 running: logic.gameState === logic.GAME_RUNNING
66 objectName: "action"66 repeat: true
6767 }
68 iconSource: Qt.resolvedUrl("imgs/png/reload.png")68
69 text: i18n.tr("New Game")69 SettingsManager{
7070 id: settingsmanager
71 onTriggered: {71 }
72 var params = settingsmanager.getDifficultyParams();72
73 logic.newGame(params[0],params[1],params[2],params[3]);73 Rectangle{
74 }74 id: maincontainer
75 }75 color: "#191919";
76 }76
7777 clip: true
78 Timer{78
79 interval: 10079 anchors.fill: parent
80 onTriggered: logic.time += 0.180
81 running: logic.gameState === logic.GAME_RUNNING81 DropdownMenu{
82 repeat: true82 id: dropdownmenu
83 }83 anchors{
8484 top: parent.top
85 SettingsManager{85 bottom: statsbar.bottom
86 id: settingsmanager86 left: parent.left
87 }87 right: parent.right
8888 }
89 Rectangle{89
90 id: maincontainer90 z: 5
91 color: "#191919";91 }
9292
93 clip: true93 TopBar{
9494 id: statsbar
95 anchors.fill: parent95 }
9696
97 DropdownMenu{
98 id: dropdownmenu
99 anchors{97 anchors{
98 bottom: parent.bottom
100 top: parent.top99 top: parent.top
101 bottom: statsbar.bottom
102 left: parent.left100 left: parent.left
103 right: parent.right101 right: parent.right
104 }102 margins: units.gu(1)
105103 }
106 z: 5104
107 }105 GameView {
108106 id: mainview
109 TopBar{107 objectName: "mainview"
110 id: statsbar108
111 }109 anchors.fill: parent
112110 anchors.topMargin: statsbar.height
113 anchors{111 visible: true
114 bottom: parent.bottom112 }
115 top: parent.top113 }
116 left: parent.left114 }
117 right: parent.right115
118 margins: units.gu(1)116 HighScoresPage {
119 }117 id: high_scores_page
120118 visible: false
121 GameView {119 }
122 id: mainview120
123 objectName: "mainview"121 SettingsPage {
124122 id: settings_page
125 anchors.fill: parent123 visible: false
126 anchors.topMargin: statsbar.height124 }
127 visible: true125
128 }126 AboutPage {
127 id: about_page
128 visible: false
129 }129 }
130 }130 }
131131
132132
=== removed file 'qml/components/AboutDialog.qml'
--- qml/components/AboutDialog.qml 2014-01-25 10:48:17 +0000
+++ qml/components/AboutDialog.qml 1970-01-01 00:00:00 +0000
@@ -1,31 +0,0 @@
1import QtQuick 2.0
2import Ubuntu.Components 0.1
3import Ubuntu.Components.Popups 0.1
4
5
6Component {
7 id: aboutdialog
8
9 Dialog {
10 id: aboutdialogue
11 title: i18n.tr("About")
12 text: i18n.tr("The remake of the popular game Netwalk optimized for Ubuntu Touch! \n\n Filippo Scognamiglio (flscogna@gmail.com)")
13
14 Image{
15 width: 128
16 height: 128
17 fillMode: Image.PreserveAspectFit
18 source: "../imgs/png/ubuntuNetwalkicon.png"
19 }
20
21 Rectangle{
22 opacity: 0
23 height: units.gu(2)
24 }
25
26 Button {
27 text: i18n.tr("Close")
28 onClicked: PopupUtils.close(aboutdialogue)
29 }
30 }
31}
320
=== added file 'qml/components/AboutPage.qml'
--- qml/components/AboutPage.qml 1970-01-01 00:00:00 +0000
+++ qml/components/AboutPage.qml 2015-06-03 03:58:13 +0000
@@ -0,0 +1,12 @@
1import QtQuick 2.0
2import Ubuntu.Components 1.1
3
4Page {
5 title: i18n.tr("About")
6
7 Label {
8 anchors.fill: parent
9 anchors.margins: units.gu (2)
10 text: i18n.tr("The remake of the popular game Netwalk optimized for Ubuntu Touch! \n\n Filippo Scognamiglio (flscogna@gmail.com)")
11 }
12}
013
=== modified file 'qml/components/DropdownMenu.qml'
--- qml/components/DropdownMenu.qml 2014-02-09 22:41:32 +0000
+++ qml/components/DropdownMenu.qml 2015-06-03 03:58:13 +0000
@@ -1,5 +1,5 @@
1import QtQuick 2.01import QtQuick 2.0
2import Ubuntu.Components 0.12import Ubuntu.Components 1.1
33
4UbuntuShape {4UbuntuShape {
5 id: dropdownmenu5 id: dropdownmenu
66
=== modified file 'qml/components/GameView.qml'
--- qml/components/GameView.qml 2014-03-05 22:42:41 +0000
+++ qml/components/GameView.qml 2015-06-03 03:58:13 +0000
@@ -1,6 +1,5 @@
1import QtQuick 2.01import QtQuick 2.0
2import Ubuntu.Components 0.12import Ubuntu.Components 1.1
3import Ubuntu.Components.Popups 0.1
43
5Item {4Item {
6 id: gameview5 id: gameview
76
=== removed file 'qml/components/HighScoresDialog.qml'
--- qml/components/HighScoresDialog.qml 2014-01-25 10:48:17 +0000
+++ qml/components/HighScoresDialog.qml 1970-01-01 00:00:00 +0000
@@ -1,90 +0,0 @@
1import QtQuick 2.0
2import Ubuntu.Components 0.1
3import Ubuntu.Components.Popups 0.1
4import Ubuntu.Components.ListItems 0.1 as ListItem
5
6Component {
7 id: highscoredialog
8
9 Dialog {
10 id: highscoredialogue
11 title: i18n.tr("HighScores")
12
13 ListModel{
14 id: highscoremodel
15
16 function appendAll(array){
17 for(var i = 0; i<array.length; i++){
18 highscoremodel.append(array[i]);
19 }
20 }
21 }
22
23 OptionSelector {
24 id: difficultyselector
25 text: i18n.tr("Difficulty")
26 model: settingsmanager.difficulty_strings
27
28 selectedIndex: settingsmanager.difficulty_index
29
30 function loadModel(difficulty){
31 highscoremodel.clear();
32 highscoremodel.appendAll(settingsmanager.highscores[difficulty]);
33 }
34
35 onSelectedIndexChanged: loadModel(selectedIndex)
36 Component.onCompleted: loadModel(selectedIndex);
37 }
38
39
40 Text{
41 Label{
42 color: "white"
43 anchors.left: parent.left
44 text: highscoremodel.count !== 0 ? i18n.tr("Name") : i18n.tr("No scores")
45 font.bold: true
46 }
47 Label{
48 color: "white"
49 font.bold: true
50 anchors.right: parent.right
51 text: highscoremodel.count !== 0 ? i18n.tr("Time") + " (" + i18n.tr("Moves") + ")" : ""
52 }
53 }
54
55 //Divider
56 Rectangle{
57 height: units.gu(0.5)
58 opacity: 0
59 }
60
61 Repeater{
62 model: highscoremodel
63
64 delegate: Text{
65 Label{
66 anchors.left: parent.left
67 text: name
68 color: "white"
69 }
70 Label{
71 anchors.right: parent.right
72 color: "white"
73 font.bold: true
74 text: time.toFixed(1) + " ("+ moves + ")";
75 }
76 }
77 }
78
79 //Divider
80 Rectangle{
81 height: units.gu(0.5)
82 opacity: 0
83 }
84
85 Button {
86 text: i18n.tr("Close")
87 onClicked: PopupUtils.close(highscoredialogue)
88 }
89 }
90}
910
=== added file 'qml/components/HighScoresPage.qml'
--- qml/components/HighScoresPage.qml 1970-01-01 00:00:00 +0000
+++ qml/components/HighScoresPage.qml 2015-06-03 03:58:13 +0000
@@ -0,0 +1,69 @@
1import QtQuick 2.0
2import Ubuntu.Components 1.1
3
4Page {
5 title: i18n.tr("HighScores")
6
7 ListModel{
8 id: highscoremodel
9
10 function appendAll(array){
11 for(var i = 0; i<array.length; i++){
12 highscoremodel.append(array[i]);
13 }
14 }
15 }
16
17 Column{
18 anchors.fill: parent
19 anchors.margins: units.gu (2)
20 spacing: units.gu (2)
21
22 OptionSelector {
23 id: difficultyselector
24 text: i18n.tr("Difficulty")
25 model: settingsmanager.difficulty_strings
26
27 selectedIndex: settingsmanager.difficulty_index
28
29 function loadModel(difficulty){
30 highscoremodel.clear();
31 highscoremodel.appendAll(settingsmanager.highscores[difficulty]);
32 }
33
34 onSelectedIndexChanged: loadModel(selectedIndex)
35 Component.onCompleted: loadModel(selectedIndex);
36 }
37
38 Label{
39 color: "white"
40 anchors.left: parent.left
41 text: highscoremodel.count !== 0 ? i18n.tr("Name") : i18n.tr("No scores")
42 font.bold: true
43 }
44 Label{
45 color: "white"
46 font.bold: true
47 anchors.right: parent.right
48 text: highscoremodel.count !== 0 ? i18n.tr("Time") + " (" + i18n.tr("Moves") + ")" : ""
49 }
50
51 Repeater{
52 model: highscoremodel
53
54 delegate: Text{
55 Label{
56 anchors.left: parent.left
57 text: name
58 color: "white"
59 }
60 Label{
61 anchors.right: parent.right
62 color: "white"
63 font.bold: true
64 text: time.toFixed(1) + " ("+ moves + ")";
65 }
66 }
67 }
68 }
69}
070
=== removed file 'qml/components/SettingsDialog.qml'
--- qml/components/SettingsDialog.qml 2014-02-19 20:31:25 +0000
+++ qml/components/SettingsDialog.qml 1970-01-01 00:00:00 +0000
@@ -1,64 +0,0 @@
1import QtQuick 2.0
2import Ubuntu.Components 0.1
3import Ubuntu.Components.Popups 0.1
4import Ubuntu.Components.ListItems 0.1 as ListItem
5
6Component {
7 id: settingsdialog
8
9 Dialog {
10 id: settingsdialogue
11 title: i18n.tr("Settings")
12
13 property int initialIndex;
14
15 Item{
16 height: childrenRect.height
17 Label{
18 text: i18n.tr("Glowing wires")
19 }
20 Switch{
21 id: glowingchecker
22 anchors.right: parent.right
23 checked: settingsmanager.glowing
24 onCheckedChanged: settingsmanager.glowing = checked;
25 }
26 }
27
28 Item{
29 height: childrenRect.height
30 Label{
31 text: i18n.tr("Rotations")
32 }
33 Switch{
34 id: rotationchecker
35 anchors.right: parent.right
36 checked: settingsmanager.rotation
37 onCheckedChanged: settingsmanager.rotation = checked;
38 }
39 }
40
41 OptionSelector {
42 id: difficultyselector
43 text: i18n.tr("Difficulty")
44 model: settingsmanager.difficulty_strings
45 selectedIndex: settingsmanager.difficulty_index
46
47 Component.onCompleted: settingsdialogue.initialIndex = selectedIndex;
48 }
49
50 Button {
51 text: i18n.tr("Close")
52 onClicked: {
53 if(difficultyselector.selectedIndex !== settingsdialogue.initialIndex){
54 settingsmanager.difficulty_index = difficultyselector.selectedIndex;
55
56 var params = settingsmanager.getDifficultyParams();
57 logic.newGame(params[0], params[1], params[2], params[3]);
58 }
59
60 PopupUtils.close(settingsdialogue);
61 }
62 }
63 }
64}
650
=== added file 'qml/components/SettingsPage.qml'
--- qml/components/SettingsPage.qml 1970-01-01 00:00:00 +0000
+++ qml/components/SettingsPage.qml 2015-06-03 03:58:13 +0000
@@ -0,0 +1,44 @@
1import QtQuick 2.0
2import Ubuntu.Components 1.1
3
4Page {
5 title: i18n.tr("Settings")
6
7 Column {
8 anchors.fill: parent
9 anchors.margins: units.gu (2)
10 spacing: units.gu (2)
11
12 Row{
13 spacing: units.gu (2)
14 Label{
15 text: i18n.tr("Glowing wires")
16 }
17 Switch{
18 checked: settingsmanager.glowing
19 onCheckedChanged: settingsmanager.glowing = checked;
20 }
21 }
22
23 Row{
24 spacing: units.gu (2)
25 Label{
26 text: i18n.tr("Rotations")
27 }
28 Switch{
29 checked: settingsmanager.rotation
30 onCheckedChanged: settingsmanager.rotation = checked;
31 }
32 }
33
34 OptionSelector {
35 text: i18n.tr("Difficulty")
36 model: settingsmanager.difficulty_strings
37 onDelegateClicked: {
38 settingsmanager.difficulty_index = index;
39 var params = settingsmanager.getDifficultyParams();
40 logic.newGame(params[0], params[1], params[2], params[3]);
41 }
42 }
43 }
44}
045
=== modified file 'qml/components/TopBar.qml'
--- qml/components/TopBar.qml 2013-09-15 17:31:59 +0000
+++ qml/components/TopBar.qml 2015-06-03 03:58:13 +0000
@@ -1,5 +1,5 @@
1import QtQuick 2.01import QtQuick 2.0
2import Ubuntu.Components 0.12import Ubuntu.Components 1.1
33
4Rectangle{4Rectangle{
5 id: statsbar5 id: statsbar
66
=== removed file 'qml/imgs/png/edit.png'
7Binary 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 differ7Binary 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
=== removed file 'qml/imgs/png/reload.png'
8Binary 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 differ8Binary 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
=== removed file 'qml/imgs/png/ubuntuNetwalkicon.png'
9Binary 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 differ9Binary 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