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
59d97468
Commit
59d97468
authored
Aug 12, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed naming on exposed QML variables
parent
2e2f23a0
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
33 deletions
+31
-33
chain.qml
ethereal/assets/qml/views/chain.qml
+2
-2
info.qml
ethereal/assets/qml/views/info.qml
+5
-5
transaction.qml
ethereal/assets/qml/views/transaction.qml
+1
-1
wallet.qml
ethereal/assets/qml/wallet.qml
+4
-4
gui.go
ethereal/gui.go
+5
-20
ui_lib.go
ethereal/ui_lib.go
+14
-1
No files found.
ethereal/assets/qml/views/chain.qml
View file @
59d97468
...
@@ -145,9 +145,9 @@ Rectangle {
...
@@ -145,9 +145,9 @@ Rectangle {
text
:
"Debug contract"
text
:
"Debug contract"
onClicked
:
{
onClicked
:
{
if
(
tx
.
createsContract
){
if
(
tx
.
createsContract
){
ui
.
startDbWithCode
(
tx
.
rawData
)
eth
.
startDbWithCode
(
tx
.
rawData
)
}
else
{
}
else
{
ui
.
startDbWithContractAndData
(
tx
.
address
,
tx
.
rawData
)
eth
.
startDbWithContractAndData
(
tx
.
address
,
tx
.
rawData
)
}
}
}
}
}
}
...
...
ethereal/assets/qml/views/info.qml
View file @
59d97468
...
@@ -35,11 +35,11 @@ Rectangle {
...
@@ -35,11 +35,11 @@ Rectangle {
text
:
"Client ID"
text
:
"Client ID"
}
}
TextField
{
TextField
{
text
:
eth
.
getCustomIdentifier
()
text
:
gui
.
getCustomIdentifier
()
width
:
500
width
:
500
placeholderText
:
"Anonymous"
placeholderText
:
"Anonymous"
onTextChanged
:
{
onTextChanged
:
{
eth
.
setCustomIdentifier
(
text
)
gui
.
setCustomIdentifier
(
text
)
}
}
}
}
}
}
...
@@ -75,7 +75,7 @@ Rectangle {
...
@@ -75,7 +75,7 @@ Rectangle {
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
onClicked
:
{
onClicked
:
{
eth
.
registerName
(
nameToReg
.
text
)
gui
.
registerName
(
nameToReg
.
text
)
nameToReg
.
text
=
""
nameToReg
.
text
=
""
}
}
}
}
...
@@ -107,7 +107,7 @@ Rectangle {
...
@@ -107,7 +107,7 @@ Rectangle {
Slider
{
Slider
{
id
:
logLevelSlider
id
:
logLevelSlider
value
:
eth
.
getLogLevelInt
()
value
:
gui
.
getLogLevelInt
()
anchors
{
anchors
{
right
:
parent
.
right
right
:
parent
.
right
top
:
parent
.
top
top
:
parent
.
top
...
@@ -124,7 +124,7 @@ Rectangle {
...
@@ -124,7 +124,7 @@ Rectangle {
stepSize
:
1
stepSize
:
1
onValueChanged
:
{
onValueChanged
:
{
eth
.
setLogLevel
(
value
)
gui
.
setLogLevel
(
value
)
}
}
}
}
}
}
...
...
ethereal/assets/qml/views/transaction.qml
View file @
59d97468
...
@@ -174,7 +174,7 @@ Rectangle {
...
@@ -174,7 +174,7 @@ Rectangle {
onClicked
:
{
onClicked
:
{
var
value
=
txValue
.
text
+
denomModel
.
get
(
valueDenom
.
currentIndex
).
zeros
;
var
value
=
txValue
.
text
+
denomModel
.
get
(
valueDenom
.
currentIndex
).
zeros
;
var
gasPrice
=
txGasPrice
.
text
+
denomModel
.
get
(
gasDenom
.
currentIndex
).
zeros
;
var
gasPrice
=
txGasPrice
.
text
+
denomModel
.
get
(
gasDenom
.
currentIndex
).
zeros
;
var
res
=
eth
.
create
(
txFuelRecipient
.
text
,
value
,
txGas
.
text
,
gasPrice
,
codeView
.
text
)
var
res
=
gui
.
create
(
txFuelRecipient
.
text
,
value
,
txGas
.
text
,
gasPrice
,
codeView
.
text
)
if
(
res
[
1
])
{
if
(
res
[
1
])
{
txResult
.
text
=
"Your contract <b>could not</b> be sent over the network:
\n
<b>"
txResult
.
text
=
"Your contract <b>could not</b> be sent over the network:
\n
<b>"
txResult
.
text
+=
res
[
1
].
error
()
txResult
.
text
+=
res
[
1
].
error
()
...
...
ethereal/assets/qml/wallet.qml
View file @
59d97468
...
@@ -26,7 +26,7 @@ ApplicationWindow {
...
@@ -26,7 +26,7 @@ ApplicationWindow {
var
pendingTxView
=
addPlugin
(
"./views/pending_tx.qml"
)
var
pendingTxView
=
addPlugin
(
"./views/pending_tx.qml"
)
// Call the ready handler
// Call the ready handler
eth
.
done
()
gui
.
done
()
}
}
function
addPlugin
(
path
,
options
)
{
function
addPlugin
(
path
,
options
)
{
...
@@ -111,7 +111,7 @@ ApplicationWindow {
...
@@ -111,7 +111,7 @@ ApplicationWindow {
text
:
"Run JS file"
text
:
"Run JS file"
onTriggered
:
{
onTriggered
:
{
generalFileDialog
.
callback
=
function
(
path
)
{
generalFileDialog
.
callback
=
function
(
path
)
{
eth
.
evalJavascriptFile
(
path
)
lib
.
evalJavascriptFile
(
path
)
}
}
generalFileDialog
.
open
()
generalFileDialog
.
open
()
}
}
...
@@ -155,7 +155,7 @@ ApplicationWindow {
...
@@ -155,7 +155,7 @@ ApplicationWindow {
id
:
miningButton
id
:
miningButton
text
:
"Start Mining"
text
:
"Start Mining"
onClicked
:
{
onClicked
:
{
eth
.
toggleMining
()
gui
.
toggleMining
()
}
}
}
}
...
@@ -456,7 +456,7 @@ ApplicationWindow {
...
@@ -456,7 +456,7 @@ ApplicationWindow {
anchors.leftMargin
:
5
anchors.leftMargin
:
5
text
:
"Import"
text
:
"Import"
onClicked
:
{
onClicked
:
{
eth
.
importTx
(
txImportField
.
text
)
lib
.
importTx
(
txImportField
.
text
)
txImportField
.
visible
=
false
txImportField
.
visible
=
false
}
}
}
}
...
...
ethereal/gui.go
View file @
59d97468
...
@@ -18,7 +18,6 @@ import (
...
@@ -18,7 +18,6 @@ import (
"github.com/ethereum/eth-go/ethreact"
"github.com/ethereum/eth-go/ethreact"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethwire"
"github.com/ethereum/eth-go/ethwire"
"github.com/ethereum/go-ethereum/javascript"
"github.com/ethereum/go-ethereum/utils"
"github.com/ethereum/go-ethereum/utils"
"github.com/go-qml/qml"
"github.com/go-qml/qml"
)
)
...
@@ -49,8 +48,6 @@ type Gui struct {
...
@@ -49,8 +48,6 @@ type Gui struct {
config
*
ethutil
.
ConfigManager
config
*
ethutil
.
ConfigManager
miner
*
ethminer
.
Miner
miner
*
ethminer
.
Miner
jsEngine
*
javascript
.
JSRE
}
}
// Create GUI, but doesn't start it
// Create GUI, but doesn't start it
...
@@ -62,7 +59,7 @@ func NewWindow(ethereum *eth.Ethereum, config *ethutil.ConfigManager, clientIden
...
@@ -62,7 +59,7 @@ func NewWindow(ethereum *eth.Ethereum, config *ethutil.ConfigManager, clientIden
pub
:=
ethpub
.
NewPEthereum
(
ethereum
)
pub
:=
ethpub
.
NewPEthereum
(
ethereum
)
return
&
Gui
{
eth
:
ethereum
,
txDb
:
db
,
pub
:
pub
,
logLevel
:
ethlog
.
LogLevel
(
logLevel
),
Session
:
session
,
open
:
false
,
clientIdentity
:
clientIdentity
,
config
:
config
,
jsEngine
:
javascript
.
NewJSRE
(
ethereum
)
}
return
&
Gui
{
eth
:
ethereum
,
txDb
:
db
,
pub
:
pub
,
logLevel
:
ethlog
.
LogLevel
(
logLevel
),
Session
:
session
,
open
:
false
,
clientIdentity
:
clientIdentity
,
config
:
config
}
}
}
func
(
gui
*
Gui
)
Start
(
assetPath
string
)
{
func
(
gui
*
Gui
)
Start
(
assetPath
string
)
{
...
@@ -81,12 +78,12 @@ func (gui *Gui) Start(assetPath string) {
...
@@ -81,12 +78,12 @@ func (gui *Gui) Start(assetPath string) {
// Create a new QML engine
// Create a new QML engine
gui
.
engine
=
qml
.
NewEngine
()
gui
.
engine
=
qml
.
NewEngine
()
context
:=
gui
.
engine
.
Context
()
context
:=
gui
.
engine
.
Context
()
gui
.
uiLib
=
NewUiLib
(
gui
.
engine
,
gui
.
eth
,
assetPath
)
// Expose the eth library and the ui library to QML
// Expose the eth library and the ui library to QML
context
.
SetVar
(
"
eth
"
,
gui
)
context
.
SetVar
(
"
gui
"
,
gui
)
context
.
SetVar
(
"pub"
,
gui
.
pub
)
context
.
SetVar
(
"pub"
,
gui
.
pub
)
gui
.
uiLib
=
NewUiLib
(
gui
.
engine
,
gui
.
eth
,
assetPath
)
context
.
SetVar
(
"eth"
,
gui
.
uiLib
)
context
.
SetVar
(
"ui"
,
gui
.
uiLib
)
// Load the main QML interface
// Load the main QML interface
data
,
_
:=
ethutil
.
Config
.
Db
.
Get
([]
byte
(
"KeyRing"
))
data
,
_
:=
ethutil
.
Config
.
Db
.
Get
([]
byte
(
"KeyRing"
))
...
@@ -126,7 +123,7 @@ func (gui *Gui) Stop() {
...
@@ -126,7 +123,7 @@ func (gui *Gui) Stop() {
gui
.
win
.
Hide
()
gui
.
win
.
Hide
()
}
}
gui
.
jsEngine
.
Stop
()
gui
.
uiLib
.
jsEngine
.
Stop
()
logger
.
Infoln
(
"Stopped"
)
logger
.
Infoln
(
"Stopped"
)
}
}
...
@@ -477,18 +474,6 @@ func (gui *Gui) Create(recipient, value, gas, gasPrice, data string) (*ethpub.PR
...
@@ -477,18 +474,6 @@ func (gui *Gui) Create(recipient, value, gas, gasPrice, data string) (*ethpub.PR
return
gui
.
pub
.
Transact
(
gui
.
privateKey
(),
recipient
,
value
,
gas
,
gasPrice
,
data
)
return
gui
.
pub
.
Transact
(
gui
.
privateKey
(),
recipient
,
value
,
gas
,
gasPrice
,
data
)
}
}
func
(
self
*
Gui
)
ImportTx
(
rlpTx
string
)
{
tx
:=
ethchain
.
NewTransactionFromBytes
(
ethutil
.
Hex2Bytes
(
rlpTx
))
self
.
eth
.
TxPool
()
.
QueueTransaction
(
tx
)
}
func
(
self
*
Gui
)
SearchChange
(
blockHash
,
address
,
storageAddress
string
)
{
}
func
(
self
*
Gui
)
EvalJavascriptFile
(
path
string
)
{
self
.
jsEngine
.
LoadExtFile
(
path
[
7
:
])
}
func
(
gui
*
Gui
)
SetCustomIdentifier
(
customIdentifier
string
)
{
func
(
gui
*
Gui
)
SetCustomIdentifier
(
customIdentifier
string
)
{
gui
.
clientIdentity
.
SetCustomIdentifier
(
customIdentifier
)
gui
.
clientIdentity
.
SetCustomIdentifier
(
customIdentifier
)
gui
.
config
.
Save
(
"id"
,
customIdentifier
)
gui
.
config
.
Save
(
"id"
,
customIdentifier
)
...
...
ethereal/ui_lib.go
View file @
59d97468
...
@@ -4,7 +4,9 @@ import (
...
@@ -4,7 +4,9 @@ import (
"path"
"path"
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/go-ethereum/javascript"
"github.com/go-qml/qml"
"github.com/go-qml/qml"
)
)
...
@@ -23,10 +25,21 @@ type UiLib struct {
...
@@ -23,10 +25,21 @@ type UiLib struct {
win
*
qml
.
Window
win
*
qml
.
Window
Db
*
Debugger
Db
*
Debugger
DbWindow
*
DebuggerWindow
DbWindow
*
DebuggerWindow
jsEngine
*
javascript
.
JSRE
}
}
func
NewUiLib
(
engine
*
qml
.
Engine
,
eth
*
eth
.
Ethereum
,
assetPath
string
)
*
UiLib
{
func
NewUiLib
(
engine
*
qml
.
Engine
,
eth
*
eth
.
Ethereum
,
assetPath
string
)
*
UiLib
{
return
&
UiLib
{
engine
:
engine
,
eth
:
eth
,
assetPath
:
assetPath
}
return
&
UiLib
{
engine
:
engine
,
eth
:
eth
,
assetPath
:
assetPath
,
jsEngine
:
javascript
.
NewJSRE
(
eth
)}
}
func
(
self
*
UiLib
)
ImportTx
(
rlpTx
string
)
{
tx
:=
ethchain
.
NewTransactionFromBytes
(
ethutil
.
Hex2Bytes
(
rlpTx
))
self
.
eth
.
TxPool
()
.
QueueTransaction
(
tx
)
}
func
(
self
*
UiLib
)
EvalJavascriptFile
(
path
string
)
{
self
.
jsEngine
.
LoadExtFile
(
path
[
7
:
])
}
}
func
(
ui
*
UiLib
)
OpenQml
(
path
string
)
{
func
(
ui
*
UiLib
)
OpenQml
(
path
string
)
{
...
...
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