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": "",
|
"profiles": "",
|
||||||
"status": "N\\A"
|
"status": "N\\A"
|
||||||
}
|
}
|
||||||
property int interval: plasmoid.configuration.autoUpdateInterval
|
|
||||||
property string pattern: plasmoid.configuration.textPattern
|
property string pattern: plasmoid.configuration.textPattern
|
||||||
property bool status: false
|
property bool status: false
|
||||||
|
// contextual actions signals
|
||||||
|
signal netctlStateChanged
|
||||||
|
|
||||||
// init
|
// init
|
||||||
Plasmoid.icon: icon.source
|
Plasmoid.icon: icon.source
|
||||||
@ -68,7 +69,7 @@ Item {
|
|||||||
id: mainData
|
id: mainData
|
||||||
engine: "netctl"
|
engine: "netctl"
|
||||||
connectedSources: ["active", "current", "extip4", "extip6", "interfaces", "intip4", "intip6", "profiles", "status"]
|
connectedSources: ["active", "current", "extip4", "extip6", "interfaces", "intip4", "intip6", "profiles", "status"]
|
||||||
interval: main.interval
|
interval: plasmoid.configuration.autoUpdateInterval
|
||||||
|
|
||||||
onNewData: {
|
onNewData: {
|
||||||
if (data.value == "N\\A") return
|
if (data.value == "N\\A") return
|
||||||
@ -77,11 +78,10 @@ Item {
|
|||||||
icon.source = iconPath[data.value]
|
icon.source = iconPath[data.value]
|
||||||
} else if (sourceName == "current") {
|
} else if (sourceName == "current") {
|
||||||
info["current"] = data.value
|
info["current"] = data.value
|
||||||
// text update
|
// update
|
||||||
info["info"] = NetctlAdds.getInfo(info["current"], info["status"])
|
info["info"] = NetctlAdds.getInfo(info["current"], info["status"])
|
||||||
text.text = NetctlAdds.parsePattern(pattern, info)
|
text.text = NetctlAdds.parsePattern(pattern, info)
|
||||||
// update menus
|
netctlStateChanged()
|
||||||
menuUpdate()
|
|
||||||
} else if (sourceName == "extip4") {
|
} else if (sourceName == "extip4") {
|
||||||
info["extip4"] = data.value
|
info["extip4"] = data.value
|
||||||
} else if (sourceName == "extip6") {
|
} else if (sourceName == "extip6") {
|
||||||
@ -134,7 +134,7 @@ Item {
|
|||||||
plasmoid.setAction("startWifi", i18n("Show WiFi menu"))
|
plasmoid.setAction("startWifi", i18n("Show WiFi menu"))
|
||||||
}
|
}
|
||||||
|
|
||||||
function menuUpdate() {
|
onNetctlStateChanged: {
|
||||||
var titleAction = plasmoid.action("titleAction")
|
var titleAction = plasmoid.action("titleAction")
|
||||||
var startAction = plasmoid.action("startProfile")
|
var startAction = plasmoid.action("startProfile")
|
||||||
var stopAction = plasmoid.action("stopProfile")
|
var stopAction = plasmoid.action("stopProfile")
|
||||||
|
Loading…
Reference in New Issue
Block a user