mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-15 06:45:48 +00:00
* better extensions update
* prepare dataaggregator to graph data * add ability to wrap text * move tag selection dialog to ui
This commit is contained in:
@ -50,6 +50,9 @@
|
||||
<entry name="translateStrings" type="bool">
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry name="wrapText" type="bool">
|
||||
<default>false</default>
|
||||
</entry>
|
||||
</group>
|
||||
|
||||
<group name="Tooltip">
|
||||
|
@ -47,6 +47,7 @@ Item {
|
||||
property alias cfg_acOffline: acOffline.text
|
||||
property alias cfg_checkUpdates: updates.checked
|
||||
property alias cfg_translateStrings: translate.checked
|
||||
property alias cfg_wrapText: wordWrap.checked
|
||||
|
||||
|
||||
Column {
|
||||
@ -120,6 +121,20 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
QtControls.Label {
|
||||
height: parent.heigth
|
||||
width: parent.width * 2 / 5
|
||||
}
|
||||
QtControls.CheckBox {
|
||||
id: wordWrap
|
||||
width: parent.width * 3 / 5
|
||||
text: i18n("Enable word wrap")
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
import QtQuick 2.4
|
||||
import QtQuick.Controls 1.3 as QtControls
|
||||
import QtQuick.Dialogs 1.2 as QtDialogs
|
||||
import QtQuick.Layouts 1.1
|
||||
import org.kde.plasma.plasmoid 2.0
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
@ -37,13 +38,6 @@ Item {
|
||||
}
|
||||
|
||||
property bool debug: awActions.isDebugEnabled()
|
||||
property variant settings: {
|
||||
"customTime": plasmoid.configuration.customTime,
|
||||
"customUptime": plasmoid.configuration.customUptime,
|
||||
"tempUnits": plasmoid.configuration.tempUnits,
|
||||
"acOnline": plasmoid.configuration.acOnline,
|
||||
"acOffline": plasmoid.configuration.acOffline
|
||||
}
|
||||
property variant tooltipSettings: {
|
||||
"tooltipNumber": plasmoid.configuration.tooltipNumber,
|
||||
"useTooltipBackground": plasmoid.configuration.useTooltipBackground,
|
||||
@ -63,8 +57,10 @@ Item {
|
||||
"upTooltipColor": plasmoid.configuration.upTooltipColor,
|
||||
"batTooltipColor": plasmoid.configuration.batTooltipColor,
|
||||
"batInTooltipColor": plasmoid.configuration.batInTooltipColor,
|
||||
// additinal field to parse AC status
|
||||
"acOnline": plasmoid.configuration.acOnline
|
||||
// additional field to parse AC status
|
||||
"acOnline": plasmoid.configuration.acOnline,
|
||||
// additional field to send notifications
|
||||
"notify": plasmoid.configuration.notify
|
||||
}
|
||||
|
||||
signal dropSource(string sourceName)
|
||||
@ -93,7 +89,7 @@ Item {
|
||||
|
||||
onNewData: {
|
||||
if (debug) console.debug("Update source", sourceName)
|
||||
awKeys.dataUpdateReceived(sourceName, data, settings)
|
||||
awKeys.dataUpdateReceived(sourceName, data)
|
||||
}
|
||||
|
||||
onSourceAdded: {
|
||||
@ -110,8 +106,7 @@ Item {
|
||||
|
||||
onNewData: {
|
||||
if (debug) console.debug("Update source", sourceName)
|
||||
// extsysmonDE.interval = plasmoid.configuration.interval
|
||||
awKeys.dataUpdateReceived(sourceName, data, settings)
|
||||
awKeys.dataUpdateReceived(sourceName, data)
|
||||
}
|
||||
}
|
||||
|
||||
@ -123,7 +118,7 @@ Item {
|
||||
|
||||
onNewData: {
|
||||
if (debug) console.debug("Update source", sourceName)
|
||||
awKeys.dataUpdateReceived(sourceName, data, settings)
|
||||
awKeys.dataUpdateReceived(sourceName, data)
|
||||
}
|
||||
}
|
||||
|
||||
@ -134,7 +129,7 @@ Item {
|
||||
anchors.fill: parent
|
||||
renderType: Text.NativeRendering
|
||||
textFormat: Text.RichText
|
||||
wrapMode: Text.NoWrap
|
||||
wrapMode: plasmoid.configuration.wrapText ? Text.WordWrap : Text.NoWrap
|
||||
|
||||
horizontalAlignment: general.align[plasmoid.configuration.textAlign]
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
@ -157,6 +152,27 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
QtDialogs.Dialog {
|
||||
id: tagSelector
|
||||
title: i18n("Select tag")
|
||||
|
||||
QtControls.ComboBox {
|
||||
id: tagSelectorBox
|
||||
width: parent.width
|
||||
editable: true
|
||||
}
|
||||
|
||||
onAccepted: {
|
||||
var tag = tagSelectorBox.editText
|
||||
var message = i18n("Tag: %1", tag)
|
||||
message += "<br>"
|
||||
message += i18n("Value: %1", awKeys.valueByKey(tag))
|
||||
message += "<br>"
|
||||
message += i18n("Info: %1", awKeys.infoByKey(tag))
|
||||
awActions.sendNotification("tag", message)
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (debug) console.debug()
|
||||
|
||||
@ -221,10 +237,15 @@ Item {
|
||||
|
||||
// init submodule
|
||||
awKeys.initKeys(plasmoid.configuration.text)
|
||||
awKeys.initTooltip(tooltipSettings)
|
||||
awKeys.setPopupEnabled(plasmoid.configuration.notify)
|
||||
awKeys.setTranslateStrings(plasmoid.configuration.translateStrings)
|
||||
awKeys.initDataAggregator(tooltipSettings)
|
||||
awKeys.setWrapNewLines(plasmoid.configuration.wrapNewLines)
|
||||
// configure aggregator
|
||||
awKeys.setAggregatorProperty("acOffline", plasmoid.configuration.acOffline)
|
||||
awKeys.setAggregatorProperty("acOnline", plasmoid.configuration.acOnline)
|
||||
awKeys.setAggregatorProperty("customTime", plasmoid.configuration.customTime)
|
||||
awKeys.setAggregatorProperty("customUptime", plasmoid.configuration.customUptime)
|
||||
awKeys.setAggregatorProperty("tempUnits", plasmoid.configuration.tempUnits)
|
||||
awKeys.setAggregatorProperty("translate", plasmoid.configuration.translateStrings)
|
||||
}
|
||||
|
||||
function action_checkUpdates() {
|
||||
@ -242,6 +263,7 @@ Item {
|
||||
function action_requestKey() {
|
||||
if (debug) console.debug()
|
||||
|
||||
return awKeys.graphicalValueByKey()
|
||||
tagSelectorBox.model = awKeys.dictKeys(true)
|
||||
return tagSelector.open()
|
||||
}
|
||||
}
|
||||
|
@ -38,33 +38,6 @@ Item {
|
||||
implicitHeight: pageColumn.implicitHeight
|
||||
|
||||
property bool debug: awActions.isDebugEnabled()
|
||||
property variant settings: {
|
||||
"customTime": plasmoid.configuration.customTime,
|
||||
"customUptime": plasmoid.configuration.customUptime,
|
||||
"tempUnits": plasmoid.configuration.tempUnits,
|
||||
"acOnline": plasmoid.configuration.acOnline,
|
||||
"acOffline": plasmoid.configuration.acOffline
|
||||
}
|
||||
property variant tooltipSettings: {
|
||||
"tooltipNumber": plasmoid.configuration.tooltipNumber,
|
||||
"useTooltipBackground": plasmoid.configuration.useTooltipBackground,
|
||||
"tooltipBackgroung": plasmoid.configuration.tooltipBackgroung,
|
||||
"cpuTooltip": plasmoid.configuration.cpuTooltip,
|
||||
"cpuclTooltip": plasmoid.configuration.cpuclTooltip,
|
||||
"memTooltip": plasmoid.configuration.memTooltip,
|
||||
"swapTooltip": plasmoid.configuration.swapTooltip,
|
||||
"downTooltip": plasmoid.configuration.downTooltip,
|
||||
"upTooltip": plasmoid.configuration.downTooltip,
|
||||
"batTooltip": plasmoid.configuration.batTooltip,
|
||||
"cpuTooltipColor": plasmoid.configuration.cpuTooltipColor,
|
||||
"cpuclTooltipColor": plasmoid.configuration.cpuclTooltipColor,
|
||||
"memTooltipColor": plasmoid.configuration.memTooltipColor,
|
||||
"swapTooltipColor": plasmoid.configuration.swapTooltipColor,
|
||||
"downTooltipColor": plasmoid.configuration.downTooltipColor,
|
||||
"upTooltipColor": plasmoid.configuration.upTooltipColor,
|
||||
"batTooltipColor": plasmoid.configuration.batTooltipColor,
|
||||
"batInTooltipColor": plasmoid.configuration.batInTooltipColor
|
||||
}
|
||||
|
||||
property alias cfg_text: textPattern.text
|
||||
|
||||
@ -362,7 +335,7 @@ Item {
|
||||
|
||||
onNewData: {
|
||||
if (debug) console.debug("Update source", sourceName)
|
||||
awKeys.dataUpdateReceived(sourceName, data, settings)
|
||||
awKeys.dataUpdateReceived(sourceName, data)
|
||||
}
|
||||
}
|
||||
|
||||
@ -374,7 +347,7 @@ Item {
|
||||
|
||||
onNewData: {
|
||||
if (debug) console.debug("Update source", sourceName)
|
||||
awKeys.dataUpdateReceived(sourceName, data, settings)
|
||||
awKeys.dataUpdateReceived(sourceName, data)
|
||||
}
|
||||
}
|
||||
|
||||
@ -386,16 +359,24 @@ Item {
|
||||
|
||||
onNewData: {
|
||||
if (debug) console.debug("Update source", sourceName)
|
||||
awKeys.dataUpdateReceived(sourceName, data, settings)
|
||||
awKeys.dataUpdateReceived(sourceName, data)
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (debug) console.debug()
|
||||
|
||||
// drop "update" source which does not required by this page
|
||||
extsysmonDE.disconnectSource("update")
|
||||
awKeys.dropSourceFromDataengine.connect(dropSource)
|
||||
// init submodule
|
||||
awKeys.initKeys(plasmoid.configuration.text)
|
||||
awKeys.setAggregatorProperty("acOffline", plasmoid.configuration.acOffline)
|
||||
awKeys.setAggregatorProperty("acOnline", plasmoid.configuration.acOnline)
|
||||
awKeys.setAggregatorProperty("customTime", plasmoid.configuration.customTime)
|
||||
awKeys.setAggregatorProperty("customUptime", plasmoid.configuration.customUptime)
|
||||
awKeys.setAggregatorProperty("tempUnits", plasmoid.configuration.tempUnits)
|
||||
awKeys.setAggregatorProperty("translate", plasmoid.configuration.translateStrings)
|
||||
}
|
||||
|
||||
onDropSource: {
|
||||
|
Reference in New Issue
Block a user