mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-04-24 15:37:23 +00:00
change in updates
This commit is contained in:
parent
73ba838685
commit
6ed45fa7a5
@ -57,9 +57,10 @@ Item {
|
||||
"profiles": "",
|
||||
"status": "N\\A"
|
||||
}
|
||||
property int interval: plasmoid.configuration.autoUpdateInterval
|
||||
property string pattern: plasmoid.configuration.textPattern
|
||||
property bool status: false
|
||||
// contextual actions signals
|
||||
signal netctlStateChanged
|
||||
|
||||
// init
|
||||
Plasmoid.icon: icon.source
|
||||
@ -68,7 +69,7 @@ Item {
|
||||
id: mainData
|
||||
engine: "netctl"
|
||||
connectedSources: ["active", "current", "extip4", "extip6", "interfaces", "intip4", "intip6", "profiles", "status"]
|
||||
interval: main.interval
|
||||
interval: plasmoid.configuration.autoUpdateInterval
|
||||
|
||||
onNewData: {
|
||||
if (data.value == "N\\A") return
|
||||
@ -77,11 +78,10 @@ Item {
|
||||
icon.source = iconPath[data.value]
|
||||
} else if (sourceName == "current") {
|
||||
info["current"] = data.value
|
||||
// text update
|
||||
// update
|
||||
info["info"] = NetctlAdds.getInfo(info["current"], info["status"])
|
||||
text.text = NetctlAdds.parsePattern(pattern, info)
|
||||
// update menus
|
||||
menuUpdate()
|
||||
netctlStateChanged()
|
||||
} else if (sourceName == "extip4") {
|
||||
info["extip4"] = data.value
|
||||
} else if (sourceName == "extip6") {
|
||||
@ -134,7 +134,7 @@ Item {
|
||||
plasmoid.setAction("startWifi", i18n("Show WiFi menu"))
|
||||
}
|
||||
|
||||
function menuUpdate() {
|
||||
onNetctlStateChanged: {
|
||||
var titleAction = plasmoid.action("titleAction")
|
||||
var startAction = plasmoid.action("startProfile")
|
||||
var stopAction = plasmoid.action("stopProfile")
|
||||
|
Loading…
Reference in New Issue
Block a user