aboutsummaryrefslogtreecommitdiffstats
path: root/ethereal
diff options
context:
space:
mode:
authorMaran <maran.hidskes@gmail.com>2014-06-03 20:30:26 +0800
committerMaran <maran.hidskes@gmail.com>2014-06-03 20:30:26 +0800
commit3755616a2912f47a963d4ecc781bddd4229fe290 (patch)
tree8a822a5fed825053fcd42e53f6657452d8c78744 /ethereal
parentcc1d043423293eff97d01c8f4897b354112c8210 (diff)
downloaddexon-3755616a2912f47a963d4ecc781bddd4229fe290.tar.gz
dexon-3755616a2912f47a963d4ecc781bddd4229fe290.tar.zst
dexon-3755616a2912f47a963d4ecc781bddd4229fe290.zip
Added namereg register option to qml wallet
Diffstat (limited to 'ethereal')
-rw-r--r--ethereal/assets/qml/wallet.qml27
-rw-r--r--ethereal/ui/gui.go5
2 files changed, 30 insertions, 2 deletions
diff --git a/ethereal/assets/qml/wallet.qml b/ethereal/assets/qml/wallet.qml
index b626bf044..fece8e7d6 100644
--- a/ethereal/assets/qml/wallet.qml
+++ b/ethereal/assets/qml/wallet.qml
@@ -254,13 +254,12 @@ ApplicationWindow {
}
}
-
property var addressModel: ListModel {
id: addressModel
}
TableView {
id: addressView
- width: parent.width
+ width: parent.width - 200
height: 200
anchors.bottom: logView.top
TableViewColumn{ role: "name"; title: "name" }
@@ -269,6 +268,30 @@ ApplicationWindow {
model: addressModel
}
+ Rectangle {
+ anchors.top: addressView.top
+ anchors.left: addressView.right
+ anchors.leftMargin: 20
+
+ TextField {
+ placeholderText: "Name to register"
+ id: nameToReg
+ width: 150
+ }
+
+ Button {
+ anchors.top: nameToReg.bottom
+ text: "Register"
+ MouseArea{
+ anchors.fill: parent
+ onClicked: {
+ eth.registerName(nameToReg.text)
+ nameToReg.text = ""
+ }
+ }
+ }
+ }
+
property var logModel: ListModel {
id: logModel
diff --git a/ethereal/ui/gui.go b/ethereal/ui/gui.go
index 701bacf00..9fc1abc28 100644
--- a/ethereal/ui/gui.go
+++ b/ethereal/ui/gui.go
@@ -329,6 +329,11 @@ func (gui *Gui) Printf(format string, v ...interface{}) {
gui.win.Root().Call("addLog", line)
}
}
+func (gui *Gui) RegisterName(name string) {
+ keyPair := ethutil.GetKeyRing().Get(0)
+ name = fmt.Sprintf("\"%s\"\n1", name)
+ gui.pub.Transact(ethutil.Hex(keyPair.PrivateKey), "namereg", "1000", "1000000", "150", name)
+}
func (gui *Gui) Transact(recipient, value, gas, gasPrice, data string) (*ethpub.PReceipt, error) {
keyPair := ethutil.GetKeyRing().Get(0)