Skip to content

Commit

Permalink
refactor: port to KConfig and KCMLauncher
Browse files Browse the repository at this point in the history
  • Loading branch information
romangg committed Feb 26, 2024
1 parent e6519b1 commit 793cdfe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions plasma-integration/plasmoid/package/contents/ui/main.qml
Expand Up @@ -30,6 +30,9 @@ import org.kde.plasma.plasma5support 2.0 as P5Support
import org.kde.kquickcontrolsaddons 2.0
import org.kde.kirigami 2.20 as Kirigami

import org.kde.config as KConfig // KAuthorized.authorizeControlModule
import org.kde.kcmutils // KCMLauncher

import org.kwinft.private.kdisplay 1.0

PlasmoidItem {
Expand All @@ -40,7 +43,7 @@ PlasmoidItem {
toolTipSubText: presentationModeEnabled ? i18n("Presentation mode is enabled") : ""

readonly property string kcmName: "kcm_kdisplay"
readonly property bool kcmAllowed: KCMShell.authorize(kcmName + ".desktop").length > 0
readonly property bool kcmAllowed: KConfig.KAuthorized.authorizeControlModule(kcmName)

readonly property bool presentationModeEnabled: presentationModeCookie > 0
property int presentationModeCookie: -1
Expand Down Expand Up @@ -96,7 +99,7 @@ PlasmoidItem {
text: i18n("Configure Display Settings…")
icon.name: "preferences-desktop-display"
visible: kcmAllowed
onTriggered: KCMShell.openSystemSettings(kcmName)
onTriggered: KCMLauncher.openSystemSettings(kcmName)
}

Component.onCompleted: {
Expand Down
6 changes: 3 additions & 3 deletions plasma-integration/po/plasma_applet_org.kwinft.kdisplay.pot
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-26 15:23+0100\n"
"POT-Creation-Date: 2024-02-26 15:24+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -102,12 +102,12 @@ msgid ""
"display device plugged in."
msgstr ""

#: plasma-integration/plasmoid/package/contents/ui/main.qml:40
#: plasma-integration/plasmoid/package/contents/ui/main.qml:43
#, kde-format
msgid "Presentation mode is enabled"
msgstr ""

#: plasma-integration/plasmoid/package/contents/ui/main.qml:96
#: plasma-integration/plasmoid/package/contents/ui/main.qml:99
#, kde-format
msgid "Configure Display Settings…"
msgstr ""

0 comments on commit 793cdfe

Please sign in to comment.