Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/main.qml
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Line(s) | 27 | Item { | |||
---|---|---|---|---|---|
60 | } | 60 | } | ||
61 | 61 | | |||
62 | PlasmaNM.ConnectionIcon { | 62 | PlasmaNM.ConnectionIcon { | ||
63 | id: connectionIconProvider | 63 | id: connectionIconProvider | ||
64 | } | 64 | } | ||
65 | 65 | | |||
66 | PlasmaNM.Handler { | 66 | PlasmaNM.Handler { | ||
67 | id: handler | 67 | id: handler | ||
68 | onWirelessScanTimerEnabled: { | ||||
69 | if (enabled) { | ||||
70 | scanTimer.restart() | ||||
71 | } else { | ||||
72 | scanTimer.stop() | ||||
73 | } | ||||
74 | } | ||||
68 | } | 75 | } | ||
69 | 76 | | |||
70 | Timer { | 77 | Timer { | ||
71 | id: scanTimer | 78 | id: scanTimer | ||
jgrulich: Since this is just one line function, you can use handler.requestScan() directly as before. | |||||
I did it for consistency, so in both files there's only one action. It's also useful for debugging. vpilo: I did it for consistency, so in both files there's only one action. It's also useful for… | |||||
It would still be one action even if you call "handler.requestScan()" instead of adding additional unnecessary layer. jgrulich: It would still be one action even if you call "handler.requestScan()" instead of adding… | |||||
72 | interval: 15000 | 79 | interval: 15000 | ||
73 | repeat: true | 80 | repeat: true | ||
74 | running: plasmoid.expanded | 81 | running: plasmoid.expanded | ||
75 | triggeredOnStart: true | | |||
76 | 82 | | |||
77 | onTriggered: { | 83 | onTriggered: handler.requestScan() | ||
78 | handler.requestScan() | | |||
79 | } | | |||
80 | } | 84 | } | ||
81 | 85 | | |||
82 | PlasmaNM.Configuration { | 86 | PlasmaNM.Configuration { | ||
83 | unlockModemOnDetection: plasmoid.configuration.unlockModemOnDetection | 87 | unlockModemOnDetection: plasmoid.configuration.unlockModemOnDetection | ||
84 | manageVirtualConnections: plasmoid.configuration.manageVirtualConnections | 88 | manageVirtualConnections: plasmoid.configuration.manageVirtualConnections | ||
85 | } | 89 | } | ||
86 | } | 90 | } |
Since this is just one line function, you can use handler.requestScan() directly as before.