Changeset View
Changeset View
Standalone View
Standalone View
mobile/wifi/package/contents/ui/main.qml
Show All 29 Lines | 26 | Kirigami.ApplicationItem { | |||
---|---|---|---|---|---|
30 | pageStack.defaultColumnWidth: Kirigami.Units.gridUnit * 25 | 30 | pageStack.defaultColumnWidth: Kirigami.Units.gridUnit * 25 | ||
31 | pageStack.initialPage: networkListview | 31 | pageStack.initialPage: networkListview | ||
32 | Kirigami.Theme.colorSet: Kirigami.Theme.Window | 32 | Kirigami.Theme.colorSet: Kirigami.Theme.Window | ||
33 | 33 | | |||
34 | anchors.fill: parent | 34 | anchors.fill: parent | ||
35 | 35 | | |||
36 | PlasmaNM.Handler { | 36 | PlasmaNM.Handler { | ||
37 | id: handler | 37 | id: handler | ||
38 | onWirelessScanTimerEnabled: { | ||||
39 | if (enabled) { | ||||
40 | scanTimer.restart() | ||||
41 | } else { | ||||
42 | scanTimer.stop() | ||||
43 | } | ||||
44 | } | ||||
38 | } | 45 | } | ||
39 | 46 | | |||
40 | PlasmaNM.EnabledConnections { | 47 | PlasmaNM.EnabledConnections { | ||
41 | id: enabledConnections | 48 | id: enabledConnections | ||
42 | 49 | | |||
43 | onWirelessEnabledChanged: { | 50 | onWirelessEnabledChanged: { | ||
44 | wifiSwitchButton.checked = wifiSwitchButton.enabled && enabled | 51 | wifiSwitchButton.checked = wifiSwitchButton.enabled && enabled | ||
45 | } | 52 | } | ||
46 | } | 53 | } | ||
47 | 54 | | |||
48 | contextDrawer: Kirigami.ContextDrawer { | 55 | contextDrawer: Kirigami.ContextDrawer { | ||
49 | id: contextDrawer | 56 | id: contextDrawer | ||
50 | } | 57 | } | ||
51 | 58 | | |||
52 | PlasmaNM.NetworkModel { | 59 | PlasmaNM.NetworkModel { | ||
53 | id: connectionModel | 60 | id: connectionModel | ||
54 | } | 61 | } | ||
55 | 62 | | |||
56 | PlasmaNM.MobileProxyModel { | 63 | PlasmaNM.MobileProxyModel { | ||
57 | id: mobileProxyModel | 64 | id: mobileProxyModel | ||
58 | sourceModel: connectionModel | 65 | sourceModel: connectionModel | ||
59 | showSavedMode: false | 66 | showSavedMode: false | ||
60 | } | 67 | } | ||
61 | 68 | | |||
69 | Component.onCompleted: handler.requestScan() | ||||
70 | | ||||
62 | Timer { | 71 | Timer { | ||
63 | id: scanTimer | 72 | id: scanTimer | ||
64 | interval: 15000 | 73 | interval: 15000 | ||
65 | repeat: true | 74 | repeat: true | ||
66 | running: parent.visible | 75 | running: parent.visible | ||
67 | triggeredOnStart: true | | |||
68 | 76 | | |||
69 | onTriggered: { | 77 | onTriggered: handler.requestScan() | ||
70 | handler.requestScan() | | |||
71 | } | | |||
72 | } | 78 | } | ||
73 | 79 | | |||
74 | NetworkListView { | 80 | NetworkListView { | ||
75 | id: networkListview | 81 | id: networkListview | ||
76 | anchors.fill: parent | 82 | anchors.fill: parent | ||
77 | } | 83 | } | ||
78 | 84 | | |||
79 | Component { | 85 | Component { | ||
Show All 14 Lines |