|
@ -10,11 +10,11 @@ import "." |
|
|
Window { |
|
|
Window { |
|
|
id: modalTransactionDialog |
|
|
id: modalTransactionDialog |
|
|
modality: Qt.WindowModal |
|
|
modality: Qt.WindowModal |
|
|
width: 640 |
|
|
width: 450 |
|
|
height: 700 |
|
|
height: (paramsModel.count > 0 ? 550 : 300) |
|
|
visible: false |
|
|
visible: false |
|
|
color: StateDialogStyle.generic.backgroundColor |
|
|
color: StateDialogStyle.generic.backgroundColor |
|
|
|
|
|
title: qsTr("Transaction Edition") |
|
|
property int transactionIndex |
|
|
property int transactionIndex |
|
|
property alias transactionParams: paramsModel; |
|
|
property alias transactionParams: paramsModel; |
|
|
property alias gas: gasField.value; |
|
|
property alias gas: gasField.value; |
|
@ -66,6 +66,9 @@ Window { |
|
|
for (var p = 0; p < parameters.length; p++) |
|
|
for (var p = 0; p < parameters.length; p++) |
|
|
loadParameter(parameters[p]); |
|
|
loadParameter(parameters[p]); |
|
|
} |
|
|
} |
|
|
|
|
|
modalTransactionDialog.setX((Screen.width - width) / 2); |
|
|
|
|
|
modalTransactionDialog.setY((Screen.height - height) / 2); |
|
|
|
|
|
|
|
|
visible = true; |
|
|
visible = true; |
|
|
valueField.focus = true; |
|
|
valueField.focus = true; |
|
|
} |
|
|
} |
|
@ -108,6 +111,15 @@ Window { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function param(name) |
|
|
|
|
|
{ |
|
|
|
|
|
for (var k = 0; k < paramsModel.count; k++) |
|
|
|
|
|
{ |
|
|
|
|
|
if (paramsModel.get(k).name === name) |
|
|
|
|
|
return paramsModel.get(k); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
function close() |
|
|
function close() |
|
|
{ |
|
|
{ |
|
|
visible = false; |
|
|
visible = false; |
|
@ -163,13 +175,16 @@ Window { |
|
|
id: regularFont |
|
|
id: regularFont |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
ColumnLayout { |
|
|
Rectangle { |
|
|
id: dialogContent |
|
|
anchors.fill: parent |
|
|
width: parent.width |
|
|
|
|
|
anchors.left: parent.left |
|
|
anchors.left: parent.left |
|
|
anchors.right: parent.right |
|
|
anchors.right: parent.right |
|
|
anchors.top: parent.top |
|
|
anchors.top: parent.top |
|
|
anchors.margins: 10 |
|
|
anchors.margins: 10 |
|
|
|
|
|
color: StateDialogStyle.generic.backgroundColor |
|
|
|
|
|
|
|
|
|
|
|
ColumnLayout { |
|
|
|
|
|
id: dialogContent |
|
|
spacing: 30 |
|
|
spacing: 30 |
|
|
RowLayout |
|
|
RowLayout |
|
|
{ |
|
|
{ |
|
@ -257,12 +272,6 @@ Window { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//ColumnLayout |
|
|
|
|
|
//{ |
|
|
|
|
|
//Layout.fillHeight: true; |
|
|
|
|
|
//Layout.fillWidth: true; |
|
|
|
|
|
//visible: paramsModel.count > 0 |
|
|
|
|
|
|
|
|
|
|
|
Label { |
|
|
Label { |
|
|
text: qsTr("Parameters") |
|
|
text: qsTr("Parameters") |
|
|
Layout.preferredWidth: 75 |
|
|
Layout.preferredWidth: 75 |
|
@ -271,50 +280,66 @@ Window { |
|
|
visible: paramsModel.count > 0 |
|
|
visible: paramsModel.count > 0 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ScrollView |
|
|
|
|
|
{ |
|
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
|
visible: paramsModel.count > 0 |
|
|
|
|
|
ColumnLayout |
|
|
|
|
|
{ |
|
|
|
|
|
id: paramRepeater |
|
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
|
spacing: 10 |
|
|
Repeater |
|
|
Repeater |
|
|
{ |
|
|
{ |
|
|
|
|
|
anchors.fill: parent |
|
|
model: paramsModel |
|
|
model: paramsModel |
|
|
visible: paramsModel.count > 0 |
|
|
visible: paramsModel.count > 0 |
|
|
Rectangle |
|
|
RowLayout |
|
|
{ |
|
|
{ |
|
|
color: "transparent" |
|
|
id: row |
|
|
Layout.fillWidth: true |
|
|
Layout.fillWidth: true |
|
|
height: 150 |
|
|
height: 150 |
|
|
|
|
|
|
|
|
Label { |
|
|
Label { |
|
|
id: typeLabel |
|
|
id: typeLabel |
|
|
text: type |
|
|
text: type |
|
|
|
|
|
font.family: regularFont.name |
|
|
|
|
|
Layout.preferredWidth: 50 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Label { |
|
|
Label { |
|
|
anchors.left: typeLabel.right |
|
|
|
|
|
id: nameLabel |
|
|
id: nameLabel |
|
|
text: name |
|
|
text: name |
|
|
|
|
|
font.family: regularFont.name |
|
|
|
|
|
Layout.preferredWidth: 50 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Label { |
|
|
Label { |
|
|
anchors.left: nameLabel.right |
|
|
|
|
|
id: equalLabel |
|
|
id: equalLabel |
|
|
text: "=" |
|
|
text: "=" |
|
|
|
|
|
font.family: regularFont.name |
|
|
|
|
|
Layout.preferredWidth: 15 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Loader |
|
|
Loader |
|
|
{ |
|
|
{ |
|
|
anchors.left: equalLabel.right |
|
|
|
|
|
id: typeLoader |
|
|
id: typeLoader |
|
|
height: 50 |
|
|
Layout.preferredHeight: 50 |
|
|
width: 150 |
|
|
Layout.preferredWidth: 150 |
|
|
|
|
|
function getCurrent() |
|
|
|
|
|
{ |
|
|
|
|
|
return modalTransactionDialog.param(name); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
Connections { |
|
|
Connections { |
|
|
target: typeLoader.item |
|
|
target: typeLoader.item |
|
|
onTextChanged: { |
|
|
onTextChanged: { |
|
|
console.log("text changed 0 " + value); |
|
|
typeLoader.getCurrent().value = typeLoader.item.text; |
|
|
value = typeLoader.item.text; |
|
|
|
|
|
console.log("text changed 1 " + value); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
sourceComponent: |
|
|
sourceComponent: |
|
|
{ |
|
|
{ |
|
|
console.log(type); |
|
|
|
|
|
if (type.indexOf("int") !== -1) |
|
|
if (type.indexOf("int") !== -1) |
|
|
return intViewComp; |
|
|
return intViewComp; |
|
|
else if (type.indexOf("bool") !== -1) |
|
|
else if (type.indexOf("bool") !== -1) |
|
@ -335,7 +360,7 @@ Window { |
|
|
height: 50 |
|
|
height: 50 |
|
|
width: 150 |
|
|
width: 150 |
|
|
id: intView |
|
|
id: intView |
|
|
text: value |
|
|
text: typeLoader.getCurrent().value |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -350,10 +375,8 @@ Window { |
|
|
defaultValue: "1" |
|
|
defaultValue: "1" |
|
|
Component.onCompleted: |
|
|
Component.onCompleted: |
|
|
{ |
|
|
{ |
|
|
/*loaderEditor.updateValue(styleData.row, styleData.role, |
|
|
var current = typeLoader.getCurrent().value; |
|
|
(paramsModel.get(styleData.row).value === "" ? defaultValue : |
|
|
(current === "" ? text = defaultValue : text = current); |
|
|
paramsModel.get(styleData.row).value)); |
|
|
|
|
|
text = (paramsModel.get(styleData.row).value === "" ? defaultValue : paramsModel.get(styleData.row).value);*/ |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -366,7 +389,10 @@ Window { |
|
|
height: 50 |
|
|
height: 50 |
|
|
width: 150 |
|
|
width: 150 |
|
|
id: stringView |
|
|
id: stringView |
|
|
text: value |
|
|
text: |
|
|
|
|
|
{ |
|
|
|
|
|
return typeLoader.getCurrent().value |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -378,40 +404,14 @@ Window { |
|
|
height: 50 |
|
|
height: 50 |
|
|
width: 150 |
|
|
width: 150 |
|
|
id: hashView |
|
|
id: hashView |
|
|
text: value |
|
|
text: typeLoader.getCurrent().value |
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
//} |
|
|
|
|
|
|
|
|
|
|
|
/*TableView { |
|
|
|
|
|
model: paramsModel |
|
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
|
Layout.minimumHeight: 150 |
|
|
|
|
|
Layout.preferredHeight: 400 |
|
|
|
|
|
Layout.maximumHeight: 600 |
|
|
|
|
|
TableViewColumn { |
|
|
|
|
|
role: "name" |
|
|
|
|
|
title: qsTr("Name") |
|
|
|
|
|
width: 120 |
|
|
|
|
|
} |
|
|
} |
|
|
TableViewColumn { |
|
|
|
|
|
role: "type" |
|
|
|
|
|
title: qsTr("Type") |
|
|
|
|
|
width: 120 |
|
|
|
|
|
} |
|
|
} |
|
|
TableViewColumn { |
|
|
|
|
|
role: "value" |
|
|
|
|
|
title: qsTr("Value") |
|
|
|
|
|
width: 240 |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
rowDelegate: rowDelegate |
|
|
|
|
|
itemDelegate: editableDelegate |
|
|
|
|
|
}*/ |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
RowLayout |
|
|
RowLayout |
|
@ -431,8 +431,7 @@ Window { |
|
|
onClicked: close(); |
|
|
onClicked: close(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
ListModel { |
|
|
ListModel { |
|
|
id: paramsModel |
|
|
id: paramsModel |
|
|
} |
|
|
} |
|
@ -466,7 +465,6 @@ Window { |
|
|
|
|
|
|
|
|
sourceComponent: |
|
|
sourceComponent: |
|
|
{ |
|
|
{ |
|
|
console.log("role " + styleData.role); |
|
|
|
|
|
if (styleData.role === "value") |
|
|
if (styleData.role === "value") |
|
|
{ |
|
|
{ |
|
|
if (paramsModel.get(styleData.row) === undefined) |
|
|
if (paramsModel.get(styleData.row) === undefined) |
|
|