~michael-sheldon/ubuntu-system-settings/fix-wallpaper-preview

« back to all changes in this revision

Viewing changes to plugins/language/PageComponent.qml

  • Committer: Bileto Bot
  • Author(s): Jonas G. Drange
  • Date: 2017-01-12 12:48:46 UTC
  • mfrom: (1741.1.28 apl)
  • Revision ID: ci-train-bot@canonical.com-20170112124846-0rsokgs0jy7j9rqv
migrates uss to apl

Approved by: Ken VanDine, system-apps-ci-bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
    objectName: "languagePage"
35
35
 
36
36
    title: i18n.tr("Language & Text")
 
37
    flickable: scrollWidget
37
38
 
38
39
    InputDeviceManager {
39
40
        id: keyboardsModel
42
43
 
43
44
    property bool externalKeyboardPresent: keyboardsModel.count > 0
44
45
 
45
 
    property var pluginOptions
46
 
    Connections {
47
 
        target: pageStack
48
 
        onCurrentPageChanged: {
49
 
            // If we are called with subpage=foo, push foo on the stack.
50
 
            //
51
 
            // We need to wait until the PageComponent has been pushed to the stack
52
 
            // before pushing the subpages, otherwise they will be pushed below the
53
 
            // PageComponent.
54
 
            if (pageStack.currentPage === root) {
55
 
                if (pluginOptions && pluginOptions['subpage']) {
56
 
                    switch (pluginOptions['subpage']) {
57
 
                    case 'hw-keyboard-layouts':
58
 
                        pageStack.push(Qt.resolvedUrl("KeyboardLayouts.qml"), {
59
 
                                           plugin: hwKeyboardPlugin,
60
 
                                           currentLayoutsDraggable: true
61
 
                                       })
62
 
                        break;
63
 
                    }
64
 
                }
65
 
 
66
 
                // Once done, disable this Connections, so that if the user navigates
67
 
                // back to the root we won't push the subpages again
68
 
                target = null
 
46
    onPushedOntoStack: {
 
47
        if (pluginOptions && pluginOptions['subpage']) {
 
48
            switch (pluginOptions['subpage']) {
 
49
            case 'hw-keyboard-layouts':
 
50
                pageStack.addPageToNextColumn(
 
51
                    root, Qt.resolvedUrl('KeyboardLayouts.qml'), {
 
52
                    plugin: hwKeyboardPlugin,
 
53
                    currentLayoutsDraggable: true
 
54
                });
 
55
                break;
69
56
            }
70
57
        }
71
58
    }
122
109
    }
123
110
 
124
111
    Flickable {
 
112
        id: scrollWidget
125
113
        anchors.fill: parent
126
114
        contentHeight: contentItem.childrenRect.height
127
115
        boundsBehavior: contentHeight > root.height ?
159
147
                value: oskPlugin.keyboardLayoutsModel.subset.length == 1 ?
160
148
                       oskPlugin.keyboardLayoutsModel.superset[oskPlugin.keyboardLayoutsModel.subset[0]][0] :
161
149
                       oskPlugin.keyboardLayoutsModel.subset.length
162
 
                onClicked: pageStack.push(Qt.resolvedUrl("KeyboardLayouts.qml"), {
 
150
                onClicked: pageStack.addPageToNextColumn(root, Qt.resolvedUrl("KeyboardLayouts.qml"), {
163
151
                    plugin: oskPlugin
164
152
                })
165
153
            }
168
156
                text: i18n.tr("External keyboard")
169
157
                progression: true
170
158
                showDivider: false
171
 
                onClicked: pageStack.push(Qt.resolvedUrl("PageHardwareKeyboard.qml"))
 
159
                onClicked: pageStack.addPageToNextColumn(root, Qt.resolvedUrl("PageHardwareKeyboard.qml"))
172
160
                visible: externalKeyboardPresent || showAllUI
173
161
            }
174
162
 
183
171
                       plugin.spellCheckingModel.subset.length
184
172
                progression: true
185
173
 
186
 
                onClicked: pageStack.push(spellChecking)
 
174
                onClicked: pageStack.addPageToNextColumn(root, spellChecking)
187
175
            }
188
176
 
189
177
            ListItem.Standard {