mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-15 14:55:48 +00:00
more correct fix for #57
This commit is contained in:
@ -24,12 +24,19 @@ import org.kde.plasma.private.awesomewidget 1.0
|
||||
|
||||
Item {
|
||||
id: aboutPage
|
||||
AWKeys {
|
||||
id: awKeys;
|
||||
}
|
||||
AWActions {
|
||||
id: awActions;
|
||||
}
|
||||
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
implicitWidth: pageColumn.implicitWidth
|
||||
implicitHeight: pageColumn.implicitHeight
|
||||
|
||||
property bool debug: AWKeys.isDebugEnabled()
|
||||
property bool debug: awKeys.isDebugEnabled()
|
||||
|
||||
|
||||
Column {
|
||||
@ -45,26 +52,26 @@ Item {
|
||||
QtControls.Label {
|
||||
QtLayouts.Layout.fillWidth: true
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: AWActions.getAboutText("header")
|
||||
text: awActions.getAboutText("header")
|
||||
}
|
||||
|
||||
QtControls.Label {
|
||||
QtLayouts.Layout.fillWidth: true
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: AWActions.getAboutText("version")
|
||||
text: awActions.getAboutText("version")
|
||||
}
|
||||
|
||||
QtControls.Label {
|
||||
QtLayouts.Layout.fillWidth: true
|
||||
horizontalAlignment: Text.AlignJustify
|
||||
text: AWActions.getAboutText("description")
|
||||
text: awActions.getAboutText("description")
|
||||
}
|
||||
|
||||
QtControls.Label {
|
||||
QtLayouts.Layout.fillWidth: true
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
textFormat: Text.RichText
|
||||
text: AWActions.getAboutText("links")
|
||||
text: awActions.getAboutText("links")
|
||||
onLinkActivated: Qt.openUrlExternally(link);
|
||||
}
|
||||
|
||||
@ -75,7 +82,7 @@ Item {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignBottom
|
||||
textFormat: Text.RichText
|
||||
text: AWActions.getAboutText("copy")
|
||||
text: awActions.getAboutText("copy")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -88,7 +95,7 @@ Item {
|
||||
QtLayouts.Layout.fillWidth: true
|
||||
wrapMode: Text.WordWrap
|
||||
horizontalAlignment: Text.AlignJustify
|
||||
text: AWActions.getAboutText("translators")
|
||||
text: awActions.getAboutText("translators")
|
||||
}
|
||||
|
||||
QtControls.Label {
|
||||
@ -97,7 +104,7 @@ Item {
|
||||
horizontalAlignment: Text.AlignJustify
|
||||
verticalAlignment: Text.AlignTop
|
||||
textFormat: Text.RichText
|
||||
text: AWActions.getAboutText("3rdparty")
|
||||
text: awActions.getAboutText("3rdparty")
|
||||
onLinkActivated: Qt.openUrlExternally(link);
|
||||
}
|
||||
}
|
||||
|
@ -23,12 +23,17 @@ import org.kde.plasma.private.awesomewidget 1.0
|
||||
|
||||
Item {
|
||||
id: advancedPage
|
||||
// backend
|
||||
AWKeys {
|
||||
id: awKeys;
|
||||
}
|
||||
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
implicitWidth: pageColumn.implicitWidth
|
||||
implicitHeight: pageColumn.implicitHeight
|
||||
|
||||
property bool debug: AWKeys.isDebugEnabled()
|
||||
property bool debug: awKeys.isDebugEnabled()
|
||||
|
||||
property alias cfg_height: widgetHeight.value
|
||||
property alias cfg_width: widgetWidth.value
|
||||
|
@ -25,12 +25,17 @@ import org.kde.plasma.private.awesomewidget 1.0
|
||||
|
||||
Item {
|
||||
id: appearancePage
|
||||
// backend
|
||||
AWKeys {
|
||||
id: awKeys;
|
||||
}
|
||||
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
implicitWidth: pageColumn.implicitWidth
|
||||
implicitHeight: pageColumn.implicitHeight
|
||||
|
||||
property bool debug: AWKeys.isDebugEnabled()
|
||||
property bool debug: awKeys.isDebugEnabled()
|
||||
property variant weight: {
|
||||
25: 0,
|
||||
50: 1,
|
||||
|
@ -26,12 +26,20 @@ import org.kde.plasma.private.awesomewidget 1.0
|
||||
|
||||
Item {
|
||||
id: dataenginePage
|
||||
// backend
|
||||
AWKeys {
|
||||
id: awKeys;
|
||||
}
|
||||
AWActions {
|
||||
id: awActions;
|
||||
}
|
||||
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
implicitWidth: pageColumn.implicitWidth
|
||||
implicitHeight: pageColumn.implicitHeight
|
||||
|
||||
property bool debug: AWKeys.isDebugEnabled()
|
||||
property bool debug: awKeys.isDebugEnabled()
|
||||
property variant tooltipSettings: {
|
||||
"tooltipNumber": plasmoid.configuration.tooltipNumber,
|
||||
"useTooltipBackground": plasmoid.configuration.useTooltipBackground,
|
||||
@ -53,7 +61,7 @@ Item {
|
||||
"batInTooltipColor": plasmoid.configuration.batInTooltipColor
|
||||
}
|
||||
|
||||
property variant cfg_dataengine: AWActions.readDataEngineConfiguration()
|
||||
property variant cfg_dataengine: awActions.readDataEngineConfiguration()
|
||||
|
||||
Column {
|
||||
id: pageColumn
|
||||
@ -87,7 +95,7 @@ Item {
|
||||
QtControls.Button {
|
||||
width: parent.width * 3 / 5
|
||||
text: i18n("Edit scripts")
|
||||
onClicked: AWKeys.editItem("extscript")
|
||||
onClicked: awKeys.editItem("extscript")
|
||||
}
|
||||
}
|
||||
|
||||
@ -128,7 +136,7 @@ Item {
|
||||
QtControls.ComboBox {
|
||||
id: hdd
|
||||
width: parent.width * 3 / 5
|
||||
model: AWKeys.getHddDevices(true)
|
||||
model: awKeys.getHddDevices(true)
|
||||
Component.onCompleted: {
|
||||
for (var i=0; i<model.length; i++) {
|
||||
if (model[i] == cfg_dataengine["HDDDEV"]) {
|
||||
@ -247,7 +255,7 @@ Item {
|
||||
QtControls.Button {
|
||||
width: parent.width * 3 / 5
|
||||
text: i18n("Edit tickers")
|
||||
onClicked: AWKeys.editItem("extquotes")
|
||||
onClicked: awKeys.editItem("extquotes")
|
||||
}
|
||||
}
|
||||
|
||||
@ -264,7 +272,7 @@ Item {
|
||||
QtControls.Button {
|
||||
width: parent.width * 3 / 5
|
||||
text: i18n("Edit command")
|
||||
onClicked: AWKeys.editItem("extupgrade")
|
||||
onClicked: awKeys.editItem("extupgrade")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -273,7 +281,7 @@ Item {
|
||||
if (debug) console.log("[dataengine::onCompleted]")
|
||||
|
||||
// init submodule
|
||||
AWKeys.initKeys(plasmoid.configuration.text)
|
||||
awKeys.initKeys(plasmoid.configuration.text)
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
@ -283,6 +291,6 @@ Item {
|
||||
cfg_dataengine["HDDDEV"] = hdd.currentText
|
||||
cfg_dataengine["PLAYER"] = player.currentText
|
||||
cfg_dataengine["MPRIS"] = mpris.currentText
|
||||
AWActions.writeDataEngineConfiguration(cfg_dataengine)
|
||||
awActions.writeDataEngineConfiguration(cfg_dataengine)
|
||||
}
|
||||
}
|
||||
|
@ -28,8 +28,15 @@ import "."
|
||||
|
||||
Item {
|
||||
id: main
|
||||
// backend
|
||||
AWKeys {
|
||||
id: awKeys;
|
||||
}
|
||||
AWActions {
|
||||
id: awActions;
|
||||
}
|
||||
|
||||
property bool debug: AWKeys.isDebugEnabled()
|
||||
property bool debug: awKeys.isDebugEnabled()
|
||||
property variant settings: {
|
||||
"customTime": plasmoid.configuration.customTime,
|
||||
"customUptime": plasmoid.configuration.customUptime,
|
||||
@ -86,13 +93,13 @@ Item {
|
||||
// FIXME: ugly workaround to make some sources working
|
||||
systemmonitorDE.interval = plasmoid.configuration.interval
|
||||
|
||||
AWKeys.setDataBySource(sourceName, data, settings)
|
||||
awKeys.setDataBySource(sourceName, data, settings)
|
||||
}
|
||||
|
||||
onSourceAdded: {
|
||||
if (debug) console.log("[main::onSourceAdded] : Source " + source)
|
||||
|
||||
AWKeys.addDevice(source)
|
||||
awKeys.addDevice(source)
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,7 +114,7 @@ Item {
|
||||
// FIXME: ugly workaround to make some sources working
|
||||
extsysmonDE.interval = plasmoid.configuration.interval
|
||||
|
||||
AWKeys.setDataBySource(sourceName, data, settings)
|
||||
awKeys.setDataBySource(sourceName, data, settings)
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,7 +127,7 @@ Item {
|
||||
onNewData: {
|
||||
if (debug) console.log("[main::onNewData] : Update source " + sourceName)
|
||||
|
||||
AWKeys.setDataBySource(sourceName, data, settings)
|
||||
awKeys.setDataBySource(sourceName, data, settings)
|
||||
}
|
||||
}
|
||||
|
||||
@ -167,8 +174,8 @@ Item {
|
||||
// init submodule
|
||||
Plasmoid.userConfiguringChanged(false)
|
||||
// connect data
|
||||
AWKeys.dropSourceFromDataengine.connect(dropSource)
|
||||
AWKeys.needToBeUpdated.connect(needUpdate)
|
||||
awKeys.dropSourceFromDataengine.connect(dropSource)
|
||||
awKeys.needToBeUpdated.connect(needUpdate)
|
||||
}
|
||||
|
||||
onDropSource: {
|
||||
@ -181,8 +188,8 @@ Item {
|
||||
onNeedUpdate: {
|
||||
if (debug) console.log("[main::onNeedUpdate]")
|
||||
|
||||
text.text = AWKeys.parsePattern(plasmoid.configuration.text)
|
||||
tooltip.text = AWKeys.toolTipImage()
|
||||
text.text = awKeys.parsePattern()
|
||||
tooltip.text = awKeys.toolTipImage()
|
||||
|
||||
sizeUpdate()
|
||||
}
|
||||
@ -211,10 +218,10 @@ Item {
|
||||
if (debug) console.log("[main::onUserConfiguringChanged]")
|
||||
|
||||
// init submodule
|
||||
AWKeys.initKeys()
|
||||
AWKeys.initTooltip(tooltipSettings)
|
||||
AWKeys.setPopupEnabled(plasmoid.configuration.notify)
|
||||
AWKeys.setWrapNewLines(plasmoid.configuration.wrapNewLines)
|
||||
awKeys.initKeys(plasmoid.configuration.text)
|
||||
awKeys.initTooltip(tooltipSettings)
|
||||
awKeys.setPopupEnabled(plasmoid.configuration.notify)
|
||||
awKeys.setWrapNewLines(plasmoid.configuration.wrapNewLines)
|
||||
|
||||
needUpdate()
|
||||
}
|
||||
@ -222,24 +229,24 @@ Item {
|
||||
function action_checkUpdates() {
|
||||
if (debug) console.log("[main::action_checkUpdates]")
|
||||
|
||||
AWActions.checkUpdates()
|
||||
awActions.checkUpdates()
|
||||
}
|
||||
|
||||
function action_showReadme() {
|
||||
if (debug) console.log("[main::action_showReadme]")
|
||||
|
||||
AWActions.showReadme()
|
||||
awActions.showReadme()
|
||||
}
|
||||
|
||||
function action_report() {
|
||||
if (debug) console.log("[main::action_report]")
|
||||
|
||||
AWActions.sendEmail()
|
||||
awActions.sendEmail()
|
||||
}
|
||||
|
||||
function action_requestKey() {
|
||||
if (debug) console.log("[main::action_requestKey]")
|
||||
|
||||
AWKeys.graphicalValueByKey()
|
||||
awKeys.graphicalValueByKey()
|
||||
}
|
||||
}
|
||||
|
@ -25,12 +25,17 @@ import org.kde.plasma.private.awesomewidget 1.0
|
||||
|
||||
Item {
|
||||
id: tooltipPage
|
||||
// backend
|
||||
AWKeys {
|
||||
id: awKeys;
|
||||
}
|
||||
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
implicitWidth: pageColumn.implicitWidth
|
||||
implicitHeight: pageColumn.implicitHeight
|
||||
|
||||
property bool debug: AWKeys.isDebugEnabled()
|
||||
property bool debug: awKeys.isDebugEnabled()
|
||||
|
||||
property alias cfg_tooltipNumber: tooltipNumber.value
|
||||
property alias cfg_useTooltipBackground: useTooltipBackground.checked
|
||||
|
@ -24,12 +24,20 @@ import org.kde.plasma.private.awesomewidget 1.0
|
||||
|
||||
Item {
|
||||
id: widgetPage
|
||||
// backend
|
||||
AWKeys {
|
||||
id: awKeys;
|
||||
}
|
||||
AWActions {
|
||||
id: awActions;
|
||||
}
|
||||
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
implicitWidth: pageColumn.implicitWidth
|
||||
implicitHeight: pageColumn.implicitHeight
|
||||
|
||||
property bool debug: AWKeys.isDebugEnabled()
|
||||
property bool debug: awKeys.isDebugEnabled()
|
||||
property variant settings: {
|
||||
"customTime": plasmoid.configuration.customTime,
|
||||
"customUptime": plasmoid.configuration.customUptime,
|
||||
@ -89,7 +97,7 @@ Item {
|
||||
"family": plasmoid.configuration.fontFamily,
|
||||
"size": plasmoid.configuration.fontSize
|
||||
}
|
||||
var font = AWActions.getFont(defaultFont)
|
||||
var font = awActions.getFont(defaultFont)
|
||||
var pos = textPattern.cursorPosition
|
||||
var selected = textPattern.selectedText
|
||||
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
|
||||
@ -249,10 +257,10 @@ Item {
|
||||
|
||||
var message = i18n("Tag: %1", tags.currentText)
|
||||
message += "<br>"
|
||||
message += i18n("Value: %1", AWKeys.valueByKey(tags.currentText))
|
||||
message += i18n("Value: %1", awKeys.valueByKey(tags.currentText))
|
||||
message += "<br>"
|
||||
message += i18n("Info: %1", AWKeys.infoByKey(tags.currentText))
|
||||
AWActions.sendNotification("tag", message)
|
||||
message += i18n("Info: %1", awKeys.infoByKey(tags.currentText))
|
||||
awActions.sendNotification("tag", message)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -263,7 +271,7 @@ Item {
|
||||
QtControls.Button {
|
||||
width: parent.width
|
||||
text: i18n("Edit bars")
|
||||
onClicked: AWKeys.editItem("graphicalitem")
|
||||
onClicked: awKeys.editItem("graphicalitem")
|
||||
}
|
||||
}
|
||||
|
||||
@ -287,7 +295,7 @@ Item {
|
||||
onNewData: {
|
||||
if (debug) console.log("[widget::onNewData] : Update source " + sourceName)
|
||||
|
||||
AWKeys.setDataBySource(sourceName, data, settings)
|
||||
awKeys.setDataBySource(sourceName, data, settings)
|
||||
}
|
||||
}
|
||||
|
||||
@ -300,7 +308,7 @@ Item {
|
||||
onNewData: {
|
||||
if (debug) console.log("[widget::onNewData] : Update source " + sourceName)
|
||||
|
||||
AWKeys.setDataBySource(sourceName, data, settings)
|
||||
awKeys.setDataBySource(sourceName, data, settings)
|
||||
}
|
||||
}
|
||||
|
||||
@ -313,7 +321,7 @@ Item {
|
||||
onNewData: {
|
||||
if (debug) console.log("[widget::onNewData] : Update source " + sourceName)
|
||||
|
||||
AWKeys.setDataBySource(sourceName, data, settings)
|
||||
awKeys.setDataBySource(sourceName, data, settings)
|
||||
}
|
||||
}
|
||||
|
||||
@ -321,7 +329,7 @@ Item {
|
||||
if (debug) console.log("[widget::onCompleted]")
|
||||
|
||||
// init submodule
|
||||
AWKeys.initKeys(plasmoid.configuration.text)
|
||||
tags.model = AWKeys.dictKeys(true)
|
||||
awKeys.initKeys(plasmoid.configuration.text)
|
||||
tags.model = awKeys.dictKeys(true)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user