~dandrader/unity8/miral

« back to all changes in this revision

Viewing changes to qml/Wizard/Pages.qml

  • Committer: CI Train Bot
  • Author(s): Michael Terry
  • Date: 2014-12-04 20:54:58 UTC
  • mfrom: (1432.4.12 wizard-tests)
  • Revision ID: ci-train-bot@canonical.com-20141204205458-14m4o0s8p9lex8ln
Add tests for welcome wizard. 
Approved by: Andrea Cimitan

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
Item {
24
24
    id: root
 
25
    objectName: "wizardPages"
25
26
    focus: true
26
27
 
27
28
    // The background wallpaper to use
36
37
 
37
38
    UbuntuSecurityPrivacyPanel {
38
39
        id: securityPrivacy
 
40
        objectName: "securityPrivacy"
39
41
    }
40
42
 
41
43
    function quitWizard() {
69
71
        visible: status === Image.Ready
70
72
    }
71
73
 
 
74
    PageList {
 
75
        id: pageList
 
76
    }
 
77
 
72
78
    PageStack {
73
79
        id: pageStack
 
80
        objectName: "pageStack"
74
81
        anchors.fill: parent
75
82
 
76
83
        function next() {
77
84
            // If we've opened any extra (non-main) pages, pop them before
78
85
            // continuing so back button returns to the previous main page.
79
 
            while (PageList.index < pageStack.depth - 1)
 
86
            while (pageList.index < pageStack.depth - 1)
80
87
                pop()
81
 
            load(PageList.next())
 
88
            load(pageList.next())
82
89
        }
83
90
 
84
91
        function prev() {
85
 
            if (PageList.index >= pageStack.depth - 1)
86
 
                PageList.prev() // update PageList.index, but not for extra pages
 
92
            if (pageList.index >= pageStack.depth - 1)
 
93
                pageList.prev() // update pageList.index, but not for extra pages
87
94
            pop()
88
95
            if (!currentPage || currentPage.opacity === 0) { // undo skipped pages
89
96
                prev()