Browse Source

ui changes

cl-refactor
yann300 10 years ago
parent
commit
f16eda5f0e
  1. 7
      mix/qml/DeployContractStep.qml
  2. 18
      mix/qml/ProjectModel.qml
  3. 21
      mix/qml/RegisteringStep.qml
  4. 3
      mix/qml/WebPreview.qml

7
mix/qml/DeployContractStep.qml

@ -28,9 +28,7 @@ Rectangle {
contractList.change() contractList.change()
accountsModel.clear() accountsModel.clear()
for (var k in worker.accounts) for (var k in worker.accounts)
{
accountsModel.append(worker.accounts[k]) accountsModel.append(worker.accounts[k])
}
if (worker.currentAccount === "" && worker.accounts.length > 0) if (worker.currentAccount === "" && worker.accounts.length > 0)
{ {
@ -395,9 +393,12 @@ Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: parent.height + 25 Layout.preferredHeight: parent.height + 25
color: "transparent" color: "transparent"
id: rectDeploymentVariable
ScrollView ScrollView
{ {
anchors.fill: parent anchors.fill: parent
anchors.topMargin: 4
anchors.bottomMargin: 4
ColumnLayout ColumnLayout
{ {
RowLayout RowLayout
@ -426,6 +427,7 @@ Rectangle {
{ {
textAddresses.text = "" textAddresses.text = ""
deployedRow.visible = Object.keys(projectModel.deploymentAddresses).length > 0 deployedRow.visible = Object.keys(projectModel.deploymentAddresses).length > 0
rectDeploymentVariable.visible = Object.keys(projectModel.deploymentAddresses).length > 0
textAddresses.text = JSON.stringify(projectModel.deploymentAddresses, null, ' ') textAddresses.text = JSON.stringify(projectModel.deploymentAddresses, null, ' ')
} }
TextArea TextArea
@ -466,7 +468,6 @@ Rectangle {
} }
} }
} }
} }
} }

18
mix/qml/ProjectModel.qml

