summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Edmundson <[email protected]>2016-12-19 11:22:29 +0000
committerDavid Edmundson <[email protected]>2016-12-19 11:22:30 +0000
commit824018a3d3fffc04c6e514a9ebeeefffc999072c (patch)
tree055c1d004a2b0ba484327589fb964a52f1e8be07
parentc6d6d380f9133e1286a9022e9895d28b5c7dcb45 (diff)
Block Network manager notifications when the popup is visible
Summary: If we have the notification plasmoid visible and expanded we don't need to see notifications of network events. Reviewers: #plasma, mart Reviewed By: mart Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D3596
-rw-r--r--applet/contents/ui/PopupDialog.qml26
1 files changed, 25 insertions, 1 deletions
diff --git a/applet/contents/ui/PopupDialog.qml b/applet/contents/ui/PopupDialog.qml
index 089c12a..6d376d8 100644
--- a/applet/contents/ui/PopupDialog.qml
+++ b/applet/contents/ui/PopupDialog.qml
@@ -19,10 +19,12 @@
*/
import QtQuick 2.2
+import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
FocusScope {
+ property var notificationInhibitorLock: undefined
PlasmaNM.AvailableDevices {
id: availableDevices
@@ -77,6 +79,28 @@ FocusScope {
Connections {
target: plasmoid
- onExpandedChanged: connectionView.currentVisibleButtonIndex = -1
+ onExpandedChanged: {
+ connectionView.currentVisibleButtonIndex = -1;
+ if (expanded) {
+ var service = notificationsEngine.serviceForSource("notifications");
+ var operation = service.operationDescription("inhibit");
+ operation.hint = "x-kde-appname";
+ operation.value = "networkmanagement";
+ var job = service.startOperationCall(operation);
+ job.finished.connect(function(job) {
+ if (expanded) {
+ notificationInhibitorLock = job.result;
+ }
+ });
+ } else {
+ notificationInhibitorLock = undefined;
+ }
+ }
+ }
+
+ PlasmaCore.DataSource {
+ id: notificationsEngine
+ engine: "notifications"
}
+
}