summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaroline Chao <caroline.chao@digia.com>2014-05-24 08:40:21 +0200
committerCaroline Chao <caroline.chao@digia.com>2014-05-23 08:57:40 +0200
commitcaddee314e9ad4f838987ed5fe62d4a36302605e (patch)
treea4db5fc0d2ecbd3f0cea11b018fd4dfd6797553a
parent37b2f3d29d921626b5ab4586b8f6c4df4bda15ec (diff)
Simplify the "isLocked" logic for the pages
Use a binding instead. Change-Id: If302c9a5fa7f4b37d1be1fbbbf4771e327d2c26f Reviewed-by: Andrew Knight <andrew.knight@digia.com>
-rw-r--r--qml/main.qml3
-rw-r--r--qml/pages/BasicPage.qml2
-rw-r--r--qml/pages/CitiesPage.qml1
-rw-r--r--qml/pages/LongTermPage.qml5
-rw-r--r--qml/pages/OneDayPage.qml3
5 files changed, 1 insertions, 13 deletions
diff --git a/qml/main.qml b/qml/main.qml
index 33b8245..ceb87ff 100644
--- a/qml/main.qml
+++ b/qml/main.qml
@@ -54,7 +54,6 @@ ApplicationWindow {
property Component citiesPage: CitiesPage {
onUpdateStatusBar: statusBarMessage = message
onNextPage: if (!isLocked) {
- isLocked = true
pageView.push(longTermPage)
clearSearchBox()
}
@@ -62,7 +61,6 @@ ApplicationWindow {
property Component longTermPage: LongTermPage {
onUpdateStatusBar: statusBarMessage = message
onNextPage: if (!isLocked) {
- isLocked = true
pageView.push(oneDayPage)
}
onPreviousPage: {
@@ -73,7 +71,6 @@ ApplicationWindow {
property Component oneDayPage: OneDayPage {
onUpdateStatusBar: statusBarMessage = message
onPreviousPage: if (!isLocked) {
- isLocked = true
pageView.pop()
}
}
diff --git a/qml/pages/BasicPage.qml b/qml/pages/BasicPage.qml
index f2563e0..dc62239 100644
--- a/qml/pages/BasicPage.qml
+++ b/qml/pages/BasicPage.qml
@@ -52,7 +52,7 @@ Item {
signal clearSearchBox
property Component pageComponent
- property bool isLocked: true
+ property bool isLocked: Stack.status !== Stack.Active
property string title1
property string title2
property string title3
diff --git a/qml/pages/CitiesPage.qml b/qml/pages/CitiesPage.qml
index b3edd01..b2c7dfd 100644
--- a/qml/pages/CitiesPage.qml
+++ b/qml/pages/CitiesPage.qml
@@ -140,7 +140,6 @@ BasicPage {
}
Stack.onStatusChanged: {
- isLocked = !(Stack.status === Stack.Active)
if (Stack.status === Stack.Activating)
updateStatusBar("")
}
diff --git a/qml/pages/LongTermPage.qml b/qml/pages/LongTermPage.qml
index 490543d..54fa12c 100644
--- a/qml/pages/LongTermPage.qml
+++ b/qml/pages/LongTermPage.qml
@@ -53,8 +53,6 @@ BasicPage {
onCityLoadedChanged: updateStatusBar(ApplicationInfo.currentCityModel.copyright + " <a href=" + ApplicationInfo.currentCityModel.sourceXml + "\>(source)")
- isLocked: true
-
pageComponent: Item {
TouchScrollView {
id: scrollview
@@ -147,7 +145,6 @@ BasicPage {
target: ApplicationInfo.currentCityModel
onError: {
cityLoaded = false
- isLocked = false
previousPage()
updateStatusBar(errorMessage)
}
@@ -157,13 +154,11 @@ BasicPage {
WeatherModel {
id: weathermodel
onShowLongTerm: {
- isLocked = false
cityLoaded = true
}
onError: {
cityLoaded = false
lastLoadedCity = ""
- isLocked = false
previousPage()
updateStatusBar(qsTr("Problem loading the data: ") + errorMessage)
}
diff --git a/qml/pages/OneDayPage.qml b/qml/pages/OneDayPage.qml
index 2908bd7..ee19b12 100644
--- a/qml/pages/OneDayPage.qml
+++ b/qml/pages/OneDayPage.qml
@@ -93,7 +93,4 @@ BasicPage {
Layout.fillWidth: true
}
}
-
- Stack.onStatusChanged: isLocked = !(Stack.status === Stack.Active)
-
}