From 4ed94d3d512da28407118723e05e29f4058497e0 Mon Sep 17 00:00:00 2001
From: obscuren <geffobscura@gmail.com>
Date: Tue, 7 Oct 2014 11:18:34 +0200
Subject: removed old windows & added websockets to mist

---
 mist/assets/qml/main.qml              | 17 ++++++-------
 mist/assets/qml/views/chain.qml       | 31 ++++++++++--------------
 mist/assets/qml/views/history.qml     |  1 -
 mist/assets/qml/views/info.qml        |  3 +--
 mist/assets/qml/views/javascript.qml  | 45 -----------------------------------
 mist/assets/qml/views/pending_tx.qml  |  1 -
 mist/assets/qml/views/transaction.qml |  1 -
 7 files changed, 21 insertions(+), 78 deletions(-)
 delete mode 100644 mist/assets/qml/views/javascript.qml

(limited to 'mist/assets')

diff --git a/mist/assets/qml/main.qml b/mist/assets/qml/main.qml
index 3d9204ce8..689427228 100644
--- a/mist/assets/qml/main.qml
+++ b/mist/assets/qml/main.qml
@@ -51,9 +51,8 @@ ApplicationWindow {
 
 		addPlugin("./views/transaction.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/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"})
 
@@ -363,12 +362,7 @@ ApplicationWindow {
 			view.visible = false
 			view.anchors.fill = mainView
 
-			if( !view.hasOwnProperty("iconSource") ) {
-				console.log("Could not load plugin. Property 'iconSourc' not found on view.");
-				return;
-			}
-
-			var menuItem = menu.createMenuItem(view.iconSource, view, options);
+			var menuItem = menu.createMenuItem(view, options);
 			if( view.hasOwnProperty("menuItem") ) {
 				view.menuItem = menuItem;
 			}
@@ -525,7 +519,7 @@ ApplicationWindow {
 				 }
 			 }
 
-			 function createMenuItem(icon, view, options) {
+			 function createMenuItem(view, options) {
 				 if(options === undefined) {
 					 options = {};
 				 }
@@ -547,7 +541,10 @@ ApplicationWindow {
 
 				 comp.view = view
 				 comp.title = view.title
-				 comp.icon = view.iconSource
+
+				 if(view.hasOwnProperty("iconSource")) {
+					 comp.icon = view.iconSource;
+				 }
 				 comp.closable = options.close;
 
 				 return comp
diff --git a/mist/assets/qml/views/chain.qml b/mist/assets/qml/views/chain.qml
index 130ff8bb9..454fafef6 100644
--- a/mist/assets/qml/views/chain.qml
+++ b/mist/assets/qml/views/chain.qml
@@ -8,8 +8,7 @@ import Ethereum 1.0
 
 Rectangle {
 	id: root
-	property var title: "Network"
-	property var iconSource: "../net.png"
+	property var title: "Block chain"
 	property var menuItem
 
 	objectName: "chainView"
@@ -102,22 +101,18 @@ Rectangle {
 			initial = false
 		}
 
-		/*
-		var txs = JSON.parse(block.transactions);
-		if(txs != null){
-			amount = txs.length
-		}
-		*/
-	       var txs = block.transactions;
 	       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){
 			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 {
 			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 {
@@ -240,16 +235,16 @@ Rectangle {
 		property var singleBlock: ListModel {
 			id: singleBlock
 		}
-		function setDetails(block){
-			singleBlock.set(0,block)
+		function setDetails(bl){
+			singleBlock.set(0, bl)
 			popup.height = 300
 			transactionModel.clear()
-			if(block.txs !== undefined){
-				for(var i = 0; i < block.txs.length; i++) {
-					transactionModel.insert(0, block.txs.get(i))
+			if(bl.txs !== undefined){
+				for(var i = 0; i < bl.txs.count; i++) {
+					transactionModel.insert(0, bl.txs.get(i))
 				}
-				if(block.txs.length > 0 && block.txs.get(0).data){
-					popup.showContractData(block.txs.get(0))
+				if(bl.txs.count > 0 && bl.txs.get(0).data){
+					popup.showContractData(bl.txs.get(0))
 				}
 			}
 			txView.forceActiveFocus()
diff --git a/mist/assets/qml/views/history.qml b/mist/assets/qml/views/history.qml
index 9eee883e3..c72f8f3ae 100644
--- a/mist/assets/qml/views/history.qml
+++ b/mist/assets/qml/views/history.qml
@@ -7,7 +7,6 @@ import QtQuick.Controls.Styles 1.1
 import Ethereum 1.0
 
 Rectangle {
-	property var iconSource: "../tx.png"
 	property var title: "Transactions"
 	property var menuItem
 
diff --git a/mist/assets/qml/views/info.qml b/mist/assets/qml/views/info.qml
index 158e2c960..3ff551b05 100644
--- a/mist/assets/qml/views/info.qml
+++ b/mist/assets/qml/views/info.qml
@@ -7,8 +7,7 @@ import QtQuick.Controls.Styles 1.1
 import Ethereum 1.0
 
 Rectangle {
-	property var title: "Information"
-	property var iconSource: "../heart.png"
+	property var title: "Debug Info"
 	property var menuItem
 
 	objectName: "infoView"
diff --git a/mist/assets/qml/views/javascript.qml b/mist/assets/qml/views/javascript.qml
deleted file mode 100644
index ea05c4148..000000000
--- a/mist/assets/qml/views/javascript.qml
+++ /dev/null
@@ -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
-		}
-	}
-}
diff --git a/mist/assets/qml/views/pending_tx.qml b/mist/assets/qml/views/pending_tx.qml
index abfa25790..4442a69db 100644
--- a/mist/assets/qml/views/pending_tx.qml
+++ b/mist/assets/qml/views/pending_tx.qml
@@ -8,7 +8,6 @@ import Ethereum 1.0
 
 Rectangle {
 	property var title: "Pending Transactions"
-	property var iconSource: "../tx.png"
 	property var menuItem
 
 	objectName: "pendingTxView"
diff --git a/mist/assets/qml/views/transaction.qml b/mist/assets/qml/views/transaction.qml
index 7d689733f..744a4da65 100644
--- a/mist/assets/qml/views/transaction.qml
+++ b/mist/assets/qml/views/transaction.qml
@@ -7,7 +7,6 @@ import QtQuick.Controls.Styles 1.1
 import Ethereum 1.0
 
 Rectangle {
-	property var iconSource: "../new.png"
 	property var title: "New transaction"
 	property var menuItem
 
-- 
cgit v1.2.3