|
@ -15,15 +15,19 @@ Window { |
|
|
|
|
|
|
|
|
id: modalDeploymentDialog |
|
|
id: modalDeploymentDialog |
|
|
modality: Qt.ApplicationModal |
|
|
modality: Qt.ApplicationModal |
|
|
width: 930 |
|
|
width: 735 |
|
|
height: 350 |
|
|
height: 480 |
|
|
|
|
|
maximumWidth: width |
|
|
|
|
|
minimumWidth: width |
|
|
|
|
|
maximumHeight: height |
|
|
|
|
|
minimumHeight: height |
|
|
visible: false |
|
|
visible: false |
|
|
property alias applicationUrlEth: applicationUrlEth.text |
|
|
property alias applicationUrlEth: applicationUrlEth.text |
|
|
property alias applicationUrlHttp: applicationUrlHttp.text |
|
|
property alias applicationUrlHttp: applicationUrlHttp.text |
|
|
property string urlHintContract: "c83d3e22645fb015d02043a744921cc2f828c64d" /* TODO: replace with the good address */ |
|
|
property string urlHintContract: urlHintAddr.text |
|
|
property string packageHash |
|
|
property string packageHash |
|
|
property alias packageBase64: base64Value.text |
|
|
property alias packageBase64: base64Value.text |
|
|
property string eth: "4c3f7330690ed3657d3fa20fe5717b84010528ae"; /* TODO: replace with the good address */ |
|
|
property string eth: registrarAddr.text |
|
|
property string currentAccount |
|
|
property string currentAccount |
|
|
property alias gasToUse: gasToUseInput.text |
|
|
property alias gasToUse: gasToUseInput.text |
|
|
|
|
|
|
|
@ -150,17 +154,57 @@ Window { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Rectangle |
|
|
Column |
|
|
{ |
|
|
{ |
|
|
|
|
|
spacing: 5 |
|
|
anchors.fill: parent |
|
|
anchors.fill: parent |
|
|
anchors.margins: 10 |
|
|
anchors.margins: 10 |
|
|
color: Style.generic.layout.backgroundColor |
|
|
ColumnLayout |
|
|
|
|
|
{ |
|
|
|
|
|
id: containerDeploy |
|
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
|
Layout.preferredHeight: 500 |
|
|
|
|
|
RowLayout |
|
|
|
|
|
{ |
|
|
|
|
|
DefaultLabel |
|
|
|
|
|
{ |
|
|
|
|
|
text: qsTr("DEPLOYING") |
|
|
|
|
|
font.italic: true |
|
|
|
|
|
font.underline: true |
|
|
|
|
|
Layout.preferredWidth: 356 |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Button |
|
|
|
|
|
{ |
|
|
|
|
|
action: displayHelpAction |
|
|
|
|
|
iconSource: "qrc:/qml/img/help.png" |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Action { |
|
|
|
|
|
id: displayHelpAction |
|
|
|
|
|
tooltip: qsTr("Help") |
|
|
|
|
|
onTriggered: { |
|
|
|
|
|
Qt.openUrlExternally("https://github.com/ethereum/wiki/wiki/Mix:-The-DApp-IDE#deployment-to-network") |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
GridLayout |
|
|
GridLayout |
|
|
{ |
|
|
{ |
|
|
columns: 2 |
|
|
columns: 2 |
|
|
anchors.top: parent.top |
|
|
|
|
|
anchors.left: parent.left |
|
|
|
|
|
width: parent.width |
|
|
width: parent.width |
|
|
|
|
|
|
|
|
|
|
|
DefaultLabel |
|
|
|
|
|
{ |
|
|
|
|
|
text: qsTr("Registrar address:") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DefaultTextField |
|
|
|
|
|
{ |
|
|
|
|
|
Layout.preferredWidth: 350 |
|
|
|
|
|
id: registrarAddr |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
DefaultLabel |
|
|
DefaultLabel |
|
|
{ |
|
|
{ |
|
|
text: qsTr("Account used to deploy:") |
|
|
text: qsTr("Account used to deploy:") |
|
@ -195,6 +239,17 @@ Window { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DefaultLabel |
|
|
|
|
|
{ |
|
|
|
|
|
text: qsTr("Amount of gas to use for each contract deployment: ") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DefaultTextField |
|
|
|
|
|
{ |
|
|
|
|
|
text: "20000" |
|
|
|
|
|
Layout.preferredWidth: 350 |
|
|
|
|
|
id: gasToUseInput |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
DefaultLabel |
|
|
DefaultLabel |
|
|
{ |
|
|
{ |
|
@ -208,7 +263,7 @@ Window { |
|
|
color: "transparent" |
|
|
color: "transparent" |
|
|
DefaultTextField |
|
|
DefaultTextField |
|
|
{ |
|
|
{ |
|
|
width: 350 |
|
|
width: 300 |
|
|
id: applicationUrlEth |
|
|
id: applicationUrlEth |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -220,29 +275,6 @@ Window { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
DefaultLabel |
|
|
|
|
|
{ |
|
|
|
|
|
text: qsTr("Web Application Ressources URL: ") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DefaultTextField |
|
|
|
|
|
{ |
|
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
|
id: applicationUrlHttp |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DefaultLabel |
|
|
|
|
|
{ |
|
|
|
|
|
text: qsTr("Amount of gas to use for each contract deployment: ") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DefaultTextField |
|
|
|
|
|
{ |
|
|
|
|
|
text: "20000" |
|
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
|
id: gasToUseInput |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DefaultLabel |
|
|
DefaultLabel |
|
|
{ |
|
|
{ |
|
|
text: qsTr("Package (Base64): ") |
|
|
text: qsTr("Package (Base64): ") |
|
@ -250,7 +282,7 @@ Window { |
|
|
|
|
|
|
|
|
TextArea |
|
|
TextArea |
|
|
{ |
|
|
{ |
|
|
Layout.fillWidth: true |
|
|
Layout.preferredWidth: 350 |
|
|
readOnly: true |
|
|
readOnly: true |
|
|
id: base64Value |
|
|
id: base64Value |
|
|
height: 60 |
|
|
height: 60 |
|
@ -258,25 +290,10 @@ Window { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
MessageDialog { |
|
|
Row |
|
|
id: deployDialog |
|
|
|
|
|
standardButtons: StandardButton.Ok |
|
|
|
|
|
icon: StandardIcon.Warning |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
MessageDialog { |
|
|
|
|
|
id: errorDialog |
|
|
|
|
|
standardButtons: StandardButton.Ok |
|
|
|
|
|
icon: StandardIcon.Critical |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
RowLayout |
|
|
|
|
|
{ |
|
|
{ |
|
|
anchors.bottom: parent.bottom |
|
|
|
|
|
anchors.right: parent.right; |
|
|
|
|
|
anchors.bottomMargin: 10 |
|
|
|
|
|
Button { |
|
|
Button { |
|
|
text: qsTr("Deploy contract / Package resources"); |
|
|
text: qsTr("Deploy"); |
|
|
tooltip: qsTr("Deploy contract and package resources files.") |
|
|
tooltip: qsTr("Deploy contract and package resources files.") |
|
|
onClicked: { |
|
|
onClicked: { |
|
|
var inError = []; |
|
|
var inError = []; |
|
@ -287,30 +304,116 @@ Window { |
|
|
inError.push(qsTr("Member too long: " + ethUrl[k]) + "\n"); |
|
|
inError.push(qsTr("Member too long: " + ethUrl[k]) + "\n"); |
|
|
} |
|
|
} |
|
|
if (!stopForInputError(inError)) |
|
|
if (!stopForInputError(inError)) |
|
|
|
|
|
{ |
|
|
|
|
|
if (contractRedeploy.checked) |
|
|
deployWarningDialog.open(); |
|
|
deployWarningDialog.open(); |
|
|
|
|
|
else |
|
|
|
|
|
ProjectModelCode.startDeployProject(false); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Button { |
|
|
CheckBox |
|
|
text: qsTr("Package resources only"); |
|
|
{ |
|
|
tooltip: qsTr("Package resources files.") |
|
|
id: contractRedeploy |
|
|
enabled: Object.keys(projectModel.deploymentAddresses).length > 0 |
|
|
enabled: Object.keys(projectModel.deploymentAddresses).length > 0 |
|
|
onClicked: { |
|
|
checked: Object.keys(projectModel.deploymentAddresses).length == 0 |
|
|
ProjectModelCode.startDeployProject(false); |
|
|
text: qsTr("Deploy Contract(s)") |
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Button { |
|
|
Rectangle |
|
|
text: qsTr("Open Package Directory"); |
|
|
{ |
|
|
enabled: projectModel.deploymentDir !== "" |
|
|
width: parent.width |
|
|
onClicked: { |
|
|
height: 1 |
|
|
|
|
|
color: "#5891d3" |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ColumnLayout |
|
|
|
|
|
{ |
|
|
|
|
|
id: containerRegister |
|
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
|
Layout.preferredHeight: 500 |
|
|
|
|
|
RowLayout |
|
|
|
|
|
{ |
|
|
|
|
|
DefaultLabel |
|
|
|
|
|
{ |
|
|
|
|
|
text: qsTr("REGISTERING") |
|
|
|
|
|
font.italic: true |
|
|
|
|
|
font.underline: true |
|
|
|
|
|
Layout.preferredWidth: 356 |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Button |
|
|
|
|
|
{ |
|
|
|
|
|
action: displayHelpAction |
|
|
|
|
|
iconSource: "qrc:/qml/img/help.png" |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Button |
|
|
|
|
|
{ |
|
|
|
|
|
action: openFolderAction |
|
|
|
|
|
iconSource: "qrc:/qml/img/openedfolder.png" |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Action { |
|
|
|
|
|
id: openFolderAction |
|
|
|
|
|
enabled: deploymentDialog.packageBase64 !== "" |
|
|
|
|
|
tooltip: qsTr("Open Package Folder") |
|
|
|
|
|
onTriggered: { |
|
|
fileIo.openFileBrowser(projectModel.deploymentDir); |
|
|
fileIo.openFileBrowser(projectModel.deploymentDir); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
GridLayout |
|
|
|
|
|
{ |
|
|
|
|
|
columns: 2 |
|
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
|
|
|
|
|
|
|
DefaultLabel |
|
|
|
|
|
{ |
|
|
|
|
|
Layout.preferredWidth: 355 |
|
|
|
|
|
text: qsTr("Url hint address:") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DefaultTextField |
|
|
|
|
|
{ |
|
|
|
|
|
Layout.preferredWidth: 350 |
|
|
|
|
|
id: urlHintAddr |
|
|
|
|
|
enabled: rowRegister.isOkToRegister() |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DefaultLabel |
|
|
|
|
|
{ |
|
|
|
|
|
Layout.preferredWidth: 355 |
|
|
|
|
|
text: qsTr("Web Application Ressources URL: ") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DefaultTextField |
|
|
|
|
|
{ |
|
|
|
|
|
Layout.preferredWidth: 350 |
|
|
|
|
|
id: applicationUrlHttp |
|
|
|
|
|
enabled: rowRegister.isOkToRegister() |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Rectangle |
|
|
|
|
|
{ |
|
|
|
|
|
id: rowRegister |
|
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
|
|
|
|
|
|
|
function isOkToRegister() |
|
|
|
|
|
{ |
|
|
|
|
|
return Object.keys(projectModel.deploymentAddresses).length > 0 && deploymentDialog.packageHash !== ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
Button { |
|
|
Button { |
|
|
text: qsTr("Register Web Application"); |
|
|
text: qsTr("Register"); |
|
|
tooltip: qsTr("Register hosted Web Application.") |
|
|
tooltip: qsTr("Register hosted Web Application.") |
|
|
|
|
|
enabled: rowRegister.isOkToRegister() |
|
|
onClicked: { |
|
|
onClicked: { |
|
|
if (applicationUrlHttp.text === "" || deploymentDialog.packageHash === "") |
|
|
if (applicationUrlHttp.text === "" || deploymentDialog.packageHash === "") |
|
|
{ |
|
|
{ |
|
@ -328,9 +431,23 @@ Window { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Button { |
|
|
Button { |
|
|
text: qsTr("Close"); |
|
|
anchors.right: parent.right |
|
|
|
|
|
text: qsTr("Cancel"); |
|
|
onClicked: close(); |
|
|
onClicked: close(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
MessageDialog { |
|
|
|
|
|
id: deployDialog |
|
|
|
|
|
standardButtons: StandardButton.Ok |
|
|
|
|
|
icon: StandardIcon.Warning |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
MessageDialog { |
|
|
|
|
|
id: errorDialog |
|
|
|
|
|
standardButtons: StandardButton.Ok |
|
|
|
|
|
icon: StandardIcon.Critical |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|