summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Grulich <[email protected]>2016-11-29 12:56:01 +0100
committerJan Grulich <[email protected]>2016-11-29 12:56:01 +0100
commit62274a54b86de657a7197cd35812cb4504b022fb (patch)
treec1387dca3f164e0e296bb66fdf1720b5633ab2c3
parentcf160bcb17981e8746fb654e37c9ad7882f67d84 (diff)
Take KIOSK restrictions into account
Allows to open network KCM only in case it's not a violation against KIOSK configuration
-rw-r--r--applet/contents/ui/Toolbar.qml1
-rw-r--r--applet/contents/ui/main.qml5
2 files changed, 5 insertions, 1 deletions
diff --git a/applet/contents/ui/Toolbar.qml b/applet/contents/ui/Toolbar.qml
index cf3a783..044fa27 100644
--- a/applet/contents/ui/Toolbar.qml
+++ b/applet/contents/ui/Toolbar.qml
@@ -119,6 +119,7 @@ Item {
iconSource: "configure"
tooltip: i18n("Configure network connections...")
+ visible: mainWindow.kcmAuthorized
onClicked: {
KCMShell.open(mainWindow.kcm)
diff --git a/applet/contents/ui/main.qml b/applet/contents/ui/main.qml
index b38383d..2236e99 100644
--- a/applet/contents/ui/main.qml
+++ b/applet/contents/ui/main.qml
@@ -29,6 +29,7 @@ Item {
property bool showSections: true
readonly property string kcm: "kcm_networkmanagement.desktop"
+ readonly property bool kcmAuthorized: KCMShell.authorize(kcm).length == 1
Plasmoid.toolTipMainText: i18n("Networks")
Plasmoid.toolTipSubText: networkStatus.activeConnections
@@ -50,7 +51,9 @@ Item {
Component.onCompleted: {
plasmoid.removeAction("configure");
- plasmoid.setAction("openKCM", i18n("&Configure Network Connections..."), "preferences-system-network");
+ if (kcmAuthorized) {
+ plasmoid.setAction("openKCM", i18n("&Configure Network Connections..."), "preferences-system-network");
+ }
}
PlasmaNM.NetworkStatus {