~system-settings-touch/ubuntu-system-settings/15.04

« back to all changes in this revision

Viewing changes to plugins/wifi/NetworkDetails.qml

merged trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 
38
38
    title: i18n.tr("Network details")
39
39
 
40
 
    Column {
41
 
 
 
40
    Flickable {
42
41
        anchors.fill: parent
43
 
 
44
 
        ListItem.Standard {
45
 
            text: i18n.tr("Name")
46
 
            control: Label {
47
 
                text: networkName
48
 
            }
49
 
        }
50
 
 
51
 
        ListItem.Standard {
52
 
            id: lastLabel
53
 
            text: i18n.tr("Last connected")
54
 
            control: Label {
55
 
                id: lastField
56
 
 
57
 
                text: networkDetails.lastUsed.length !== 0 ?
58
 
                    networkDetails.lastUsed : i18n.tr("Never")
59
 
            }
60
 
        }
61
 
 
62
 
        ListItem.Standard {
63
 
            id: passwordLabel
64
 
            text: i18n.tr("Password")
65
 
            visible: networkDetails.password.length !== 0
66
 
            control: TextInput {
67
 
                id: passwordField
68
 
                readOnly: true
69
 
                text: networkDetails.password
70
 
                echoMode: passwordVisibleSwitch.checked ?
71
 
                    TextInput.Normal : TextInput.Password
72
 
            }
73
 
        }
74
 
 
75
 
        ListItem.Standard {
76
 
            id: passwordVisible
77
 
            text: i18n.tr("Show password")
78
 
            visible: networkDetails.password.length !== 0
79
 
            control: Switch {
80
 
                id: passwordVisibleSwitch
81
 
            }
82
 
        }
83
 
 
84
 
        ListItem.Divider {}
85
 
 
86
 
        Button {
87
 
            objectName: "forgetNetwork"
88
 
            text : i18n.tr("Forget this network")
89
 
            anchors {
90
 
                left: parent.left
91
 
                right: parent.right
92
 
                margins: units.gu(2)
93
 
            }
94
 
            onClicked : {
95
 
                DbusHelper.forgetConnection(dbusPath);
96
 
                pageStack.pop();
 
42
        contentHeight: contentItem.childrenRect.height
 
43
        boundsBehavior: (contentHeight > networkDetails.height) ?
 
44
                            Flickable.DragAndOvershootBounds :
 
45
                            Flickable.StopAtBounds
 
46
        /* Set the direction to workaround
 
47
           https://bugreports.qt-project.org/browse/QTBUG-31905 otherwise the UI
 
48
           might end up in a situation where scrolling doesn't work */
 
49
        flickableDirection: Flickable.VerticalFlick
 
50
 
 
51
        Column {
 
52
 
 
53
            anchors.left: parent.left
 
54
            anchors.right: parent.right
 
55
 
 
56
            ListItem.Standard {
 
57
                text: i18n.tr("Name")
 
58
                control: Label {
 
59
                    text: networkName
 
60
                }
 
61
            }
 
62
 
 
63
            ListItem.Standard {
 
64
                id: lastLabel
 
65
                text: i18n.tr("Last connected")
 
66
                control: Label {
 
67
                    id: lastField
 
68
 
 
69
                    text: networkDetails.lastUsed.length !== 0 ?
 
70
                        networkDetails.lastUsed : i18n.tr("Never")
 
71
                }
 
72
            }
 
73
 
 
74
            ListItem.Standard {
 
75
                id: passwordLabel
 
76
                text: i18n.tr("Password")
 
77
                visible: networkDetails.password.length !== 0
 
78
                control: TextInput {
 
79
                    id: passwordField
 
80
                    readOnly: true
 
81
                    text: networkDetails.password
 
82
                    echoMode: passwordVisibleSwitch.checked ?
 
83
                        TextInput.Normal : TextInput.Password
 
84
                }
 
85
            }
 
86
 
 
87
            ListItem.Standard {
 
88
                id: passwordVisible
 
89
                text: i18n.tr("Show password")
 
90
                visible: networkDetails.password.length !== 0
 
91
                control: Switch {
 
92
                    id: passwordVisibleSwitch
 
93
                }
 
94
            }
 
95
 
 
96
            ListItem.Divider {}
 
97
 
 
98
            Button {
 
99
                objectName: "forgetNetwork"
 
100
                text : i18n.tr("Forget this network")
 
101
                anchors {
 
102
                    left: parent.left
 
103
                    right: parent.right
 
104
                    margins: units.gu(2)
 
105
                }
 
106
                onClicked : {
 
107
                    DbusHelper.forgetConnection(dbusPath);
 
108
                    pageStack.pop();
 
109
                }
97
110
            }
98
111
        }
99
112
    }