@ -86,14 +86,8 @@ Item {
function cleanDeploymentStatus() function cleanDeploymentStatus()
{ {
deployedScenarioIndex = 0 deployedScenarioIndex = 0
applicationUrlEth = ""
applicationUrlHttp = ""
deployBlockNumber = "" deployBlockNumber = ""
deploymentTrHashes = {} deploymentTrHashes = {}
registerContentHashTrHash = ""
registerUrlTrHash = ""
registerContentHashBlockNumber = -1
registerUrlBlockNumber = -1
deploymentAddresses = {} deploymentAddresses = {}
deploymentDir = "" deploymentDir = ""
deploymentDialog.packageStep.packageHash = "" deploymentDialog.packageStep.packageHash = ""
@ -102,6 +96,18 @@ Item {
deploymentDialog.packageStep.lastDeployDate = "" deploymentDialog.packageStep.lastDeployDate = ""
deploymentDialog.packageStep.localPackageUrl = "" deploymentDialog.packageStep.localPackageUrl = ""
saveProject() saveProject()
cleanRegisteringStatus()
}
function cleanRegisteringStatus()
{
applicationUrlEth = ""
applicationUrlHttp = ""
registerContentHashTrHash = ""
registerUrlTrHash = ""
registerContentHashBlockNumber = -1
registerUrlBlockNumber = -1
saveProject()
} }
Connections { Connections {

21
mix/qml/RegisteringStep.qml

@ -24,27 +24,35 @@ Rectangle {
function show() function show()
{ {
ctrRegisterLabel.calculateRegisterGas() ctrRegisterLabel.calculateRegisterGas()
applicationUrlEthCtrl.text = projectModel.applicationUrlEth if (applicationUrlHttpCtrl.text === "")
applicationUrlHttpCtrl.text = projectModel.applicationUrlHttp applicationUrlHttpCtrl.text = projectModel.applicationUrlHttp
if (applicationUrlEthCtrl.text === "")
applicationUrlEthCtrl.text = projectModel.applicationUrlEth
visible = true visible = true
verificationEthUrl.text = "" verificationEthUrl.text = ""
if (projectModel.registerContentHashTrHash !== "") if (projectModel.registerContentHashTrHash !== "" && projectModel.registerContentHashBlockNumber !== -1)
{ {
worker.verifyHash("registerHash", projectModel.registerContentHashTrHash, function(bn, trLost) worker.verifyHash("registerHash", projectModel.registerContentHashTrHash, function(bn, trLost)
{ {
updateVerification(projectModel.registerContentHashBlockNumber, bn, trLost, verificationEthUrl, "registerHash") updateVerification(projectModel.registerContentHashBlockNumber, bn, trLost, verificationEthUrl, "registerHash")
}); });
} }
else if (projectModel.registerContentHashTrHash !== "" && projectModel.registerContentHashBlockNumber === -1)
verificationEthUrl.text = qsTr("waiting verification")
verificationUrl.text = "" verificationUrl.text = ""
if (projectModel.registerUrlTrHash !== "") if (projectModel.registerUrlTrHash !== "" && projectModel.registerUrlBlockNumber !== -1)
{ {
worker.verifyHash("registerUrl", projectModel.registerUrlTrHash, function(bn, trLost) worker.verifyHash("registerUrl", projectModel.registerUrlTrHash, function(bn, trLost)
{ {
updateVerification(projectModel.registerUrlBlockNumber, bn, trLost, verificationUrl, "registerUrl") updateVerification(projectModel.registerUrlBlockNumber, bn, trLost, verificationUrl, "registerUrl")
}); });
} }
else if (projectModel.registerUrlTrHash !== "" && projectModel.registerUrlBlockNumber === -1)
verificationUrl.text = qsTr("waiting verification")
} }
function updateVerification(originbn, bn, trLost, ctrl, trContext) function updateVerification(originbn, bn, trLost, ctrl, trContext)
@ -259,6 +267,7 @@ Rectangle {
NetworkDeploymentCode.registerDapp(ethUrl, gasPrice, function(){ NetworkDeploymentCode.registerDapp(ethUrl, gasPrice, function(){
projectModel.applicationUrlEth = applicationUrlEthCtrl.text projectModel.applicationUrlEth = applicationUrlEthCtrl.text
projectModel.saveProject() projectModel.saveProject()
verificationEthUrl.text = qsTr("waiting verifications")
worker.waitForTrReceipt(projectModel.registerContentHashTrHash, function(status, receipt) worker.waitForTrReceipt(projectModel.registerContentHashTrHash, function(status, receipt)
{ {
worker.verifyHash("registerHash", projectModel.registerContentHashTrHash, function(bn, trLost) worker.verifyHash("registerHash", projectModel.registerContentHashTrHash, function(bn, trLost)
@ -290,6 +299,7 @@ Rectangle {
registerToUrlHint(applicationUrlHttpCtrl.text, gasPrice, function(){ registerToUrlHint(applicationUrlHttpCtrl.text, gasPrice, function(){
projectModel.applicationUrlHttp = applicationUrlHttpCtrl.text projectModel.applicationUrlHttp = applicationUrlHttpCtrl.text
projectModel.saveProject() projectModel.saveProject()
verificationUrl.text = qsTr("waiting verifications")
worker.waitForTrReceipt(projectModel.registerUrlTrHash, function(status, receipt) worker.waitForTrReceipt(projectModel.registerUrlTrHash, function(status, receipt)
{ {
worker.verifyHash("registerUrl", projectModel.registerUrlTrHash, function(bn, trLost) worker.verifyHash("registerUrl", projectModel.registerUrlTrHash, function(bn, trLost)
@ -313,6 +323,9 @@ Rectangle {
width: 30 width: 30
onClicked: onClicked:
{ {
verificationEthUrl.text = ""
verificationUrl.text = ""
projectModel.cleanRegisteringStatus()
var gasPrice = deploymentDialog.deployStep.gasPrice.toHexWei() var gasPrice = deploymentDialog.deployStep.gasPrice.toHexWei()
parent.registerHash(gasPrice, function(){ parent.registerHash(gasPrice, function(){
parent.registerUrl(gasPrice, function(){}) parent.registerUrl(gasPrice, function(){})

3
mix/qml/WebPreview.qml

@ -272,7 +272,8 @@ Item {
Button Button
{ {
height: 28 height: 22
width: 22
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
action: expressionAction action: expressionAction
iconSource: "qrc:/qml/img/console.png" iconSource: "qrc:/qml/img/console.png"

Loading…
Cancel
Save