From 36405af0cc235f11eb79ade947ea21ce9c5e949a Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 22 Jan 2015 22:32:50 +0100 Subject: [PATCH] refactoring --- mix/ClientModel.cpp | 1 - mix/qml/main.qml | 29 ++++++++++++++++------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/mix/ClientModel.cpp b/mix/ClientModel.cpp index e91985f3f..f1e026c18 100644 --- a/mix/ClientModel.cpp +++ b/mix/ClientModel.cpp @@ -218,4 +218,3 @@ ExecutionResult ClientModel::callContract(Address const& _contract, bytes const& r.contractAddress = _contract; return r; } - diff --git a/mix/qml/main.qml b/mix/qml/main.qml index fb0977904..722417801 100644 --- a/mix/qml/main.qml +++ b/mix/qml/main.qml @@ -78,34 +78,37 @@ ApplicationWindow { text: "&Run" shortcut: "F5" onTriggered: { - + var item = TransactionHelper.defaultTransaction(); + item.executeConstructor = true; if (codeModel.code.contract.constructor.parameters.length === 0) { mainContent.ensureRightView(); - clientModel.debugDeployment(); + startF5Debugging(item); } else - { - var item = TransactionHelper.defaultTransaction(); - item.executeConstructor = true; transactionDialog.open(0, item); - } } enabled: codeModel.hasContract && !clientModel.running; } + function startF5Debugging(transaction) + { + var ether = QEtherHelper.createEther("100000000000000000000000000", QEther.Wei); + var state = { + title: "", + balance: ether, + transactions: [transaction] + }; + clientModel.debugState(state); + } + TransactionDialog { id: transactionDialog onAccepted: { mainContent.ensureRightView(); var item = transactionDialog.getItem(); - var ether = QEtherHelper.createEther("100000000000000000000000000", QEther.Wei); - var state = { - title: "", - balance: ether, - transactions: [item] - }; - clientModel.debugState(state); + item.executeConstructor = true; + startF5Debugging(item); } useTransactionDefaultValue: true }