~ci-train-bot/ubuntu-settings-components/ubuntu-settings-components-ubuntu-zesty-2329

« back to all changes in this revision

Viewing changes to plugins/Ubuntu/Settings/Vpn/VpnRoutesField.qml

  • Committer: Bileto Bot
  • Date: 2016-06-27 18:12:21 UTC
  • Revision ID: ci-train-bot@canonical.com-20160627181221-ro7l1wbboxm6h1i2
Tags: 0.8+16.10.20160627.2-0ubuntu1
Releasing 0.8+16.10.20160627.2-0ubuntu1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2016 Canonical Ltd.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it
 
5
 * under the terms of the GNU Lesser General Public License version 3,
 
6
 * as published by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU Lesser General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU Lesser General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 */
 
16
 
 
17
import QtQuick 2.4
 
18
import QtQuick.Layouts 1.1
 
19
import Ubuntu.Components 1.3
 
20
import Ubuntu.Components.ListItems 1.3 as ListItems
 
21
 
 
22
Column {
 
23
    id: routes
 
24
    spacing: units.gu(1)
 
25
 
 
26
    property alias neverDefault: ownNetworksToggle.checked
 
27
    property bool enabled: true
 
28
 
 
29
    Label {
 
30
        text: i18n.dtr("ubuntu-settings-components", "Use this VPN for:")
 
31
        font.bold: true
 
32
        color: theme.palette.normal.baseText
 
33
        elide: Text.ElideRight
 
34
    }
 
35
 
 
36
    Column {
 
37
        anchors { left: parent.left; right: parent.right }
 
38
        spacing: units.gu(1)
 
39
 
 
40
        ListItems.ThinDivider {}
 
41
 
 
42
        RowLayout {
 
43
            anchors { left: parent.left; right: parent.right }
 
44
 
 
45
            CheckBox {
 
46
                id: allNetworksToggle
 
47
                objectName: "vpnAllNetworksToggle"
 
48
                checked: !ownNetworksToggle.checked
 
49
                onTriggered: {
 
50
                    ownNetworksToggle.checked = !checked;
 
51
                    checked = Qt.binding(function () {
 
52
                        return !ownNetworksToggle.checked
 
53
                    });
 
54
                }
 
55
                enabled: routes.enabled
 
56
                activeFocusOnPress: false
 
57
            }
 
58
 
 
59
            Label {
 
60
                text: i18n.dtr("ubuntu-settings-components", "All network connections")
 
61
                Layout.fillWidth: true
 
62
            }
 
63
        }
 
64
 
 
65
        RowLayout {
 
66
            anchors { left: parent.left; right: parent.right }
 
67
 
 
68
            CheckBox {
 
69
                id: ownNetworksToggle
 
70
                objectName: "vpnOwnNetworksToggle"
 
71
                enabled: routes.enabled
 
72
                activeFocusOnPress: false
 
73
            }
 
74
 
 
75
            Label {
 
76
                text: i18n.dtr("ubuntu-settings-components", "Its own network")
 
77
                Layout.fillWidth: true
 
78
            }
 
79
        }
 
80
 
 
81
        ListItems.ThinDivider {}
 
82
    }
 
83
}