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

18
mix/qml/ProjectModel.qml

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

21
mix/qml/RegisteringStep.qml

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

3
mix/qml/WebPreview.qml

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

Loading…
Cancel
Save