Merge lp:~rpadovani/stock-ticker-mobile-app/error-dialog into lp:stock-ticker-mobile-app

Proposed by Riccardo Padovani
Status: Merged
Approved by: Robert Steckroth
Approved revision: 36
Merged at revision: 36
Proposed branch: lp:~rpadovani/stock-ticker-mobile-app/error-dialog
Merge into: lp:stock-ticker-mobile-app
Diff against target: 83 lines (+31/-8)
1 file modified
Stock_Ticker.qml (+31/-8)
To merge this branch: bzr merge lp:~rpadovani/stock-ticker-mobile-app/error-dialog
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Robert Steckroth Approve
Review via email: mp+173977@code.launchpad.net

Commit message

For now if there is an error loading resources remains endlessly turning circle, which can be frustrating for a user.
I implemented a primitive error message.

Description of the change

For now if there is an error loading resources remains endlessly turning circle, which can be frustrating for a user.
I implemented a primitive error message.

To post a comment you must log in.
Revision history for this message
Robert Steckroth (robertsteckroth) wrote :

Error popup will always display due to the "Operation canceled" error mesage that happens at listview load time.

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
1=== modified file 'Stock_Ticker.qml'
2--- Stock_Ticker.qml 2013-07-10 01:46:45 +0000
3+++ Stock_Ticker.qml 2013-07-10 15:50:35 +0000
4@@ -41,6 +41,7 @@
5 property string changedFormat: "%"
6 property int chart_index: 1
7 property string lastSortType: "Name"
8+ property string errorText;
9
10 property int dummyTextWidth: 0 // Holds the width of the percent sign in Stock_Component_Main
11
12@@ -353,8 +354,11 @@
13 onStatusChanged: {
14 if ( XmlListModel.Loading )
15 log("Loading newsFeed: "+source)
16- if ( XmlListModel.Error && errorString() )
17- log("Error loading "+source+" : "+errorString())
18+ if ( XmlListModel.Error && errorString()) {
19+ errorText = i18n.tr("Error loading ") +source+" : "+i18n.tr("check your connection and your firewall settings.")
20+ errorPopupDialog.show();
21+ console.log("Error loading "+source+" : "+errorString())
22+ }
23 if ( status === XmlListModel.Ready )
24 for ( var y = 0; y < count; y++ )
25 newsFeedList.set(y, {"title": get(y).title, "description": get(y).description, "link": get(y).link })
26@@ -391,8 +395,11 @@
27 onStatusChanged: { // Rember, the component methods that start with "on" do not evealuate external program signals
28 if ( XmlListModel.Loading )
29 log("Loading currentStocks: "+source)
30- if ( XmlListModel.Error && errorString() )
31- log("Error loading "+source+" : "+errorString())
32+ if ( XmlListModel.Error && errorString() ) {
33+ errorText = i18n.tr("Error loading ") +source+" : "+i18n.tr("check your connection and your firewall settings.")
34+ errorPopupDialog.show();
35+ console.log("Error loading "+source+" : "+errorString())
36+ }
37 if ( status === XmlListModel.Ready ) {
38 Storage.setSetting("currentStocks_source", source)
39 manageCurrentModel() // Populate the models with this cool function
40@@ -443,8 +450,11 @@
41 onStatusChanged: { // Rember, the component methods that start with "on" do not evealuate external program signals
42 if ( XmlListModel.Loading )
43 log("Loading stksearchresults: "+source)
44- if ( XmlListModel.Error && errorString() )
45- log("Error loading "+source+" : "+errorString())
46+ if ( XmlListModel.Error && errorString() ) {
47+ errorText = i18n.tr("Error loading ") +source+" : "+i18n.tr("check your connection and your firewall settings.")
48+ errorPopupDialog.show();
49+ console.log("Error loading "+source+" : "+errorString())
50+ }
51 if ( status === XmlListModel.Ready ) {
52 Storage.setSetting("stksearchresults_source", source)
53 manageSearchModel()
54@@ -473,8 +483,11 @@
55 onStatusChanged: { // Rember, the component methods that start with "on" do not evealuate external program signals
56 if ( XmlListModel.Loading )
57 log("Loading currentStocksChart: "+source)
58- if ( XmlListModel.Error && errorString() )
59- log("Error loading "+source+" : "+errorString())
60+ if ( XmlListModel.Error && errorString() ) {
61+ errorText = i18n.tr("Error loading ") +source+" : "+i18n.tr("check your connection and your firewall settings.")
62+ errorPopupDialog.show();
63+ console.log("Error loading "+source+" : "+errorString())
64+ }
65 if ( status === XmlListModel.Ready )
66 chartsPage.repaintCanvas()
67 }
68@@ -617,5 +630,15 @@
69 }
70 }
71 }
72+
73+ Dialog {
74+ id: errorPopupDialog
75+ title: i18n.tr("Error")
76+ text: errorText
77+ Button {
78+ text: i18n.tr("Ok")
79+ onClicked: PopupUtils.close(errorPopupDialog)
80+ }
81+ }
82 }
83 }

Subscribers

People subscribed via source and target branches