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
ded013b7
Commit
ded013b7
authored
Aug 23, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor updates to the UI
parent
5ac875b0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
117 additions
and
42 deletions
+117
-42
info.qml
ethereal/assets/qml/views/info.qml
+89
-41
gui.go
ethereal/gui.go
+28
-0
main.go
ethereal/main.go
+0
-1
No files found.
ethereal/assets/qml/views/info.qml
View file @
ded013b7
...
...
@@ -44,59 +44,104 @@ Rectangle {
gui
.
setCustomIdentifier
(
text
)
}
}
}
property
var
addressModel
:
ListModel
{
id
:
addressModel
TextArea
{
objectName
:
"statsPane"
width
:
parent
.
width
height
:
200
selectByMouse
:
true
readOnly
:
true
font.family
:
"Courier"
}
}
TableView
{
id
:
addressView
RowLayout
{
id
:
logLayout
width
:
parent
.
width
height
:
200
anchors.bottom
:
logLayout
.
top
TableViewColumn
{
role
:
"name"
;
title
:
"name"
}
TableViewColumn
{
role
:
"address"
;
title
:
"address"
;
width
:
300
}
model
:
addressModel
itemDelegate
:
Item
{
Text
{
anchors
{
left
:
parent
.
left
right
:
parent
.
right
leftMargin
:
10
verticalCenter
:
parent
.
verticalCenter
}
color
:
styleData
.
textColor
elide
:
styleData
.
elideMode
text
:
styleData
.
value
font.pixelSize
:
11
MouseArea
{
acceptedButtons
:
Qt
.
LeftButton
|
Qt
.
RightButton
propagateComposedEvents
:
true
anchors.fill
:
parent
onClicked
:
{
addressView
.
selection
.
clear
()
addressView
.
selection
.
select
(
styleData
.
row
)
if
(
mouse
.
button
==
Qt
.
RightButton
)
{
contextMenu
.
row
=
styleData
.
row
;
contextMenu
.
popup
()
anchors.bottom
:
parent
.
bottom
TableView
{
id
:
addressView
width
:
parent
.
width
height
:
200
anchors
{
left
:
parent
.
left
right
:
logLevelSlider
.
left
bottom
:
parent
.
bottom
top
:
parent
.
top
}
TableViewColumn
{
role
:
"name"
;
title
:
"name"
}
TableViewColumn
{
role
:
"address"
;
title
:
"address"
;
width
:
300
}
property
var
addressModel
:
ListModel
{
id
:
addressModel
}
model
:
addressModel
itemDelegate
:
Item
{
Text
{
anchors
{
left
:
parent
.
left
right
:
parent
.
right
leftMargin
:
10
verticalCenter
:
parent
.
verticalCenter
}
color
:
styleData
.
textColor
elide
:
styleData
.
elideMode
text
:
styleData
.
value
font.pixelSize
:
11
MouseArea
{
acceptedButtons
:
Qt
.
LeftButton
|
Qt
.
RightButton
propagateComposedEvents
:
true
anchors.fill
:
parent
onClicked
:
{
addressView
.
selection
.
clear
()
addressView
.
selection
.
select
(
styleData
.
row
)
if
(
mouse
.
button
==
Qt
.
RightButton
)
{
contextMenu
.
row
=
styleData
.
row
;
contextMenu
.
popup
()
}
}
}
}
}
Menu
{
id
:
contextMenu
property
var
row
;
MenuItem
{
text
:
"Copy"
onTriggered
:
{
copyToClipboard
(
addressModel
.
get
(
this
.
row
).
address
)
}
}
}
}
Menu
{
id
:
contextMenu
property
var
row
;
Slider
{
id
:
logLevelSlider
value
:
gui
.
getLogLevelInt
()
anchors
{
right
:
parent
.
right
top
:
parent
.
top
bottom
:
parent
.
bottom
MenuItem
{
text
:
"Copy"
onTriggered
:
{
copyToClipboard
(
addressModel
.
get
(
this
.
row
).
address
)
}
rightMargin
:
5
leftMargin
:
5
topMargin
:
5
bottomMargin
:
5
}
orientation
:
Qt
.
Vertical
maximumValue
:
5
stepSize
:
1
onValueChanged
:
{
gui
.
setLogLevel
(
value
)
}
}
}
...
...
@@ -104,6 +149,8 @@ Rectangle {
property
var
logModel
:
ListModel
{
id
:
logModel
}
/*
RowLayout {
id: logLayout
width: parent.width
...
...
@@ -147,6 +194,7 @@ Rectangle {
}
}
}
*/
function
addDebugMessage
(
message
){
debuggerLog
.
append
({
value
:
message
})
...
...
ethereal/gui.go
View file @
ded013b7
...
...
@@ -6,6 +6,7 @@ import (
"fmt"
"math/big"
"os"
"runtime"
"strconv"
"strings"
"time"
...
...
@@ -412,6 +413,7 @@ func (gui *Gui) update() {
peerUpdateTicker
:=
time
.
NewTicker
(
5
*
time
.
Second
)
generalUpdateTicker
:=
time
.
NewTicker
(
1
*
time
.
Second
)
statsUpdateTicker
:=
time
.
NewTicker
(
5
*
time
.
Second
)
state
:=
gui
.
eth
.
StateManager
()
.
TransState
()
...
...
@@ -488,6 +490,10 @@ func (gui *Gui) update() {
pow
:=
gui
.
miner
.
GetPow
()
miningLabel
.
Set
(
"text"
,
"Mining @ "
+
strconv
.
FormatInt
(
pow
.
GetHashrate
(),
10
)
+
"Khash"
)
}
case
<-
statsUpdateTicker
.
C
:
gui
.
setStatsPane
()
}
}
}()
...
...
@@ -507,6 +513,28 @@ func (gui *Gui) update() {
reactor
.
Subscribe
(
"peerList"
,
peerChan
)
}
func
(
gui
*
Gui
)
setStatsPane
()
{
var
memStats
runtime
.
MemStats
runtime
.
ReadMemStats
(
&
memStats
)
statsPane
:=
gui
.
getObjectByName
(
"statsPane"
)
statsPane
.
Set
(
"text"
,
fmt
.
Sprintf
(
`###### Ethereal 0.6.4 (%s) #######
CPU: # %d
Goroutines: # %d
CGoCalls: # %d
Alloc: %d
Heap Alloc: %d
CGNext: %x
NumGC: %d
`
,
runtime
.
Version
(),
runtime
.
NumCPU
,
runtime
.
NumGoroutine
(),
runtime
.
NumCgoCall
(),
memStats
.
Alloc
,
memStats
.
HeapAlloc
,
memStats
.
NextGC
,
memStats
.
NumGC
,
))
}
func
(
gui
*
Gui
)
CopyToClipboard
(
data
string
)
{
//clipboard.WriteAll("test")
fmt
.
Println
(
"COPY currently BUGGED. Here are the contents:
\n
"
,
data
)
...
...
ethereal/main.go
View file @
ded013b7
...
...
@@ -71,7 +71,6 @@ func main() {
// This is a bit of a cheat, but ey!
os
.
Setenv
(
"QTWEBKIT_INSPECTOR_SERVER"
,
"127.0.0.1:99999"
)
//qml.Init(nil)
qml
.
Run
(
run
)
var
interrupted
=
false
...
...
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