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
a8409b0a
Commit
a8409b0a
authored
Aug 17, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implementing new wallet views
parent
5ae3deea
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
147 additions
and
38 deletions
+147
-38
history.qml
ethereal/assets/qml/views/history.qml
+4
-3
info.qml
ethereal/assets/qml/views/info.qml
+1
-1
wallet.qml
ethereal/assets/qml/views/wallet.qml
+63
-0
wallet.qml
ethereal/assets/qml/wallet.qml
+62
-16
webapp.qml
ethereal/assets/qml/webapp.qml
+13
-13
wallet.png
ethereal/assets/wallet.png
+0
-0
gui.go
ethereal/gui.go
+1
-2
types.go
javascript/types.go
+3
-3
No files found.
ethereal/assets/qml/views/history.qml
View file @
a8409b0a
...
...
@@ -11,14 +11,15 @@ Rectangle {
property
var
title
:
"Transactions"
property
var
menuItem
property
var
txModel
:
ListModel
{
id
:
txModel
}
id
:
historyView
visible
:
false
anchors.fill
:
parent
objectName
:
"transactionView"
property
var
txModel
:
ListModel
{
id
:
txModel
}
TableView
{
id
:
txTableView
anchors.fill
:
parent
...
...
ethereal/assets/qml/views/info.qml
View file @
a8409b0a
...
...
@@ -29,7 +29,7 @@ Rectangle {
text
:
"Address"
}
TextField
{
text
:
eth
.
getK
ey
().
address
text
:
eth
.
k
ey
().
address
width
:
500
}
...
...
ethereal/assets/qml/views/wallet.qml
0 → 100644
View file @
a8409b0a
import
QtQuick
2.0
import
QtQuick
.
Controls
1.0
;
import
QtQuick
.
Layouts
1.0
;
import
QtQuick
.
Dialogs
1.0
;
import
QtQuick
.
Window
2.1
;
import
QtQuick
.
Controls
.
Styles
1.1
import
Ethereum
1.0
Rectangle
{
id
:
root
property
var
title
:
"Wallet"
property
var
iconFile
:
"../wallet.png"
property
var
menuItem
objectName
:
"walletView"
anchors.fill
:
parent
function
onReady
()
{
menuItem
.
secondary
=
eth
.
numberToHuman
(
eth
.
balanceAt
(
eth
.
key
().
address
))
}
ColumnLayout
{
spacing
:
10
y
:
40
anchors
{
left
:
parent
.
left
right
:
parent
.
right
}
Text
{
text
:
"<b>Balance</b>: "
+
eth
.
numberToHuman
(
eth
.
balanceAt
(
eth
.
key
().
address
))
font.pixelSize
:
24
anchors
{
horizontalCenter
:
parent
.
horizontalCenter
}
}
TableView
{
id
:
txTableView
anchors
{
left
:
parent
.
left
right
:
parent
.
right
}
TableViewColumn
{
role
:
"num"
;
title
:
"#"
;
width
:
30
}
TableViewColumn
{
role
:
"from"
;
title
:
"From"
;
width
:
280
}
TableViewColumn
{
role
:
"to"
;
title
:
"To"
;
width
:
280
}
TableViewColumn
{
role
:
"value"
;
title
:
"Amount"
;
width
:
100
}
model
:
ListModel
{
id
:
txModel
Component.onCompleted
:
{
var
messages
=
JSON
.
parse
(
eth
.
messages
({
latest
:
-
1
,
from
:
"e6716f9544a56c530d868e4bfbacb172315bdead"
}))
for
(
var
i
=
0
;
i
<
messages
.
length
;
i
++
)
{
var
message
=
messages
[
i
];
this
.
insert
(
0
,
{
num
:
i
,
from
:
message
.
from
,
to
:
message
.
to
,
value
:
eth
.
numberToHuman
(
message
.
value
)})
}
}
}
}
}
}
ethereal/assets/qml/wallet.qml
View file @
a8409b0a
...
...
@@ -6,6 +6,7 @@ import QtQuick.Window 2.1;
import
QtQuick
.
Controls
.
Styles
1.1
import
Ethereum
1.0
ApplicationWindow
{
id
:
root
...
...
@@ -30,12 +31,14 @@ ApplicationWindow {
// Takes care of loading all default plugins
Component.onCompleted
:
{
var
historyView
=
addPlugin
(
"./views/history.qml"
,
{
default
:
true
})
var
newTxView
=
addPlugin
(
"./views/transaction.qml"
,
{
default
:
true
})
var
chainView
=
addPlugin
(
"./views/chain.qml"
,
{
default
:
true
})
var
infoView
=
addPlugin
(
"./views/info.qml"
,
{
default
:
true
})
var
pendingTxView
=
addPlugin
(
"./views/pending_tx.qml"
,
{
default
:
true
})
var
pendingTxView
=
addPlugin
(
"./views/javascript.qml"
,
{
default
:
true
})
var
walletView
=
addPlugin
(
"./views/wallet.qml"
,
{
section
:
"ethereum"
})
var
historyView
=
addPlugin
(
"./views/history.qml"
,
{
section
:
"legacy"
})
var
newTxView
=
addPlugin
(
"./views/transaction.qml"
,
{
section
:
"legacy"
})
var
chainView
=
addPlugin
(
"./views/chain.qml"
,
{
section
:
"legacy"
})
var
infoView
=
addPlugin
(
"./views/info.qml"
,
{
section
:
"legacy"
})
var
pendingTxView
=
addPlugin
(
"./views/pending_tx.qml"
,
{
section
:
"legacy"
})
var
pendingTxView
=
addPlugin
(
"./views/javascript.qml"
,
{
section
:
"legacy"
})
// Call the ready handler
gui
.
done
()
...
...
@@ -252,10 +255,10 @@ ApplicationWindow {
function
setView
(
view
,
menu
)
{
for
(
var
i
=
0
;
i
<
views
.
length
;
i
++
)
{
views
[
i
]
[
0
]
.
visible
=
false
views
[
i
]
.
view
.
visible
=
false
views
[
i
]
[
1
]
.
border
.
color
=
"#00000000"
views
[
i
]
[
1
]
.
color
=
"#00000000"
views
[
i
]
.
menuItem
.
border
.
color
=
"#00000000"
views
[
i
]
.
menuItem
.
color
=
"#00000000"
}
view
.
visible
=
true
...
...
@@ -265,14 +268,21 @@ ApplicationWindow {
function
addComponent
(
component
,
options
)
{
var
view
=
mainView
.
createView
(
component
,
options
)
if
(
!
view
.
hasOwnProperty
(
"iconFile"
))
{
console
.
log
(
"Could not load plugin. Property 'iconFile' not found on view."
);
return
;
}
var
menuItem
=
menu
.
createMenuItem
(
view
.
iconFile
,
view
,
options
);
if
(
view
.
hasOwnProperty
(
"menuItem"
))
{
view
.
menuItem
=
menuItem
;
}
mainSplit
.
views
.
push
({
view
:
view
,
menuItem
:
menuItem
});
mainSplit
.
views
.
push
([
view
,
menuItem
]);
if
(
view
.
hasOwnProperty
(
"onReady"
))
{
view
.
onReady
.
call
(
view
)
}
return
view
}
...
...
@@ -294,6 +304,7 @@ ApplicationWindow {
property
var
view
;
property
alias
title
:
label
.
text
property
alias
icon
:
icon
.
source
property
alias
secondary
:
secondary
.
text
width
:
180
...
...
@@ -310,11 +321,13 @@ ApplicationWindow {
Image
{
id
:
icon
height
:
20
width
:
20
anchors
{
left
:
parent
.
left
verticalCenter
:
parent
.
verticalCenter
leftMargin
:
3
}
source
:
"../pick.png"
}
Text
{
...
...
@@ -322,10 +335,10 @@ ApplicationWindow {
anchors
{
left
:
icon
.
right
verticalCenter
:
parent
.
verticalCenter
leftMargin
:
3
}
text
:
"Chain"
font.bold
:
true
//font.bold: true
color
:
"#0D0A01"
font.pixelSize
:
12
}
...
...
@@ -355,15 +368,29 @@ ApplicationWindow {
options
=
{};
}
if
(
options
.
default
)
{
var
comp
=
menuItemTemplate
.
createObject
(
menuDefault
)
var
section
;
switch
(
options
.
section
)
{
case
"ethereum"
:
section
=
menuDefault
;
break
;
case
"legacy"
:
section
=
menuLegacy
;
break
;
default
:
section
=
menuApps
;
break
;
}
var
comp
=
menuItemTemplate
.
createObject
(
section
)
comp
.
view
=
view
comp
.
title
=
view
.
title
comp
.
icon
=
view
.
iconFile
/*
if(view.secondary !== undefined) {
comp.secondary = view.secondary
}
*/
return
comp
...
...
@@ -376,7 +403,7 @@ ApplicationWindow {
ColumnLayout
{
id
:
menuColumn
y
:
3
0
y
:
1
0
width
:
parent
.
width
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
...
...
@@ -401,6 +428,25 @@ ApplicationWindow {
}
}
Text
{
text
:
"LEGACY"
font.bold
:
true
anchors
{
left
:
parent
.
left
leftMargin
:
5
}
color
:
"#888888"
}
ColumnLayout
{
id
:
menuLegacy
spacing
:
3
anchors
{
left
:
parent
.
left
right
:
parent
.
right
}
}
Text
{
text
:
"APPS"
font.bold
:
true
...
...
ethereal/assets/qml/webapp.qml
View file @
a8409b0a
...
...
@@ -142,39 +142,39 @@ ApplicationWindow {
try
{
switch
(
data
.
call
)
{
case
"getCoinBase"
:
postData
(
data
.
_seed
,
eth
.
getC
oinBase
())
postData
(
data
.
_seed
,
eth
.
c
oinBase
())
break
case
"getIsListening"
:
postData
(
data
.
_seed
,
eth
.
getI
sListening
())
postData
(
data
.
_seed
,
eth
.
i
sListening
())
break
case
"getIsMining"
:
postData
(
data
.
_seed
,
eth
.
getI
sMining
())
postData
(
data
.
_seed
,
eth
.
i
sMining
())
break
case
"getPeerCount"
:
postData
(
data
.
_seed
,
eth
.
getP
eerCount
())
postData
(
data
.
_seed
,
eth
.
p
eerCount
())
break
case
"getTxCountAt"
:
require
(
1
)
postData
(
data
.
_seed
,
eth
.
getT
xCountAt
(
data
.
args
[
0
]))
postData
(
data
.
_seed
,
eth
.
t
xCountAt
(
data
.
args
[
0
]))
break
case
"getBlockByNumber"
:
var
block
=
eth
.
getB
lockByNumber
(
data
.
args
[
0
])
var
block
=
eth
.
b
lockByNumber
(
data
.
args
[
0
])
postData
(
data
.
_seed
,
block
)
break
case
"getBlockByHash"
:
var
block
=
eth
.
getB
lockByHash
(
data
.
args
[
0
])
var
block
=
eth
.
b
lockByHash
(
data
.
args
[
0
])
postData
(
data
.
_seed
,
block
)
break
...
...
@@ -190,22 +190,22 @@ ApplicationWindow {
case
"getStorage"
:
require
(
2
);
var
stateObject
=
eth
.
getS
tateObject
(
data
.
args
[
0
])
var
storage
=
stateObject
.
getStorage
(
data
.
args
[
1
])
var
stateObject
=
eth
.
s
tateObject
(
data
.
args
[
0
])
var
storage
=
stateObject
.
storageAt
(
data
.
args
[
1
])
postData
(
data
.
_seed
,
storage
)
break
case
"getEachStorage"
:
require
(
1
);
var
storage
=
JSON
.
parse
(
eth
.
getE
achStorage
(
data
.
args
[
0
]))
var
storage
=
JSON
.
parse
(
eth
.
e
achStorage
(
data
.
args
[
0
]))
postData
(
data
.
_seed
,
storage
)
break
case
"getTransactionsFor"
:
require
(
1
);
var
txs
=
eth
.
getT
ransactionsFor
(
data
.
args
[
0
],
true
)
var
txs
=
eth
.
t
ransactionsFor
(
data
.
args
[
0
],
true
)
postData
(
data
.
_seed
,
txs
)
break
...
...
@@ -213,12 +213,12 @@ ApplicationWindow {
case
"getBalance"
:
require
(
1
);
postData
(
data
.
_seed
,
eth
.
getS
tateObject
(
data
.
args
[
0
]).
value
());
postData
(
data
.
_seed
,
eth
.
s
tateObject
(
data
.
args
[
0
]).
value
());
break
case
"getKey"
:
var
key
=
eth
.
getK
ey
().
privateKey
;
var
key
=
eth
.
k
ey
().
privateKey
;
postData
(
data
.
_seed
,
key
)
break
...
...
ethereal/assets/wallet.png
0 → 100644
View file @
a8409b0a
1.09 KB
ethereal/gui.go
View file @
a8409b0a
...
...
@@ -334,7 +334,6 @@ func (gui *Gui) readPreviousTransactions() {
}
func
(
gui
*
Gui
)
processBlock
(
block
*
ethchain
.
Block
,
initial
bool
)
{
//name := ethpub.FindNameInNameReg(gui.eth.StateManager(), block.Coinbase)
name
:=
strings
.
Trim
(
gui
.
pipe
.
World
()
.
Config
()
.
Get
(
"NameReg"
)
.
Storage
(
block
.
Coinbase
)
.
Str
(),
"
\x00
"
)
b
:=
ethpipe
.
NewJSBlock
(
block
)
b
.
Name
=
name
...
...
@@ -491,7 +490,7 @@ func (gui *Gui) setPeerInfo() {
gui
.
win
.
Root
()
.
Call
(
"setPeers"
,
fmt
.
Sprintf
(
"%d / %d"
,
gui
.
eth
.
PeerCount
(),
gui
.
eth
.
MaxPeers
))
gui
.
win
.
Root
()
.
Call
(
"resetPeers"
)
for
_
,
peer
:=
range
gui
.
pipe
.
Get
Peers
()
{
for
_
,
peer
:=
range
gui
.
pipe
.
Peers
()
{
gui
.
win
.
Root
()
.
Call
(
"addPeer"
,
peer
)
}
}
...
...
javascript/types.go
View file @
a8409b0a
...
...
@@ -73,15 +73,15 @@ type JSEthereum struct {
}
func
(
self
*
JSEthereum
)
GetBlock
(
hash
string
)
otto
.
Value
{
return
self
.
toVal
(
&
JSBlock
{
self
.
JSPipe
.
Get
BlockByHash
(
hash
),
self
})
return
self
.
toVal
(
&
JSBlock
{
self
.
JSPipe
.
BlockByHash
(
hash
),
self
})
}
func
(
self
*
JSEthereum
)
GetPeers
()
otto
.
Value
{
return
self
.
toVal
(
self
.
JSPipe
.
Get
Peers
())
return
self
.
toVal
(
self
.
JSPipe
.
Peers
())
}
func
(
self
*
JSEthereum
)
GetKey
()
otto
.
Value
{
return
self
.
toVal
(
self
.
JSPipe
.
Get
Key
())
return
self
.
toVal
(
self
.
JSPipe
.
Key
())
}
func
(
self
*
JSEthereum
)
GetStateObject
(
addr
string
)
otto
.
Value
{
...
...
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