|
|
@ -14,7 +14,7 @@ Dialog { |
|
|
|
modality: Qt.ApplicationModal |
|
|
|
|
|
|
|
width: 630 |
|
|
|
height: 480 |
|
|
|
height: 500 |
|
|
|
title: qsTr("Edit State") |
|
|
|
visible: false |
|
|
|
|
|
|
@ -45,16 +45,22 @@ Dialog { |
|
|
|
|
|
|
|
accountsModel.clear(); |
|
|
|
stateAccounts = []; |
|
|
|
var miner = 0; |
|
|
|
|
|
|
|
for (var k = 0; k < item.accounts.length; k++) |
|
|
|
{ |
|
|
|
accountsModel.append(item.accounts[k]); |
|
|
|
stateAccounts.push(item.accounts[k]); |
|
|
|
if (item.accounts[k].name === item.miner.name) |
|
|
|
miner = k; |
|
|
|
} |
|
|
|
|
|
|
|
visible = true; |
|
|
|
isDefault = setDefault; |
|
|
|
titleField.focus = true; |
|
|
|
defaultCheckBox.enabled = !isDefault; |
|
|
|
comboMiner.model = stateAccounts; |
|
|
|
comboMiner.currentIndex = miner; |
|
|
|
forceActiveFocus(); |
|
|
|
} |
|
|
|
|
|
|
@ -75,6 +81,14 @@ Dialog { |
|
|
|
} |
|
|
|
item.transactions = stateTransactions; |
|
|
|
item.accounts = stateAccounts; |
|
|
|
for (var k = 0; k < stateAccounts.length; k++) |
|
|
|
{ |
|
|
|
if (stateAccounts[k].name === comboMiner.currentText) |
|
|
|
{ |
|
|
|
item.miner = stateAccounts[k]; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
return item; |
|
|
|
} |
|
|
|
contentItem: Rectangle { |
|
|
@ -159,7 +173,7 @@ Dialog { |
|
|
|
TableViewColumn { |
|
|
|
role: "name" |
|
|
|
title: qsTr("Name") |
|
|
|
width: 150 |
|
|
|
width: 230 |
|
|
|
delegate: Item { |
|
|
|
RowLayout |
|
|
|
{ |
|
|
@ -190,7 +204,12 @@ Dialog { |
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
onTextChanged: { |
|
|
|
if (styleData.row > -1) |
|
|
|
stateAccounts[styleData.row].name = text; |
|
|
|
{ |
|
|
|
stateAccounts[styleData.row].name = text |
|
|
|
var index = comboMiner.currentIndex; |
|
|
|
comboMiner.model = stateAccounts; |
|
|
|
comboMiner.currentIndex = index; |
|
|
|
} |
|
|
|
} |
|
|
|
text: { |
|
|
|
return styleData.value |
|
|
@ -226,6 +245,25 @@ Dialog { |
|
|
|
Layout.fillWidth: true |
|
|
|
} |
|
|
|
|
|
|
|
RowLayout |
|
|
|
{ |
|
|
|
Layout.fillWidth: true |
|
|
|
DefaultLabel { |
|
|
|
Layout.preferredWidth: 85 |
|
|
|
text: qsTr("Miner") |
|
|
|
} |
|
|
|
ComboBox { |
|
|
|
id: comboMiner |
|
|
|
textRole: "name" |
|
|
|
Layout.fillWidth: true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
CommonSeparator |
|
|
|
{ |
|
|
|
Layout.fillWidth: true |
|
|
|
} |
|
|
|
|
|
|
|
RowLayout |
|
|
|
{ |
|
|
|
Layout.fillWidth: true |
|
|
|