Browse Source

ui changes

cl-refactor
yann300 10 years ago
parent
commit
e901a081a7
  1. 60
      mix/qml/DeployContractStep.qml
  2. 6
      mix/qml/js/NetworkDeployment.js
  3. 5
      mix/qml/js/TransactionHelper.js

60
mix/qml/DeployContractStep.qml

@ -366,6 +366,18 @@ Rectangle {
}
}
Rectangle
{
border.color: "#cccccc"
border.width: 2
Layout.fillWidth: true
Layout.preferredHeight: parent.height + 25
color: "transparent"
ScrollView
{
anchors.fill: parent
ColumnLayout
{
RowLayout
{
id: deployedRow
@ -386,47 +398,18 @@ Rectangle {
{
anchors.top: parent.top
anchors.topMargin: 1
ListModel
{
id: deployedAddrModel
}
Repeater
{
width: parent.width
id: deployedAddresses
model: deployedAddrModel
function refresh()
{
deployedAddrModel.clear()
textAddresses.text = ""
deployedRow.visible = Object.keys(projectModel.deploymentAddresses).length > 0
for (var k in projectModel.deploymentAddresses)
{
if (k.indexOf("-") !== -1) // this is an contract instance. ctr without - are the last deployed (to support old project)
deployedAddrModel.append({ id: k, value: projectModel.deploymentAddresses[k]})
textAddresses.text = JSON.stringify(projectModel.deploymentAddresses, null, ' ')
}
}
Rectangle
{
Layout.preferredHeight: 20
Layout.preferredWidth: 235
color: "transparent"
Label
{
id: labelContract
width: 112
elide: Text.ElideRight
text: index > -1 ? deployedAddrModel.get(index).id : ""
}
TextField
TextArea
{
width: 123
anchors.verticalCenter: parent.verticalCenter
anchors.left: labelContract.right
text: index > - 1 ? deployedAddrModel.get(index).value : ""
}
}
anchors.fill: parent
id: textAddresses
}
}
}
@ -447,13 +430,16 @@ Rectangle {
}
}
Label
TextArea
{
id: verificationLabel
maximumLineCount: 20
}
}
}
}
}
}
Rectangle
{

6
mix/qml/js/NetworkDeployment.js

@ -296,7 +296,7 @@ function packageDapp(addresses)
deploymentDialog.packageStep.packageBase64 = packageRet[1];
deploymentDialog.packageStep.localPackageUrl = packageRet[2] + "?hash=" + packageRet[0];
deploymentDialog.packageStep.lastDeployDate = date
deploymentComplete()
deploymentStepChanged(qsTr("Dapp is Packaged"))
}
function registerDapp(url, callback)
@ -305,7 +305,7 @@ function registerDapp(url, callback)
checkEthPath(url, false, function (success) {
if (!success)
return;
deploymentComplete();
deploymentStepChanged(qsTr("Dapp has been registered. Please wait for verifications."));
if (callback)
callback()
});
@ -549,7 +549,7 @@ function registerToUrlHint(url, callback)
rpcCall(requests, function (httpRequest, response) {
projectModel.registerUrlTrHash = JSON.parse(response)[0].result
deploymentComplete();
deploymentStepChanged(qsTr("Dapp resources has been registered. Please wait for verifications."));
if (callback)
callback()
});

5
mix/qml/js/TransactionHelper.js

@ -19,8 +19,7 @@ function defaultTransaction()
function rpcCall(requests, callBack, error)
{
//var jsonRpcUrl = "http://localhost:8545";
var jsonRpcUrl = "http://10.10.42.111:8545"
var jsonRpcUrl = "http://localhost:8545";
var rpcRequest = JSON.stringify(requests);
console.log(rpcRequest);
var httpRequest = new XMLHttpRequest();
@ -29,8 +28,6 @@ function rpcCall(requests, callBack, error)
httpRequest.setRequestHeader("Content-length", rpcRequest.length);
httpRequest.setRequestHeader("Connection", "close");
httpRequest.onreadystatechange = function() {
console.log(httpRequest.readyState)
console.log(httpRequest.responseText)
if (httpRequest.readyState === XMLHttpRequest.DONE) {
if (httpRequest.status !== 200 || httpRequest.responseText === "")
{

Loading…
Cancel
Save