You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

186 lines
3.5 KiB

import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import QtQuick.Window 2.0
import QtQuick.Dialogs 1.2
import QtQuick.Controls.Styles 1.3
import org.ethereum.qml.QEther 1.0
import "js/TransactionHelper.js" as TransactionHelper
10 years ago
import "js/NetworkDeployment.js" as NetworkDeploymentCode
import "js/QEtherHelper.js" as QEtherHelper
import "."
Dialog {
id: modalDeploymentDialog
modality: Qt.ApplicationModal
width: 1000
10 years ago
height: 450
visible: false
10 years ago
property alias deployStep: deployStep
property alias packageStep: packageStep
property alias registerStep: registerStep
property alias worker: worker
10 years ago
property alias steps: steps
function close()
{
visible = false;
}
function open()
{
10 years ago
deployStep.visible = false
packageStep.visible = false
registerStep.visible = false
steps.init()
worker.renewCtx()
visible = true;
}
10 years ago
DeploymentWorker
{
10 years ago
id: worker
}
contentItem: Rectangle {
color: appStyle.generic.layout.backgroundColor
anchors.fill: parent
10 years ago
ColumnLayout
{
spacing: 5
anchors.fill: parent
anchors.margins: 10
10 years ago
10 years ago
Rectangle
{
10 years ago
id: explanation
Layout.preferredWidth: parent.width - 50
Layout.preferredHeight: 50
10 years ago
color: "transparent"
10 years ago
Label
{
10 years ago
id: info
10 years ago
anchors.centerIn: parent
10 years ago
text: qsTr("Putting your dapp live is a multi step process. You can read more about it on the")
}
Text {
anchors.left: info.right
anchors.leftMargin: 7
id: linkText
text: '<html><style type="text/css"></style><a href="https://github.com/ethereum/wiki/wiki/Mix:-The-DApp-IDE#deployment-to-network">guide to uploading</a></html>'
onLinkActivated: Qt.openUrlExternally("https://github.com/ethereum/wiki/wiki/Mix:-The-DApp-IDE#deployment-to-network")
anchors.verticalCenter: parent.verticalCenter
MouseArea
{
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
}
}
10 years ago
}
10 years ago
RowLayout
{
ColumnLayout
{
10 years ago
Layout.preferredHeight: parent.height - 50
Layout.preferredWidth: 200
DeploymentDialogSteps
{
10 years ago
id: steps
10 years ago
worker: worker
}
10 years ago
}
10 years ago
Connections
{
target: steps
property variant selected
onSelected:
{
10 years ago
if (selected)
selected.visible = false
switch (step)
{
10 years ago
case "deploy":
{
selected = deployStep
break;
}
10 years ago
case "package":
{
10 years ago
selected = packageStep
break;
}
10 years ago
case "register":
{
10 years ago
selected = registerStep
break;
}
10 years ago
}
selected.show()
}
}
10 years ago
ColumnLayout
{
10 years ago
Layout.preferredHeight: parent.height - 50
Layout.preferredWidth: parent.width - 200
DeployContractStep
{
10 years ago
id: deployStep
visible: false
worker: worker
}
10 years ago
PackagingStep
{
10 years ago
id: packageStep
visible: false
worker: worker
}
10 years ago
RegisteringStep
{
10 years ago
id: registerStep
visible: false
worker: worker
}
}
10 years ago
}
Rectangle
10 years ago
{
Layout.fillWidth: true
10 years ago
Layout.preferredHeight: 30
color: "transparent"
Button
{
10 years ago
text: qsTr("Cancel")
anchors.right: parent.right
anchors.rightMargin: 10
onClicked:
{
10 years ago
modalDeploymentDialog.close()
10 years ago
}
}
}
10 years ago
}
}
MessageDialog {
id: deployDialog
standardButtons: StandardButton.Ok
icon: StandardIcon.Warning
}
MessageDialog {
id: errorDialog
standardButtons: StandardButton.Ok
icon: StandardIcon.Critical
}
}