summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Uwe Broulik <[email protected]>2017-01-11 16:48:23 +0100
committerKai Uwe Broulik <[email protected]>2017-01-11 16:48:44 +0100
commit3b71bfdc18dd3b57de62e0f81327a717983548d7 (patch)
tree39d371be3f54c65f0bd66d3954e3a71dc609c511
parent7ff20d5ad73c64f8111fb57627e45f20fabd5aa4 (diff)
Take into account kiosk restrictions for when appmenu is disabled
There's no point in telling the user to go to a settings module that is restricted. Also disallow going there in this case.
-rw-r--r--applets/appmenu/package/contents/ui/main.qml10
1 files changed, 6 insertions, 4 deletions
diff --git a/applets/appmenu/package/contents/ui/main.qml b/applets/appmenu/package/contents/ui/main.qml
index 3a47eee..a4f6ec6 100644
--- a/applets/appmenu/package/contents/ui/main.qml
+++ b/applets/appmenu/package/contents/ui/main.qml
@@ -34,6 +34,8 @@ Item {
readonly property bool view: plasmoid.configuration.compactView
readonly property bool menuAvailable: appMenuModel.menuAvailable
+ readonly property bool kcmAuthorized: KCMShell.authorize(["style.desktop"]).length > 0
+
onViewChanged: {
plasmoid.nativeInterface.view = view
}
@@ -49,7 +51,7 @@ Item {
Layout.fillHeight: false
Layout.minimumWidth: implicitWidth
Layout.maximumWidth: implicitWidth
- enabled: appletEnabled ? menuAvailable : true
+ enabled: appletEnabled ? menuAvailable : kcmAuthorized
checkable: appletEnabled && menuAvailable && plasmoid.nativeInterface.currentIndex === fakeIndex
checked: checkable
iconSource: appletEnabled ? i18n("application-menu") : i18n("emblem-warning")
@@ -59,8 +61,6 @@ Item {
} else {
KCMShell.open("style")
}
-
-
}
}
@@ -108,7 +108,9 @@ Item {
}
}
- Plasmoid.toolTipSubText: !appletEnabled ? i18n("Application Menu Widget is disabled in settings.\n\nGo to System Settings > Application Style > Fine Tuning (tab) to enable it.") : ""
+ Plasmoid.toolTipMainText: appletEnabled ? "" : i18n("Application Menu Widget is disabled")
+ Plasmoid.toolTipSubText: appletEnabled || !root.kcmAuthorized ? ""
+ : i18nc("it being the 'Application Menu Widget'", "Go to System Settings > Application Style > Fine Tuning (tab) to enable it.");
AppMenuPrivate.AppMenuModel {
id: appMenuModel