Browse Source

bugfix (bad scenario loaded in the deployment dialog)

cl-refactor
yann300 10 years ago
parent
commit
7a9df8017b
  1. 7
      mix/qml/DeployContractStep.qml
  2. 3
      mix/qml/ScenarioLoader.qml
  3. 10
      mix/qml/StateListModel.qml

7
mix/qml/DeployContractStep.qml

@ -112,14 +112,10 @@ Rectangle {
for (var k = 0; k < projectModel.stateListModel.get(currentIndex).blocks.count; k++)
{
for (var j = 0; j < projectModel.stateListModel.get(currentIndex).blocks.get(k).transactions.count; j++)
{
trListModel.append(projectModel.stateListModel.get(currentIndex).blocks.get(k).transactions.get(j));
}
}
for (var k = 0; k < trListModel.count; k++)
{
trList.itemAt(k).init()
}
ctrDeployCtrLabel.calculateContractDeployGas();
}
}
@ -166,11 +162,9 @@ Rectangle {
if (trListModel.get(index).parameters)
{
for (var k in trListModel.get(index).parameters)
{
paramList.append({ "name": k, "value": trListModel.get(index).parameters[k] })
}
}
}
Label
{
@ -220,7 +214,6 @@ Rectangle {
}
}
ColumnLayout
{
anchors.top: parent.top

3
mix/qml/ScenarioLoader.qml

@ -291,7 +291,7 @@ ColumnLayout
text: qsTr("Restore")
function restore()
{
var state = projectModel.stateListModel.reloadStateFromFromProject(scenarioList.currentIndex)
var state = projectModel.stateListModel.reloadStateFromProject(scenarioList.currentIndex)
if (state)
{
restored(state)
@ -302,7 +302,6 @@ ColumnLayout
roundLeft: true
}
Rectangle
{
width: 1

10
mix/qml/StateListModel.qml

@ -186,12 +186,13 @@ Item {
onProjectLoading: stateListModel.loadStatesFromProject(projectData);
onProjectFileSaving: {
projectData.states = []
for(var i = 0; i < stateListModel.count; i++) {
for(var i = 0; i < stateListModel.count; i++)
{
projectData.states.push(toPlainStateItem(stateList[i]));
stateListModel.set(i, stateList[i]);
}
projectData.defaultStateIndex = stateListModel.defaultStateIndex;
stateListModel.data = projectData
}
onNewProject: {
var state = toPlainStateItem(stateListModel.createDefaultState());
@ -247,7 +248,8 @@ Item {
signal stateRun(int index)
signal stateDeleted(int index)
function defaultTransactionItem() {
function defaultTransactionItem()
{
return TransactionHelper.defaultTransaction();
}
@ -409,7 +411,7 @@ Item {
return ""
}
function reloadStateFromFromProject(index)
function reloadStateFromProject(index)
{
if (data)
{

Loading…
Cancel
Save