From e901a081a7488597833dad92e3288dd14a81a1c2 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 22 Jul 2015 11:32:02 +0200 Subject: [PATCH] ui changes --- mix/qml/DeployContractStep.qml | 120 ++++++++++++++------------------ mix/qml/js/NetworkDeployment.js | 6 +- mix/qml/js/TransactionHelper.js | 5 +- 3 files changed, 57 insertions(+), 74 deletions(-) diff --git a/mix/qml/DeployContractStep.qml b/mix/qml/DeployContractStep.qml index 97fbe664f..fc0a904dc 100644 --- a/mix/qml/DeployContractStep.qml +++ b/mix/qml/DeployContractStep.qml @@ -366,92 +366,78 @@ Rectangle { } } - RowLayout + Rectangle { - id: deployedRow + border.color: "#cccccc" + border.width: 2 Layout.fillWidth: true - Rectangle + Layout.preferredHeight: parent.height + 25 + color: "transparent" + ScrollView { - width: labelWidth - Label - { - id: labelAddresses - text: qsTr("Deployed Contracts") - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - } - } - - ColumnLayout - { - anchors.top: parent.top - anchors.topMargin: 1 - ListModel + anchors.fill: parent + ColumnLayout { - id: deployedAddrModel - } - - Repeater - { - id: deployedAddresses - model: deployedAddrModel - function refresh() + RowLayout { - deployedAddrModel.clear() - deployedRow.visible = Object.keys(projectModel.deploymentAddresses).length > 0 - for (var k in projectModel.deploymentAddresses) + id: deployedRow + Layout.fillWidth: true + Rectangle { - 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]}) + width: labelWidth + Label + { + id: labelAddresses + text: qsTr("Deployed Contracts") + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + } + } + + ColumnLayout + { + anchors.top: parent.top + anchors.topMargin: 1 + width: parent.width + id: deployedAddresses + function refresh() + { + textAddresses.text = "" + deployedRow.visible = Object.keys(projectModel.deploymentAddresses).length > 0 + textAddresses.text = JSON.stringify(projectModel.deploymentAddresses, null, ' ') + } + TextArea + { + anchors.fill: parent + id: textAddresses + } } } - Rectangle + RowLayout { - Layout.preferredHeight: 20 - Layout.preferredWidth: 235 - color: "transparent" - Label + id: verificationRow + Layout.fillWidth: true + visible: Object.keys(projectModel.deploymentAddresses).length > 0 + Rectangle { - id: labelContract - width: 112 - elide: Text.ElideRight - text: index > -1 ? deployedAddrModel.get(index).id : "" + width: labelWidth + Label + { + text: qsTr("Verifications") + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + } } - TextField + TextArea { - width: 123 - anchors.verticalCenter: parent.verticalCenter - anchors.left: labelContract.right - text: index > - 1 ? deployedAddrModel.get(index).value : "" + id: verificationLabel } } } } - } - RowLayout - { - id: verificationRow - Layout.fillWidth: true - visible: Object.keys(projectModel.deploymentAddresses).length > 0 - Rectangle - { - width: labelWidth - Label - { - text: qsTr("Verifications") - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - } - } - - Label - { - id: verificationLabel - maximumLineCount: 20 - } } } diff --git a/mix/qml/js/NetworkDeployment.js b/mix/qml/js/NetworkDeployment.js index 2fc207ddf..b9c3f0d82 100644 --- a/mix/qml/js/NetworkDeployment.js +++ b/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() }); diff --git a/mix/qml/js/TransactionHelper.js b/mix/qml/js/TransactionHelper.js index d471824f5..33dadab9d 100644 --- a/mix/qml/js/TransactionHelper.js +++ b/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 === "") {