good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
31ffca6d
Commit
31ffca6d
authored
Mar 15, 2015
by
Viktor Trón
Browse files
Options
Downloads
Patches
Plain Diff
remove jsre from mist
parent
da440978
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
cmd/mist/assets/qml/main.qml
+51
-150
51 additions, 150 deletions
cmd/mist/assets/qml/main.qml
cmd/mist/gui.go
+2
-23
2 additions, 23 deletions
cmd/mist/gui.go
cmd/mist/main.go
+2
-1
2 additions, 1 deletion
cmd/mist/main.go
cmd/mist/ui_lib.go
+8
-19
8 additions, 19 deletions
cmd/mist/ui_lib.go
with
63 additions
and
193 deletions
cmd/mist/assets/qml/main.qml
+
51
−
150
View file @
31ffca6d
...
...
@@ -158,105 +158,6 @@ ApplicationWindow {
menuBar
:
MenuBar
{
Menu
{
title
:
"
File
"
MenuItem
{
text
:
"
New tab
"
shortcut
:
"
Ctrl+t
"
onTriggered
:
{
activeView
(
catalog
.
view
,
catalog
.
menuItem
);
}
}
MenuSeparator
{}
MenuItem
{
text
:
"
Import key
"
shortcut
:
"
Ctrl+i
"
onTriggered
:
{
generalFileDialog
.
show
(
true
,
function
(
path
)
{
gui
.
importKey
(
path
)
})
}
}
MenuItem
{
text
:
"
Export keys
"
shortcut
:
"
Ctrl+e
"
onTriggered
:
{
generalFileDialog
.
show
(
false
,
function
(
path
)
{
})
}
}
MenuItem
{
text
:
"
Generate key
"
shortcut
:
"
Ctrl+k
"
onTriggered
:
gui
.
generateKey
()
}
}
Menu
{
title
:
"
Developer
"
MenuItem
{
text
:
"
Import Tx
"
onTriggered
:
{
txImportDialog
.
visible
=
true
}
}
MenuItem
{
text
:
"
Run JS file
"
onTriggered
:
{
generalFileDialog
.
show
(
true
,
function
(
path
)
{
eth
.
evalJavascriptFile
(
path
)
})
}
}
MenuItem
{
text
:
"
Dump state
"
onTriggered
:
{
generalFileDialog
.
show
(
false
,
function
(
path
)
{
// Empty hash for latest
gui
.
dumpState
(
""
,
path
)
})
}
}
MenuSeparator
{}
}
Menu
{
title
:
"
Network
"
MenuItem
{
text
:
"
Add Peer
"
shortcut
:
"
Ctrl+p
"
onTriggered
:
{
addPeerWin
.
visible
=
true
}
}
MenuItem
{
text
:
"
Show Peers
"
shortcut
:
"
Ctrl+e
"
onTriggered
:
{
peerWindow
.
visible
=
true
}
}
}
Menu
{
title
:
"
Help
"
MenuItem
{
text
:
"
About
"
onTriggered
:
{
aboutWin
.
visible
=
true
}
}
}
}
property
var
blockModel
:
ListModel
{
id
:
blockModel
...
...
This diff is collapsed.
Click to expand it.
cmd/mist/gui.go
+
2
−
23
View file @
31ffca6d
...
...
@@ -25,9 +25,7 @@ import "C"
import
(
"encoding/json"
"fmt"
"io/ioutil"
"math/big"
"os"
"path"
"runtime"
"sort"
...
...
@@ -99,7 +97,7 @@ func NewWindow(ethereum *eth.Ethereum) *Gui {
return
gui
}
func
(
gui
*
Gui
)
Start
(
assetPath
string
)
{
func
(
gui
*
Gui
)
Start
(
assetPath
,
libPath
string
)
{
defer
gui
.
txDb
.
Close
()
guilogger
.
Infoln
(
"Starting GUI"
)
...
...
@@ -117,7 +115,7 @@ func (gui *Gui) Start(assetPath string) {
// Create a new QML engine
gui
.
engine
=
qml
.
NewEngine
()
context
:=
gui
.
engine
.
Context
()
gui
.
uiLib
=
NewUiLib
(
gui
.
engine
,
gui
.
eth
,
assetPath
)
gui
.
uiLib
=
NewUiLib
(
gui
.
engine
,
gui
.
eth
,
assetPath
,
libPath
)
gui
.
whisper
=
qwhisper
.
New
(
gui
.
eth
.
Whisper
())
// Expose the eth library and the ui library to QML
...
...
@@ -292,25 +290,6 @@ func (self *Gui) getObjectByName(objectName string) qml.Object {
return
self
.
win
.
Root
()
.
ObjectByName
(
objectName
)
}
func
loadJavascriptAssets
(
gui
*
Gui
)
(
jsfiles
string
)
{
for
_
,
fn
:=
range
[]
string
{
"ext/q.js"
,
"ext/eth.js/main.js"
,
"ext/eth.js/qt.js"
,
"ext/setup.js"
}
{
f
,
err
:=
os
.
Open
(
gui
.
uiLib
.
AssetPath
(
fn
))
if
err
!=
nil
{
fmt
.
Println
(
err
)
continue
}
content
,
err
:=
ioutil
.
ReadAll
(
f
)
if
err
!=
nil
{
fmt
.
Println
(
err
)
continue
}
jsfiles
+=
string
(
content
)
}
return
}
func
(
gui
*
Gui
)
SendCommand
(
cmd
ServEv
)
{
gui
.
serviceEvents
<-
cmd
}
...
...
This diff is collapsed.
Click to expand it.
cmd/mist/main.go
+
2
−
1
View file @
31ffca6d
...
...
@@ -65,6 +65,7 @@ func init() {
utils
.
NodeKeyFileFlag
,
utils
.
RPCListenAddrFlag
,
utils
.
RPCPortFlag
,
utils
.
JSpathFlag
,
}
}
...
...
@@ -111,7 +112,7 @@ func run(ctx *cli.Context) {
gui
:=
NewWindow
(
ethereum
)
utils
.
RegisterInterrupt
(
func
(
os
.
Signal
)
{
gui
.
Stop
()
})
// gui blocks the main thread
gui
.
Start
(
ctx
.
GlobalString
(
assetPathFlag
.
Name
))
gui
.
Start
(
ctx
.
GlobalString
(
assetPathFlag
.
Name
)
,
ctx
.
GlobalString
(
utils
.
JSpathFlag
.
Name
)
)
return
nil
})
}
This diff is collapsed.
Click to expand it.
cmd/mist/ui_lib.go
+
8
−
19
View file @
31ffca6d
...
...
@@ -21,7 +21,6 @@
package
main
import
(
"fmt"
"io/ioutil"
"path"
...
...
@@ -29,7 +28,6 @@ import (
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/event/filter"
"github.com/ethereum/go-ethereum/javascript"
"github.com/ethereum/go-ethereum/xeth"
"github.com/obscuren/qml"
)
...
...
@@ -49,15 +47,19 @@ type UiLib struct {
// The main application window
win
*
qml
.
Window
jsEngine
*
javascript
.
JSRE
filterCallbacks
map
[
int
][]
int
filterManager
*
filter
.
FilterManager
}
func
NewUiLib
(
engine
*
qml
.
Engine
,
eth
*
eth
.
Ethereum
,
assetPath
string
)
*
UiLib
{
func
NewUiLib
(
engine
*
qml
.
Engine
,
eth
*
eth
.
Ethereum
,
assetPath
,
libPath
string
)
*
UiLib
{
x
:=
xeth
.
New
(
eth
,
nil
)
lib
:=
&
UiLib
{
XEth
:
x
,
engine
:
engine
,
eth
:
eth
,
assetPath
:
assetPath
,
jsEngine
:
javascript
.
NewJSRE
(
x
),
filterCallbacks
:
make
(
map
[
int
][]
int
)}
//, filters: make(map[int]*xeth.JSFilter)}
lib
:=
&
UiLib
{
XEth
:
x
,
engine
:
engine
,
eth
:
eth
,
assetPath
:
assetPath
,
filterCallbacks
:
make
(
map
[
int
][]
int
),
}
lib
.
filterManager
=
filter
.
NewFilterManager
(
eth
.
EventMux
())
go
lib
.
filterManager
.
Start
()
...
...
@@ -76,19 +78,6 @@ func (self *UiLib) ImportTx(rlpTx string) {
}
}
func
(
self
*
UiLib
)
EvalJavascriptFile
(
path
string
)
{
self
.
jsEngine
.
LoadExtFile
(
path
[
7
:
])
}
func
(
self
*
UiLib
)
EvalJavascriptString
(
str
string
)
string
{
value
,
err
:=
self
.
jsEngine
.
Run
(
str
)
if
err
!=
nil
{
return
err
.
Error
()
}
return
fmt
.
Sprintf
(
"%v"
,
value
)
}
func
(
ui
*
UiLib
)
Muted
(
content
string
)
{
component
,
err
:=
ui
.
engine
.
LoadFile
(
ui
.
AssetPath
(
"qml/muted.qml"
))
if
err
!=
nil
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment