Browse Source

refactoring

cl-refactor
yann300 10 years ago
committed by yann300
parent
commit
36405af0cc
  1. 1
      mix/ClientModel.cpp
  2. 27
      mix/qml/main.qml

1
mix/ClientModel.cpp

@ -218,4 +218,3 @@ ExecutionResult ClientModel::callContract(Address const& _contract, bytes const&
r.contractAddress = _contract; r.contractAddress = _contract;
return r; return r;
} }

27
mix/qml/main.qml

@ -78,35 +78,38 @@ ApplicationWindow {
text: "&Run" text: "&Run"
shortcut: "F5" shortcut: "F5"
onTriggered: { onTriggered: {
var item = TransactionHelper.defaultTransaction();
item.executeConstructor = true;
if (codeModel.code.contract.constructor.parameters.length === 0) if (codeModel.code.contract.constructor.parameters.length === 0)
{ {
mainContent.ensureRightView(); mainContent.ensureRightView();
clientModel.debugDeployment(); startF5Debugging(item);
} }
else else
{
var item = TransactionHelper.defaultTransaction();
item.executeConstructor = true;
transactionDialog.open(0, item); transactionDialog.open(0, item);
} }
}
enabled: codeModel.hasContract && !clientModel.running; enabled: codeModel.hasContract && !clientModel.running;
} }
TransactionDialog { function startF5Debugging(transaction)
id: transactionDialog {
onAccepted: {
mainContent.ensureRightView();
var item = transactionDialog.getItem();
var ether = QEtherHelper.createEther("100000000000000000000000000", QEther.Wei); var ether = QEtherHelper.createEther("100000000000000000000000000", QEther.Wei);
var state = { var state = {
title: "", title: "",
balance: ether, balance: ether,
transactions: [item] transactions: [transaction]
}; };
clientModel.debugState(state); clientModel.debugState(state);
} }
TransactionDialog {
id: transactionDialog
onAccepted: {
mainContent.ensureRightView();
var item = transactionDialog.getItem();
item.executeConstructor = true;
startF5Debugging(item);
}
useTransactionDefaultValue: true useTransactionDefaultValue: true
} }

Loading…
Cancel
Save