|
@ -15,10 +15,11 @@ Rectangle |
|
|
|
|
|
|
|
|
anchors.fill: parent |
|
|
anchors.fill: parent |
|
|
radius: 5 |
|
|
radius: 5 |
|
|
color: LogsPaneStyle.generic.layout.backgroundColor |
|
|
color: "transparent" |
|
|
ColumnLayout { |
|
|
id: logsPane |
|
|
|
|
|
Column { |
|
|
z: 2 |
|
|
z: 2 |
|
|
height: parent.height |
|
|
height: parent.height - rowAction.height |
|
|
width: parent.width |
|
|
width: parent.width |
|
|
spacing: 0 |
|
|
spacing: 0 |
|
|
|
|
|
|
|
@ -26,19 +27,18 @@ Rectangle |
|
|
id: logsModel |
|
|
id: logsModel |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
TableView { |
|
|
ScrollView |
|
|
id: logsTable |
|
|
|
|
|
clip: true |
|
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
|
Layout.preferredHeight: parent.height - rowAction.height |
|
|
|
|
|
headerVisible : false |
|
|
|
|
|
onDoubleClicked: |
|
|
|
|
|
{ |
|
|
{ |
|
|
var log = logsModel.get(logsTable.currentRow); |
|
|
id: scrollView |
|
|
if (log) |
|
|
height: parent.height |
|
|
clipboard.text = (log.type + "\t" + log.level + "\t" + log.date + "\t" + log.content); |
|
|
width: parent.width |
|
|
} |
|
|
horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff |
|
|
|
|
|
ColumnLayout |
|
|
|
|
|
{ |
|
|
|
|
|
id: logsRect |
|
|
|
|
|
spacing: 0 |
|
|
|
|
|
Repeater { |
|
|
|
|
|
clip: true |
|
|
model: SortFilterProxyModel { |
|
|
model: SortFilterProxyModel { |
|
|
id: proxyModel |
|
|
id: proxyModel |
|
|
source: logsModel |
|
|
source: logsModel |
|
@ -80,37 +80,76 @@ Rectangle |
|
|
filterSyntax: SortFilterProxyModel.RegExp |
|
|
filterSyntax: SortFilterProxyModel.RegExp |
|
|
filterCaseSensitivity: Qt.CaseInsensitive |
|
|
filterCaseSensitivity: Qt.CaseInsensitive |
|
|
} |
|
|
} |
|
|
TableViewColumn |
|
|
|
|
|
|
|
|
Rectangle |
|
|
{ |
|
|
{ |
|
|
role: "date" |
|
|
width: 750 |
|
|
title: qsTr("date") |
|
|
height: 30 |
|
|
|
|
|
color: |
|
|
|
|
|
{ |
|
|
|
|
|
if (level === "warning" || level === "error") |
|
|
|
|
|
return "#fffcd5"; |
|
|
|
|
|
else |
|
|
|
|
|
return index % 2 === 0 ? "transparent" : LogsPaneStyle.generic.layout.logAlternateColor; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DefaultLabel { |
|
|
|
|
|
text: date; |
|
|
|
|
|
font.family: LogsPaneStyle.generic.layout.logLabelFont |
|
|
width: LogsPaneStyle.generic.layout.dateWidth |
|
|
width: LogsPaneStyle.generic.layout.dateWidth |
|
|
delegate: itemDelegate |
|
|
font.pointSize: Style.absoluteSize(-1) |
|
|
|
|
|
anchors.left: parent.left |
|
|
|
|
|
anchors.leftMargin: 15 |
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
|
|
color: { |
|
|
|
|
|
parent.getColor(level); |
|
|
} |
|
|
} |
|
|
TableViewColumn |
|
|
} |
|
|
{ |
|
|
|
|
|
role: "type" |
|
|
DefaultLabel { |
|
|
title: qsTr("type") |
|
|
text: type; |
|
|
|
|
|
font.family: LogsPaneStyle.generic.layout.logLabelFont |
|
|
width: LogsPaneStyle.generic.layout.typeWidth |
|
|
width: LogsPaneStyle.generic.layout.typeWidth |
|
|
delegate: itemDelegate |
|
|
font.pointSize: Style.absoluteSize(-1) |
|
|
|
|
|
anchors.left: parent.left |
|
|
|
|
|
anchors.leftMargin: 100 |
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
|
|
color: { |
|
|
|
|
|
parent.getColor(level); |
|
|
} |
|
|
} |
|
|
TableViewColumn |
|
|
} |
|
|
{ |
|
|
|
|
|
role: "content" |
|
|
DefaultLabel { |
|
|
title: qsTr("content") |
|
|
text: content; |
|
|
|
|
|
font.family: LogsPaneStyle.generic.layout.logLabelFont |
|
|
width: LogsPaneStyle.generic.layout.contentWidth |
|
|
width: LogsPaneStyle.generic.layout.contentWidth |
|
|
delegate: itemDelegate |
|
|
font.pointSize: Style.absoluteSize(-1) |
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
|
|
anchors.left: parent.left |
|
|
|
|
|
anchors.leftMargin: 190 |
|
|
|
|
|
color: { |
|
|
|
|
|
parent.getColor(level); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
rowDelegate: Item { |
|
|
function getColor() |
|
|
Rectangle { |
|
|
{ |
|
|
width: logsTable.width - 4 |
|
|
if (level === "error") |
|
|
height: 17 |
|
|
return "red"; |
|
|
color: styleData.alternate ? "transparent" : LogsPaneStyle.generic.layout.logAlternateColor |
|
|
else if (level === "warning") |
|
|
|
|
|
return "orange"; |
|
|
|
|
|
else |
|
|
|
|
|
return "#808080"; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Component { |
|
|
Component { |
|
|
id: itemDelegate |
|
|
id: itemDelegate |
|
|
DefaultLabel { |
|
|
DefaultLabel { |
|
@ -128,58 +167,43 @@ Rectangle |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Row |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Rectangle |
|
|
{ |
|
|
{ |
|
|
id: rowAction |
|
|
gradient: Gradient { |
|
|
|
|
|
GradientStop { position: 0.0; color: "#f1f1f1" } |
|
|
|
|
|
GradientStop { position: 1.0; color: "#d9d7da" } |
|
|
|
|
|
} |
|
|
Layout.preferredHeight: LogsPaneStyle.generic.layout.headerHeight |
|
|
Layout.preferredHeight: LogsPaneStyle.generic.layout.headerHeight |
|
|
height: LogsPaneStyle.generic.layout.headerHeight |
|
|
height: LogsPaneStyle.generic.layout.headerHeight |
|
|
|
|
|
width: logsPane.width |
|
|
|
|
|
anchors.bottom: parent.bottom |
|
|
|
|
|
Row |
|
|
|
|
|
{ |
|
|
|
|
|
id: rowAction |
|
|
anchors.leftMargin: LogsPaneStyle.generic.layout.leftMargin |
|
|
anchors.leftMargin: LogsPaneStyle.generic.layout.leftMargin |
|
|
anchors.left: parent.left |
|
|
anchors.left: parent.left |
|
|
spacing: LogsPaneStyle.generic.layout.headerButtonSpacing |
|
|
spacing: LogsPaneStyle.generic.layout.headerButtonSpacing |
|
|
Button |
|
|
height: parent.height |
|
|
{ |
|
|
Rectangle |
|
|
height: LogsPaneStyle.generic.layout.headerButtonHeight |
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
|
|
action: clearAction |
|
|
|
|
|
iconSource: "qrc:/qml/img/broom.png" |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Action { |
|
|
|
|
|
id: clearAction |
|
|
|
|
|
enabled: logsModel.count > 0 |
|
|
|
|
|
tooltip: qsTr("Clear") |
|
|
|
|
|
onTriggered: { |
|
|
|
|
|
logsModel.clear() |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Button |
|
|
|
|
|
{ |
|
|
{ |
|
|
height: LogsPaneStyle.generic.layout.headerButtonHeight |
|
|
color: "transparent" |
|
|
|
|
|
height: 20 |
|
|
|
|
|
width: 50 |
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
action: copytoClipBoardAction |
|
|
DefaultLabel |
|
|
iconSource: "qrc:/qml/img/copy.png" |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Action { |
|
|
|
|
|
id: copytoClipBoardAction |
|
|
|
|
|
enabled: logsModel.count > 0 |
|
|
|
|
|
tooltip: qsTr("Copy to Clipboard") |
|
|
|
|
|
onTriggered: { |
|
|
|
|
|
var content = ""; |
|
|
|
|
|
for (var k = 0; k < logsModel.count; k++) |
|
|
|
|
|
{ |
|
|
{ |
|
|
var log = logsModel.get(k); |
|
|
color: "#808080" |
|
|
content += log.type + "\t" + log.level + "\t" + log.date + "\t" + log.content + "\n"; |
|
|
font.family: LogsPaneStyle.generic.layout.logLabelFont |
|
|
} |
|
|
text: qsTr("Show:") |
|
|
clipboard.text = content; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Rectangle { |
|
|
Rectangle { |
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
width: 1; |
|
|
width: 1; |
|
|
height: parent.height - 10 |
|
|
height: parent.height |
|
|
color : "#808080" |
|
|
color : "#808080" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -187,6 +211,7 @@ Rectangle |
|
|
id: javascriptButton |
|
|
id: javascriptButton |
|
|
checkable: true |
|
|
checkable: true |
|
|
height: LogsPaneStyle.generic.layout.headerButtonHeight |
|
|
height: LogsPaneStyle.generic.layout.headerButtonHeight |
|
|
|
|
|
width: 20 |
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
checked: true |
|
|
checked: true |
|
|
onCheckedChanged: { |
|
|
onCheckedChanged: { |
|
@ -202,16 +227,28 @@ Rectangle |
|
|
font.pointSize: Style.absoluteSize(-3) |
|
|
font.pointSize: Style.absoluteSize(-3) |
|
|
color: LogsPaneStyle.generic.layout.logLabelColor |
|
|
color: LogsPaneStyle.generic.layout.logLabelColor |
|
|
anchors.centerIn: parent |
|
|
anchors.centerIn: parent |
|
|
text: qsTr("JavaScript") |
|
|
text: qsTr("JS") |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
background: |
|
|
|
|
|
Rectangle { |
|
|
|
|
|
color: javascriptButton.checked ? "#cfcfcf" : "transparent" |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Rectangle { |
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
|
|
width: 1; |
|
|
|
|
|
height: parent.height |
|
|
|
|
|
color : "#808080" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
ToolButton { |
|
|
ToolButton { |
|
|
id: runButton |
|
|
id: runButton |
|
|
checkable: true |
|
|
checkable: true |
|
|
height: LogsPaneStyle.generic.layout.headerButtonHeight |
|
|
height: LogsPaneStyle.generic.layout.headerButtonHeight |
|
|
|
|
|
width: 30 |
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
checked: true |
|
|
checked: true |
|
|
onCheckedChanged: { |
|
|
onCheckedChanged: { |
|
@ -230,14 +267,26 @@ Rectangle |
|
|
text: qsTr("Run") |
|
|
text: qsTr("Run") |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
background: |
|
|
|
|
|
Rectangle { |
|
|
|
|
|
color: runButton.checked ? "#cfcfcf" : "transparent" |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Rectangle { |
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
|
|
width: 1; |
|
|
|
|
|
height: parent.height |
|
|
|
|
|
color : "#808080" |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
ToolButton { |
|
|
ToolButton { |
|
|
id: stateButton |
|
|
id: stateButton |
|
|
checkable: true |
|
|
checkable: true |
|
|
height: LogsPaneStyle.generic.layout.headerButtonHeight |
|
|
height: LogsPaneStyle.generic.layout.headerButtonHeight |
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
|
|
width: 35 |
|
|
checked: true |
|
|
checked: true |
|
|
onCheckedChanged: { |
|
|
onCheckedChanged: { |
|
|
proxyModel.toogleFilter("state") |
|
|
proxyModel.toogleFilter("state") |
|
@ -250,26 +299,144 @@ Rectangle |
|
|
DefaultLabel { |
|
|
DefaultLabel { |
|
|
font.family: LogsPaneStyle.generic.layout.logLabelFont |
|
|
font.family: LogsPaneStyle.generic.layout.logLabelFont |
|
|
font.pointSize: Style.absoluteSize(-3) |
|
|
font.pointSize: Style.absoluteSize(-3) |
|
|
color: "#5391d8" |
|
|
color: LogsPaneStyle.generic.layout.logLabelColor |
|
|
anchors.centerIn: parent |
|
|
anchors.centerIn: parent |
|
|
text: qsTr("State") |
|
|
text: qsTr("State") |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
background: |
|
|
|
|
|
Rectangle { |
|
|
|
|
|
color: stateButton.checked ? "#cfcfcf" : "transparent" |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Rectangle { |
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
|
|
width: 1; |
|
|
|
|
|
height: parent.height |
|
|
|
|
|
color : "#808080" |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Row |
|
|
|
|
|
{ |
|
|
|
|
|
height: parent.height |
|
|
|
|
|
anchors.right: parent.right |
|
|
|
|
|
anchors.rightMargin: 4 |
|
|
|
|
|
spacing: 4 |
|
|
|
|
|
Button |
|
|
|
|
|
{ |
|
|
|
|
|
id: clearButton |
|
|
|
|
|
height: LogsPaneStyle.generic.layout.headerButtonHeight |
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
|
|
action: hideAction |
|
|
|
|
|
iconSource: "qrc:/qml/img/cleariconactive.png" |
|
|
|
|
|
style: |
|
|
|
|
|
ButtonStyle { |
|
|
|
|
|
background: |
|
|
|
|
|
Rectangle { |
|
|
|
|
|
height: LogsPaneStyle.generic.layout.headerButtonHeight |
|
|
|
|
|
implicitHeight: LogsPaneStyle.generic.layout.headerButtonHeight |
|
|
|
|
|
color: "transparent" |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Image { |
|
|
|
|
|
id: clearImage |
|
|
|
|
|
source: "qrc:/qml/img/cleariconactive.png" |
|
|
|
|
|
anchors.centerIn: parent |
|
|
|
|
|
fillMode: Image.PreserveAspectFit |
|
|
|
|
|
width: 30 |
|
|
|
|
|
height: 30 |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Button |
|
|
|
|
|
{ |
|
|
|
|
|
id: exitButton |
|
|
|
|
|
height: LogsPaneStyle.generic.layout.headerButtonHeight |
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
|
|
action: exitAction |
|
|
|
|
|
iconSource: "qrc:/qml/img/exit.png" |
|
|
|
|
|
style: |
|
|
|
|
|
ButtonStyle { |
|
|
|
|
|
background: |
|
|
|
|
|
Rectangle { |
|
|
|
|
|
height: LogsPaneStyle.generic.layout.headerButtonHeight |
|
|
|
|
|
color: "transparent" |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Button |
|
|
|
|
|
{ |
|
|
|
|
|
id: copyButton |
|
|
|
|
|
height: LogsPaneStyle.generic.layout.headerButtonHeight |
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
|
|
action: copytoClipBoardAction |
|
|
|
|
|
iconSource: "qrc:/qml/img/copyiconactive.png" |
|
|
|
|
|
style: |
|
|
|
|
|
ButtonStyle { |
|
|
|
|
|
background: |
|
|
|
|
|
Rectangle { |
|
|
|
|
|
height: LogsPaneStyle.generic.layout.headerButtonHeight |
|
|
|
|
|
color: "transparent" |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Action { |
|
|
|
|
|
id: clearAction |
|
|
|
|
|
tooltip: qsTr("Hide") |
|
|
|
|
|
onTriggered: { |
|
|
|
|
|
logsPane.parent.toggle(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Action { |
|
|
|
|
|
id: hideAction |
|
|
|
|
|
enabled: logsModel.count > 0 |
|
|
|
|
|
tooltip: qsTr("Clear") |
|
|
|
|
|
onTriggered: { |
|
|
|
|
|
logsModel.clear() |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Action { |
|
|
|
|
|
id: copytoClipBoardAction |
|
|
|
|
|
enabled: logsModel.count > 0 |
|
|
|
|
|
tooltip: qsTr("Copy to Clipboard") |
|
|
|
|
|
onTriggered: { |
|
|
|
|
|
var content = ""; |
|
|
|
|
|
for (var k = 0; k < logsModel.count; k++) |
|
|
|
|
|
{ |
|
|
|
|
|
var log = logsModel.get(k); |
|
|
|
|
|
content += log.type + "\t" + log.level + "\t" + log.date + "\t" + log.content + "\n"; |
|
|
|
|
|
} |
|
|
|
|
|
clipboard.text = content; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
DefaultTextField |
|
|
DefaultTextField |
|
|
{ |
|
|
{ |
|
|
id: searchBox |
|
|
id: searchBox |
|
|
height: LogsPaneStyle.generic.layout.headerButtonHeight |
|
|
height: LogsPaneStyle.generic.layout.headerButtonHeight - 5 |
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
width: LogsPaneStyle.generic.layout.headerInputWidth |
|
|
width: LogsPaneStyle.generic.layout.headerInputWidth - 40 |
|
|
font.family: LogsPaneStyle.generic.layout.logLabelFont |
|
|
font.family: LogsPaneStyle.generic.layout.logLabelFont |
|
|
font.pointSize: Style.absoluteSize(-3) |
|
|
font.pointSize: Style.absoluteSize(-3) |
|
|
font.italic: true |
|
|
font.italic: true |
|
|
|
|
|
text: qsTr("Search") |
|
|
onTextChanged: { |
|
|
onTextChanged: { |
|
|
proxyModel.search(text); |
|
|
proxyModel.search(text); |
|
|
} |
|
|
} |
|
|
|
|
|
style: |
|
|
|
|
|
TextFieldStyle { |
|
|
|
|
|
background: Rectangle { |
|
|
|
|
|
radius: 10 |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|