Browse Source

autoselect transaction

cl-refactor
yann300 10 years ago
parent
commit
b8c01de80b
  1. 28
      mix/qml/Block.qml
  2. 7
      mix/qml/BlockChain.qml
  3. 3
      mix/qml/ScenarioExecution.qml
  4. 4
      mix/qml/StateList.qml

28
mix/qml/Block.qml

@ -46,6 +46,11 @@ ColumnLayout
transactionDialog.open(txIndex, blockIndex, transactions.get(txIndex))
}
function select(txIndex)
{
transactionRepeater.itemAt(txIndex).select()
}
onOpenedTrChanged:
{
Layout.preferredHeight = calculateHeight()
@ -129,6 +134,12 @@ ColumnLayout
id: rowTransaction
Layout.preferredHeight: trHeight
spacing: 0
function select()
{
rowContentTr.select()
}
function displayContent()
{
logsText.text = ""
@ -222,6 +233,15 @@ ColumnLayout
}
}
function select()
{
rowContentTr.selected = true
rowContentTr.color = "#4F4F4F"
hash.color = "#EAB920"
func.color = "#EAB920"
txSelected(index)
}
function deselect()
{
rowContentTr.selected = false
@ -235,13 +255,7 @@ ColumnLayout
anchors.fill: parent
onClicked: {
if (!rowContentTr.selected)
{
rowContentTr.selected = true
rowContentTr.color = "#4F4F4F"
hash.color = "#EAB920"
func.color = "#EAB920"
txSelected(index)
}
rowContentTr.select()
else
rowContentTr.deselect()

7
mix/qml/BlockChain.qml

@ -184,6 +184,11 @@ ColumnLayout {
itemAt(blockIndex).editTx(txIndex)
}
function select(blockIndex, txIndex)
{
itemAt(blockIndex).select(txIndex)
}
Block
{
Connections
@ -569,6 +574,7 @@ ColumnLayout {
trModel.sender = _r.sender
trModel.returnParameters = _r.returnParameters
blockModel.setTransaction(blockIndex, trIndex, trModel)
blockChainRepeater.select(blockIndex, trIndex)
return;
}
}
@ -590,6 +596,7 @@ ColumnLayout {
itemTr.returnParameters = _r.returnParameters
model.blocks[model.blocks.length - 1].transactions.push(itemTr)
blockModel.appendTransaction(itemTr)
blockChainRepeater.select(blockIndex, trIndex)
}
onNewState: {

3
mix/qml/ScenarioExecution.qml

@ -85,7 +85,8 @@ Rectangle {
target: blockChain
property var currentSelectedBlock
property var currentSelectedTx
onTxSelected: {
onTxSelected:
{
currentSelectedBlock = blockIndex
currentSelectedTx = txIndex
updateWatchers(blockIndex, txIndex)

4
mix/qml/StateList.qml

@ -37,10 +37,6 @@ Dialog {
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.rightMargin: 10
Button {
action: addStateAction
}
Button {
action: closeAction
}

Loading…
Cancel
Save