Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/PopupDialog.qml
Show All 21 Lines | |||||
22 | import QtQuick.Layouts 1.2 | 22 | import QtQuick.Layouts 1.2 | ||
23 | import org.kde.plasma.components 2.0 as PlasmaComponents | 23 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
24 | import org.kde.plasma.core 2.0 as PlasmaCore | 24 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
25 | import org.kde.plasma.extras 2.0 as PlasmaExtras | 25 | import org.kde.plasma.extras 2.0 as PlasmaExtras | ||
26 | import org.kde.plasma.networkmanagement 0.2 as PlasmaNM | 26 | import org.kde.plasma.networkmanagement 0.2 as PlasmaNM | ||
27 | 27 | | |||
28 | FocusScope { | 28 | FocusScope { | ||
29 | id: full | 29 | id: full | ||
30 | property var notificationInhibitorLock: undefined | | |||
31 | 30 | | |||
32 | PlasmaNM.AvailableDevices { | 31 | PlasmaNM.AvailableDevices { | ||
33 | id: availableDevices | 32 | id: availableDevices | ||
34 | } | 33 | } | ||
35 | 34 | | |||
36 | Component { | 35 | Component { | ||
37 | id: networkModelComponent | 36 | id: networkModelComponent | ||
38 | PlasmaNM.NetworkModel {} | 37 | PlasmaNM.NetworkModel {} | ||
Show All 37 Lines | 56 | PlasmaExtras.ScrollArea { | |||
76 | } | 75 | } | ||
77 | } | 76 | } | ||
78 | } | 77 | } | ||
79 | 78 | | |||
80 | Connections { | 79 | Connections { | ||
81 | target: plasmoid | 80 | target: plasmoid | ||
82 | onExpandedChanged: { | 81 | onExpandedChanged: { | ||
83 | connectionView.currentVisibleButtonIndex = -1; | 82 | connectionView.currentVisibleButtonIndex = -1; | ||
84 | if (expanded) { | | |||
85 | var service = notificationsEngine.serviceForSource("notifications"); | | |||
86 | var operation = service.operationDescription("inhibit"); | | |||
87 | operation.hint = "x-kde-appname"; | | |||
88 | operation.value = "networkmanagement"; | | |||
89 | var job = service.startOperationCall(operation); | | |||
90 | job.finished.connect(function(job) { | | |||
91 | if (expanded) { | | |||
92 | notificationInhibitorLock = job.result; | | |||
93 | } | | |||
94 | }); | | |||
95 | handler.requestScan() | | |||
96 | } else { | | |||
97 | notificationInhibitorLock = undefined; | | |||
98 | toolbar.closeSearch() | | |||
99 | } | | |||
100 | 83 | | |||
101 | if (expanded) { | 84 | if (expanded) { | ||
85 | handler.requestScan(); | ||||
102 | full.connectionModel = networkModelComponent.createObject(full) | 86 | full.connectionModel = networkModelComponent.createObject(full) | ||
103 | } else { | 87 | } else { | ||
104 | full.connectionModel.destroy() | 88 | full.connectionModel.destroy() | ||
89 | toolbar.closeSearch(); | ||||
105 | } | 90 | } | ||
106 | } | 91 | } | ||
107 | } | 92 | } | ||
108 | | ||||
109 | PlasmaCore.DataSource { | | |||
110 | id: notificationsEngine | | |||
111 | engine: "notifications" | | |||
112 | } | | |||
113 | } | 93 | } |