Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/PopupDialog.qml
Show All 15 Lines | 1 | /* | |||
---|---|---|---|---|---|
16 | 16 | | |||
17 | You should have received a copy of the GNU Lesser General Public | 17 | You should have received a copy of the GNU Lesser General Public | ||
18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | 18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
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.components 3.0 as PlasmaComponents3 | ||||
24 | import org.kde.plasma.core 2.0 as PlasmaCore | 25 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
25 | import org.kde.plasma.extras 2.0 as PlasmaExtras | 26 | import org.kde.plasma.extras 2.0 as PlasmaExtras | ||
26 | import org.kde.plasma.networkmanagement 0.2 as PlasmaNM | 27 | import org.kde.plasma.networkmanagement 0.2 as PlasmaNM | ||
27 | 28 | | |||
28 | FocusScope { | 29 | PlasmaComponents3.Page { | ||
29 | id: full | 30 | id: full | ||
30 | 31 | | |||
31 | property alias toolbarValues: toolbar | 32 | property alias toolbarValues: toolbar | ||
32 | 33 | | |||
33 | PlasmaNM.AvailableDevices { | 34 | PlasmaNM.AvailableDevices { | ||
34 | id: availableDevices | 35 | id: availableDevices | ||
35 | } | 36 | } | ||
36 | 37 | | |||
37 | Component { | 38 | Component { | ||
38 | id: networkModelComponent | 39 | id: networkModelComponent | ||
39 | PlasmaNM.NetworkModel {} | 40 | PlasmaNM.NetworkModel {} | ||
40 | } | 41 | } | ||
41 | 42 | | |||
42 | property PlasmaNM.NetworkModel connectionModel: null | 43 | property PlasmaNM.NetworkModel connectionModel: null | ||
43 | 44 | | |||
44 | PlasmaNM.AppletProxyModel { | 45 | PlasmaNM.AppletProxyModel { | ||
45 | id: appletProxyModel | 46 | id: appletProxyModel | ||
46 | 47 | | |||
47 | sourceModel: full.connectionModel | 48 | sourceModel: full.connectionModel | ||
48 | } | 49 | } | ||
49 | 50 | | |||
50 | ColumnLayout { | 51 | header: PlasmaExtras.PlasmoidHeading { | ||
51 | anchors.fill: parent | | |||
52 | | ||||
53 | Toolbar { | 52 | Toolbar { | ||
54 | id: toolbar | 53 | id: toolbar | ||
55 | Layout.fillWidth: true | 54 | width: parent.width | ||
56 | } | 55 | } | ||
56 | } | ||||
57 | | ||||
58 | FocusScope { | ||||
59 | | ||||
60 | anchors.fill: parent | ||||
61 | anchors.topMargin: units.smallSpacing * 2 | ||||
57 | 62 | | |||
58 | PlasmaExtras.ScrollArea { | 63 | PlasmaExtras.ScrollArea { | ||
59 | id: scrollView | 64 | id: scrollView | ||
60 | Layout.fillWidth: true | 65 | anchors.fill: parent | ||
61 | Layout.fillHeight: true | | |||
62 | frameVisible: false | 66 | frameVisible: false | ||
63 | 67 | | |||
64 | PlasmaExtras.Heading { | 68 | PlasmaExtras.Heading { | ||
65 | id: disabledMessage | 69 | id: disabledMessage | ||
66 | anchors.fill: parent | 70 | anchors.fill: parent | ||
67 | horizontalAlignment: Text.AlignHCenter | 71 | horizontalAlignment: Text.AlignHCenter | ||
68 | verticalAlignment: Text.AlignVCenter | 72 | verticalAlignment: Text.AlignVCenter | ||
69 | level: 3 | 73 | level: 3 | ||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | 106 | ListView { | |||
113 | section.property: showSeparator ? "Section" : "" | 117 | section.property: showSeparator ? "Section" : "" | ||
114 | section.delegate: ListItem { separator: true } | 118 | section.delegate: ListItem { separator: true } | ||
115 | highlight: PlasmaComponents.Highlight { } | 119 | highlight: PlasmaComponents.Highlight { } | ||
116 | highlightMoveDuration: units.longDuration | 120 | highlightMoveDuration: units.longDuration | ||
117 | highlightResizeDuration: units.longDuration | 121 | highlightResizeDuration: units.longDuration | ||
118 | delegate: ConnectionItem { } | 122 | delegate: ConnectionItem { } | ||
119 | } | 123 | } | ||
120 | } | 124 | } | ||
121 | } | | |||
122 | 125 | | |||
123 | Connections { | 126 | Connections { | ||
124 | target: plasmoid | 127 | target: plasmoid | ||
125 | onExpandedChanged: { | 128 | onExpandedChanged: { | ||
126 | connectionView.currentVisibleButtonIndex = -1; | 129 | connectionView.currentVisibleButtonIndex = -1; | ||
127 | 130 | | |||
128 | if (expanded) { | 131 | if (expanded) { | ||
129 | handler.requestScan(); | 132 | handler.requestScan(); | ||
130 | full.connectionModel = networkModelComponent.createObject(full) | 133 | full.connectionModel = networkModelComponent.createObject(full) | ||
131 | } else { | 134 | } else { | ||
132 | full.connectionModel.destroy() | 135 | full.connectionModel.destroy() | ||
133 | toolbar.closeSearch(); | 136 | toolbar.closeSearch(); | ||
134 | } | 137 | } | ||
135 | } | 138 | } | ||
136 | } | 139 | } | ||
137 | } | 140 | } | ||
141 | } |