diff --git a/applet/contents/ui/ConnectionItem.qml b/applet/contents/ui/ConnectionItem.qml index 96060397..f450a12b 100644 --- a/applet/contents/ui/ConnectionItem.qml +++ b/applet/contents/ui/ConnectionItem.qml @@ -1,357 +1,358 @@ /* Copyright 2013-2017 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ import QtQuick 2.2 import QtQuick.Layouts 1.2 import org.kde.kcoreaddons 1.0 as KCoreAddons import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.networkmanagement 0.2 as PlasmaNM PlasmaComponents.ListItem { id: connectionItem property bool activating: ConnectionState == PlasmaNM.Enums.Activating property int baseHeight: Math.max(units.iconSizes.medium, connectionNameLabel.height + connectionStatusLabel.height) + Math.round(units.gridUnit / 2) property bool expanded: visibleDetails || visiblePasswordDialog property bool predictableWirelessPassword: !Uuid && Type == PlasmaNM.Enums.Wireless && (SecurityType == PlasmaNM.Enums.StaticWep || SecurityType == PlasmaNM.Enums.WpaPsk || SecurityType == PlasmaNM.Enums.Wpa2Psk) property bool showSpeed: ConnectionState == PlasmaNM.Enums.Activated && (Type == PlasmaNM.Enums.Wired || Type == PlasmaNM.Enums.Wireless || Type == PlasmaNM.Enums.Gsm || Type == PlasmaNM.Enums.Cdma) property bool visibleDetails: false property bool visiblePasswordDialog: false checked: connectionItem.containsMouse enabled: true height: expanded ? baseHeight + separator.height + expandableComponentLoader.height + (2 * Math.round(units.gridUnit / 3)) : baseHeight PlasmaCore.DataSource { id: dataSource property string downloadSource: "network/interfaces/" + DeviceName + "/receiver/data" property string uploadSource: "network/interfaces/" + DeviceName + "/transmitter/data" connectedSources: showSpeed && plasmoid.expanded ? [downloadSource, uploadSource] : [] engine: "systemmonitor" interval: 2000 } ColumnLayout { anchors.fill: parent RowLayout { Layout.fillWidth: true spacing: Math.round(units.gridUnit / 2) PlasmaCore.SvgItem { id: connectionSvgIcon Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft elementId: ConnectionIcon - height: units.iconSizes.medium; width: height + height: Layout.preferredHeight + width: Layout.preferredWidth svg: PlasmaCore.Svg { multipleImages: true imagePath: "icons/network" colorGroup: PlasmaCore.ColorScope.colorGroup } } ColumnLayout { Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft spacing: 0 PlasmaComponents.Label { id: connectionNameLabel Layout.fillWidth: true height: paintedHeight elide: Text.ElideRight font.weight: ConnectionState == PlasmaNM.Enums.Activated ? Font.DemiBold : Font.Normal font.italic: ConnectionState == PlasmaNM.Enums.Activating ? true : false text: ItemUniqueName textFormat: Text.PlainText } PlasmaComponents.Label { id: connectionStatusLabel Layout.fillWidth: true height: paintedHeight elide: Text.ElideRight font.pointSize: theme.smallestFont.pointSize opacity: 0.6 text: itemText() } } PlasmaComponents.BusyIndicator { id: connectingIndicator Layout.alignment: Qt.AlignVCenter | Qt.AlignRight Layout.fillHeight: true running: plasmoid.expanded && !stateChangeButton.visible && ConnectionState == PlasmaNM.Enums.Activating visible: running opacity: visible } PlasmaComponents.Button { id: stateChangeButton Layout.alignment: Qt.AlignVCenter | Qt.AlignRight opacity: connectionView.currentVisibleButtonIndex == index ? 1 : 0 visible: opacity != 0 text: (ConnectionState == PlasmaNM.Enums.Deactivated) ? i18n("Connect") : i18n("Disconnect") Behavior on opacity { NumberAnimation { duration: units.shortDuration } } onClicked: changeState() } } PlasmaCore.SvgItem { id: separator height: lineSvg.elementSize("horizontal-line").height Layout.fillWidth: true Layout.maximumHeight: height elementId: "horizontal-line" svg: PlasmaCore.Svg { id: lineSvg; imagePath: "widgets/line" } visible: connectionItem.expanded opacity: visible } Loader { id: expandableComponentLoader Layout.fillHeight: true Layout.fillWidth: true height: childrenRect.height } } Component { id: detailsComponent Item { height: childrenRect.height PlasmaComponents.TabBar { id: detailsTabBar anchors { left: parent.left right: parent.right top: parent.top } height: visible ? implicitHeight : 0 visible: showSpeed && dataSource.data && dataSource.data[dataSource.downloadSource] && dataSource.data[dataSource.uploadSource] PlasmaComponents.TabButton { id: speedTabButton text: i18n("Speed") } PlasmaComponents.TabButton { id: detailsTabButton text: i18n("Details") } Component.onCompleted: { if (!speedTabButton.visible) { currentTab = detailsTabButton } } } DetailsText { anchors { left: parent.left leftMargin: units.iconSizes.medium right: parent.right top: detailsTabBar.visible ? detailsTabBar.bottom : parent.top topMargin: Math.round(units.gridUnit / 3) } details: ConnectionDetails visible: detailsTabBar.currentTab == detailsTabButton } TrafficMonitor { anchors { left: parent.left right: parent.right top: detailsTabBar.visible ? detailsTabBar.bottom : parent.top topMargin: Math.round(units.gridUnit / 3) } dataEngine: dataSource deviceName: DeviceName visible: detailsTabBar.currentTab == speedTabButton } } } Component { id: passwordDialogComponent Item { property alias password: passwordField.text property alias passwordInput: passwordField height: childrenRect.height PasswordField { id: passwordField anchors { left: parent.left right: parent.right top: parent.top } securityType: SecurityType onAccepted: { stateChangeButton.clicked() } onAcceptableInputChanged: { stateChangeButton.enabled = acceptableInput } Component.onCompleted: { stateChangeButton.enabled = false } Component.onDestruction: { stateChangeButton.enabled = true } } } } states: [ State { name: "collapsed" when: !(visibleDetails || visiblePasswordDialog) StateChangeScript { script: if (expandableComponentLoader.status == Loader.Ready) {expandableComponentLoader.sourceComponent = undefined} } }, State { name: "expandedDetails" when: visibleDetails StateChangeScript { script: createContent() } }, State { name: "expandedPasswordDialog" when: visiblePasswordDialog StateChangeScript { script: createContent() } PropertyChanges { target: stateChangeButton; opacity: 1 } } ] function createContent() { if (visibleDetails) { expandableComponentLoader.sourceComponent = detailsComponent } else if (visiblePasswordDialog) { expandableComponentLoader.sourceComponent = passwordDialogComponent expandableComponentLoader.item.passwordInput.forceActiveFocus() } } function changeState() { visibleDetails = false if (Uuid || !predictableWirelessPassword || visiblePasswordDialog) { if (ConnectionState == PlasmaNM.Enums.Deactivated) { if (!predictableWirelessPassword && !Uuid) { handler.addAndActivateConnection(DevicePath, SpecificPath) } else if (visiblePasswordDialog) { if (expandableComponentLoader.item.password != "") { handler.addAndActivateConnection(DevicePath, SpecificPath, expandableComponentLoader.item.password) visiblePasswordDialog = false } else { connectionItem.clicked() } } else { handler.activateConnection(ConnectionPath, DevicePath, SpecificPath) } } else { handler.deactivateConnection(ConnectionPath, DevicePath) } } else if (predictableWirelessPassword) { appletProxyModel.dynamicSortFilter = false visiblePasswordDialog = true } } function itemText() { if (ConnectionState == PlasmaNM.Enums.Activating) { if (Type == PlasmaNM.Enums.Vpn) return VpnState else return DeviceState } else if (ConnectionState == PlasmaNM.Enums.Deactivating) { if (Type == PlasmaNM.Enums.Vpn) return VpnState else return DeviceState } else if (ConnectionState == PlasmaNM.Enums.Deactivated) { var result = LastUsed if (SecurityType > PlasmaNM.Enums.NoneSecurity) result += ", " + SecurityTypeString return result } else if (ConnectionState == PlasmaNM.Enums.Activated) { if (showSpeed && dataSource.data && dataSource.data[dataSource.downloadSource] && dataSource.data[dataSource.uploadSource]) { var downloadColor = theme.highlightColor // cycle upload color by 180 degrees var uploadColor = Qt.hsva((downloadColor.hsvHue + 0.5) % 1, downloadColor.hsvSaturation, downloadColor.hsvValue, downloadColor.a) return i18n("Connected, %2/s, %4/s", downloadColor, KCoreAddons.Format.formatByteSize(dataSource.data[dataSource.downloadSource].value * 1024 || 0), uploadColor, KCoreAddons.Format.formatByteSize(dataSource.data[dataSource.uploadSource].value * 1024 || 0)) } else { return i18n("Connected") } } } onActivatingChanged: { if (ConnectionState == PlasmaNM.Enums.Activating) { ListView.view.positionViewAtBeginning() } } onClicked: { if (visiblePasswordDialog) { appletProxyModel.dynamicSortFilter = true visiblePasswordDialog = false } else { visibleDetails = !visibleDetails } if (visibleDetails || visiblePasswordDialog) { ListView.view.currentIndex = index } else { ListView.view.currentIndex = -1 } } onContainsMouseChanged: { if (connectionItem.containsMouse) { connectionView.currentVisibleButtonIndex = index } } } diff --git a/vpn/fortisslvpn/plasmanetworkmanagement_fortisslvpnui.desktop b/vpn/fortisslvpn/plasmanetworkmanagement_fortisslvpnui.desktop index 3ded370f..b080d7f1 100644 --- a/vpn/fortisslvpn/plasmanetworkmanagement_fortisslvpnui.desktop +++ b/vpn/fortisslvpn/plasmanetworkmanagement_fortisslvpnui.desktop @@ -1,84 +1,84 @@ [Desktop Entry] Type=Service Icon= ServiceTypes=PlasmaNetworkManagement/VpnUiPlugin X-KDE-Library=plasmanetworkmanagement_fortisslvpnui X-NetworkManager-Services=org.freedesktop.NetworkManager.fortisslvpn X-KDE-PluginInfo-Author=Jan Grulich X-KDE-PluginInfo-Email=jgrulich@redhat.com X-KDE-PluginInfo-Name=plasmanetworkmanagement_fortisslvpnui X-KDE-PluginInfo-Version=0.1 X-KDE-PluginInfo-Website= X-KDE-PluginInfo-Category=VPNService X-KDE-PluginInfo-Depends= X-KDE-PluginInfo-License=GPL X-KDE-PluginInfo-EnabledByDefault=false Name=Fortinet SSLVPN (fortisslvpn) Name[ca]=Fortinet SSLVPN (fortisslvpn) Name[ca@valencia]=Fortinet SSLVPN (fortisslvpn) Name[da]=Fortinet SSLVPN (fortisslvpn) Name[de]=Fortinet SSLVPN (fortisslvpn) Name[el]=Fortinet SSLVPN (fortisslvpn) Name[en_GB]=Fortinet SSLVPN (fortisslvpn) Name[es]=SSLVPN de Fortinet (fortisslvpn) Name[eu]=Fortinet SSLVPN (fortisslvpn) Name[fi]=Fortinet SSLVPN (fortisslvpn) Name[fr]=SSLVPN Fortinet (fortisslvpn) Name[gl]=VPN SSL de Fortinet (fortisslvpn) Name[hu]=Fortinet SSLVPN (fortisslvpn) Name[it]=Fortinet SSLVPN (fortisslvpn) Name[ko]=Fortinet SSLVPN (fortisslvpn) Name[nl]=Fortinet SSLVPN (fortisslvpn) Name[nn]=Fortinet SSLVPN (fortisslvpn) Name[pa]=ਫੋਰਟੀਨੈੱਟ SSLVPN (fortisslvpn) Name[pl]=Fortinet SSLVPN (fortisslvpn) Name[pt]=SSLVPN do Fortinet (fortisslvpn) Name[pt_BR]=Fortinet SSLVPN (fortisslvpn) Name[ru]=Fortinet SSLVPN (fortisslvpn) Name[sk]=Fortinet SSLVPN (fortisslvpn) Name[sl]=Fortinet SSLVPN (fortisslvpn) Name[sr]=Фортинетов ССЛ ВПН Name[sr@ijekavian]=Фортинетов ССЛ ВПН Name[sr@ijekavianlatin]=Fortinetov SSL VPN Name[sr@latin]=Fortinetov SSL VPN Name[sv]=Fortinet SSLVPN (fortisslvpn) Name[tr]=Fortinet SSLVPN (fortisslvpn) Name[uk]=Fortinet SSLVPN (fortisslvpn) Name[x-test]=xxFortinet SSLVPN (fortisslvpn)xx Name[zh_CN]=Fortinet SSLVPN (fortisslvpn) Name[zh_TW]=Fortinet SSLVPN (fortisslvpn) Comment=Fortinet SSLVPN virtual private networks Comment[ca]=Xarxes privades virtuals Fortinet SSLVPN Comment[ca@valencia]=Xarxes privades virtuals Fortinet SSLVPN Comment[da]=Fortinet SSLVPN virtuelle private netværk Comment[de]=Virtuelles privates Netzwerk Fortinet-SSLVPN Comment[el]=Εικονικά ιδωτικά δίκτυα Fortinet SSLVPN Comment[en_GB]=Fortinet SSLVPN virtual private networks Comment[es]=Redes privadas virtuales SSLVPN de Fortinet Comment[eu]=Fortinet SSLVPN alegiazko sare pribatuak Comment[fi]=Fortinet SSLVPN -virtuaaliyksityisverkot Comment[fr]=Réseaux privés virtuels SSLVPN Fortinet Comment[gl]=Redes privadas virtuais SSL de Fortinet Comment[hu]=Fortinet SSLVPN virtuális magánhálózat Comment[it]=Reti private virtuali Fortinet SSLVPN Comment[ko]=Fortinet SSLVPN 가상 개인 네트워크 Comment[nl]=Fortinet SSLVPN virtuele private netwerken Comment[nn]=Fortinet SSLVPN virtuelle private nettverk Comment[pa]=ਫੋਰਟੀਨੈੱਟ SSLVPN ਵਰਚੁਅਲ ਪਰਾਈਵੇਟ ਨੈੱਟਵਰਕ Comment[pl]=Fortinet SSLVPN wirtualne prywatne sieci Comment[pt]=Redes privadas virtuais do SSLVPN do Fortinet Comment[pt_BR]=Redes privadas virtuais Fortinet SSLVPN Comment[ru]=Виртуальные частные сети Fortinet SSLVPN Comment[sk]=Virtuálne privátne siete Fortinet SSLVPN Comment[sl]=Navidezna zasebna omrežja Fortinet SSLVPN Comment[sr]=Виртуелне приватне мреже преко Фортинетовог ССЛ ВПН‑а Comment[sr@ijekavian]=Виртуелне приватне мреже преко Фортинетовог ССЛ ВПН‑а Comment[sr@ijekavianlatin]=Virtuelne privatne mreže preko Fortinetovog SSL VPN‑a Comment[sr@latin]=Virtuelne privatne mreže preko Fortinetovog SSL VPN‑a Comment[sv]=Fortinet SSLVPN virtuella privata nätverk Comment[tr]=Fortinet SSLVPN sanal özel ağlar Comment[uk]=Віртуальні приватні мережі SSLVPN Fortinet Comment[x-test]=xxFortinet SSLVPN virtual private networksxx -Comment[zh_CN]=Fortinet SSLVPN 虚拟专网 +Comment[zh_CN]=Fortinet SSLVPN 虛拟私人网络 Comment[zh_TW]=Fortinet SSLVPN 虛擬私人網路