Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/PopupDialog.qml
Show All 22 Lines | |||||
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 | 30 | | |||
31 | property alias toolbarValues: toolbar | ||||
32 | | ||||
31 | PlasmaNM.AvailableDevices { | 33 | PlasmaNM.AvailableDevices { | ||
32 | id: availableDevices | 34 | id: availableDevices | ||
33 | } | 35 | } | ||
34 | 36 | | |||
35 | Component { | 37 | Component { | ||
36 | id: networkModelComponent | 38 | id: networkModelComponent | ||
37 | PlasmaNM.NetworkModel {} | 39 | PlasmaNM.NetworkModel {} | ||
38 | } | 40 | } | ||
Show All 13 Lines | 53 | Toolbar { | |||
52 | id: toolbar | 54 | id: toolbar | ||
53 | Layout.fillWidth: true | 55 | Layout.fillWidth: true | ||
54 | } | 56 | } | ||
55 | 57 | | |||
56 | PlasmaExtras.ScrollArea { | 58 | PlasmaExtras.ScrollArea { | ||
57 | id: scrollView | 59 | id: scrollView | ||
58 | Layout.fillWidth: true | 60 | Layout.fillWidth: true | ||
59 | Layout.fillHeight: true | 61 | Layout.fillHeight: true | ||
62 | frameVisible: false | ||||
63 | | ||||
64 | PlasmaExtras.Heading { | ||||
65 | id: disabledMessage | ||||
66 | anchors.fill: parent | ||||
67 | horizontalAlignment: Text.AlignHCenter | ||||
68 | verticalAlignment: Text.AlignVCenter | ||||
69 | level: 3 | ||||
70 | visible: connectionView.count === 0 && text != "" | ||||
71 | enabled: false | ||||
72 | text: { | ||||
73 | if (toolbarValues.displayplaneModeMessage) { | ||||
74 | return i18n("Airplane mode is enabled") | ||||
75 | } | ||||
76 | if (toolbarValues.displayWifiMessage) { | ||||
77 | if (toolbarValues.displayWwanMessage) { | ||||
78 | return i18n("Wireless and mobile networks are deactivated") | ||||
79 | } | ||||
80 | return i18n("Wireless is deactivated") | ||||
81 | } | ||||
82 | if (toolbarValues.displayWwanMessage) { | ||||
83 | return i18n("Mobile network is deactivated") | ||||
84 | } | ||||
85 | return "" | ||||
86 | } | ||||
87 | } | ||||
88 | | ||||
89 | PlasmaExtras.Heading { | ||||
90 | id: message | ||||
91 | anchors.fill: parent | ||||
92 | horizontalAlignment: Text.AlignHCenter | ||||
93 | verticalAlignment: Text.AlignVCenter | ||||
94 | level: 3 | ||||
95 | opacity: connectionView.count === 0 && !disabledMessage.visible ? 0.6 : 0 | ||||
96 | // Check connectionView.count again, to avoid a small delay. | ||||
97 | visible: opacity >= 0.6 && connectionView.count === 0 | ||||
98 | Behavior on opacity { NumberAnimation { duration: 5000 } } | ||||
99 | text: i18n("No available connections") | ||||
100 | } | ||||
60 | 101 | | |||
61 | ListView { | 102 | ListView { | ||
62 | id: connectionView | 103 | id: connectionView | ||
63 | 104 | | |||
64 | property bool availableConnectionsVisible: false | 105 | property bool availableConnectionsVisible: false | ||
65 | property int currentVisibleButtonIndex: -1 | 106 | property int currentVisibleButtonIndex: -1 | ||
66 | 107 | | |||
67 | anchors.fill: parent | 108 | anchors.fill: parent | ||
Show All 26 Lines |