Socialify

Folder ..

Viewing Panel.qml
118 lines (94 loc) • 2.8 KB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import QtQuick 2.2
import QtQuick.Layouts 1.3
import QtQuick.Controls 1.4

import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.plasma.components 2.0 as PlasmaComponents

import org.kde.kquickcontrolsaddons 2.0

import org.kde.plasma.networkmanagement 0.2 as PlasmaNM


FocusScope {

    PlasmaNM.AvailableDevices {
        id: availableDevices
    }

    PlasmaNM.NetworkModel {
        id: connectionModel
    }

    PlasmaNM.AppletProxyModel {
        id: appletProxyModel

        sourceModel: connectionModel
    }

    Toolbar {
        id: toolbar

        anchors {
            left: parent.left
            right: parent.right
            top: parent.top
        }
    }

    PlasmaExtras.ScrollArea {
        id: scrollView

        anchors {
            bottom: actions.top
            left: parent.left
            right: parent.right
            top: toolbar.bottom
        }

        ListView {
            id: connectionView

            property bool availableConnectionsVisible: false
            property int currentVisibleButtonIndex: -1

            anchors.fill: parent
            clip: true
            model: appletProxyModel
            currentIndex: -1
            boundsBehavior: Flickable.StopAtBounds
            section.property: showSections ? "Section" : ""
            section.delegate: Header { text: section }
            delegate: ConnectionItem { }
        }
    }

    GridLayout {
        id: actions
        columns: 2
        anchors {
            left: parent.left
            right: parent.right
            bottom: parent.bottom
        }

        PlasmaComponents.ToolButton {
            iconSource: "preferences-system-network"
            tooltip: i18n("Configure system proxy...")

            text: i18n("Proxy")
            onClicked: {
                KCMShell.open(["proxy"])
            }
        }
        PlasmaComponents.ToolButton {
            iconSource: "emblem-shared-symbolic"
            tooltip: i18n("Configure shared resources...")

            text: i18n("Shared resources")
            onClicked: {
                KCMShell.open(["smb"])
            }
        }

        PlasmaComponents.ToolButton {
            iconSource: "preferences-web-browser-ssl"
            tooltip: i18n("Configure ssl certificates...")

            text: i18n("SSL Certificates")
            onClicked: {
                KCMShell.open(["kcm_ssl"])
            }
        }
        PlasmaComponents.ToolButton {
            iconSource: "network-card"
            tooltip: i18n("View network interfaces...")

            text: i18n("Network Interfaces")
            onClicked: {
                KCMShell.open(["nic"])
            }
        }
    }

    Connections {
        target: plasmoid
        onExpandedChanged: connectionView.currentVisibleButtonIndex = -1
    }
}