From 7a9df8017b9561fd171f2d4678a1f57b4f8fa050 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 27 Jul 2015 15:31:02 +0200 Subject: [PATCH] bugfix (bad scenario loaded in the deployment dialog) --- mix/qml/DeployContractStep.qml | 7 ------- mix/qml/ScenarioLoader.qml | 3 +-- mix/qml/StateListModel.qml | 10 ++++++---- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/mix/qml/DeployContractStep.qml b/mix/qml/DeployContractStep.qml index 01f06e4f2..d7060f1ee 100644 --- a/mix/qml/DeployContractStep.qml +++ b/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,9 +162,7 @@ Rectangle { if (trListModel.get(index).parameters) { for (var k in trListModel.get(index).parameters) - { paramList.append({ "name": k, "value": trListModel.get(index).parameters[k] }) - } } } @@ -220,7 +214,6 @@ Rectangle { } } - ColumnLayout { anchors.top: parent.top diff --git a/mix/qml/ScenarioLoader.qml b/mix/qml/ScenarioLoader.qml index 8b6886c93..5b8cb2d70 100644 --- a/mix/qml/ScenarioLoader.qml +++ b/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 diff --git a/mix/qml/StateListModel.qml b/mix/qml/StateListModel.qml index e7b092463..efa52f853 100644 --- a/mix/qml/StateListModel.qml +++ b/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) {