mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-10 04:15:51 +00:00
improve update events
This commit is contained in:
@ -66,7 +66,8 @@ Item {
|
||||
}
|
||||
|
||||
signal dropSource(string sourceName)
|
||||
signal needUpdate
|
||||
signal needTextUpdate(string newText)
|
||||
signal needToolTipUpdate(string newText)
|
||||
signal sizeUpdate
|
||||
|
||||
|
||||
@ -91,7 +92,7 @@ Item {
|
||||
onNewData: {
|
||||
if (debug) console.log("[main::onNewData] : Update source " + sourceName)
|
||||
// FIXME: ugly workaround to make some sources working
|
||||
systemmonitorDE.interval = plasmoid.configuration.interval
|
||||
// systemmonitorDE.interval = plasmoid.configuration.interval
|
||||
|
||||
awKeys.setDataBySource(sourceName, data, settings)
|
||||
}
|
||||
@ -112,7 +113,7 @@ Item {
|
||||
onNewData: {
|
||||
if (debug) console.log("[main::onNewData] : Update source " + sourceName)
|
||||
// FIXME: ugly workaround to make some sources working
|
||||
extsysmonDE.interval = plasmoid.configuration.interval
|
||||
// extsysmonDE.interval = plasmoid.configuration.interval
|
||||
|
||||
awKeys.setDataBySource(sourceName, data, settings)
|
||||
}
|
||||
@ -175,7 +176,8 @@ Item {
|
||||
Plasmoid.userConfiguringChanged(false)
|
||||
// connect data
|
||||
awKeys.dropSourceFromDataengine.connect(dropSource)
|
||||
awKeys.needToBeUpdated.connect(needUpdate)
|
||||
awKeys.needTextToBeUpdated.connect(needTextUpdate)
|
||||
awKeys.needToolTipToBeUpdated.connect(needToolTipUpdate)
|
||||
}
|
||||
|
||||
onDropSource: {
|
||||
@ -185,15 +187,19 @@ Item {
|
||||
systemmonitorDE.disconnectSource(sourceName)
|
||||
}
|
||||
|
||||
onNeedUpdate: {
|
||||
if (debug) console.log("[main::onNeedUpdate]")
|
||||
|
||||
text.text = awKeys.parsePattern()
|
||||
tooltip.text = awKeys.toolTipImage()
|
||||
onNeedTextUpdate: {
|
||||
if (debug) console.log("[main::onNeedTextUpdate]")
|
||||
|
||||
text.text = newText
|
||||
sizeUpdate()
|
||||
}
|
||||
|
||||
onNeedToolTipUpdate: {
|
||||
if (debug) console.log("[main::onNeedToolTipUpdate]")
|
||||
|
||||
tooltip.text = newText
|
||||
}
|
||||
|
||||
onSizeUpdate: {
|
||||
if (debug) console.log("[main::onSizeUpdate]")
|
||||
|
||||
@ -223,7 +229,7 @@ Item {
|
||||
awKeys.setPopupEnabled(plasmoid.configuration.notify)
|
||||
awKeys.setWrapNewLines(plasmoid.configuration.wrapNewLines)
|
||||
|
||||
needUpdate()
|
||||
needTextUpdate(plasmoid.configuration.text)
|
||||
}
|
||||
|
||||
function action_checkUpdates() {
|
||||
|
Reference in New Issue
Block a user