Minor UI adjustments

This commit is contained in:
obscuren 2014-06-12 10:06:02 +02:00
parent 1d300bbc10
commit e7a22af0e6
2 changed files with 40 additions and 11 deletions

View File

@ -768,6 +768,20 @@ ApplicationWindow {
anchors.leftMargin: 5 anchors.leftMargin: 5
anchors.topMargin: 5 anchors.topMargin: 5
ListModel {
id: denomModel
ListElement { text: "Wei" ; zeros: "" }
ListElement { text: "Ada" ; zeros: "000" }
ListElement { text: "Babbage" ; zeros: "000000" }
ListElement { text: "Shannon" ; zeros: "000000000" }
ListElement { text: "Szabo" ; zeros: "000000000000" }
ListElement { text: "Finney" ; zeros: "000000000000000" }
ListElement { text: "Ether" ; zeros: "000000000000000000" }
ListElement { text: "Einstein" ;zeros: "000000000000000000000" }
ListElement { text: "Douglas" ; zeros: "000000000000000000000000000000000000000000" }
}
TextField { TextField {
id: txFuelRecipient id: txFuelRecipient
placeholderText: "Address / Name or empty for contract" placeholderText: "Address / Name or empty for contract"
@ -775,13 +789,21 @@ ApplicationWindow {
width: 400 width: 400
} }
TextField { RowLayout {
id: txValue TextField {
width: 222 id: txValue
placeholderText: "Amount" width: 222
validator: RegExpValidator { regExp: /\d*/ } placeholderText: "Amount"
onTextChanged: { validator: RegExpValidator { regExp: /\d*/ }
contractFormReady() onTextChanged: {
contractFormReady()
}
}
ComboBox {
id: valueDenom
currentIndex: 6
model: denomModel
} }
} }
@ -807,7 +829,7 @@ ApplicationWindow {
id: txGasPrice id: txGasPrice
width: 200 width: 200
placeholderText: "Gas price" placeholderText: "Gas price"
text: "1000000" text: "10"
validator: RegExpValidator { regExp: /\d*/ } validator: RegExpValidator { regExp: /\d*/ }
/* /*
onTextChanged: { onTextChanged: {
@ -815,6 +837,12 @@ ApplicationWindow {
} }
*/ */
} }
ComboBox {
id: gasDenom
currentIndex: 4
model: denomModel
}
} }
Label { Label {
@ -848,8 +876,9 @@ ApplicationWindow {
] ]
text: "Send" text: "Send"
onClicked: { onClicked: {
//this.enabled = false var value = txValue.text + denomModel.get(valueDenom.currentIndex).zeros;
var res = eth.create(txFuelRecipient.text, txValue.text, txGas.text, txGasPrice.text, codeView.text) var gasPrice = txGasPrice.text + denomModel.get(gasDenom.currentIndex).zeros;
var res = eth.create(txFuelRecipient.text, value, txGas.text, gasPrice, codeView.text)
if(res[1]) { if(res[1]) {
txResult.text = "Your contract <b>could not</b> be send over the network:\n<b>" txResult.text = "Your contract <b>could not</b> be send over the network:\n<b>"
txResult.text += res[1].error() txResult.text += res[1].error()

View File

@ -69,7 +69,7 @@ func (gui *Gui) Start(assetPath string) {
Init: func(p *ethpub.KeyVal, obj qml.Object) { p.Key = ""; p.Value = "" }, Init: func(p *ethpub.KeyVal, obj qml.Object) { p.Key = ""; p.Value = "" },
}}) }})
ethutil.Config.SetClientString(fmt.Sprintf("/Ethereal v%s", version)) ethutil.Config.SetClientString("Ethereal")
// Create a new QML engine // Create a new QML engine
gui.engine = qml.NewEngine() gui.engine = qml.NewEngine()