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
2b967558
Commit
2b967558
authored
Feb 22, 2014
by
Jeffrey Wilcke
Browse files
Options
Downloads
Patches
Plain Diff
Working out UI
parent
3e8b27c9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
config.go
+1
-1
1 addition, 1 deletion
config.go
ui/gui.go
+19
-2
19 additions, 2 deletions
ui/gui.go
wallet.qml
+43
-3
43 additions, 3 deletions
wallet.qml
with
63 additions
and
6 deletions
config.go
+
1
−
1
View file @
2b967558
...
@@ -21,7 +21,7 @@ func Init() {
...
@@ -21,7 +21,7 @@ func Init() {
flag
.
BoolVar
(
&
StartConsole
,
"c"
,
false
,
"debug and testing console"
)
flag
.
BoolVar
(
&
StartConsole
,
"c"
,
false
,
"debug and testing console"
)
flag
.
BoolVar
(
&
StartMining
,
"m"
,
false
,
"start dagger mining"
)
flag
.
BoolVar
(
&
StartMining
,
"m"
,
false
,
"start dagger mining"
)
flag
.
BoolVar
(
&
ShowGenesis
,
"g"
,
false
,
"prints genesis header and exits"
)
flag
.
BoolVar
(
&
ShowGenesis
,
"g"
,
false
,
"prints genesis header and exits"
)
flag
.
BoolVar
(
&
UseGui
,
"gui"
,
fals
e
,
"use the gui"
)
flag
.
BoolVar
(
&
UseGui
,
"gui"
,
tru
e
,
"use the gui"
)
flag
.
BoolVar
(
&
UseUPnP
,
"upnp"
,
false
,
"enable UPnP support"
)
flag
.
BoolVar
(
&
UseUPnP
,
"upnp"
,
false
,
"enable UPnP support"
)
flag
.
BoolVar
(
&
UseSeed
,
"seed"
,
true
,
"seed peers"
)
flag
.
BoolVar
(
&
UseSeed
,
"seed"
,
true
,
"seed peers"
)
flag
.
BoolVar
(
&
GenAddr
,
"genaddr"
,
false
,
"create a new priv/pub key"
)
flag
.
BoolVar
(
&
GenAddr
,
"genaddr"
,
false
,
"create a new priv/pub key"
)
...
...
This diff is collapsed.
Click to expand it.
ui/gui.go
+
19
−
2
View file @
2b967558
...
@@ -56,10 +56,12 @@ func (ui *Gui) Start() {
...
@@ -56,10 +56,12 @@ func (ui *Gui) Start() {
context
:=
ui
.
engine
.
Context
()
context
:=
ui
.
engine
.
Context
()
context
.
SetVar
(
"eth"
,
ui
.
lib
)
context
.
SetVar
(
"eth"
,
ui
.
lib
)
context
.
SetVar
(
"ui"
,
&
UiLib
{
engine
:
ui
.
engine
})
context
.
SetVar
(
"ui"
,
&
UiLib
{
engine
:
ui
.
engine
,
eth
:
ui
.
eth
})
ui
.
eth
.
BlockManager
.
SecondaryBlockProcessor
=
ui
ui
.
eth
.
BlockManager
.
SecondaryBlockProcessor
=
ui
ethutil
.
Config
.
Log
.
AddLogSystem
(
ui
)
go
ui
.
setInitialBlockChain
()
go
ui
.
setInitialBlockChain
()
go
ui
.
updatePeers
()
go
ui
.
updatePeers
()
...
@@ -73,13 +75,23 @@ func (ui *Gui) setInitialBlockChain() {
...
@@ -73,13 +75,23 @@ func (ui *Gui) setInitialBlockChain() {
ui
.
ProcessBlock
(
block
)
ui
.
ProcessBlock
(
block
)
}
}
ui
.
eth
.
Start
()
}
}
func
(
ui
*
Gui
)
ProcessBlock
(
block
*
ethchain
.
Block
)
{
func
(
ui
*
Gui
)
ProcessBlock
(
block
*
ethchain
.
Block
)
{
ui
.
win
.
Root
()
.
Call
(
"addBlock"
,
NewBlockFromBlock
(
block
))
ui
.
win
.
Root
()
.
Call
(
"addBlock"
,
NewBlockFromBlock
(
block
))
}
}
func
(
ui
*
Gui
)
Println
(
v
...
interface
{})
{
str
:=
fmt
.
Sprintln
(
v
...
)
// remove last \n
ui
.
win
.
Root
()
.
Call
(
"addLog"
,
str
[
:
len
(
str
)
-
1
])
}
func
(
ui
*
Gui
)
Printf
(
format
string
,
v
...
interface
{})
{
str
:=
strings
.
TrimRight
(
fmt
.
Sprintf
(
format
,
v
...
),
"
\n
"
)
ui
.
win
.
Root
()
.
Call
(
"addLog"
,
str
)
}
func
(
ui
*
Gui
)
updatePeers
()
{
func
(
ui
*
Gui
)
updatePeers
()
{
for
{
for
{
ui
.
win
.
Root
()
.
Call
(
"setPeers"
,
fmt
.
Sprintf
(
"%d / %d"
,
ui
.
eth
.
Peers
()
.
Len
(),
ui
.
eth
.
MaxPeers
))
ui
.
win
.
Root
()
.
Call
(
"setPeers"
,
fmt
.
Sprintf
(
"%d / %d"
,
ui
.
eth
.
Peers
()
.
Len
(),
ui
.
eth
.
MaxPeers
))
...
@@ -89,6 +101,7 @@ func (ui *Gui) updatePeers() {
...
@@ -89,6 +101,7 @@ func (ui *Gui) updatePeers() {
type
UiLib
struct
{
type
UiLib
struct
{
engine
*
qml
.
Engine
engine
*
qml
.
Engine
eth
*
eth
.
Ethereum
}
}
func
(
ui
*
UiLib
)
Open
(
path
string
)
{
func
(
ui
*
UiLib
)
Open
(
path
string
)
{
...
@@ -104,6 +117,10 @@ func (ui *UiLib) Open(path string) {
...
@@ -104,6 +117,10 @@ func (ui *UiLib) Open(path string) {
}()
}()
}
}
func
(
ui
*
UiLib
)
Connect
()
{
ui
.
eth
.
Start
()
}
type
Tester
struct
{
type
Tester
struct
{
root
qml
.
Object
root
qml
.
Object
}
}
...
...
This diff is collapsed.
Click to expand it.
wallet.qml
+
43
−
3
View file @
2b967558
...
@@ -2,6 +2,7 @@ import QtQuick 2.0
...
@@ -2,6 +2,7 @@ import QtQuick 2.0
import
QtQuick
.
Controls
1.0
;
import
QtQuick
.
Controls
1.0
;
import
QtQuick
.
Layouts
1.0
;
import
QtQuick
.
Layouts
1.0
;
import
QtQuick
.
Dialogs
1.0
;
import
QtQuick
.
Dialogs
1.0
;
import
QtQuick
.
Window
2.1
;
import
GoExtensions
1.0
import
GoExtensions
1.0
ApplicationWindow
{
ApplicationWindow
{
...
@@ -60,18 +61,34 @@ ApplicationWindow {
...
@@ -60,18 +61,34 @@ ApplicationWindow {
}
}
TableView
{
TableView
{
id
:
blockTable
width
:
parent
.
width
width
:
parent
.
width
height
:
100
anchors.bottom
:
parent
.
bottom
anchors.top
:
splitView
.
bottom
anchors.top
:
splitView
.
bottom
anchors.bottom
:
logView
.
top
TableViewColumn
{
role
:
"
number
"
;
title
:
"
#
"
;
width
:
100
}
TableViewColumn
{
role
:
"
number
"
;
title
:
"
#
"
;
width
:
100
}
TableViewColumn
{
role
:
"
hash
"
;
title
:
"
Hash
"
;
width
:
560
}
TableViewColumn
{
role
:
"
hash
"
;
title
:
"
Hash
"
;
width
:
560
}
model
:
blockModel
model
:
blockModel
onDoubleClicked
:
{
onDoubleClicked
:
{
console
.
log
(
eth
.
getBlock
(
blockModel
.
get
(
row
).
hash
))
popup
.
visible
=
true
popup
.
block
=
eth
.
getBlock
(
blockModel
.
get
(
row
).
hash
)
popup
.
hashLabel
.
text
=
popup
.
block
.
hash
}
}
}
property
var
logModel
:
ListModel
{
id
:
logModel
}
TableView
{
id
:
logView
width
:
parent
.
width
height
:
150
anchors.bottom
:
parent
.
bottom
TableViewColumn
{
role
:
"
description
"
;
title
:
"
log
"
}
model
:
logModel
}
}
FileDialog
{
FileDialog
{
...
@@ -86,6 +103,13 @@ ApplicationWindow {
...
@@ -86,6 +103,13 @@ ApplicationWindow {
RowLayout
{
RowLayout
{
anchors.fill
:
parent
anchors.fill
:
parent
Button
{
Button
{
id
:
connectButton
onClicked
:
ui
.
connect
()
text
:
"
Connect
"
}
Button
{
anchors.left
:
connectButton
.
right
anchors.leftMargin
:
5
onClicked
:
openAppDialog
.
open
()
onClicked
:
openAppDialog
.
open
()
text
:
"
Import App
"
text
:
"
Import App
"
}
}
...
@@ -107,10 +131,26 @@ ApplicationWindow {
...
@@ -107,10 +131,26 @@ ApplicationWindow {
}
}
}
}
Window
{
id
:
popup
visible
:
false
property
var
block
Label
{
id
:
hashLabel
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
function
addBlock
(
block
)
{
function
addBlock
(
block
)
{
blockModel
.
insert
(
0
,
{
number
:
block
.
number
,
hash
:
block
.
hash
})
blockModel
.
insert
(
0
,
{
number
:
block
.
number
,
hash
:
block
.
hash
})
}
}
function
addLog
(
str
)
{
console
.
log
(
str
)
logModel
.
insert
(
0
,
{
description
:
str
})
}
function
setPeers
(
text
)
{
function
setPeers
(
text
)
{
peerLabel
.
text
=
text
peerLabel
.
text
=
text
}
}
...
...
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