Merge lp:~rpadovani/ubuntu-weather-app/1200600 into lp:ubuntu-weather-app/obsolete.trunk

Proposed by Riccardo Padovani
Status: Merged
Approved by: Martin Borho
Approved revision: 62
Merged at revision: 62
Proposed branch: lp:~rpadovani/ubuntu-weather-app/1200600
Merge into: lp:ubuntu-weather-app/obsolete.trunk
Diff against target: 33 lines (+12/-0)
1 file modified
components/AddLocationPage.qml (+12/-0)
To merge this branch: bzr merge lp:~rpadovani/ubuntu-weather-app/1200600
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Nekhelesh Ramananthan (community) Approve
Martin Borho Approve
Review via email: mp+174405@code.launchpad.net

Commit message

Added "No city" in city list when no city is found.
See #1200600

Description of the change

Added "No city" in city list when no city is found.
See #1200600

To post a comment you must log in.
Revision history for this message
Martin Borho (martin-borho) wrote :

Thanks for the fix, that was fast!

But one request:

By using only "if (citiesModel.count < 1) {" in the onMessage handler instead of "if (!number) {", you could remove the "number" var. Leads to less code.

Cheers
Martin

review: Needs Fixing
61. By Riccardo Padovani

lightened the control for no city message

Revision history for this message
Riccardo Padovani (rpadovani) wrote :

Good point, done :)

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

@Martin, Riccardo: I do not it is necessary to provide a width to the Label? Also I was told wherever possible try using anchors instead of hard coding width or height.

review: Needs Fixing
Revision history for this message
Martin Borho (martin-borho) wrote :

@Nekhelesh, Riccardo: I guess the design of the label is likely to be changed anyways when the visual design is ready. So for me it's ok for the moment.

But Riccardo can change it, if he wants to?

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

@Martin: Yes the design might change in the future, however my point was that you do not need to specify the width of the label. Since Riccardo has specified the anchors in the page, that alone is sufficient.

Label {
 text: "Sometext"
 anchors.centerin: parent
}

This code alone would do it.

review: Needs Fixing
Revision history for this message
Martin Borho (martin-borho) wrote :

@Nekhelesh: ah, got you! your're right of course.

62. By Riccardo Padovani

Delete width of label

Revision history for this message
Riccardo Padovani (rpadovani) wrote :

Ok, done it.
Sorry for the error, but I have not figured everything yet.

Revision history for this message
Martin Borho (martin-borho) wrote :

Fine, thanks Riccardo!

review: Approve
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

lgtm now. Ready for merge.

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'components/AddLocationPage.qml'
--- components/AddLocationPage.qml 2013-07-03 19:39:29 +0000
+++ components/AddLocationPage.qml 2013-07-13 13:37:26 +0000
@@ -28,10 +28,15 @@
28 listView.visible = true28 listView.visible = true
29 messageObject.result.locations.forEach(function(loc) {29 messageObject.result.locations.forEach(function(loc) {
30 citiesModel.append(loc);30 citiesModel.append(loc);
31 noCityError.visible = false
31 });32 });
32 } else {33 } else {
33 console.log(messageObject.error.msg+" / "+messageObject.error.request.url)34 console.log(messageObject.error.msg+" / "+messageObject.error.request.url)
34 }35 }
36 if (!citiesModel.count) {
37 noCityError.visible = true
38 noCityError.text = i18n.tr("No location was found for ") + locationString.text
39 }
35 }40 }
36 }41 }
3742
@@ -74,6 +79,13 @@
74 width: parent.width79 width: parent.width
75 height: units.gu(52)80 height: units.gu(52)
76 color: "transparent"81 color: "transparent"
82 Label {
83 id: noCityError
84 visible: false
85 anchors.centerIn: parent;
86 font.pixelSize: 18
87 }
88
77 ListView {89 ListView {
78 id: listView;90 id: listView;
79 objectName: "SearchResultList"91 objectName: "SearchResultList"

Subscribers

People subscribed via source and target branches