|
|
@ -16,23 +16,24 @@ ColumnLayout |
|
|
|
property int number |
|
|
|
property int blockWidth: Layout.preferredWidth - statusWidth - horizontalMargin |
|
|
|
property int horizontalMargin: 10 |
|
|
|
property int trHeight: 30 |
|
|
|
property int trHeight: 35 |
|
|
|
spacing: 0 |
|
|
|
property int openedTr: 0 |
|
|
|
property int blockIndex |
|
|
|
property variant scenario |
|
|
|
property string labelColor: "#414141" |
|
|
|
|
|
|
|
function calculateHeight() |
|
|
|
{ |
|
|
|
if (transactions) |
|
|
|
{ |
|
|
|
if (index >= 0) |
|
|
|
return 30 + 30 * transactions.count + openedTr |
|
|
|
return trHeight + trHeight * transactions.count + openedTr |
|
|
|
else |
|
|
|
return 30 |
|
|
|
return trHeight |
|
|
|
} |
|
|
|
else |
|
|
|
return 30 |
|
|
|
return trHeight |
|
|
|
} |
|
|
|
|
|
|
|
onOpenedTrChanged: |
|
|
@ -41,31 +42,67 @@ ColumnLayout |
|
|
|
height = calculateHeight() |
|
|
|
} |
|
|
|
|
|
|
|
DebuggerPaneStyle { |
|
|
|
id: dbgStyle |
|
|
|
} |
|
|
|
|
|
|
|
Rectangle |
|
|
|
{ |
|
|
|
id: top |
|
|
|
Layout.preferredWidth: blockWidth |
|
|
|
height: 10 |
|
|
|
anchors.bottom: rowHeader.top |
|
|
|
color: "#DEDCDC" |
|
|
|
radius: 15 |
|
|
|
anchors.left: parent.left |
|
|
|
anchors.leftMargin: statusWidth |
|
|
|
anchors.bottomMargin: -5 |
|
|
|
} |
|
|
|
|
|
|
|
RowLayout |
|
|
|
{ |
|
|
|
Layout.preferredHeight: trHeight |
|
|
|
Layout.preferredWidth: blockWidth |
|
|
|
id: rowHeader |
|
|
|
spacing: 0 |
|
|
|
Rectangle |
|
|
|
{ |
|
|
|
color: "#DEDCDC" |
|
|
|
Layout.preferredWidth: blockWidth |
|
|
|
Layout.preferredHeight: trHeight |
|
|
|
radius: 4 |
|
|
|
color: "#DEDCDC" |
|
|
|
anchors.left: parent.left |
|
|
|
anchors.leftMargin: statusWidth + 5 |
|
|
|
anchors.leftMargin: statusWidth |
|
|
|
Label { |
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
anchors.left: parent.left |
|
|
|
anchors.leftMargin: horizontalMargin |
|
|
|
font.pointSize: dbgStyle.absoluteSize(1) |
|
|
|
color: "#adadad" |
|
|
|
text: |
|
|
|
{ |
|
|
|
if (status === "mined") |
|
|
|
if (number === -2) |
|
|
|
return qsTr("STARTING PARAMETERS") |
|
|
|
else if (status === "mined") |
|
|
|
return qsTr("BLOCK") + " " + number |
|
|
|
else |
|
|
|
return qsTr("BLOCK") + " pending" |
|
|
|
return qsTr("PENDING TRANSACTIONS") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Label |
|
|
|
{ |
|
|
|
text: qsTr("EDIT") |
|
|
|
color: "#1397da" |
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
anchors.right: parent.right |
|
|
|
anchors.rightMargin: 14 |
|
|
|
MouseArea |
|
|
|
{ |
|
|
|
anchors.fill: parent |
|
|
|
onClicked: |
|
|
|
{ |
|
|
|
// load edit block panel |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -75,11 +112,11 @@ ColumnLayout |
|
|
|
{ |
|
|
|
id: transactionRepeater |
|
|
|
model: transactions |
|
|
|
|
|
|
|
RowLayout |
|
|
|
{ |
|
|
|
id: rowTransaction |
|
|
|
Layout.preferredHeight: trHeight |
|
|
|
spacing: 0 |
|
|
|
function displayContent() |
|
|
|
{ |
|
|
|
logsText.text = "" |
|
|
@ -99,7 +136,7 @@ ColumnLayout |
|
|
|
var p = log.param.get(i) |
|
|
|
logsText.text += p.name + " = " + p.value + " - indexed:" + p.indexed + "\n" |
|
|
|
} |
|
|
|
else{ |
|
|
|
else { |
|
|
|
logsText.text += "From : " + log.address + "\n" |
|
|
|
} |
|
|
|
} |
|
|
@ -112,18 +149,19 @@ ColumnLayout |
|
|
|
{ |
|
|
|
id: trSaveStatus |
|
|
|
Layout.preferredWidth: statusWidth |
|
|
|
Layout.preferredHeight: trHeight |
|
|
|
Layout.preferredHeight: parent.height |
|
|
|
color: "transparent" |
|
|
|
anchors.top: parent.top |
|
|
|
property bool saveStatus |
|
|
|
|
|
|
|
Image { |
|
|
|
anchors.top: parent.top |
|
|
|
anchors.left: parent.left |
|
|
|
anchors.leftMargin: -9 |
|
|
|
anchors.topMargin: -9 |
|
|
|
id: saveStatusImage |
|
|
|
source: "qrc:/qml/img/recyclediscard@2x.png" |
|
|
|
width: statusWidth |
|
|
|
width: statusWidth + 20 |
|
|
|
fillMode: Image.PreserveAspectFit |
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
anchors.horizontalCenter: parent.horizontalCenter |
|
|
|
} |
|
|
|
|
|
|
|
Component.onCompleted: |
|
|
@ -160,23 +198,42 @@ ColumnLayout |
|
|
|
color: "#DEDCDC" |
|
|
|
id: rowContentTr |
|
|
|
anchors.top: parent.top |
|
|
|
|
|
|
|
MouseArea |
|
|
|
{ |
|
|
|
anchors.fill: parent |
|
|
|
onDoubleClicked: |
|
|
|
{ |
|
|
|
transactionDialog.stateAccounts = scenario.accounts |
|
|
|
transactionDialog.execute = false |
|
|
|
transactionDialog.open(index, blockIndex, transactions.get(index)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
ColumnLayout |
|
|
|
{ |
|
|
|
anchors.top: parent.top |
|
|
|
spacing: 10 |
|
|
|
width: parent.width |
|
|
|
spacing: 20 |
|
|
|
RowLayout |
|
|
|
{ |
|
|
|
anchors.top: parent.top |
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
spacing: cellSpacing |
|
|
|
Text |
|
|
|
Layout.fillWidth: true |
|
|
|
Rectangle |
|
|
|
{ |
|
|
|
id: hash |
|
|
|
Layout.preferredWidth: fromWidth |
|
|
|
anchors.left: parent.left |
|
|
|
anchors.leftMargin: horizontalMargin |
|
|
|
Layout.preferredWidth: fromWidth |
|
|
|
Text |
|
|
|
{ |
|
|
|
id: hash |
|
|
|
width: parent.width - 30 |
|
|
|
elide: Text.ElideRight |
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
maximumLineCount: 1 |
|
|
|
color: labelColor |
|
|
|
font.pointSize: dbgStyle.absoluteSize(1) |
|
|
|
font.bold: true |
|
|
|
text: { |
|
|
|
if (index >= 0) |
|
|
|
return transactions.get(index).sender |
|
|
@ -184,20 +241,32 @@ ColumnLayout |
|
|
|
return "" |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Rectangle |
|
|
|
{ |
|
|
|
Layout.preferredWidth: toWidth |
|
|
|
Text |
|
|
|
{ |
|
|
|
id: func |
|
|
|
text: { |
|
|
|
if (index >= 0) |
|
|
|
parent.userFrienldyToken(transactions.get(index).label) |
|
|
|
parent.parent.userFrienldyToken(transactions.get(index).label) |
|
|
|
else |
|
|
|
return "" |
|
|
|
} |
|
|
|
elide: Text.ElideRight |
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
color: labelColor |
|
|
|
font.pointSize: dbgStyle.absoluteSize(1) |
|
|
|
font.bold: true |
|
|
|
maximumLineCount: 1 |
|
|
|
Layout.preferredWidth: toWidth |
|
|
|
width: parent.width |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function userFrienldyToken(value) |
|
|
|
{ |
|
|
@ -212,12 +281,19 @@ ColumnLayout |
|
|
|
return value |
|
|
|
} |
|
|
|
|
|
|
|
Rectangle |
|
|
|
{ |
|
|
|
Layout.preferredWidth: valueWidth |
|
|
|
Text |
|
|
|
{ |
|
|
|
id: returnValue |
|
|
|
elide: Text.ElideRight |
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
maximumLineCount: 1 |
|
|
|
Layout.preferredWidth: valueWidth |
|
|
|
color: labelColor |
|
|
|
font.bold: true |
|
|
|
font.pointSize: dbgStyle.absoluteSize(1) |
|
|
|
width: parent.width -30 |
|
|
|
text: { |
|
|
|
if (index >= 0 && transactions.get(index).returned) |
|
|
|
return transactions.get(index).returned |
|
|
@ -225,6 +301,7 @@ ColumnLayout |
|
|
|
return "" |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Rectangle |
|
|
|
{ |
|
|
@ -236,7 +313,11 @@ ColumnLayout |
|
|
|
{ |
|
|
|
id: logs |
|
|
|
anchors.left: parent.left |
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
anchors.leftMargin: 10 |
|
|
|
color: labelColor |
|
|
|
font.bold: true |
|
|
|
font.pointSize: dbgStyle.absoluteSize(1) |
|
|
|
text: { |
|
|
|
if (index >= 0 && transactions.get(index).logs && transactions.get(index).logs.count) |
|
|
|
return transactions.get(index).logs.count |
|
|
@ -251,42 +332,56 @@ ColumnLayout |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Rectangle |
|
|
|
RowLayout |
|
|
|
{ |
|
|
|
Layout.preferredWidth: debugActionWidth |
|
|
|
Layout.preferredHeight: trHeight - 10 |
|
|
|
color: "transparent" |
|
|
|
|
|
|
|
Image { |
|
|
|
source: "qrc:/qml/img/edit.png" |
|
|
|
width: 18 |
|
|
|
fillMode: Image.PreserveAspectFit |
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
anchors.horizontalCenter: parent.horizontalCenter |
|
|
|
id: rowDetailedContent |
|
|
|
visible: false |
|
|
|
Layout.preferredHeight:{ |
|
|
|
if (index >= 0 && transactions.get(index).logs) |
|
|
|
return 100 * transactions.get(index).logs.count |
|
|
|
else |
|
|
|
return 100 |
|
|
|
} |
|
|
|
MouseArea |
|
|
|
onVisibleChanged: |
|
|
|
{ |
|
|
|
anchors.fill: parent |
|
|
|
onClicked: |
|
|
|
var lognb = transactions.get(index).logs.count |
|
|
|
if (visible) |
|
|
|
{ |
|
|
|
transactionDialog.stateAccounts = scenario.accounts |
|
|
|
transactionDialog.execute = false |
|
|
|
transactionDialog.open(index, blockIndex, transactions.get(index)) |
|
|
|
rowContentTr.Layout.preferredHeight = trHeight + 100 * lognb |
|
|
|
openedTr += 100 * lognb |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
rowContentTr.Layout.preferredHeight = trHeight |
|
|
|
openedTr -= 100 * lognb |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Text { |
|
|
|
anchors.left: parent.left |
|
|
|
anchors.leftMargin: horizontalMargin |
|
|
|
id: logsText |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Rectangle |
|
|
|
{ |
|
|
|
Layout.preferredWidth: debugActionWidth |
|
|
|
Layout.preferredHeight: trHeight - 10 |
|
|
|
width: debugActionWidth |
|
|
|
height: trHeight |
|
|
|
anchors.left: rowContentTr.right |
|
|
|
anchors.topMargin: -6 |
|
|
|
anchors.top: rowContentTr.top |
|
|
|
anchors.leftMargin: -50 |
|
|
|
color: "transparent" |
|
|
|
|
|
|
|
Image { |
|
|
|
id: debugImg |
|
|
|
source: "qrc:/qml/img/rightarrow@2x.png" |
|
|
|
width: statusWidth |
|
|
|
width: debugActionWidth |
|
|
|
fillMode: Image.PreserveAspectFit |
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
anchors.horizontalCenter: parent.horizontalCenter |
|
|
@ -306,41 +401,19 @@ ColumnLayout |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
RowLayout |
|
|
|
{ |
|
|
|
id: rowDetailedContent |
|
|
|
visible: false |
|
|
|
Layout.preferredHeight:{ |
|
|
|
if (index >= 0 && transactions.get(index).logs) |
|
|
|
return 100 * transactions.get(index).logs.count |
|
|
|
else |
|
|
|
return 100 |
|
|
|
} |
|
|
|
onVisibleChanged: |
|
|
|
{ |
|
|
|
var lognb = transactions.get(index).logs.count |
|
|
|
if (visible) |
|
|
|
{ |
|
|
|
rowContentTr.Layout.preferredHeight = trHeight + 100 * lognb |
|
|
|
openedTr += 100 * lognb |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
rowContentTr.Layout.preferredHeight = trHeight |
|
|
|
openedTr -= 100 * lognb |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Text { |
|
|
|
Rectangle |
|
|
|
{ |
|
|
|
id: right |
|
|
|
Layout.preferredWidth: blockWidth |
|
|
|
height: 10 |
|
|
|
anchors.top: parent.bottom |
|
|
|
anchors.topMargin: 5 |
|
|
|
color: "#DEDCDC" |
|
|
|
radius: 15 |
|
|
|
anchors.left: parent.left |
|
|
|
anchors.leftMargin: horizontalMargin |
|
|
|
id: logsText |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
anchors.leftMargin: statusWidth |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|