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 RowLayout
{ {
id: deployedRow id: deployedRow
@ -386,47 +398,18 @@ Rectangle {
{ {
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 1 anchors.topMargin: 1
ListModel width: parent.width
{
id: deployedAddrModel
}
Repeater
{
id: deployedAddresses id: deployedAddresses
model: deployedAddrModel
function refresh() function refresh()
{ {
deployedAddrModel.clear() textAddresses.text = ""
deployedRow.visible = Object.keys(projectModel.deploymentAddresses).length > 0 deployedRow.visible = Object.keys(projectModel.deploymentAddresses).length > 0
for (var k in projectModel.deploymentAddresses) textAddresses.text = JSON.stringify(projectModel.deploymentAddresses, null, ' ')
{
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]})
} }
} TextArea
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
{ {
width: 123 anchors.fill: parent
anchors.verticalCenter: parent.verticalCenter id: textAddresses
anchors.left: labelContract.right
text: index > - 1 ? deployedAddrModel.get(index).value : ""
}
}
} }
} }
} }
@ -447,13 +430,16 @@ Rectangle {
} }
} }
Label TextArea
{ {
id: verificationLabel id: verificationLabel
maximumLineCount: 20
} }
} }
} }
}
}
}
Rectangle Rectangle
{ {

6
mix/qml/js/NetworkDeployment.js

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

5
mix/qml/js/TransactionHelper.js

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

Loading…
Cancel
Save