~ken-vandine/ubuntu-system-settings/no_s_i_d

« back to all changes in this revision

Viewing changes to plugins/bluetooth/DevicePage.qml

  • Committer: Bileto Bot
  • Author(s): Ken VanDine
  • Date: 2016-07-22 14:38:13 UTC
  • mfrom: (1556.3.32 slotsLayout)
  • Revision ID: ci-train-bot@canonical.com-20160722143813-ht9e4766lm0ie5fa
Ported to use Slots layout and updated visuals (LP: #1596529)

Approved by: Jonas G. Drange

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * This file is part of ubuntu-system-settings
3
3
 *
4
 
 * Copyright (C) 2013-2015 Canonical Ltd.
 
4
 * Copyright (C) 2013-2016 Canonical Ltd.
5
5
 *
6
6
 * Contact: Charles Kerr <charles.kerr@canonical.com>
7
7
 *
21
21
import QMenuModel 0.1
22
22
import QtQuick 2.0
23
23
import SystemSettings 1.0
 
24
import SystemSettings.ListItems 1.0 as SettingsListItems
24
25
import Ubuntu.Components 1.3
25
26
import Ubuntu.Components.Popups 1.3
26
 
import Ubuntu.Components.ListItems 1.3 as ListItem
27
27
import Ubuntu.SystemSettings.Bluetooth 1.0
28
28
 
29
29
Page {
97
97
                right: parent.right
98
98
            }
99
99
 
100
 
            ListItem.SingleValue {
 
100
            SettingsListItems.SingleValue {
101
101
                text: i18n.tr("Name")
102
102
                value: backend.selectedDevice &&
103
103
                       backend.selectedDevice.name.length > 0 ?
104
104
                             backend.selectedDevice.name :
105
105
                             i18n.tr("None")
106
106
            }
107
 
            ListItem.Standard {
108
 
                Rectangle {
109
 
                    color: "transparent"
110
 
                    anchors.fill: parent
111
 
                    anchors.topMargin: units.gu(1)
112
 
                    anchors.leftMargin: units.gu(2)
113
 
                    anchors.rightMargin: units.gu(2)
114
 
 
115
 
                    Label {
116
 
                        anchors {
117
 
                            top: parent.top
118
 
                            left: parent.left
119
 
                            topMargin: units.gu(1)
120
 
                        }
121
 
                        height: units.gu(3)
122
 
                        text: i18n.tr("Type")
123
 
                    }
124
 
                    Image {
125
 
                        anchors {
126
 
                            right: deviceType.left
127
 
                            rightMargin: units.gu(1)
128
 
                        }
129
 
                        height: units.gu(4)
130
 
                        width: units.gu(4)
131
 
                        source: backend.selectedDevice ? backend.selectedDevice.iconName : ""
132
 
                    }
133
 
                    Label {
134
 
                        id: deviceType
135
 
                        anchors {
136
 
                            top: parent.top
137
 
                            right: parent.right
138
 
                            topMargin: units.gu(1)
139
 
                        }
140
 
                        height: units.gu(3)
141
 
                        text: getTypeString(backend.selectedDevice ? backend.selectedDevice.type : Device.OTHER)
142
 
                    }
 
107
            SettingsListItems.SingleValue {
 
108
                text: i18n.tr("Type")
 
109
                value: getTypeString(backend.selectedDevice ? backend.selectedDevice.type : Device.OTHER)
 
110
                Image {
 
111
                    height: units.gu(4)
 
112
                    width: units.gu(4)
 
113
                    source: backend.selectedDevice ? backend.selectedDevice.iconName : ""
 
114
                    visible: source
 
115
                    SlotsLayout.position: SlotsLayout.Trailing-1
143
116
                }
144
117
            }
145
 
            ListItem.SingleValue {
 
118
            SettingsListItems.SingleValue {
146
119
                text: i18n.tr("Status")
147
120
                value: getStatusString(backend.selectedDevice ? backend.selectedDevice.connection : Device.Disconnected)
148
121
            }
149
 
            ListItem.SingleValue {
 
122
            SettingsListItems.SingleValue {
150
123
                text: i18n.tr("Signal Strength")
151
124
                value: getSignalString(backend.selectedDevice ? backend.selectedDevice.strength : Device.None)
152
125
            }
153
 
            ListItem.Standard {
 
126
            SettingsListItems.Standard {
154
127
                id: trustedCheck
155
128
                text: i18n.tr("Connect automatically when detected:")
156
 
                visible: backend.selectedDevice.paired
157
 
                control: CheckBox {
 
129
                CheckBox {
158
130
                    property bool serverChecked: backend.selectedDevice ? backend.selectedDevice.trusted : false
159
131
                    onServerCheckedChanged: checked = serverChecked
160
132
                    Component.onCompleted: checked = serverChecked
165
137
                    }
166
138
                }
167
139
            }
168
 
            ListItem.SingleControl {
169
 
                control: Button {
 
140
 
 
141
            SettingsListItems.SingleControl {
 
142
                Button {
 
143
                    anchors.centerIn: parent
 
144
                    width: parent.width - units.gu(8)
170
145
                    text: backend.selectedDevice && (backend.selectedDevice.connection == Device.Connected || backend.selectedDevice.connection == Device.Connecting) ? i18n.tr("Disconnect") : i18n.tr("Connect")
171
 
                    width: parent.width - units.gu(8)
172
146
                    onClicked: {
173
147
                        if (backend.selectedDevice
174
148
                            && (backend.selectedDevice.connection == Device.Connected
185
159
                    enabled: backend.selectedDevice && backend.powered ? true : false
186
160
                }
187
161
            }
188
 
            ListItem.SingleControl {
189
 
                control: Button {
 
162
 
 
163
            SettingsListItems.SingleControl {
 
164
                Button {
 
165
                    anchors.centerIn: parent
 
166
                    width: parent.width - units.gu(8)
190
167
                    text: i18n.tr("Forget this device")
191
 
                    width: parent.width - units.gu(8)
192
168
                    onClicked: {
193
169
                        backend.removeDevice();
194
170
                        backend.resetSelectedDevice();