From 127e201895c87620686a9393af37e0e9e7c4f284 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 7 Apr 2015 13:53:20 +0200 Subject: [PATCH] fix DeploymentDialog.qml bugs --- mix/qml/DeploymentDialog.qml | 48 +++++++++++++++++++++++++++++++++ mix/qml/LogsPane.qml | 48 +++++++++++++++++++++++++++++++-- mix/qml/js/TransactionHelper.js | 2 +- 3 files changed, 95 insertions(+), 3 deletions(-) diff --git a/mix/qml/DeploymentDialog.qml b/mix/qml/DeploymentDialog.qml index 2e7e1601b..6ed7afed5 100644 --- a/mix/qml/DeploymentDialog.qml +++ b/mix/qml/DeploymentDialog.qml @@ -329,6 +329,54 @@ Dialog { } } + RowLayout + { + Layout.fillWidth: true + Rectangle + { + Layout.preferredWidth: 357 + color: "transparent" + } + + Button + { + id: deployButton + action: runAction + iconSource: "qrc:/qml/img/run.png" + } + + Action { + id: runAction + tooltip: qsTr("Deploy contract(s) and Package resources files.") + onTriggered: { + var inError = []; + var ethUrl = ProjectModelCode.formatAppUrl(applicationUrlEth.text); + for (var k in ethUrl) + { + if (ethUrl[k].length > 32) + inError.push(qsTr("Member too long: " + ethUrl[k]) + "\n"); + } + if (!stopForInputError(inError)) + { + if (contractRedeploy.checked) + deployWarningDialog.open(); + else + ProjectModelCode.startDeployProject(false); + } + } + } + + CheckBox + { + anchors.left: deployButton.right + id: contractRedeploy + enabled: Object.keys(projectModel.deploymentAddresses).length > 0 + checked: Object.keys(projectModel.deploymentAddresses).length == 0 + text: qsTr("Deploy Contract(s)") + anchors.verticalCenter: parent.verticalCenter + } + } + Rectangle { width: parent.width diff --git a/mix/qml/LogsPane.qml b/mix/qml/LogsPane.qml index 082c55386..21e14e817 100644 --- a/mix/qml/LogsPane.qml +++ b/mix/qml/LogsPane.qml @@ -62,7 +62,7 @@ Rectangle model: SortFilterProxyModel { id: proxyModel source: logsModel - property var roles: ["-", "javascript", "run", "state", "comp"] + property var roles: ["-", "javascript", "run", "state", "comp", "deployment"] Component.onCompleted: { filterType = regEx(proxyModel.roles); @@ -95,7 +95,7 @@ Rectangle return "(?:" + roles.join('|') + ")"; } - filterType: "(?:javascript|run|state|comp)" + filterType: "(?:javascript|run|state|comp|deployment)" filterContent: "" filterSyntax: SortFilterProxyModel.RegExp filterCaseSensitivity: Qt.CaseInsensitive @@ -389,6 +389,50 @@ Rectangle height: parent.height color: logStyle.generic.layout.buttonSeparatorColor2 } + + ToolButton { + id: deloyButton + checkable: true + height: logStyle.generic.layout.headerButtonHeight + width: 50 + anchors.verticalCenter: parent.verticalCenter + checked: true + onCheckedChanged: { + proxyModel.toogleFilter("deployment") + } + tooltip: qsTr("Deployment") + style: + ButtonStyle { + label: + Item { + DefaultLabel { + font.family: logStyle.generic.layout.logLabelFont + font.pointSize: appStyle.absoluteSize(-3) + color: logStyle.generic.layout.logLabelColor + anchors.centerIn: parent + text: qsTr("Deploy.") + } + } + background: + Rectangle { + color: deloyButton.checked ? logStyle.generic.layout.buttonSelected : "transparent" + } + } + } + + Rectangle { + anchors.verticalCenter: parent.verticalCenter + width: 1; + height: parent.height + color: logStyle.generic.layout.buttonSeparatorColor1 + } + + Rectangle { + anchors.verticalCenter: parent.verticalCenter + width: 2; + height: parent.height + color: logStyle.generic.layout.buttonSeparatorColor2 + } } Row diff --git a/mix/qml/js/TransactionHelper.js b/mix/qml/js/TransactionHelper.js index 5668030be..566b04910 100644 --- a/mix/qml/js/TransactionHelper.js +++ b/mix/qml/js/TransactionHelper.js @@ -25,7 +25,7 @@ function rpcCall(requests, callBack) if (httpRequest.readyState === XMLHttpRequest.DONE) { if (httpRequest.status !== 200 || httpRequest.responseText === "") { - var errorText = qsTr("Deployment error: Error while registering Dapp ") + httpRequest.status; + var errorText = qsTr("Unable to initiate request to the live network. Please verify your ethereum node is up.") + qsTr(" Error status: ") + httpRequest.status; console.log(errorText); deploymentError(errorText); }