some fixes

This commit is contained in:
arcan1s
2015-02-03 02:01:43 +03:00
parent 27fd4e8f1e
commit 86d4bd76ea
8 changed files with 97 additions and 47 deletions

View File

@ -70,7 +70,6 @@ Item {
text: i18n("ACPI path")
}
QtControls.TextField {
height: parent.height
width: parent.width * 3 / 5
text: cfg_dataengine["ACPIPATH"]
}
@ -154,9 +153,8 @@ Item {
text: i18n("hddtemp cmd")
}
QtControls.TextField {
height: parent.height
width: parent.width * 3 / 5
text: cfg_dataengine["HDDTEMP"]
text: cfg_dataengine["HDDTEMPCMD"]
}
}
@ -171,7 +169,6 @@ Item {
text: i18n("MPD address")
}
QtControls.TextField {
height: parent.height
width: parent.width * 3 / 5
text: cfg_dataengine["MPDADDRESS"]
}

View File

@ -62,14 +62,12 @@ Item {
// init
Plasmoid.icon: "utilities-system-monitor"
Plasmoid.backgroundHints: "DefaultBackground"
Plasmoid.toolTipMainText: "Awesome Widget"
Plasmoid.backgroundHints: plasmoid.configuration.background ? "DefaultBackground" : "NoBackground"
Plasmoid.associatedApplication: "ksysguard"
PlasmaCore.DataSource {
id: systemmonitorDE
engine: "systemmonitor"
connectedSources: []
interval: plasmoid.configuration.interval
onNewData: {
@ -81,8 +79,7 @@ Item {
onSourceAdded: {
if (debug) console.log("[main::onSourceAdded] : Source " + source)
systemmonitorDE.connectSource(source)
AWKeys.addDevice(source)
if (AWKeys.addDevice(source)) systemmonitorDE.connectSource(source)
}
}
@ -96,9 +93,7 @@ Item {
onNewData: {
if (debug) console.log("[main::onNewData] : Update source " + sourceName)
AWKeys.setDataBySource(sourceName, data, settings)
// update
if (sourceName == "update") needUpdate()
if (AWKeys.setDataBySource(sourceName, data, settings)) needUpdate()
}
}
@ -130,6 +125,13 @@ Item {
horizontalAlignment: general.align[plasmoid.configuration.textAlign]
textFormat: Text.RichText
text: plasmoid.configuration.text
PlasmaCore.ToolTipArea {
id: tooltip
height: 100
width: 500
mainText: "Awesome Widget"
}
}
}
@ -148,6 +150,8 @@ Item {
if (debug) console.log("[main::onNeedUpdate]")
text.text = AWKeys.parsePattern(plasmoid.configuration.text)
// FIXME change to pixmap/image/etc
tooltip.mainText = AWKeys.toolTipImage()
// update geometry
text.update()
height = text.contentHeight

View File

@ -59,6 +59,7 @@ Item {
width: parent.width
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap
text: i18n("CPU, CPU clock, memory, swap and network labels support graphical tooltip. To enable them just make needed checkbox fully checked.")
}

View File

@ -69,6 +69,7 @@ Item {
width: parent.width
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap
text: i18n("Detailed information may be found on <a href=\"http://arcanis.name/projects/awesome-widgets/\">project homepage</a>")
}