Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
5768b18a
Commit
5768b18a
authored
Apr 11, 2014
by
Maran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored simple send to use states
parent
4d187984
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
211 additions
and
180 deletions
+211
-180
wallet.qml
ethereal/assets/qml/wallet.qml
+211
-180
No files found.
ethereal/assets/qml/wallet.qml
View file @
5768b18a
...
...
@@ -187,52 +187,89 @@ ApplicationWindow {
anchors.bottomMargin
:
5
id
:
newTransactionTab
Component.onCompleted
:{
addTab
(
"S
end ether
"
,
newTransaction
)
addTab
(
"S
imple send
"
,
newTransaction
)
addTab
(
"Create contract"
,
newContract
)
}
}
Component
{
id
:
newTransaction
Column
{
id
:
simpleSendColumn
states
:
[
State
{
name
:
"ERROR"
},
State
{
name
:
"DONE"
PropertyChanges
{
target
:
txSimpleValue
;
visible
:
false
}
PropertyChanges
{
target
:
txSimpleRecipient
;
visible
:
false
}
PropertyChanges
{
target
:
newSimpleTxButton
;
visible
:
false
}
PropertyChanges
{
target
:
txSimpleResult
;
visible
:
true
}
PropertyChanges
{
target
:
txSimpleOutput
;
visible
:
true
}
PropertyChanges
{
target
:
newSimpleTxButton
;
visible
:
true
}
},
State
{
name
:
"SETUP"
PropertyChanges
{
target
:
txSimpleValue
;
visible
:
true
;
text
:
""
}
PropertyChanges
{
target
:
txSimpleRecipient
;
visible
:
true
;
text
:
""
}
PropertyChanges
{
target
:
txSimpleButton
;
visible
:
true
}
PropertyChanges
{
target
:
newSimpleTxButton
;
visible
:
false
}
}
]
spacing
:
5
anchors.leftMargin
:
5
anchors.topMargin
:
5
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
function
checkFormState
(){
if
(
txSimpleRecipient
.
text
.
length
==
40
&&
txSimpleValue
.
text
.
length
>
0
)
{
txSimpleButton
.
state
=
"READY"
}
else
{
txSimpleButton
.
state
=
"NOTREADY"
}
}
TextField
{
id
:
txSimpleRecipient
placeholderText
:
"Recipient address"
Layout.fillWidth
:
true
validator
:
RegExpValidator
{
regExp
:
/
[
a-f0-9
]{40}
/
}
width
:
530
onTextChanged
:
{
checkFormState
()
}
}
TextField
{
id
:
txSimpleValue
placeholderText
:
"Amount"
anchors.rightMargin
:
5
validator
:
IntValidator
{
}
onTextChanged
:
{
checkFormState
()
}
}
Button
{
id
:
txSimpleButton
states
:
[
State
{
name
:
"READY"
PropertyChanges
{
target
:
txSimpleButton
;
enabled
:
true
}
},
State
{
name
:
"NOTREADY"
PropertyChanges
{
target
:
txSimpleButton
;
enabled
:
false
}
}
]
text
:
"Send"
enabled
:
false
onClicked
:
{
//this.enabled = false
var
res
=
eth
.
createTx
(
txSimpleRecipient
.
text
,
txSimpleValue
.
text
,
""
,
""
,
""
)
if
(
res
[
1
])
{
txSimpleResult
.
text
=
"There has been an error broadcasting your transaction:"
+
res
[
1
].
error
()
txSimpleResult
.
visible
=
true
}
else
{
txSimpleResult
.
text
=
"Your transaction has been broadcasted over the network.
\n
Your transaction id is:"
txSimpleOutput
.
text
=
res
[
0
]
txSimpleOutput
.
visible
=
true
txSimpleResult
.
visible
=
true
txSimpleValue
.
visible
=
false
txSimpleRecipient
.
visible
=
false
txSimpleValue
.
text
=
""
txSimpleRecipient
.
text
=
""
txSimpleRecipient
.
focus
=
true
newSimpleTxButton
.
visible
=
true
this
.
visible
=
false
simpleSendColumn
.
state
=
"DONE"
}
}
}
...
...
@@ -252,13 +289,7 @@ ApplicationWindow {
text
:
"Create an other transaction"
onClicked
:
{
this
.
visible
=
false
txSimpleResult
.
text
=
""
txSimpleOutput
.
text
=
""
txSimpleResult
.
visible
=
false
txSimpleOutput
.
visible
=
false
txSimpleValue
.
visible
=
true
txSimpleRecipient
.
visible
=
true
txSimpleButton
.
visible
=
true
simpleSendColumn
.
state
=
"SETUP"
}
}
}
...
...
@@ -713,4 +744,4 @@ ApplicationWindow {
function
setPeers
(
text
)
{
peerLabel
.
text
=
text
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment