Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/PopupDialog.qml
Show All 20 Lines | |||||
21 | import QtQuick 2.2 | 21 | import QtQuick 2.2 | ||
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 | property var notificationInhibitorLock: undefined | 30 | property var notificationInhibitorLock: undefined | ||
30 | 31 | | |||
31 | PlasmaNM.AvailableDevices { | 32 | PlasmaNM.AvailableDevices { | ||
32 | id: availableDevices | 33 | id: availableDevices | ||
33 | } | 34 | } | ||
34 | 35 | | |||
35 | PlasmaNM.NetworkModel { | 36 | Component { | ||
36 | id: connectionModel | 37 | id: networkModelComponent | ||
38 | PlasmaNM.NetworkModel {} | ||||
37 | } | 39 | } | ||
38 | 40 | | |||
41 | property PlasmaNM.NetworkModel connectionModel: null | ||||
42 | | ||||
39 | PlasmaNM.AppletProxyModel { | 43 | PlasmaNM.AppletProxyModel { | ||
40 | id: appletProxyModel | 44 | id: appletProxyModel | ||
41 | 45 | | |||
42 | sourceModel: connectionModel | 46 | sourceModel: full.connectionModel | ||
43 | } | 47 | } | ||
44 | 48 | | |||
45 | ColumnLayout { | 49 | ColumnLayout { | ||
46 | anchors.fill: parent | 50 | anchors.fill: parent | ||
47 | 51 | | |||
48 | Toolbar { | 52 | Toolbar { | ||
49 | id: toolbar | 53 | id: toolbar | ||
50 | Layout.fillWidth: true | 54 | Layout.fillWidth: true | ||
Show All 37 Lines | 91 | if (expanded) { | |||
88 | notificationInhibitorLock = job.result; | 92 | notificationInhibitorLock = job.result; | ||
89 | } | 93 | } | ||
90 | }); | 94 | }); | ||
91 | handler.requestScan() | 95 | handler.requestScan() | ||
92 | } else { | 96 | } else { | ||
93 | notificationInhibitorLock = undefined; | 97 | notificationInhibitorLock = undefined; | ||
94 | toolbar.closeSearch() | 98 | toolbar.closeSearch() | ||
95 | } | 99 | } | ||
100 | | ||||
101 | if (expanded) { | ||||
102 | full.connectionModel = networkModelComponent.createObject(full) | ||||
103 | } else { | ||||
104 | full.connectionModel.destroy() | ||||
105 | } | ||||
96 | } | 106 | } | ||
97 | } | 107 | } | ||
98 | 108 | | |||
99 | PlasmaCore.DataSource { | 109 | PlasmaCore.DataSource { | ||
100 | id: notificationsEngine | 110 | id: notificationsEngine | ||
101 | engine: "notifications" | 111 | engine: "notifications" | ||
102 | } | 112 | } | ||
103 | } | 113 | } |