Browse Source

- UI changes

- Filter by message type
cl-refactor
yann300 10 years ago
parent
commit
b020371743
  1. 107
      mix/qml/LogsPane.qml
  2. 27
      mix/qml/StatusPane.qml
  3. 1
      mix/res.qrc

107
mix/qml/LogsPane.qml

@ -1,6 +1,7 @@
import QtQuick 2.0
import QtQuick.Layouts 1.0
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.3
import org.ethereum.qml.SortFilterProxyModel 1.0
import "."
@ -15,10 +16,10 @@ Rectangle
radius: 5
color: "#f7f7f7"
border.color: "#808080"
border.width: 2
border.width: 1
ColumnLayout {
height: parent.height - 4
width: parent.width - 2
height: parent.height
width: parent.width
spacing: 0
Row
{
@ -62,11 +63,93 @@ Rectangle
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;
content += log.type + "\t" + log.level + "\t" + log.date + "\t" + log.content + "\n";
}
appContext.toClipboard(content);
}
}
Rectangle {
anchors.verticalCenter: parent.verticalCenter
width: 1;
height: parent.height - 10
color : "#808080"
}
ToolButton {
id: javascriptButton
checkable: true
height: 30
anchors.verticalCenter: parent.verticalCenter
checked: true
onCheckedChanged: {
proxyModel.toogleFilter("javascript")
}
tooltip: qsTr("JavaScript")
style:
ButtonStyle {
label:
Item {
DefaultLabel {
font.family: "sans serif"
font.pointSize: Style.absoluteSize(-3)
color: "#5391d8"
anchors.centerIn: parent
text: qsTr("JavaScript")
}
}
}
}
ToolButton {
id: runButton
checkable: true
height: 30
anchors.verticalCenter: parent.verticalCenter
checked: true
onCheckedChanged: {
proxyModel.toogleFilter("run")
}
tooltip: qsTr("Run")
style:
ButtonStyle {
label:
Item {
DefaultLabel {
font.family: "sans serif"
font.pointSize: Style.absoluteSize(-3)
color: "#5391d8"
anchors.centerIn: parent
text: qsTr("Run")
}
}
}
}
ToolButton {
id: stateButton
checkable: true
height: 30
anchors.verticalCenter: parent.verticalCenter
checked: true
onCheckedChanged: {
proxyModel.toogleFilter("state")
}
tooltip: qsTr("State")
style:
ButtonStyle {
label:
Item {
DefaultLabel {
font.family: "sans serif"
font.pointSize: Style.absoluteSize(-3)
color: "#5391d8"
anchors.centerIn: parent
text: qsTr("State")
}
}
}
}
}
ListModel {
@ -89,9 +172,17 @@ Rectangle
id: proxyModel
source: logsModel
filterRole: ""
filterString: ""
filterSyntax: SortFilterProxyModel.Wildcard
function toogleFilter(_value)
{
if (filterString.indexOf('_' + _value) !== -1)
filterString = filterString.replace('_' + _value, _value);
else
filterString = filterString.replace(_value, '_' + _value);
}
filterRole: "type"
filterString: "(?:javascript|run|state)"
filterSyntax: SortFilterProxyModel.RegExp
filterCaseSensitivity: Qt.CaseInsensitive
}
TableViewColumn
@ -139,5 +230,5 @@ Rectangle
}
}
}
}
}
}

27
mix/qml/StatusPane.qml

@ -87,6 +87,24 @@ Rectangle {
width: 500
height: 30
color: "#fcfbfc"
states: [
State {
name: "logsOpened"
PropertyChanges {
target: statusContainer
border.color: "#808080"
border.width: 1
}
},
State {
name: "logsClosed"
PropertyChanges {
target: statusContainer
border.color: "#808080"
border.width: 0
}
}
]
Text {
anchors.verticalCenter: parent.verticalCenter
@ -152,18 +170,25 @@ Rectangle {
function toggle()
{
if (logsContainer.state === "opened")
{
statusContainer.state = "logsClosed";
logsContainer.state = "closed"
}
else
{
statusContainer.state = "logsOpened";
logsContainer.state = "opened";
}
}
id: logsContainer
width: 1000
height: 0
anchors.topMargin: 2
//anchors.topMargin:
anchors.top: statusContainer.bottom
anchors.horizontalCenter: parent.horizontalCenter
visible: false
radius: 5
Component.onCompleted:
{
var top = logsContainer;

1
mix/res.qrc

@ -110,7 +110,6 @@
<file>qml/img/run.png</file>
<file>qml/img/note.png</file>
<file>qml/LogsPane.qml</file>
<file>qml/LogsWindow.qml</file>
<file>qml/img/copy.png</file>
<file>qml/img/broom.png</file>
</qresource>

Loading…
Cancel
Save