Browse Source

ui changes

cl-refactor
yann300 9 years ago
parent
commit
5117b44345
  1. 58
      mix/qml/BlockChain.qml
  2. 21
      mix/qml/DeployContractStep.qml
  3. 20
      mix/qml/DeploymentDialog.qml
  4. 4
      mix/qml/DeploymentDialogSteps.qml
  5. 61
      mix/qml/KeyValuePanel.qml
  6. 15
      mix/qml/RegisteringStep.qml
  7. 3
      mix/qml/js/NetworkDeployment.js

58
mix/qml/BlockChain.qml

@ -120,52 +120,6 @@ ColumnLayout {
Layout.preferredHeight: 10
}
RowLayout
{
id: header
spacing: 0
Layout.preferredHeight: 24
visible: false
Rectangle
{
Layout.preferredWidth: statusWidth
Layout.preferredHeight: parent.height
color: "transparent"
Image {
id: debugImage
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
source: "qrc:/qml/img/recycleicon@2x.png"
width: statusWidth + 10
fillMode: Image.PreserveAspectFit
}
}
Rectangle
{
anchors.verticalCenter: parent.verticalCenter
Layout.preferredWidth: fromWidth
Label
{
anchors.verticalCenter: parent.verticalCenter
text: "From"
anchors.left: parent.left
anchors.leftMargin: horizontalMargin
}
}
Label
{
text: "To"
anchors.verticalCenter: parent.verticalCenter
Layout.preferredWidth: toWidth + cellSpacing
}
Label
{
text: ""
anchors.verticalCenter: parent.verticalCenter
Layout.preferredWidth: debugActionWidth
}
}
Rectangle
{
Layout.preferredHeight: 500
@ -184,18 +138,6 @@ ColumnLayout {
width: parent.width
spacing: 20
Block
{
scenario: blockChainPanel.model
Layout.preferredWidth: blockChainScrollView.width
Layout.preferredHeight: 60
blockIndex: -1
transactions: []
status: ""
number: -2
trHeight: 60
}
Repeater // List of blocks
{
id: blockChainRepeater

21
mix/qml/DeployContractStep.qml

@ -46,13 +46,24 @@ Rectangle {
function updateVerification(blockNumber, trLost)
{
verificationLabel.text = blockNumber - projectModel.deployBlockNumber
if (trLost.length > 0)
var nb = parseInt(blockNumber - projectModel.deployBlockNumber)
if (nb >= 10)
{
verificationLabel.text += "\n" + qsTr("Transactions lost") + "\n"
for (var k in trLost)
verificationLabel.text = qsTr("contracts deployment verified")
verificationLabel.color = "green"
}
else
{
verificationLabel.text = nb
if (trLost.length > 0)
{
verificationLabel.text += trLost[k] + "\n"
deploymentStepChanged("following transactions are invalidated:")
verificationLabel.text += "\n" + qsTr("Transactions lost") + "\n"
for (var k in trLost)
{
deploymentStepChanged(trLost[k])
verificationLabel.text += trLost[k] + "\n"
}
}
}
}

20
mix/qml/DeploymentDialog.qml

@ -53,15 +53,31 @@ Dialog {
anchors.fill: parent
anchors.margins: 10
RowLayout
Rectangle
{
id: explanation
Layout.preferredWidth: parent.width - 50
Layout.preferredHeight: 50
color: "transparent"
Label
{
id: info
anchors.centerIn: parent
text: qsTr("Putting your dapp live is a multi step process. You can read more about it on the 'guide to uploading'.")
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
}
}
}

4
mix/qml/DeploymentDialogSteps.qml

@ -236,10 +236,8 @@ Rectangle {
Button
{
Layout.preferredHeight: 22
Layout.preferredWidth: 22
action: clearAction
iconSource: "qrc:/qml/img/cleariconactive.png"
text: qsTr("Clear Messages")
}
Action {

61
mix/qml/KeyValuePanel.qml

@ -82,51 +82,44 @@ ColumnLayout {
clip: true
ColumnLayout
{
anchors.margins: 10
spacing: 0
id: colValue
anchors.top: parent.top
anchors.topMargin: 5
Repeater
{
id: repeaterKeyValue
model: modelKeyValue
RowLayout
Row
{
Layout.fillWidth: true
Layout.preferredHeight: 30
spacing: 0
Rectangle
spacing: 5
anchors.left: colValue.left
anchors.leftMargin: 5
Label
{
Layout.preferredWidth: columnValues.width / 2
Label
{
width: columnValues.width / 2 - 20
elide: Text.ElideRight
maximumLineCount: 1
anchors.left: parent.left
anchors.leftMargin: 10
text: {
if (index >= 0 && repeaterKeyValue.model.get(index).key !== undefined)
return repeaterKeyValue.model.get(index).key
else
return ""
}
maximumLineCount: 1
text: {
if (index >= 0 && repeaterKeyValue.model.get(index).key !== undefined)
return repeaterKeyValue.model.get(index).key
else
return ""
}
}
Rectangle
Label
{
Layout.preferredWidth: columnValues.width / 2 - 10
Label
{
width: columnValues.width / 2 - 10
elide: Text.ElideRight
maximumLineCount: 1
anchors.right: parent.right
anchors.rightMargin: 10
text: {
if (index >= 0 && repeaterKeyValue.model.get(index).value !== undefined)
return repeaterKeyValue.model.get(index).value
else
return ""
}
text: "="
}
Label
{
maximumLineCount: 1
text: {
if (index >= 0 && repeaterKeyValue.model.get(index).value !== undefined)
return repeaterKeyValue.model.get(index).value
else
return ""
}
}
}

15
mix/qml/RegisteringStep.qml

@ -33,7 +33,7 @@ Rectangle {
{
worker.verifyHash("registerHash", projectModel.registerContentHashTrHash, function(bn, trLost)
{
updateVerification(projectModel.registerContentHashBlockNumber, bn, trLost, verificationEthUrl)
updateVerification(projectModel.registerContentHashBlockNumber, bn, trLost, verificationEthUrl, "registerHash")
});
}
@ -42,20 +42,27 @@ Rectangle {
{
worker.verifyHash("registerUrl", projectModel.registerUrlTrHash, function(bn, trLost)
{
updateVerification(projectModel.registerUrlBlockNumber, bn, trLost, verificationUrl)
updateVerification(projectModel.registerUrlBlockNumber, bn, trLost, verificationUrl, "registerUrl")
});
}
}
function updateVerification(originbn, bn, trLost, ctrl)
function updateVerification(originbn, bn, trLost, ctrl, trContext)
{
if (trLost.length === 0)
{
ctrl.text = bn - originbn
ctrl.text += qsTr(" verifications")
if (parseInt(bn - originbn) >= 10)
{
ctrl.color= "green"
ctrl.text= qsTr("verified")
}
else
ctrl.text += qsTr(" verifications")
}
else
{
deploymentStepChanged(trContext + qsTr(" has been invalidated.") + trLost[0] + " " + qsTr("no longer present") )
ctrl.text = qsTr("invalidated")
}
}

3
mix/qml/js/NetworkDeployment.js

@ -77,10 +77,7 @@ function checkPathCreationCost(ethUrl, callBack)
}
}
else
{
deploymentStepChanged(qsTr("Your Dapp can be registered here."));
callBack((dappUrl.length - 1) * (deploymentDialog.registerStep.ownedRegistrarDeployGas + deploymentDialog.registerStep.ownedRegistrarSetSubRegistrarGas) + deploymentDialog.registerStep.ownedRegistrarSetContentHashGas);
}
});
}

Loading…
Cancel
Save