Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop

This commit is contained in:
obscuren
2015-02-19 22:46:15 +01:00
19 changed files with 654 additions and 658 deletions

View File

@ -67,6 +67,7 @@ func main() {
DataDir: Datadir,
LogFile: LogFile,
LogLevel: LogLevel,
LogFormat: LogFormat,
MaxPeers: MaxPeer,
Port: OutboundPort,
NAT: NAT,

View File

@ -20,16 +20,18 @@
console.log("loaded?");
document.onkeydown = function(evt) {
// This functions keeps track of keyboard inputs in order to allow copy, paste and other features
evt = evt || window.event;
if (evt.ctrlKey && evt.keyCode == 67) {
window.document.execCommand("copy");
console.log("Ctrl-C");
} else if (evt.ctrlKey && evt.keyCode == 88) {
window.document.execCommand("cut");
console.log("Ctrl-X");
} if (evt.ctrlKey && evt.keyCode == 86) {
console.log("Ctrl-V");
} if (evt.ctrlKey && evt.keyCode == 90) {
console.log("Ctrl-Z");
} else if (evt.ctrlKey && evt.keyCode == 86) {
window.document.execCommand("paste");
} else if (evt.ctrlKey && evt.keyCode == 90) {
window.document.execCommand("undo");
} else if (evt.ctrlKey && evt.shiftKey && evt.keyCode == 90) {
window.document.execCommand("redo");
}
};

View File

@ -131,7 +131,11 @@ ApplicationWindow {
var existingDomain = matches && matches[1];
if (requestedDomain == existingDomain) {
domainAlreadyOpen = true;
mainSplit.views[i].view.url = url;
if (mainSplit.views[i].view.url != url){
mainSplit.views[i].view.url = url;
}
activeView(mainSplit.views[i].view, mainSplit.views[i].menuItem);
}
}
@ -928,7 +932,8 @@ ApplicationWindow {
model: peerModel
TableViewColumn{width: 180; role: "addr" ; title: "Remote Address" }
TableViewColumn{width: 280; role: "nodeID" ; title: "Node ID" }
TableViewColumn{width: 180; role: "caps" ; title: "Capabilities" }
TableViewColumn{width: 100; role: "name" ; title: "Name" }
TableViewColumn{width: 40; role: "caps" ; title: "Capabilities" }
}
}
}

View File

@ -3,7 +3,7 @@ import QtQuick.Controls 1.0;
import QtQuick.Controls.Styles 1.0
import QtQuick.Layouts 1.0;
import QtWebEngine 1.0
//import QtWebEngine.experimental 1.0
import QtWebEngine.experimental 1.0
import QtQuick.Window 2.0;
Rectangle {
@ -340,7 +340,7 @@ Rectangle {
WebEngineView {
objectName: "webView"
id: webview
//experimental.settings.javascriptCanAccessClipboard: true
experimental.settings.javascriptCanAccessClipboard: true
//experimental.settings.localContentCanAccessRemoteUrls: true
anchors {
left: parent.left
@ -399,7 +399,8 @@ Rectangle {
onLoadingChanged: {
if (loadRequest.status == WebEngineView.LoadSucceededStatus) {
webview.runJavaScript("document.title", function(pageTitle) {
webview.runJavaScript("document.title", function(pageTitle) {
menuItem.title = pageTitle;
});
@ -441,7 +442,8 @@ Rectangle {
webview.runJavaScript(eth.readFile("bignumber.min.js"));
webview.runJavaScript(eth.readFile("ethereum.js/dist/ethereum.js"));
webview.runJavaScript(eth.readFile("mist.js"));
var cleanTitle = webview.url.toString()
var matches = cleanTitle.match(/^[a-z]*\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);
var domain = matches && matches[1];

View File

@ -3,7 +3,7 @@ import QtQuick.Controls 1.0;
import QtQuick.Controls.Styles 1.0
import QtQuick.Layouts 1.0;
import QtWebEngine 1.0
//import QtWebEngine.experimental 1.0
import QtWebEngine.experimental 1.0
import QtQuick.Window 2.0;
@ -21,8 +21,6 @@ Rectangle {
property alias windowTitle: webview.title
property alias webView: webview
property var cleanPath: false
property var open: function(url) {
if(!window.cleanPath) {
@ -66,9 +64,6 @@ Rectangle {
}
}
Component.onCompleted: {
}
Item {
objectName: "root"
id: root
@ -85,7 +80,7 @@ Rectangle {
property var domain: "ethereum-dapp-catalog.meteor.com"
url: protocol + domain
//experimental.settings.javascriptCanAccessClipboard: true
experimental.settings.javascriptCanAccessClipboard: true
onJavaScriptConsoleMessage: {
@ -112,11 +107,11 @@ Rectangle {
}
}
// onLoadingChanged: {
// if (loadRequest.status == WebEngineView.LoadSucceededStatus) {
// webview.runJavaScript(eth.readFile("mist.js"));
// }
// }
onLoadingChanged: {
if (loadRequest.status == WebEngineView.LoadSucceededStatus) {
webview.runJavaScript(eth.readFile("mist.js"));
}
}
}

View File

@ -63,6 +63,7 @@ var (
DebugFile string
LogLevel int
VmType int
MinerThreads int
)
// flags specific to gui client
@ -137,6 +138,8 @@ func Init() {
flag.StringVar(&BootNodes, "bootnodes", "", "space-separated node URLs for discovery bootstrap")
flag.IntVar(&MaxPeer, "maxpeer", 30, "maximum desired peers")
flag.IntVar(&MinerThreads, "minerthreads", runtime.NumCPU(), "number of miner threads")
flag.Parse()
var err error

View File

@ -453,7 +453,7 @@ NumGC: %d
))
}
type qmlpeer struct{ Addr, NodeID, Caps string }
type qmlpeer struct{ Addr, NodeID, Name, Caps string }
type peersByID []*qmlpeer
@ -468,6 +468,7 @@ func (gui *Gui) setPeerInfo() {
qpeers[i] = &qmlpeer{
NodeID: p.ID().String(),
Addr: p.RemoteAddr().String(),
Name: p.Name(),
Caps: fmt.Sprint(p.Caps()),
}
}

View File

@ -52,19 +52,20 @@ func run() error {
config := utils.InitConfig(VmType, ConfigFile, Datadir, "ETH")
ethereum, err := eth.New(&eth.Config{
Name: p2p.MakeName(ClientIdentifier, Version),
KeyStore: KeyStore,
DataDir: Datadir,
LogFile: LogFile,
LogLevel: LogLevel,
MaxPeers: MaxPeer,
Port: OutboundPort,
NAT: NAT,
Shh: true,
BootNodes: BootNodes,
NodeKey: NodeKey,
KeyRing: KeyRing,
Dial: true,
Name: p2p.MakeName(ClientIdentifier, Version),
KeyStore: KeyStore,
DataDir: Datadir,
LogFile: LogFile,
LogLevel: LogLevel,
MaxPeers: MaxPeer,
Port: OutboundPort,
NAT: NAT,
Shh: true,
BootNodes: BootNodes,
NodeKey: NodeKey,
KeyRing: KeyRing,
Dial: true,
MinerThreads: MinerThreads,
})
if err != nil {
mainlogger.Fatalln(err)

View File

@ -225,7 +225,7 @@ func StartMining(ethereum *eth.Ethereum) bool {
go func() {
clilogger.Infoln("Start mining")
if gminer == nil {
gminer = miner.New(addr, ethereum)
gminer = miner.New(addr, ethereum, 4)
}
gminer.Start()
}()