Browse Source

DeploymentDialog.qml Redesign

cl-refactor
yann300 10 years ago
parent
commit
85435c10c5
  1. 241
      mix/qml/DeploymentDialog.qml
  2. 2
      mix/qml/StatusPane.qml
  3. BIN
      mix/qml/img/help.png
  4. BIN
      mix/qml/img/openedfolder.png
  5. 2
      mix/res.qrc

241
mix/qml/DeploymentDialog.qml

@ -15,15 +15,19 @@ Window {
id: modalDeploymentDialog
modality: Qt.ApplicationModal
width: 930
height: 350
width: 735
height: 480
maximumWidth: width
minimumWidth: width
maximumHeight: height
minimumHeight: height
visible: false
property alias applicationUrlEth: applicationUrlEth.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 alias packageBase64: base64Value.text
property string eth: "4c3f7330690ed3657d3fa20fe5717b84010528ae"; /* TODO: replace with the good address */
property string eth: registrarAddr.text
property string currentAccount
property alias gasToUse: gasToUseInput.text
@ -150,17 +154,57 @@ Window {
}
}
Rectangle
Column
{
anchors.fill : parent
spacing: 5
anchors.fill: parent
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
{
columns: 2
anchors.top: parent.top
anchors.left: parent.left
width: parent.width
DefaultLabel
{
text: qsTr("Registrar address:")
}
DefaultTextField
{
Layout.preferredWidth: 350
id: registrarAddr
}
DefaultLabel
{
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
{
@ -208,7 +263,7 @@ Window {
color: "transparent"
DefaultTextField
{
width: 350
width: 300
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
{
text: qsTr("Package (Base64): ")
@ -250,7 +282,7 @@ Window {
TextArea
{
Layout.fillWidth: true
Layout.preferredWidth: 350
readOnly: true
id: base64Value
height: 60
@ -258,25 +290,10 @@ Window {
}
}
MessageDialog {
id: deployDialog
standardButtons: StandardButton.Ok
icon: StandardIcon.Warning
}
MessageDialog {
id: errorDialog
standardButtons: StandardButton.Ok
icon: StandardIcon.Critical
}
RowLayout
Row
{
anchors.bottom: parent.bottom
anchors.right: parent.right;
anchors.bottomMargin: 10
Button {
text: qsTr("Deploy contract / Package resources");
text: qsTr("Deploy");
tooltip: qsTr("Deploy contract and package resources files.")
onClicked: {
var inError = [];
@ -287,30 +304,116 @@ Window {
inError.push(qsTr("Member too long: " + ethUrl[k]) + "\n");
}
if (!stopForInputError(inError))
{
if (contractRedeploy.checked)
deployWarningDialog.open();
else
ProjectModelCode.startDeployProject(false);
}
}
}
Button {
text: qsTr("Package resources only");
tooltip: qsTr("Package resources files.")
CheckBox
{
id: contractRedeploy
enabled: Object.keys(projectModel.deploymentAddresses).length > 0
onClicked: {
ProjectModelCode.startDeployProject(false);
checked: Object.keys(projectModel.deploymentAddresses).length == 0
text: qsTr("Deploy Contract(s)")
anchors.verticalCenter: parent.verticalCenter
}
}
}
Button {
text: qsTr("Open Package Directory");
enabled: projectModel.deploymentDir !== ""
onClicked: {
Rectangle
{
width: parent.width
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);
}
}
}
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 {
text: qsTr("Register Web Application");
text: qsTr("Register");
tooltip: qsTr("Register hosted Web Application.")
enabled: rowRegister.isOkToRegister()
onClicked: {
if (applicationUrlHttp.text === "" || deploymentDialog.packageHash === "")
{
@ -328,9 +431,23 @@ Window {
}
Button {
text: qsTr("Close");
anchors.right: parent.right
text: qsTr("Cancel");
onClicked: close();
}
}
}
}
MessageDialog {
id: deployDialog
standardButtons: StandardButton.Ok
icon: StandardIcon.Warning
}
MessageDialog {
id: errorDialog
standardButtons: StandardButton.Ok
icon: StandardIcon.Critical
}
}

2
mix/qml/StatusPane.qml

@ -46,7 +46,7 @@ Rectangle {
Connections {
target:clientModel
onRunStarted: infoMessage(qsTr("Running transactions..."));
onRunFailed: errorMessage(qsTr("Error running transactions"));
onRunFailed: errorMessage(qsTr("Error running transactions: " + _message));
onRunComplete: infoMessage(qsTr("Run complete"));
onNewBlock: infoMessage(qsTr("New block created"));
}

BIN
mix/qml/img/help.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

BIN
mix/qml/img/openedfolder.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

2
mix/res.qrc

@ -103,5 +103,7 @@
<file>qml/img/available_updates.png</file>
<file>qml/DeploymentDialog.qml</file>
<file>qml/img/search_filled.png</file>
<file>qml/img/help.png</file>
<file>qml/img/openedfolder.png</file>
</qresource>
</RCC>

Loading…
Cancel
Save