|
|
|
@ -6,17 +6,28 @@ import QtQuick.Window 2.1; |
|
|
|
|
import QtQuick.Controls.Styles 1.1 |
|
|
|
|
import Ethereum 1.0 |
|
|
|
|
|
|
|
|
|
import "../ext/filter.js" as Eth |
|
|
|
|
|
|
|
|
|
ApplicationWindow { |
|
|
|
|
id: root |
|
|
|
|
|
|
|
|
|
property alias miningButtonText: miningButton.text |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
width: 900 |
|
|
|
|
height: 600 |
|
|
|
|
minimumHeight: 300 |
|
|
|
|
|
|
|
|
|
title: "Ethereal" |
|
|
|
|
title: "Ether browser" |
|
|
|
|
|
|
|
|
|
// This signal is used by the filter API. The filter API connects using this signal handler from |
|
|
|
|
// the different QML files and plugins. |
|
|
|
|
signal message(var callback, int seed, int seedCallback); |
|
|
|
|
function invokeFilterCallback(data, receiverSeed, callbackSeed) { |
|
|
|
|
var messages = JSON.parse(data) |
|
|
|
|
// Signal handler |
|
|
|
|
message(data, receiverSeed, callbackSeed); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
TextField { |
|
|
|
|
id: copyElementHax |
|
|
|
@ -31,17 +42,17 @@ ApplicationWindow { |
|
|
|
|
|
|
|
|
|
// Takes care of loading all default plugins |
|
|
|
|
Component.onCompleted: { |
|
|
|
|
var walletView = addPlugin("./views/wallet.qml", {section: "ethereum"}) |
|
|
|
|
|
|
|
|
|
var historyView = addPlugin("./views/history.qml", {section: "legacy"}) |
|
|
|
|
var newTxView = addPlugin("./views/transaction.qml", {section: "legacy"}) |
|
|
|
|
var chainView = addPlugin("./views/chain.qml", {section: "legacy"}) |
|
|
|
|
var infoView = addPlugin("./views/info.qml", {section: "legacy"}) |
|
|
|
|
var pendingTxView = addPlugin("./views/pending_tx.qml", {section: "legacy"}) |
|
|
|
|
var pendingTxView = addPlugin("./views/javascript.qml", {section: "legacy"}) |
|
|
|
|
var walletView = addPlugin("./views/wallet.qml", {noAdd: true, section: "ethereum", active: true}) |
|
|
|
|
var historyView = addPlugin("./views/history.qml", {noAdd: true, section: "legacy"}) |
|
|
|
|
var newTxView = addPlugin("./views/transaction.qml", {noAdd: true, section: "legacy"}) |
|
|
|
|
var chainView = addPlugin("./views/chain.qml", {noAdd: true, section: "legacy"}) |
|
|
|
|
var infoView = addPlugin("./views/info.qml", {noAdd: true, section: "legacy"}) |
|
|
|
|
var pendingTxView = addPlugin("./views/pending_tx.qml", {noAdd: true, section: "legacy"}) |
|
|
|
|
var pendingTxView = addPlugin("./views/javascript.qml", {noAdd: true, section: "legacy"}) |
|
|
|
|
|
|
|
|
|
// Call the ready handler |
|
|
|
|
gui.done() |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function addPlugin(path, options) { |
|
|
|
@ -50,10 +61,20 @@ ApplicationWindow { |
|
|
|
|
if(component.status == Component.Error) { |
|
|
|
|
console.debug("Error:"+ component.errorString()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return mainSplit.addComponent(component, options) |
|
|
|
|
var views = mainSplit.addComponent(component, options) |
|
|
|
|
views.menuItem.path = path |
|
|
|
|
|
|
|
|
|
mainSplit.views.push(views); |
|
|
|
|
|
|
|
|
|
if(!options.noAdd) { |
|
|
|
|
gui.addPlugin(path) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return views.view |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
MenuBar { |
|
|
|
@ -76,7 +97,7 @@ ApplicationWindow { |
|
|
|
|
text: "Add plugin" |
|
|
|
|
onTriggered: { |
|
|
|
|
generalFileDialog.show(true, function(path) { |
|
|
|
|
addPlugin(path, {canClose: true}) |
|
|
|
|
addPlugin(path, {canClose: true, section: "apps"}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -268,23 +289,29 @@ ApplicationWindow { |
|
|
|
|
|
|
|
|
|
function addComponent(component, options) { |
|
|
|
|
var view = mainView.createView(component, options) |
|
|
|
|
view.visible = false |
|
|
|
|
view.anchors.fill = mainView |
|
|
|
|
|
|
|
|
|
if(!view.hasOwnProperty("iconFile")) { |
|
|
|
|
if( !view.hasOwnProperty("iconFile") ) { |
|
|
|
|
console.log("Could not load plugin. Property 'iconFile' not found on view."); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var menuItem = menu.createMenuItem(view.iconFile, view, options); |
|
|
|
|
if(view.hasOwnProperty("menuItem")) { |
|
|
|
|
if( view.hasOwnProperty("menuItem") ) { |
|
|
|
|
view.menuItem = menuItem; |
|
|
|
|
} |
|
|
|
|
mainSplit.views.push({view: view, menuItem: menuItem}); |
|
|
|
|
|
|
|
|
|
if(view.hasOwnProperty("onReady")) { |
|
|
|
|
if( view.hasOwnProperty("onReady") ) { |
|
|
|
|
view.onReady.call(view) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return view |
|
|
|
|
if( options.active ) { |
|
|
|
|
setView(view, menuItem) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return {view: view, menuItem: menuItem} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/********************* |
|
|
|
@ -302,6 +329,7 @@ ApplicationWindow { |
|
|
|
|
Rectangle { |
|
|
|
|
id: menuItem |
|
|
|
|
property var view; |
|
|
|
|
property var path; |
|
|
|
|
|
|
|
|
|
property alias title: label.text |
|
|
|
|
property alias icon: icon.source |
|
|
|
@ -319,6 +347,13 @@ ApplicationWindow { |
|
|
|
|
leftMargin: 4 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
MouseArea { |
|
|
|
|
anchors.fill: parent |
|
|
|
|
onClicked: { |
|
|
|
|
mainSplit.setView(view, menuItem) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Image { |
|
|
|
|
id: icon |
|
|
|
|
height: 20 |
|
|
|
@ -328,6 +363,12 @@ ApplicationWindow { |
|
|
|
|
verticalCenter: parent.verticalCenter |
|
|
|
|
leftMargin: 3 |
|
|
|
|
} |
|
|
|
|
MouseArea { |
|
|
|
|
anchors.fill: parent |
|
|
|
|
onClicked: { |
|
|
|
|
menuItem.closeApp() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Text { |
|
|
|
@ -338,7 +379,6 @@ ApplicationWindow { |
|
|
|
|
leftMargin: 3 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//font.bold: true |
|
|
|
|
color: "#0D0A01" |
|
|
|
|
font.pixelSize: 12 |
|
|
|
|
} |
|
|
|
@ -354,11 +394,15 @@ ApplicationWindow { |
|
|
|
|
font.pixelSize: 12 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
MouseArea { |
|
|
|
|
anchors.fill: parent |
|
|
|
|
onClicked: { |
|
|
|
|
mainSplit.setView(view, menuItem) |
|
|
|
|
|
|
|
|
|
function closeApp() { |
|
|
|
|
if(this.view.hasOwnProperty("onDestroy")) { |
|
|
|
|
this.view.onDestroy.call(this.view) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.view.destroy() |
|
|
|
|
this.destroy() |
|
|
|
|
gui.removePlugin(this.path) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -428,8 +472,9 @@ ApplicationWindow { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Text { |
|
|
|
|
text: "LEGACY" |
|
|
|
|
text: "APPS" |
|
|
|
|
font.bold: true |
|
|
|
|
anchors { |
|
|
|
|
left: parent.left |
|
|
|
@ -439,7 +484,7 @@ ApplicationWindow { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ColumnLayout { |
|
|
|
|
id: menuLegacy |
|
|
|
|
id: menuApps |
|
|
|
|
spacing: 3 |
|
|
|
|
anchors { |
|
|
|
|
left: parent.left |
|
|
|
@ -448,7 +493,7 @@ ApplicationWindow { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Text { |
|
|
|
|
text: "APPS" |
|
|
|
|
text: "DEBUG" |
|
|
|
|
font.bold: true |
|
|
|
|
anchors { |
|
|
|
|
left: parent.left |
|
|
|
@ -457,53 +502,15 @@ ApplicationWindow { |
|
|
|
|
color: "#888888" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
Rectangle { |
|
|
|
|
width: 180 |
|
|
|
|
height: 28 |
|
|
|
|
border.color: "#CCCCCC" |
|
|
|
|
border.width: 1 |
|
|
|
|
radius: 5 |
|
|
|
|
color: "#FFFFFF" |
|
|
|
|
|
|
|
|
|
anchors { |
|
|
|
|
left: parent.left |
|
|
|
|
leftMargin: 4 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Image { |
|
|
|
|
id: icon |
|
|
|
|
ColumnLayout { |
|
|
|
|
id: menuLegacy |
|
|
|
|
spacing: 3 |
|
|
|
|
anchors { |
|
|
|
|
left: parent.left |
|
|
|
|
verticalCenter: parent.verticalCenter |
|
|
|
|
} |
|
|
|
|
source: "../pick.png" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Text { |
|
|
|
|
anchors { |
|
|
|
|
left: icon.right |
|
|
|
|
verticalCenter: parent.verticalCenter |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
text: "Wallet" |
|
|
|
|
font.bold: true |
|
|
|
|
color: "#0D0A01" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Text { |
|
|
|
|
anchors { |
|
|
|
|
right: parent.right |
|
|
|
|
rightMargin: 8 |
|
|
|
|
verticalCenter: parent.verticalCenter |
|
|
|
|
} |
|
|
|
|
color: "#AEADBE" |
|
|
|
|
text: "12e15 Ξ" |
|
|
|
|
font.pixelSize: 12 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
*/ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/********************* |
|
|
|
@ -557,17 +564,18 @@ ApplicationWindow { |
|
|
|
|
if(ext == "html" || ext == "htm") { |
|
|
|
|
eth.openHtml(path) |
|
|
|
|
}else if(ext == "qml"){ |
|
|
|
|
eth.openQml(path) |
|
|
|
|
addPlugin(path, {canClose: true, section: "apps"}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function setWalletValue(value) { |
|
|
|
|
walletValueLabel.text = value |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function loadPlugin(name) { |
|
|
|
|
console.log("Loading plugin" + name) |
|
|
|
|
mainView.addPlugin(name) |
|
|
|
|
var view = mainView.addPlugin(name) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function setPeers(text) { |
|
|
|
@ -718,4 +726,4 @@ ApplicationWindow { |
|
|
|
|
addrField.focus = true |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|