removed old windows & added websockets to mist

This commit is contained in:
obscuren 2014-10-07 11:18:34 +02:00
parent e100aa3c6c
commit 4ed94d3d51
10 changed files with 51 additions and 100 deletions

View File

@ -13,7 +13,7 @@ import (
const ( const (
ClientIdentifier = "Ethereum(G)" ClientIdentifier = "Ethereum(G)"
Version = "0.6.7" Version = "0.6.8"
) )
var logger = ethlog.NewLogger("CLI") var logger = ethlog.NewLogger("CLI")

View File

@ -51,9 +51,8 @@ ApplicationWindow {
addPlugin("./views/transaction.qml", {noAdd: true, close: false, section: "legacy"}); addPlugin("./views/transaction.qml", {noAdd: true, close: false, section: "legacy"});
addPlugin("./views/chain.qml", {noAdd: true, close: false, section: "legacy"}); addPlugin("./views/chain.qml", {noAdd: true, close: false, section: "legacy"});
addPlugin("./views/info.qml", {noAdd: true, close: false, section: "legacy"});
addPlugin("./views/pending_tx.qml", {noAdd: true, close: false, section: "legacy"}); addPlugin("./views/pending_tx.qml", {noAdd: true, close: false, section: "legacy"});
addPlugin("./views/javascript.qml", {noAdd: true, close: false, section: "legacy"}); addPlugin("./views/info.qml", {noAdd: true, close: false, section: "legacy"});
addPlugin("./views/jeffcoin/jeffcoin.qml", {noAdd: true, close: false, section: "apps"}) addPlugin("./views/jeffcoin/jeffcoin.qml", {noAdd: true, close: false, section: "apps"})
@ -363,12 +362,7 @@ ApplicationWindow {
view.visible = false view.visible = false
view.anchors.fill = mainView view.anchors.fill = mainView
if( !view.hasOwnProperty("iconSource") ) { var menuItem = menu.createMenuItem(view, options);
console.log("Could not load plugin. Property 'iconSourc' not found on view.");
return;
}
var menuItem = menu.createMenuItem(view.iconSource, view, options);
if( view.hasOwnProperty("menuItem") ) { if( view.hasOwnProperty("menuItem") ) {
view.menuItem = menuItem; view.menuItem = menuItem;
} }
@ -525,7 +519,7 @@ ApplicationWindow {
} }
} }
function createMenuItem(icon, view, options) { function createMenuItem(view, options) {
if(options === undefined) { if(options === undefined) {
options = {}; options = {};
} }
@ -547,7 +541,10 @@ ApplicationWindow {
comp.view = view comp.view = view
comp.title = view.title comp.title = view.title
comp.icon = view.iconSource
if(view.hasOwnProperty("iconSource")) {
comp.icon = view.iconSource;
}
comp.closable = options.close; comp.closable = options.close;
return comp return comp

View File

@ -8,8 +8,7 @@ import Ethereum 1.0
Rectangle { Rectangle {
id: root id: root
property var title: "Network" property var title: "Block chain"
property var iconSource: "../net.png"
property var menuItem property var menuItem
objectName: "chainView" objectName: "chainView"
@ -102,22 +101,18 @@ Rectangle {
initial = false initial = false
} }
/*
var txs = JSON.parse(block.transactions);
if(txs != null){
amount = txs.length
}
*/
var txs = block.transactions;
var amount = block.transactions.length; var amount = block.transactions.length;
var txs = [];
for(var i = 0; i < block.transactions.length; i++) {
var tx = JSON.parse(block.transactions.getAsJson(i));
txs.push(tx);
}
if(initial){ if(initial){
blockModel.append({size: block.size, number: block.number, name: block.name, gasLimit: block.gasLimit, gasUsed: block.gasUsed, coinbase: block.coinbase, hash: block.hash, txs: txs, txAmount: amount, time: block.time, prettyTime: convertToPretty(block.time)}) blockModel.append({size: block.size, number: block.number, name: block.name, gasLimit: block.gasLimit, gasUsed: block.gasUsed, coinbase: block.coinbase, hash: block.hash, txs: txs, txAmount: amount, time: block.time, prettyTime: convertToPretty(block.time)})
} else { } else {
blockModel.insert(0, {size: block.size, number: block.number, name: block.name, gasLimit: block.gasLimit, gasUsed: block.gasUsed, coinbase: block.coinbase, hash: block.hash, txs: txs, txAmount: amount, time: block.time, prettyTime: convertToPretty(block.time)}) blockModel.insert(0, {size: block.size, number: block.number, name: block.name, gasLimit: block.gasLimit, gasUsed: block.gasUsed, coinbase: block.coinbase, hash: block.hash, txs: txs, txAmount: amount, time: block.time, prettyTime: convertToPretty(block.time)})
} }
//root.secondary.text = "#" + block.number;
} }
Window { Window {
@ -240,16 +235,16 @@ Rectangle {
property var singleBlock: ListModel { property var singleBlock: ListModel {
id: singleBlock id: singleBlock
} }
function setDetails(block){ function setDetails(bl){
singleBlock.set(0,block) singleBlock.set(0, bl)
popup.height = 300 popup.height = 300
transactionModel.clear() transactionModel.clear()
if(block.txs !== undefined){ if(bl.txs !== undefined){
for(var i = 0; i < block.txs.length; i++) { for(var i = 0; i < bl.txs.count; i++) {
transactionModel.insert(0, block.txs.get(i)) transactionModel.insert(0, bl.txs.get(i))
} }
if(block.txs.length > 0 && block.txs.get(0).data){ if(bl.txs.count > 0 && bl.txs.get(0).data){
popup.showContractData(block.txs.get(0)) popup.showContractData(bl.txs.get(0))
} }
} }
txView.forceActiveFocus() txView.forceActiveFocus()

View File

@ -7,7 +7,6 @@ import QtQuick.Controls.Styles 1.1
import Ethereum 1.0 import Ethereum 1.0
Rectangle { Rectangle {
property var iconSource: "../tx.png"
property var title: "Transactions" property var title: "Transactions"
property var menuItem property var menuItem

View File

@ -7,8 +7,7 @@ import QtQuick.Controls.Styles 1.1
import Ethereum 1.0 import Ethereum 1.0
Rectangle { Rectangle {
property var title: "Information" property var title: "Debug Info"
property var iconSource: "../heart.png"
property var menuItem property var menuItem
objectName: "infoView" objectName: "infoView"

View File

@ -1,45 +0,0 @@
import QtQuick 2.0
import QtQuick.Controls 1.0;
import QtQuick.Layouts 1.0;
import QtQuick.Dialogs 1.0;
import QtQuick.Window 2.1;
import QtQuick.Controls.Styles 1.1
import Ethereum 1.0
Rectangle {
property var title: "JavaScript"
property var iconSource: "../tx.png"
property var menuItem
objectName: "javascriptView"
visible: false
anchors.fill: parent
TextField {
id: input
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
}
height: 20
Keys.onReturnPressed: {
var res = eth.evalJavascriptString(this.text);
this.text = "";
output.append(res)
}
}
TextArea {
id: output
text: "> JSRE Ready..."
anchors {
top: parent.top
left: parent.left
right: parent.right
bottom: input.top
}
}
}

View File

@ -8,7 +8,6 @@ import Ethereum 1.0
Rectangle { Rectangle {
property var title: "Pending Transactions" property var title: "Pending Transactions"
property var iconSource: "../tx.png"
property var menuItem property var menuItem
objectName: "pendingTxView" objectName: "pendingTxView"

View File

@ -7,7 +7,6 @@ import QtQuick.Controls.Styles 1.1
import Ethereum 1.0 import Ethereum 1.0
Rectangle { Rectangle {
property var iconSource: "../new.png"
property var title: "New transaction" property var title: "New transaction"
property var menuItem property var menuItem

View File

@ -13,26 +13,29 @@ import (
"github.com/ethereum/eth-go/ethlog" "github.com/ethereum/eth-go/ethlog"
) )
var Identifier string var (
var KeyRing string Identifier string
var KeyStore string KeyRing string
var StartRpc bool KeyStore string
var RpcPort int StartRpc bool
var UseUPnP bool StartWebSockets bool
var OutboundPort string RpcPort int
var ShowGenesis bool UseUPnP bool
var AddPeer string OutboundPort string
var MaxPeer int ShowGenesis bool
var GenAddr bool AddPeer string
var UseSeed bool MaxPeer int
var SecretFile string GenAddr bool
var ExportDir string UseSeed bool
var NonInteractive bool SecretFile string
var Datadir string ExportDir string
var LogFile string NonInteractive bool
var ConfigFile string Datadir string
var DebugFile string LogFile string
var LogLevel int ConfigFile string
DebugFile string
LogLevel int
)
// flags specific to gui client // flags specific to gui client
var AssetPath string var AssetPath string
@ -83,6 +86,7 @@ func Init() {
flag.IntVar(&MaxPeer, "maxpeer", 10, "maximum desired peers") flag.IntVar(&MaxPeer, "maxpeer", 10, "maximum desired peers")
flag.IntVar(&RpcPort, "rpcport", 8080, "port to start json-rpc server on") flag.IntVar(&RpcPort, "rpcport", 8080, "port to start json-rpc server on")
flag.BoolVar(&StartRpc, "rpc", false, "start rpc server") flag.BoolVar(&StartRpc, "rpc", false, "start rpc server")
flag.BoolVar(&StartWebSockets, "ws", false, "start websocket server")
flag.BoolVar(&NonInteractive, "y", false, "non-interactive mode (say yes to confirmations)") flag.BoolVar(&NonInteractive, "y", false, "non-interactive mode (say yes to confirmations)")
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")

View File

@ -12,7 +12,7 @@ import (
const ( const (
ClientIdentifier = "Mist" ClientIdentifier = "Mist"
Version = "0.6.7" Version = "0.6.8"
) )
var ethereum *eth.Ethereum var ethereum *eth.Ethereum
@ -80,6 +80,10 @@ func main() {
utils.HandleInterrupt() utils.HandleInterrupt()
if StartWebSockets {
utils.StartWebSockets(ethereum)
}
// we need to run the interrupt callbacks in case gui is closed // we need to run the interrupt callbacks in case gui is closed
// this skips if we got here by actual interrupt stopping the GUI // this skips if we got here by actual interrupt stopping the GUI
if !interrupted { if !interrupted {