~ci-train-bot/ubuntu-system-settings/ubuntu-system-settings-ubuntu-vivid-2451

« back to all changes in this revision

Viewing changes to plugins/orientation-lock/EntryComponent.qml

  • Committer: Bileto Bot
  • Author(s): Jonas G. Drange, Ken VanDine
  • Date: 2016-12-07 15:16:59 UTC
  • mfrom: (1728.1.9 main_list_view)
  • Revision ID: ci-train-bot@canonical.com-20161207151659-1geuqsfkt82mth1m
* Replaces the grid with a list
* Replaces MainWindow search with PageHeader search
* Adds testing of new PageHeader search (and mocks PluginManager. This is a bit hacky, since SystemSettings implicitly provides PluginManager in main.cpp)

Approved by: Jonas G. Drange, Ken VanDine

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
import GSettings 1.0
22
22
import QtQuick 2.4
23
 
import QtQuick.Window 2.1
 
23
import SystemSettings.ListItems 1.0 as SettingsListItems
24
24
import Ubuntu.Components 1.3
25
25
 
26
 
 
27
 
ListItem {
28
 
    id: root
29
 
    height: layout.height
30
 
 
31
 
    ListItemLayout {
32
 
        id: layout
33
 
        title.text: i18n.tr(model.displayName)
34
 
        Switch {
35
 
            id: control
36
 
            objectName: "orientationLockSwitch"
37
 
 
38
 
            SlotsLayout.position: SlotsLayout.Trailing
39
 
            property bool serverChecked: systemSettings.rotationLock
40
 
            onServerCheckedChanged: checked = serverChecked
41
 
            Component.onCompleted: checked = serverChecked
42
 
            onTriggered: systemSettings.rotationLock = checked
43
 
 
44
 
            GSettings {
45
 
                id: systemSettings
46
 
                schema.id: "com.ubuntu.touch.system"
47
 
            }
48
 
        }
49
 
        Icon {
50
 
            SlotsLayout.position: SlotsLayout.Leading;
51
 
            SlotsLayout.padding { top: 0; bottom: 0 }
52
 
            source: model.icon
53
 
            height: units.gu(5)
 
26
SettingsListItems.Icon {
 
27
    text: i18n.tr(model.displayName)
 
28
    iconSource: model.icon
 
29
 
 
30
    Switch {
 
31
        id: control
 
32
        objectName: "orientationLockSwitch"
 
33
 
 
34
        SlotsLayout.position: SlotsLayout.Trailing
 
35
        property bool serverChecked: systemSettings.rotationLock
 
36
        onServerCheckedChanged: checked = serverChecked
 
37
        Component.onCompleted: checked = serverChecked
 
38
        onTriggered: systemSettings.rotationLock = checked
 
39
 
 
40
        GSettings {
 
41
            id: systemSettings
 
42
            schema.id: "com.ubuntu.touch.system"
54
43
        }
55
44
    }
56
45
}