summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Klapetek <[email protected]>2015-09-09 16:10:16 -0400
committerMartin Klapetek <[email protected]>2015-09-09 16:10:16 -0400
commit24e26440dc908b2672ca4d308910853d3eac13d5 (patch)
tree5cab2835e0a336ad3ea9b644a1342c9cee200b58
parent556c76ff9df959f96fde75b4ef709c739ae6ec76 (diff)
[owncloud] Use StackView instead of simple Loader
-rw-r--r--src/owncloud/package/contents/ui/main.qml41
1 files changed, 24 insertions, 17 deletions
diff --git a/src/owncloud/package/contents/ui/main.qml b/src/owncloud/package/contents/ui/main.qml
index 4fec1db..649b052 100644
--- a/src/owncloud/package/contents/ui/main.qml
+++ b/src/owncloud/package/contents/ui/main.qml
@@ -38,10 +38,24 @@ ApplicationWindow {
text: i18n("Add new ownCloud account")
}
- Loader {
- id: loader
+ StackView {
+ id: stack
+
Layout.fillHeight: true
Layout.fillWidth: true
+
+ initialItem: BasicInfo {
+ id: basicInfoPage
+ objectName: "basicInfoPage"
+ }
+ }
+
+ Component {
+ id: servicesComponent
+
+ Services {
+ objectName: "servicesPage"
+ }
}
RowLayout {
@@ -49,12 +63,11 @@ ApplicationWindow {
id: backButton
Layout.fillWidth: true
text: i18n("Back");
- enabled: false
+ enabled: stack.currentItem.objectName == "servicesPage"
onClicked: {
- if (loader.source == Qt.resolvedUrl("Services.qml")) {
- loader.source = "BasicInfo.qml";
- backButton.enabled = false;
+ if (stack.currentItem.objectName == "servicesPage") {
+ stack.pop(servicesComponent);
}
}
}
@@ -63,13 +76,12 @@ ApplicationWindow {
id: nextButton
Layout.fillWidth: true
text: i18n("Next")
- enabled: loader.item ? loader.item.canContinue : false
- visible: loader.source == Qt.resolvedUrl("BasicInfo.qml")
+ enabled: basicInfoPage.canContinue //: false
+ visible: stack.currentItem == basicInfoPage
onClicked: {
- if (loader.source == Qt.resolvedUrl("BasicInfo.qml")) {
- loader.source = "Services.qml";
- backButton.enabled = true;
+ if (stack.currentItem == basicInfoPage) {
+ stack.push(servicesComponent);
}
}
}
@@ -78,7 +90,7 @@ ApplicationWindow {
id: finishButton
Layout.fillWidth: true
text: i18n("Finish")
- visible: loader.source == Qt.resolvedUrl("Services.qml")
+ visible: stack.currentItem.objectName == "servicesPage"
onClicked: {
helper.finish(loader.item.contactsEnabled ? "" : "contacts");
@@ -86,9 +98,4 @@ ApplicationWindow {
}
}
}
-
- Component.onCompleted: {
- loader.source = "BasicInfo.qml"
- nextButton.enabled = true;
- }
}