Commit 387609d1 authored by George Vogiatzis's avatar George Vogiatzis Committed by Nate Graham

[Applet]Add info messages.

Summary:
Add info messages, when there are no available connections.
"Airplane mode is enabled"
"Wireless and mobile networks are deactivated"
"Wireless is deactivated"
"Mobile network is deactivated"
And "No available connections" with 5 seconds delay.

Test Plan: {F8104078,size=full}

Reviewers: #plasma, #vdg, jgrulich, ngraham

Reviewed By: #vdg, jgrulich, ngraham

Subscribers: ngraham, broulik, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D27392
parent f8a60c63
......@@ -28,6 +28,8 @@ import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
FocusScope {
id: full
property alias toolbarValues: toolbar
PlasmaNM.AvailableDevices {
id: availableDevices
}
......@@ -57,6 +59,45 @@ FocusScope {
id: scrollView
Layout.fillWidth: true
Layout.fillHeight: true
frameVisible: false
PlasmaExtras.Heading {
id: disabledMessage
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
level: 3
visible: connectionView.count === 0 && text != ""
enabled: false
text: {
if (toolbarValues.displayplaneModeMessage) {
return i18n("Airplane mode is enabled")
}
if (toolbarValues.displayWifiMessage) {
if (toolbarValues.displayWwanMessage) {
return i18n("Wireless and mobile networks are deactivated")
}
return i18n("Wireless is deactivated")
}
if (toolbarValues.displayWwanMessage) {
return i18n("Mobile network is deactivated")
}
return ""
}
}
PlasmaExtras.Heading {
id: message
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
level: 3
opacity: connectionView.count === 0 && !disabledMessage.visible ? 0.6 : 0
// Check connectionView.count again, to avoid a small delay.
visible: opacity >= 0.6 && connectionView.count === 0
Behavior on opacity { NumberAnimation { duration: 5000 } }
text: i18n("No available connections")
}
ListView {
id: connectionView
......
......@@ -29,6 +29,10 @@ import org.kde.kquickcontrolsaddons 2.0
GridLayout {
id: toolbar
readonly property var displayWifiMessage: !wifiSwitchButton.checked && wifiSwitchButton.visible
readonly property var displayWwanMessage: !wwanSwitchButton.checked && wwanSwitchButton.visible
readonly property var displayplaneModeMessage: planeModeSwitchButton.checked && planeModeSwitchButton.visible
function closeSearch() {
searchToggleButton.checked = false
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment