Browse Source

refactoring

cl-refactor
yann300 10 years ago
committed by yann300
parent
commit
36405af0cc
  1. 1
      mix/ClientModel.cpp
  2. 29
      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;
} }

29
mix/qml/main.qml

@ -78,34 +78,37 @@ 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;
} }
function startF5Debugging(transaction)
{
var ether = QEtherHelper.createEther("100000000000000000000000000", QEther.Wei);
var state = {
title: "",
balance: ether,
transactions: [transaction]
};
clientModel.debugState(state);
}
TransactionDialog { TransactionDialog {
id: transactionDialog id: transactionDialog
onAccepted: { onAccepted: {
mainContent.ensureRightView(); mainContent.ensureRightView();
var item = transactionDialog.getItem(); var item = transactionDialog.getItem();
var ether = QEtherHelper.createEther("100000000000000000000000000", QEther.Wei); item.executeConstructor = true;
var state = { startF5Debugging(item);
title: "",
balance: ether,
transactions: [item]
};
clientModel.debugState(state);
} }
useTransactionDefaultValue: true useTransactionDefaultValue: true
} }

Loading…
Cancel
Save