mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-15 06:45:48 +00:00
more correct logging, use qt logging for qml as well
This commit is contained in:
@ -111,6 +111,6 @@ Item {
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (debug) console.log("")
|
||||
if (debug) console.debug()
|
||||
}
|
||||
}
|
||||
|
@ -69,6 +69,7 @@ Item {
|
||||
width: parent.width * 2 / 3
|
||||
text: plasmoid.configuration.currentFontFamily
|
||||
onClicked: {
|
||||
if (debug) console.debug()
|
||||
fontDialog.setFont()
|
||||
fontDialog.visible = true
|
||||
}
|
||||
@ -133,8 +134,10 @@ Item {
|
||||
]
|
||||
onCurrentIndexChanged: cfg_currentFontWeight = model[currentIndex]["name"]
|
||||
Component.onCompleted: {
|
||||
if (debug) console.debug()
|
||||
for (var i = 0; i < model.length; i++) {
|
||||
if (model[i]["name"] == plasmoid.configuration.currentFontWeight) {
|
||||
if (debug) console.info("Found", model[i]["name"], "on", i)
|
||||
fontWeight.currentIndex = i;
|
||||
}
|
||||
}
|
||||
@ -168,8 +171,10 @@ Item {
|
||||
]
|
||||
onCurrentIndexChanged: cfg_currentFontStyle = model[currentIndex]["name"]
|
||||
Component.onCompleted: {
|
||||
if (debug) console.debug()
|
||||
for (var i = 0; i < model.length; i++) {
|
||||
if (model[i]["name"] == plasmoid.configuration.currentFontStyle) {
|
||||
if (debug) console.info("Found", model[i]["name"], "on", i)
|
||||
fontStyle.currentIndex = i;
|
||||
}
|
||||
}
|
||||
@ -214,12 +219,14 @@ Item {
|
||||
signal setFont
|
||||
|
||||
onAccepted: {
|
||||
if (debug) console.debug()
|
||||
selectFont.text = fontDialog.font.family
|
||||
fontSize.value = fontDialog.font.pointSize
|
||||
fontStyle.currentIndex = fontDialog.font.italic ? 1 : 0
|
||||
fontWeight.currentIndex = weight[fontDialog.font.weight]
|
||||
}
|
||||
onSetFont: {
|
||||
if (debug) console.debug()
|
||||
fontDialog.font = Qt.font({
|
||||
family: selectFont.text,
|
||||
pointSize: fontSize.value > 0 ? fontSize.value : 12,
|
||||
@ -230,6 +237,6 @@ Item {
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (debug) console.log("")
|
||||
if (debug) console.debug()
|
||||
}
|
||||
}
|
||||
|
@ -128,8 +128,10 @@ Item {
|
||||
]
|
||||
onCurrentIndexChanged: cfg_tooltipType = model[currentIndex]["name"]
|
||||
Component.onCompleted: {
|
||||
if (debug) console.debug()
|
||||
for (var i = 0; i < model.length; i++) {
|
||||
if (model[i]["name"] == plasmoid.configuration.tooltipType) {
|
||||
if (debug) console.info("Found", model[i]["name"], "on", i)
|
||||
tooltipType.currentIndex = i;
|
||||
}
|
||||
}
|
||||
@ -255,6 +257,6 @@ Item {
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (debug) console.log("")
|
||||
if (debug) console.debug()
|
||||
}
|
||||
}
|
||||
|
@ -69,6 +69,7 @@ Item {
|
||||
width: parent.width * 2 / 3
|
||||
text: plasmoid.configuration.fontFamily
|
||||
onClicked: {
|
||||
if (debug) console.debug()
|
||||
fontDialog.setFont()
|
||||
fontDialog.visible = true
|
||||
}
|
||||
@ -133,8 +134,10 @@ Item {
|
||||
]
|
||||
onCurrentIndexChanged: cfg_fontWeight = model[currentIndex]["name"]
|
||||
Component.onCompleted: {
|
||||
if (debug) console.debug()
|
||||
for (var i = 0; i < model.length; i++) {
|
||||
if (model[i]["name"] == plasmoid.configuration.fontWeight) {
|
||||
if (debug) console.info("Found", model[i]["name"], "on", i)
|
||||
fontWeight.currentIndex = i;
|
||||
}
|
||||
}
|
||||
@ -168,8 +171,10 @@ Item {
|
||||
]
|
||||
onCurrentIndexChanged: cfg_fontStyle = model[currentIndex]["name"]
|
||||
Component.onCompleted: {
|
||||
if (debug) console.debug()
|
||||
for (var i = 0; i < model.length; i++) {
|
||||
if (model[i]["name"] == plasmoid.configuration.fontStyle) {
|
||||
if (debug) console.info("Found", model[i]["name"], "on", i)
|
||||
fontStyle.currentIndex = i;
|
||||
}
|
||||
}
|
||||
@ -214,12 +219,14 @@ Item {
|
||||
signal setFont
|
||||
|
||||
onAccepted: {
|
||||
if (debug) console.debug()
|
||||
selectFont.text = fontDialog.font.family
|
||||
fontSize.value = fontDialog.font.pointSize
|
||||
fontStyle.currentIndex = fontDialog.font.italic ? 1 : 0
|
||||
fontWeight.currentIndex = weight[fontDialog.font.weight]
|
||||
}
|
||||
onSetFont: {
|
||||
if (debug) console.debug()
|
||||
fontDialog.font = Qt.font({
|
||||
family: selectFont.text,
|
||||
pointSize: fontSize.value > 0 ? fontSize.value : 12,
|
||||
@ -230,6 +237,6 @@ Item {
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (debug) console.log("")
|
||||
if (debug) console.debug()
|
||||
}
|
||||
}
|
||||
|
@ -108,11 +108,11 @@ Item {
|
||||
}
|
||||
|
||||
onNeedUpdate: {
|
||||
if (debug) console.log("")
|
||||
if (debug) console.debug()
|
||||
|
||||
for (var i=0; i<repeater.count; i++) {
|
||||
if (!repeater.itemAt(i)) {
|
||||
if (debug) console.log("Nothing to do here " + i)
|
||||
if (debug) console.info("Nothing to do here", i)
|
||||
timer.start()
|
||||
return
|
||||
}
|
||||
@ -138,7 +138,7 @@ Item {
|
||||
}
|
||||
|
||||
onNeedTooltipUpdate: {
|
||||
if (debug) console.log("")
|
||||
if (debug) console.debug()
|
||||
|
||||
for (var i=0; i<repeater.count; i++) {
|
||||
repeater.itemAt(i).tooltip.text = dpAdds.toolTipImage(i + 1)
|
||||
@ -146,7 +146,7 @@ Item {
|
||||
}
|
||||
|
||||
onSizeUpdate: {
|
||||
if (debug) console.log("")
|
||||
if (debug) console.debug()
|
||||
|
||||
if (plasmoid.configuration.height == 0) {
|
||||
var newHeight = 0
|
||||
@ -171,14 +171,14 @@ Item {
|
||||
}
|
||||
|
||||
Plasmoid.onActivated: {
|
||||
if (debug) console.log("")
|
||||
if (debug) console.debug()
|
||||
|
||||
// dpAdds.changePanelsState()
|
||||
}
|
||||
|
||||
Plasmoid.onUserConfiguringChanged: {
|
||||
if (plasmoid.userConfiguring) return
|
||||
if (debug) console.log("")
|
||||
if (debug) console.debug()
|
||||
|
||||
dpAdds.setMark(plasmoid.configuration.mark)
|
||||
dpAdds.setPanelsToControl(plasmoid.configuration.panels)
|
||||
@ -188,7 +188,7 @@ Item {
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (debug) console.log("")
|
||||
if (debug) console.debug()
|
||||
|
||||
// init submodule
|
||||
Plasmoid.userConfiguringChanged(false)
|
||||
|
@ -59,8 +59,7 @@ Item {
|
||||
iconName: "font"
|
||||
|
||||
onClicked: {
|
||||
if (debug) console.log("Font button")
|
||||
|
||||
if (debug) console.debug("Font button")
|
||||
var defaultFont = {
|
||||
"color": plasmoid.configuration.fontColor,
|
||||
"family": plasmoid.configuration.fontFamily,
|
||||
@ -81,8 +80,7 @@ Item {
|
||||
iconName: "format-indent-more"
|
||||
|
||||
onClicked: {
|
||||
if (debug) console.log("Indent button")
|
||||
|
||||
if (debug) console.debug("Indent button")
|
||||
var pos = textPattern.cursorPosition
|
||||
var selected = textPattern.selectedText
|
||||
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
|
||||
@ -95,8 +93,7 @@ Item {
|
||||
iconName: "format-text-bold"
|
||||
|
||||
onClicked: {
|
||||
if (debug) console.log("Bold button")
|
||||
|
||||
if (debug) console.debug("Bold button")
|
||||
var pos = textPattern.cursorPosition
|
||||
var selected = textPattern.selectedText
|
||||
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
|
||||
@ -108,8 +105,7 @@ Item {
|
||||
iconName: "format-text-italic"
|
||||
|
||||
onClicked: {
|
||||
if (debug) console.log("Italic button")
|
||||
|
||||
if (debug) console.debug("Italic button")
|
||||
var pos = textPattern.cursorPosition
|
||||
var selected = textPattern.selectedText
|
||||
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
|
||||
@ -121,8 +117,7 @@ Item {
|
||||
iconName: "format-text-underline"
|
||||
|
||||
onClicked: {
|
||||
if (debug) console.log("Underline button")
|
||||
|
||||
if (debug) console.debug("Underline button")
|
||||
var pos = textPattern.cursorPosition
|
||||
var selected = textPattern.selectedText
|
||||
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
|
||||
@ -134,8 +129,7 @@ Item {
|
||||
iconName: "format-text-strikethrough"
|
||||
|
||||
onClicked: {
|
||||
if (debug) console.log("Strike button")
|
||||
|
||||
if (debug) console.debug("Strike button")
|
||||
var pos = textPattern.cursorPosition
|
||||
var selected = textPattern.selectedText
|
||||
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
|
||||
@ -148,8 +142,7 @@ Item {
|
||||
iconName: "format-justify-left"
|
||||
|
||||
onClicked: {
|
||||
if (debug) console.log("Left button")
|
||||
|
||||
if (debug) console.debug("Left button")
|
||||
var pos = textPattern.cursorPosition
|
||||
var selected = textPattern.selectedText
|
||||
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
|
||||
@ -161,8 +154,7 @@ Item {
|
||||
iconName: "format-justify-center"
|
||||
|
||||
onClicked: {
|
||||
if (debug) console.log("Center button")
|
||||
|
||||
if (debug) console.debug("Center button")
|
||||
var pos = textPattern.cursorPosition
|
||||
var selected = textPattern.selectedText
|
||||
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
|
||||
@ -174,8 +166,7 @@ Item {
|
||||
iconName: "format-justify-right"
|
||||
|
||||
onClicked: {
|
||||
if (debug) console.log("Right button")
|
||||
|
||||
if (debug) console.debug("Right button")
|
||||
var pos = textPattern.cursorPosition
|
||||
var selected = textPattern.selectedText
|
||||
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
|
||||
@ -187,8 +178,7 @@ Item {
|
||||
iconName: "format-justify-fill"
|
||||
|
||||
onClicked: {
|
||||
if (debug) console.log("Justify button")
|
||||
|
||||
if (debug) console.debug("Justify button")
|
||||
var pos = textPattern.cursorPosition
|
||||
var selected = textPattern.selectedText
|
||||
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
|
||||
@ -210,8 +200,7 @@ Item {
|
||||
text: i18n("Add")
|
||||
|
||||
onClicked: {
|
||||
if (debug) console.log("Add tag button")
|
||||
|
||||
if (debug) console.debug("Add tag button")
|
||||
var pos = textPattern.cursorPosition
|
||||
var selected = textPattern.selectedText
|
||||
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
|
||||
@ -223,8 +212,7 @@ Item {
|
||||
text: i18n("Show value")
|
||||
|
||||
onClicked: {
|
||||
if (debug) console.log("Show tag button")
|
||||
|
||||
if (debug) console.debug("Show tag button")
|
||||
var message = i18n("Tag: %1", tags.currentText)
|
||||
message += "<br>"
|
||||
message += i18n("Value: %1", dpAdds.valueByKey(tags.currentText))
|
||||
@ -244,6 +232,6 @@ Item {
|
||||
|
||||
|
||||
Component.onCompleted: {
|
||||
if (debug) console.log("")
|
||||
if (debug) console.debug()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user