diff --git a/.gitignore b/.gitignore
index 199746006..8be0f0ba8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -39,7 +39,6 @@ extdep/download
*.pyc
-
# MacOS Development
.DS_Store
# CocoaPods
diff --git a/BuildInfo.h.in b/BuildInfo.h.in
index 7d2bfc1c8..5e97b71a5 100644
--- a/BuildInfo.h.in
+++ b/BuildInfo.h.in
@@ -1,7 +1,7 @@
#pragma once
+#define ETH_PROJECT_VERSION "@PROJECT_VERSION@"
#define ETH_COMMIT_HASH @ETH_COMMIT_HASH@
#define ETH_CLEAN_REPO @ETH_CLEAN_REPO@
#define ETH_BUILD_TYPE @ETH_BUILD_TYPE@
-#define ETH_BUILD_PLATFORM @ETH_BUILD_PLATFORM@
-
+#define ETH_BUILD_PLATFORM @ETH_BUILD_PLATFORM@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8f44df13e..55aefe335 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,14 @@
# cmake global
cmake_minimum_required(VERSION 2.8.12)
-project(ethereum)
+set(PROJECT_VERSION "0.9.40")
+if (${CMAKE_VERSION} VERSION_GREATER 3.0)
+ cmake_policy(SET CMP0042 OLD) # fix MACOSX_RPATH
+ cmake_policy(SET CMP0048 NEW) # allow VERSION argument in project()
+ project(ethereum VERSION ${PROJECT_VERSION})
+else()
+ project(ethereum)
+endif()
set(CMAKE_AUTOMOC ON)
@@ -22,29 +29,123 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
######################################################################################################
-# user defined, defaults
-# Normally, set(...CACHE...) creates cache variables, but does not modify them.
-option(VMTRACE "VM tracing and run-time checks (useful for cross-implementation VM debugging)" OFF)
-option(PARANOID "Additional run-time checks" OFF)
-option(JSONRPC "Build with jsonprc. default on" ON)
-option(FATDB "Build with ability to list entries in the Trie. Doubles DB size, slows everything down, but good for looking at state diffs and trie contents." OFF)
-option(USENPM "Use npm to recompile ethereum.js if it was changed" OFF)
-option(PROFILING "Build in support for profiling" OFF)
-option(ROCKSDB "Use rocksdb rather than leveldb" OFF)
-
-set(BUNDLE "none" CACHE STRING "Predefined bundle of software to build (none, full, user, tests, minimal).")
-option(MINER "Build the CLI miner component" ON)
-option(ETHKEY "Build the CLI key manager component" ON)
-option(SOLIDITY "Build the Solidity language components" ON)
-option(SERPENT "Build the Serpent language components" ON)
-option(TOOLS "Build the tools components" ON)
-option(GUI "Build GUI components (AlethZero, Mix)" ON)
-option(TESTS "Build the tests." ON)
-option(NOBOOST "No use of boost macros in test functions" OFF)
-option(EVMJIT "Build just-in-time compiler for EVM code (requires LLVM)" OFF)
-option(ETHASHCL "Build in support for GPU mining via OpenCL" ON)
-option(JSCONSOLE "Build in javascript console" ON)
-option(FRONTIER "Build for Frontier network" OFF)
+# note: The value "default" which provides the defaults is just a fake value
+# which lets us keep the default values of all build options and is set at
+# the beginning of this file.
+
+# TODO: Abstract into something sensible and move into a function.
+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
+ set(DECENT_PLATFORM OFF)
+else ()
+ set(DECENT_PLATFORM ON)
+endif ()
+
+#defaults:
+set(D_CMAKE_BUILD_TYPE "RelWithDebInfo")
+set(D_SERPENT ${DECENT_PLATFORM})
+set(D_SOLIDITY ON)
+set(D_USENPM OFF)
+set(D_GUI ON)
+set(D_TOOLS ON)
+set(D_TESTS ON)
+set(D_FATDB ON)
+set(D_ETHASHCL ON)
+set(D_EVMJIT ON)
+set(D_JSCONSOLE ON)
+set(D_JSONRPC ON)
+set(D_VMTRACE OFF)
+set(D_PARANOID OFF)
+set(D_PROFILING OFF)
+set(D_ROCKSDB OFF)
+set(D_NOBOOST OFF)
+set(D_OLYMPIC OFF)
+set(D_MINER ON)
+set(D_ETHKEY ON)
+
+if (BUNDLE STREQUAL "minimal")
+ set(D_SERPENT OFF)
+ set(D_SOLIDITY OFF)
+ set(D_USENPM OFF)
+ set(D_GUI OFF)
+ set(D_TOOLS ON)
+ set(D_TESTS OFF)
+elseif (BUNDLE STREQUAL "full")
+ set(D_SERPENT ${DECENT_PLATFORM})
+ set(D_SOLIDITY ON)
+ set(D_USENPM ON)
+ set(D_GUI ON)
+ set(D_TOOLS ON)
+ set(D_TESTS ON)
+ set(D_FATDB ON)
+elseif (BUNDLE STREQUAL "cli")
+ set(D_SERPENT ${DECENT_PLATFORM})
+ set(D_SOLIDITY ON)
+ set(D_USENPM ON)
+ set(D_GUI OFF)
+ set(D_TOOLS ON)
+ set(D_TESTS ON)
+ set(D_FATDB ON)
+elseif (BUNDLE STREQUAL "core")
+ set(D_SERPENT OFF)
+ set(D_SOLIDITY ON)
+ set(D_USENPM OFF)
+ set(D_GUI ON)
+ set(D_TOOLS ON)
+ set(D_TESTS OFF)
+ set(D_FATDB ON)
+elseif (BUNDLE STREQUAL "tests")
+ set(D_SERPENT ${DECENT_PLATFORM})
+ set(D_SOLIDITY ON)
+ set(D_USENPM OFF)
+ set(D_GUI OFF)
+ set(D_TOOLS OFF)
+ set(D_TESTS ON)
+ set(D_FATDB ON)
+elseif (BUNDLE STREQUAL "user")
+ set(D_SERPENT OFF)
+ set(D_SOLIDITY OFF)
+ set(D_USENPM OFF)
+ set(D_GUI ON)
+ set(D_TOOLS ON)
+ set(D_TESTS OFF)
+elseif (BUNDLE STREQUAL "wallet")
+ set(D_SERPENT OFF)
+ set(D_SOLIDITY OFF)
+ set(D_USENPM OFF)
+ set(D_GUI OFF)
+ set(D_TOOLS OFF)
+ set(D_TESTS OFF)
+ set(D_ETHKEY ON)
+ set(D_MINER OFF)
+ set(D_ETHASHCL ON)
+elseif (BUNDLE STREQUAL "miner")
+ set(D_SERPENT OFF)
+ set(D_SOLIDITY OFF)
+ set(D_USENPM OFF)
+ set(D_GUI OFF)
+ set(D_TOOLS OFF)
+ set(D_TESTS OFF)
+ set(D_ETHKEY OFF)
+ set(D_MINER ON)
+ set(D_ETHASHCL ON)
+elseif (BUNDLE STREQUAL "release") # release builds
+ set(D_SERPENT ${DECENT_PLATFORM})
+ set(D_SOLIDITY ON)
+ set(D_USENPM OFF)
+ set(D_GUI ON)
+ set(D_TOOLS ON)
+ set(D_TESTS OFF)
+ set(D_FATDB OFF)
+ set(D_ETHASHCL ON)
+ set(D_EVMJIT ON)
+ set(D_JSCONSOLE ON)
+ set(D_JSONRPC ON)
+ set(D_CMAKE_BUILD_TYPE "Release")
+endif ()
+
+if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
+ set(CMAKE_BUILD_TYPE ${D_CMAKE_BUILD_TYPE})
+endif ()
# propagates CMake configuration options to the compiler
function(configureProject)
@@ -88,7 +189,9 @@ function(configureProject)
add_definitions(-DNOBOOST)
endif()
- if (FRONTIER)
+ if (OLYMPIC)
+ add_definitions(-DETH_OLYMPIC)
+ else()
add_definitions(-DETH_FRONTIER)
endif()
@@ -136,6 +239,7 @@ function(createBuildInfo)
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${CMAKE_COMMAND} -DETH_SOURCE_DIR="${CMAKE_SOURCE_DIR}" -DETH_DST_DIR="${CMAKE_BINARY_DIR}"
-DETH_BUILD_TYPE="${_cmake_build_type}" -DETH_BUILD_PLATFORM="${ETH_BUILD_PLATFORM}"
+ -DPROJECT_VERSION="${PROJECT_VERSION}"
-P "${ETH_SCRIPTS_DIR}/buildinfo.cmake"
)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
@@ -170,24 +274,11 @@ if (HEADLESS)
set(GUI OFF)
endif ()
-# TODO: Abstract into something sensible and move into a function.
-if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
- set(DECENT_PLATFORM OFF)
-else ()
- set(DECENT_PLATFORM ON)
-endif ()
-
macro(eth_format_option O)
if (${${O}})
set(${O} ON)
- else()
- set(${O} OFF)
- endif()
-endmacro()
-
-macro(eth_format_option_on_decent_platform O)
- if (${${O}})
- set(${O} ${DECENT_PLATFORM})
+ elseif ("${${O}}" STREQUAL "" AND ${D_${O}})
+ set(${O} ON)
else()
set(${O} OFF)
endif()
@@ -212,8 +303,8 @@ eth_format_option(TOOLS)
eth_format_option(ETHKEY)
eth_format_option(ETHASHCL)
eth_format_option(JSCONSOLE)
-eth_format_option(FRONTIER)
-eth_format_option_on_decent_platform(SERPENT)
+eth_format_option(OLYMPIC)
+eth_format_option(SERPENT)
if (JSCONSOLE)
set(JSONRPC ON)
@@ -223,94 +314,8 @@ if (GUI)
set(JSONRPC ON)
endif()
-# note: The value "default" which provides the defaults is just a fake value
-# which lets us keep the default values of all build options and is set at
-# the beginning of this file.
-if (BUNDLE STREQUAL "minimal")
- set(SERPENT OFF)
- set(SOLIDITY OFF)
- set(USENPM OFF)
- set(GUI OFF)
- set(TOOLS ON)
- set(TESTS OFF)
-elseif (BUNDLE STREQUAL "full")
- set(SERPENT ${DECENT_PLATFORM})
- set(SOLIDITY ON)
- set(USENPM ON)
- set(GUI ON)
- set(TOOLS ON)
- set(TESTS ON)
- set(FATDB ON)
-elseif (BUNDLE STREQUAL "cli")
- set(SERPENT ${DECENT_PLATFORM})
- set(SOLIDITY ON)
- set(USENPM ON)
- set(GUI OFF)
- set(TOOLS ON)
- set(TESTS ON)
- set(FATDB ON)
-elseif (BUNDLE STREQUAL "core")
- set(SERPENT OFF)
- set(SOLIDITY ON)
- set(USENPM OFF)
- set(GUI ON)
- set(TOOLS ON)
- set(TESTS OFF)
- set(FATDB ON)
-elseif (BUNDLE STREQUAL "tests")
- set(SERPENT ${DECENT_PLATFORM})
- set(SOLIDITY ON)
- set(USENPM OFF)
- set(GUI OFF)
- set(TOOLS OFF)
- set(TESTS ON)
- set(FATDB ON)
-elseif (BUNDLE STREQUAL "user")
- set(SERPENT OFF)
- set(SOLIDITY OFF)
- set(USENPM OFF)
- set(GUI ON)
- set(TOOLS ON)
- set(TESTS OFF)
-elseif (BUNDLE STREQUAL "wallet")
- set(SERPENT OFF)
- set(SOLIDITY OFF)
- set(USENPM OFF)
- set(GUI OFF)
- set(TOOLS OFF)
- set(TESTS OFF)
- set(ETHKEY ON)
- set(MINER OFF)
- set(ETHASHCL ON)
-elseif (BUNDLE STREQUAL "miner")
- set(SERPENT OFF)
- set(SOLIDITY OFF)
- set(USENPM OFF)
- set(GUI OFF)
- set(TOOLS OFF)
- set(TESTS OFF)
- set(ETHKEY OFF)
- set(MINER ON)
- set(ETHASHCL ON)
-elseif (BUNDLE STREQUAL "release")
- set(SERPENT OFF)
- set(SOLIDITY ON)
- set(USENPM OFF)
- set(GUI ON)
- set(TOOLS ON)
- set(TESTS OFF)
- set(FATDB OFF)
- set(ETHASHCL ON)
- set(EVMJIT ON)
- set(JSCONSOLE ON)
- set(JSONRPC ON)
-endif ()
-
-# Default CMAKE_BUILD_TYPE to "Release".
-set(CMAKE_BUILD_TYPE CACHE STRING "Release")
-if ("x${CMAKE_BUILD_TYPE}" STREQUAL "x")
- set(CMAKE_BUILD_TYPE "Release")
-endif ()
+# Default CMAKE_BUILD_TYPE accordingly.
+set(CMAKE_BUILD_TYPE CACHE STRING ${D_CMAKE_BUILD_TYPE})
# Default TARGET_PLATFORM to ${CMAKE_SYSTEM_NAME}
# change this once we support cross compiling
@@ -339,7 +344,7 @@ message("-- FATDB Full database exploring ${FATDB}")
message("-- JSONRPC JSON-RPC support ${JSONRPC}")
message("-- USENPM Javascript source building ${USENPM}")
message("-- ROCKSDB Prefer rocksdb to leveldb ${ROCKSDB}")
-message("-- FRONTIER Default to the Frontier network ${FRONTIER}")
+message("-- OLYMPIC Default to the Olympic network ${OLYMPIC}")
message("------------------------------------------------------------- components")
message("-- MINER Build miner ${MINER}")
message("-- ETHKEY Build wallet tools ${ETHKEY}")
@@ -374,9 +379,14 @@ else()
endif()
if (EVMJIT)
- if (CMAKE_SYSTEM_NAME STREQUAL "Windows" AND NOT DEFINED LLVM_DIR)
- set(LLVM_DIR "${CMAKE_SOURCE_DIR}/extdep/install/windows/x64/share/llvm/cmake")
+ if (NOT DEFINED LLVM_DIR)
+ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
+ set(LLVM_DIR "${CMAKE_SOURCE_DIR}/extdep/install/windows/x64/share/llvm/cmake")
+ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+ set(LLVM_DIR "/usr/local/opt/llvm/share/llvm/cmake")
+ endif()
endif()
+
set(EVMJIT_CPP TRUE) # include CPP-JIT connector
add_subdirectory(evmjit)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
@@ -517,12 +527,12 @@ endif ()
if (WIN32)
# packaging stuff
include(InstallRequiredSystemLibraries)
- set(CPACK_PACKAGE_NAME "Ethereum (++)")
- set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The Ethereum (++) Toolset")
+ set(CPACK_PACKAGE_NAME "Ethereum")
+ set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The Ethereum Toolset")
set(CPACK_PACKAGE_VENDOR "ethereum.org")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
- set(CPACK_PACKAGE_VERSION "0.9.34")
+ set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_GENERATOR "NSIS")
# seems to be not working
# set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/alethzero/alethzero.bmp")
@@ -547,7 +557,7 @@ if (WIN32)
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
endif()
- set(CPACK_NSIS_DISPLAY_NAME "Ethereum (++)")
+ set(CPACK_NSIS_DISPLAY_NAME "Ethereum")
set(CPACK_NSIS_HELP_LINK "https://github.com/ethereum/cpp-ethereum")
set(CPACK_NSIS_URL_INFO_ABOUT "https://github.com/ethereum/cpp-ethereum")
set(CPACK_NSIS_CONTACT "ethereum.org")
diff --git a/README.md b/README.md
index 5b56dbc11..1446e14da 100644
--- a/README.md
+++ b/README.md
@@ -24,7 +24,7 @@ Ethereum is based on a design in an original whitepaper by Vitalik Buterin. This
- *LianaHus* (**Liana Husikyan**) Solidity
- *chfast* (**Paweł Bylica**) EVMJIT
- *cubedro* (**Marian Oancea**) web3.js
-- *gluk250* (**Vlad Gluhovsky**) Whisper
+- *gluk256* (**Vlad Gluhovsky**) Whisper
- *programmerTim* (**Tim Hughes**) libethash-cl
And let's not forget: Caktux (neth, ongoing CI), Eric Lombrozo (original MinGW32 cross-compilation), Marko Simovic (original CI).
diff --git a/alethzero/AllAccounts.cpp b/alethzero/AllAccounts.cpp
new file mode 100644
index 000000000..7f660edf4
--- /dev/null
+++ b/alethzero/AllAccounts.cpp
@@ -0,0 +1,133 @@
+/*
+ This file is part of cpp-ethereum.
+
+ cpp-ethereum is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ cpp-ethereum is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpp-ethereum. If not, see .
+*/
+/** @file AllAccounts.h
+ * @author Gav Wood
+ * @date 2015
+ */
+
+#include "AllAccounts.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include "ui_AllAccounts.h"
+using namespace std;
+using namespace dev;
+using namespace az;
+using namespace eth;
+
+AllAccounts::AllAccounts(MainFace* _m):
+ Plugin(_m, "AllAccounts"),
+ m_ui(new Ui::AllAccounts)
+{
+ dock(Qt::RightDockWidgetArea, "All Accounts")->setWidget(new QWidget());
+ m_ui->setupUi(dock()->widget());
+ installWatches();
+ refresh();
+
+ connect(m_ui->accounts, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), SLOT(on_accounts_currentItemChanged()));
+ connect(m_ui->accounts, SIGNAL(doubleClicked(QModelIndex)), SLOT(on_accounts_doubleClicked()));
+ connect(m_ui->refreshAccounts, SIGNAL(clicked()), SLOT(refresh()));
+ connect(m_ui->accountsFilter, SIGNAL(textChanged(QString)), SLOT(onAllChange()));
+ connect(m_ui->showBasic, SIGNAL(toggled(bool)), SLOT(onAllChange()));
+ connect(m_ui->showContracts, SIGNAL(toggled(bool)), SLOT(onAllChange()));
+ connect(m_ui->onlyNamed, SIGNAL(toggled(bool)), SLOT(onAllChange()));
+}
+
+AllAccounts::~AllAccounts()
+{
+}
+
+void AllAccounts::installWatches()
+{
+ main()->installWatch(ChainChangedFilter, [=](LocalisedLogEntries const&){ onAllChange(); });
+ main()->installWatch(PendingChangedFilter, [=](LocalisedLogEntries const&){ onAllChange(); });
+}
+
+void AllAccounts::refresh()
+{
+ DEV_TIMED_FUNCTION;
+#if ETH_FATDB || !ETH_TRUE
+ cwatch << "refreshAccounts()";
+ m_ui->accounts->clear();
+ bool showContract = m_ui->showContracts->isChecked();
+ bool showBasic = m_ui->showBasic->isChecked();
+ bool onlyNamed = m_ui->onlyNamed->isChecked();
+ auto as = ethereum()->addresses();
+ sort(as.begin(), as.end());
+ for (auto const& i: as)
+ {
+ bool isContract = (ethereum()->codeHashAt(i) != EmptySHA3);
+ if (!((showContract && isContract) || (showBasic && !isContract)))
+ continue;
+ string r = static_cast(main())->render(i);
+ if (onlyNamed && !(r.find('"') != string::npos || r.substr(0, 2) == "XE"))
+ continue;
+ (new QListWidgetItem(QString("%2: %1 [%3]").arg(formatBalance(ethereum()->balanceAt(i)).c_str()).arg(QString::fromStdString(r)).arg((unsigned)ethereum()->countAt(i)), m_ui->accounts))
+ ->setData(Qt::UserRole, QByteArray((char const*)i.data(), Address::size));
+ }
+#endif
+ m_ui->refreshAccounts->setEnabled(false);
+}
+
+void AllAccounts::onAllChange()
+{
+ m_ui->refreshAccounts->setEnabled(true);
+}
+
+void AllAccounts::on_accounts_currentItemChanged()
+{
+ m_ui->accountInfo->clear();
+ if (auto item = m_ui->accounts->currentItem())
+ {
+ auto hba = item->data(Qt::UserRole).toByteArray();
+ assert(hba.size() == 20);
+ auto address = h160((byte const*)hba.data(), h160::ConstructFromPointer);
+
+ stringstream s;
+ try
+ {
+ auto storage = ethereum()->storageAt(address);
+ for (auto const& i: storage)
+ s << "@" << showbase << hex << main()->prettyU256(i.first) << " " << showbase << hex << main()->prettyU256(i.second) << "
";
+ s << "Body Code (" << sha3(ethereum()->codeAt(address)).abridged() << ")
" << disassemble(ethereum()->codeAt(address));
+ s << ETH_HTML_DIV(ETH_HTML_MONO) << toHex(ethereum()->codeAt(address)) << "";
+ s << "Creation Addresses (" << ethereum()->countAt(address) << "+)
";
+ for (auto i = 0; i < 5; ++i)
+ s << ETH_HTML_DIV(ETH_HTML_MONO) << toAddress(address, ethereum()->countAt(address) + i).hex() << "";
+ m_ui->accountInfo->appendHtml(QString::fromStdString(s.str()));
+ }
+ catch (dev::InvalidTrie)
+ {
+ m_ui->accountInfo->appendHtml("Corrupted trie.");
+ }
+ m_ui->accountInfo->moveCursor(QTextCursor::Start);
+ }
+}
+
+void AllAccounts::on_accounts_doubleClicked()
+{
+ if (m_ui->accounts->count())
+ {
+ auto hba = m_ui->accounts->currentItem()->data(Qt::UserRole).toByteArray();
+ auto h = Address((byte const*)hba.data(), Address::ConstructFromPointer);
+ qApp->clipboard()->setText(QString::fromStdString(toHex(h.asArray())));
+ }
+}
+
diff --git a/alethzero/AllAccounts.h b/alethzero/AllAccounts.h
new file mode 100644
index 000000000..7cc91afec
--- /dev/null
+++ b/alethzero/AllAccounts.h
@@ -0,0 +1,60 @@
+/*
+ This file is part of cpp-ethereum.
+
+ cpp-ethereum is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ cpp-ethereum is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpp-ethereum. If not, see .
+*/
+/** @file AllAccounts.h
+ * @author Gav Wood
+ * @date 2015
+ */
+
+#pragma once
+
+#include
+#include
+#include "MainFace.h"
+
+namespace Ui
+{
+class AllAccounts;
+}
+
+namespace dev
+{
+namespace az
+{
+
+class AllAccounts: public QObject, public Plugin
+{
+ Q_OBJECT
+
+public:
+ AllAccounts(MainFace* _m);
+ ~AllAccounts();
+
+private slots:
+ void on_accounts_currentItemChanged();
+ void on_accounts_doubleClicked();
+
+ void onAllChange();
+ void refresh();
+
+private:
+ void installWatches();
+
+ Ui::AllAccounts* m_ui;
+};
+
+}
+}
diff --git a/alethzero/AllAccounts.ui b/alethzero/AllAccounts.ui
new file mode 100644
index 000000000..ca0ad31bc
--- /dev/null
+++ b/alethzero/AllAccounts.ui
@@ -0,0 +1,134 @@
+
+
+ AllAccounts
+
+
+
+ 0
+ 0
+ 400
+ 300
+
+
+
+ Form
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+ -
+
+
-
+
+
+ Filter...
+
+
+
+ -
+
+
+ Basic
+
+
+ true
+
+
+
+ -
+
+
+ Contracts
+
+
+ true
+
+
+ true
+
+
+
+ -
+
+
+ Only Named
+
+
+ true
+
+
+ false
+
+
+
+ -
+
+
+ Refresh
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Qt::Horizontal
+
+
+
+
+ 0
+ 0
+
+
+
+ Qt::NoFocus
+
+
+ QFrame::NoFrame
+
+
+
+
+
+ 2
+ 0
+
+
+
+ Qt::WheelFocus
+
+
+ QFrame::NoFrame
+
+
+ true
+
+
+
+
+
+
+
+
+
diff --git a/alethzero/BrainWallet.cpp b/alethzero/BrainWallet.cpp
new file mode 100644
index 000000000..c6c710811
--- /dev/null
+++ b/alethzero/BrainWallet.cpp
@@ -0,0 +1,71 @@
+/*
+ This file is part of cpp-ethereum.
+
+ cpp-ethereum is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ cpp-ethereum is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpp-ethereum. If not, see .
+*/
+/** @file BrainWallet.h
+ * @author Gav Wood
+ * @date 2015
+ */
+
+#include "BrainWallet.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "ui_BrainWallet.h"
+using namespace std;
+using namespace dev;
+using namespace az;
+using namespace eth;
+
+BrainWallet::BrainWallet(MainFace* _m):
+ Plugin(_m, "BrainWallet")
+{
+ QAction* a = new QAction("New Brain Wallet...", main());
+ QMenu* m = _m->findChild("menuTools");
+ m->addSeparator();
+ m->addAction(a);
+ connect(a, SIGNAL(triggered()), SLOT(create()));
+}
+
+BrainWallet::~BrainWallet()
+{
+}
+
+void BrainWallet::create()
+{
+ QDialog d;
+ Ui_BrainWallet u;
+ u.setupUi(&d);
+ d.setWindowTitle("New Brain Wallet");
+ connect(u.generate, &QPushButton::clicked, [&](){
+ boost::random_device d;
+ boost::random::uniform_int_distribution pickWord(0, WordList.size() - 1);
+ QString t;
+ for (int i = 0; i < 13; ++i)
+ t += (t.size() ? " " : "") + QString::fromStdString(WordList[pickWord(d)]);
+ u.seed->setPlainText(t);
+ });
+
+ if (d.exec() == QDialog::Accepted)
+ {
+ main()->keyManager().importBrain(u.seed->toPlainText().trimmed().toStdString(), u.name->text().toStdString(), u.hint->toPlainText().toStdString());
+ main()->noteKeysChanged();
+ }
+}
diff --git a/alethzero/BrainWallet.h b/alethzero/BrainWallet.h
new file mode 100644
index 000000000..6b472c6da
--- /dev/null
+++ b/alethzero/BrainWallet.h
@@ -0,0 +1,44 @@
+/*
+ This file is part of cpp-ethereum.
+
+ cpp-ethereum is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ cpp-ethereum is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpp-ethereum. If not, see .
+*/
+/** @file BrainWallet.h
+ * @author Gav Wood
+ * @date 2015
+ */
+
+#pragma once
+
+#include "MainFace.h"
+
+namespace dev
+{
+namespace az
+{
+
+class BrainWallet: public QObject, public Plugin
+{
+ Q_OBJECT
+
+public:
+ BrainWallet(MainFace* _m);
+ ~BrainWallet();
+
+private slots:
+ void create();
+};
+
+}
+}
diff --git a/alethzero/BrainWallet.ui b/alethzero/BrainWallet.ui
new file mode 100644
index 000000000..d401e138a
--- /dev/null
+++ b/alethzero/BrainWallet.ui
@@ -0,0 +1,136 @@
+
+
+ BrainWallet
+
+
+
+ 0
+ 0
+ 511
+ 508
+
+
+
+ Dialog
+
+
+ -
+
+
+ <html><head/><body><p><span style=" font-weight:600;">WARNING: Brain wallets, or human-entropic seeds, are practically and cryptographically insecure. They're a terrible idea for protecteding anything of value and this functionality is here only as a toy.</span></p><p>That said, if you're intent on using one, make the phrase as long and random as you can. If you're sensible, you'll ask the internet for a list of words to memorise and use those. Write the phrase down on paper and bury it under an oak tree or something - if you forget it, you're screwed.</p></body></html>
+
+
+ true
+
+
+
+ -
+
+
+ Please name of this account here e.g. My Brain Wallet
+
+
+
+ -
+
+
+ Write your seed phrase here. Make it long and random. Don't ever forget it. If you want it to have any chance at being secure, ask a machine to select 13 dictionary words at random.
+
+
+
+ -
+
+
+ <html><head/><body><p>You can leave a hint here if you want; don't rely on it or there's little point in it being a <span style=" font-style:italic;">brain</span> wallet.</p></body></html>
+
+
+ true
+
+
+
+ -
+
+
+ An optional hint for the text above.
+
+
+
+ -
+
+
-
+
+
+ &Generate
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Cancel
+
+
+
+ -
+
+
+ &Create
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+ create
+ clicked()
+ BrainWallet
+ accept()
+
+
+ 462
+ 484
+
+
+ 449
+ 504
+
+
+
+
+ cancel
+ clicked()
+ BrainWallet
+ reject()
+
+
+ 381
+ 483
+
+
+ 351
+ 506
+
+
+
+
+
diff --git a/alethzero/CMakeLists.txt b/alethzero/CMakeLists.txt
index 1b1138eab..9bbb8f92d 100644
--- a/alethzero/CMakeLists.txt
+++ b/alethzero/CMakeLists.txt
@@ -20,8 +20,14 @@ include_directories(BEFORE ..)
include_directories(${JSON_RPC_CPP_INCLUDE_DIRS})
include_directories(${Boost_INCLUDE_DIRS})
-find_package (Qt5WebEngine QUIET)
-find_package (Qt5WebEngineWidgets QUIET)
+find_package (Qt5WebEngine)
+find_package (Qt5WebEngineWidgets)
+if (APPLE)
+# TODO: remove indirect dependencies once macdeployqt is fixed
+ find_package (Qt5WebEngineCore)
+ find_package (Qt5DBus)
+ find_package (Qt5PrintSupport)
+endif()
qt5_wrap_ui(ui_Main.h Main.ui)
qt5_wrap_ui(ui_Connect.h Connect.ui)
@@ -31,6 +37,11 @@ qt5_wrap_ui(ui_ExportState.h ExportState.ui)
qt5_wrap_ui(ui_GetPassword.h GetPassword.ui)
qt5_wrap_ui(ui_GasPricing.h GasPricing.ui)
+# Extensions
+qt5_wrap_ui(ui_AllAccounts.h AllAccounts.ui)
+qt5_wrap_ui(ui_LogPanel.h LogPanel.ui)
+qt5_wrap_ui(ui_BrainWallet.h BrainWallet.ui)
+
file(GLOB HEADERS "*.h")
if (APPLE)
@@ -42,7 +53,7 @@ endif ()
# eth_add_executable is defined in cmake/EthExecutableHelper.cmake
eth_add_executable(${EXECUTABLE}
ICON alethzero
- UI_RESOURCES alethzero.icns Main.ui Connect.ui Debugger.ui Transact.ui ExportState.ui GetPassword.ui GasPricing.ui
+ UI_RESOURCES alethzero.icns Main.ui Connect.ui Debugger.ui Transact.ui ExportState.ui GetPassword.ui GasPricing.ui AllAccounts.ui LogPanel.ui BrainWallet.ui
WIN_RESOURCES alethzero.rc
)
@@ -52,6 +63,11 @@ target_link_libraries(${EXECUTABLE} Qt5::Core)
target_link_libraries(${EXECUTABLE} Qt5::Widgets)
target_link_libraries(${EXECUTABLE} Qt5::WebEngine)
target_link_libraries(${EXECUTABLE} Qt5::WebEngineWidgets)
+if (APPLE)
+ target_link_libraries(${EXECUTABLE} Qt5::WebEngineCore)
+ target_link_libraries(${EXECUTABLE} Qt5::DBus)
+ target_link_libraries(${EXECUTABLE} Qt5::PrintSupport)
+endif()
target_link_libraries(${EXECUTABLE} webthree)
target_link_libraries(${EXECUTABLE} ethereum)
target_link_libraries(${EXECUTABLE} evm)
diff --git a/alethzero/Connect.cpp b/alethzero/Connect.cpp
index 69cc43f93..27813d5e8 100644
--- a/alethzero/Connect.cpp
+++ b/alethzero/Connect.cpp
@@ -20,9 +20,10 @@
*/
#include "Connect.h"
-
#include
#include "ui_Connect.h"
+using namespace dev;
+using namespace az;
Connect::Connect(QWidget *parent) :
QDialog(parent),
diff --git a/alethzero/Connect.h b/alethzero/Connect.h
index 8209a78af..c8d56bde3 100644
--- a/alethzero/Connect.h
+++ b/alethzero/Connect.h
@@ -25,9 +25,16 @@
#include
namespace Ui { class Connect; }
-namespace dev { namespace p2p { class Host; } }
-class Connect : public QDialog
+namespace dev
+{
+
+namespace p2p { class Host; }
+
+namespace az
+{
+
+class Connect: public QDialog
{
Q_OBJECT
@@ -53,3 +60,6 @@ public:
private:
Ui::Connect* ui;
};
+
+}
+}
diff --git a/alethzero/Context.cpp b/alethzero/Context.cpp
index 9c64362dc..d567c4ee5 100644
--- a/alethzero/Context.cpp
+++ b/alethzero/Context.cpp
@@ -25,7 +25,8 @@
#include
using namespace std;
using namespace dev;
-using namespace dev::eth;
+using namespace eth;
+using namespace az;
NatSpecFace::~NatSpecFace()
{
@@ -35,7 +36,7 @@ Context::~Context()
{
}
-void setValueUnits(QComboBox* _units, QSpinBox* _value, u256 _v)
+void dev::az::setValueUnits(QComboBox* _units, QSpinBox* _value, u256 _v)
{
initUnits(_units);
_units->setCurrentIndex(0);
@@ -47,30 +48,30 @@ void setValueUnits(QComboBox* _units, QSpinBox* _value, u256 _v)
_value->setValue((unsigned)_v);
}
-u256 fromValueUnits(QComboBox* _units, QSpinBox* _value)
+u256 dev::az::fromValueUnits(QComboBox* _units, QSpinBox* _value)
{
return _value->value() * units()[units().size() - 1 - _units->currentIndex()].first;
}
-void initUnits(QComboBox* _b)
+void dev::az::initUnits(QComboBox* _b)
{
for (auto n = (unsigned)units().size(); n-- != 0; )
_b->addItem(QString::fromStdString(units()[n].second), n);
}
-vector keysAsVector(QList const& keys)
+vector dev::az::keysAsVector(QList const& keys)
{
auto list = keys.toStdList();
return {begin(list), end(list)};
}
-bool sourceIsSolidity(string const& _source)
+bool dev::az::sourceIsSolidity(string const& _source)
{
// TODO: Improve this heuristic
return (_source.substr(0, 8) == "contract" || _source.substr(0, 5) == "//sol");
}
-bool sourceIsSerpent(string const& _source)
+bool dev::az::sourceIsSerpent(string const& _source)
{
// TODO: Improve this heuristic
return (_source.substr(0, 5) == "//ser");
diff --git a/alethzero/Context.h b/alethzero/Context.h
index 7dc2d5bc7..4fc07b0f7 100644
--- a/alethzero/Context.h
+++ b/alethzero/Context.h
@@ -30,7 +30,13 @@
class QComboBox;
class QSpinBox;
-namespace dev { namespace eth { struct StateDiff; class KeyManager; } }
+namespace dev
+{
+
+namespace eth { struct StateDiff; class KeyManager; }
+
+namespace az
+{
#define ETH_HTML_SMALL "font-size: small; "
#define ETH_HTML_MONO "font-family: Ubuntu Mono, Monospace, Lucida Console, Courier New; font-weight: bold; "
@@ -69,7 +75,10 @@ public:
virtual std::string render(dev::Address const& _a) const = 0;
virtual dev::Secret retrieveSecret(dev::Address const& _a) const = 0;
virtual dev::eth::KeyManager& keyManager() = 0;
+ virtual void noteKeysChanged() = 0;
virtual dev::u256 gasPrice() const = 0;
};
+}
+}
diff --git a/alethzero/DappHost.cpp b/alethzero/DappHost.cpp
index 3b0661ad1..19059e8dc 100644
--- a/alethzero/DappHost.cpp
+++ b/alethzero/DappHost.cpp
@@ -24,8 +24,8 @@
#include
#include
#include
-
using namespace dev;
+using namespace az;
DappHost::DappHost(int _port, int _threads):
m_port(_port),
diff --git a/alethzero/DappHost.h b/alethzero/DappHost.h
index 50dff741d..e2fd12689 100644
--- a/alethzero/DappHost.h
+++ b/alethzero/DappHost.h
@@ -29,6 +29,12 @@
struct MHD_Daemon;
struct MHD_Connection;
+namespace dev
+{
+
+namespace az
+{
+
/// DApp web server. Servers web content, resolves paths by hashes
class DappHost
{
@@ -60,3 +66,5 @@ private:
std::map m_entriesByPath;
};
+}
+}
diff --git a/alethzero/DappLoader.cpp b/alethzero/DappLoader.cpp
index a91531f89..605a9c953 100644
--- a/alethzero/DappLoader.cpp
+++ b/alethzero/DappLoader.cpp
@@ -34,12 +34,12 @@
#include
#include
#include "DappLoader.h"
-
using namespace dev;
-using namespace dev::eth;
-using namespace dev::crypto;
+using namespace az;
+using namespace eth;
+using namespace crypto;
-QString contentsOfQResource(std::string const& res);
+namespace dev { namespace az { QString contentsOfQResource(std::string const& res); } }
DappLoader::DappLoader(QObject* _parent, WebThreeDirect* _web3, Address _nameReg):
QObject(_parent), m_web3(_web3), m_nameReg(_nameReg)
@@ -130,14 +130,14 @@ void DappLoader::downloadComplete(QNetworkReply* _reply)
h256 expected = m_uriHashes[requestUrl];
bytes package(reinterpret_cast(data.constData()), reinterpret_cast(data.constData() + data.size()));
Secp256k1PP dec;
- dec.decrypt(expected, package);
+ dec.decrypt(Secret(expected), package);
h256 got = sha3(package);
if (got != expected)
{
//try base64
data = QByteArray::fromBase64(data);
package = bytes(reinterpret_cast(data.constData()), reinterpret_cast(data.constData() + data.size()));
- dec.decrypt(expected, package);
+ dec.decrypt(Secret(expected), package);
got = sha3(package);
if (got != expected)
throw dev::Exception() << errinfo_comment("Dapp content hash does not match");
@@ -145,6 +145,7 @@ void DappLoader::downloadComplete(QNetworkReply* _reply)
RLP rlp(package);
loadDapp(rlp);
+ bytesRef(&package).cleanse(); // TODO: replace with bytesSec once the crypto API is up to it.
}
catch (...)
{
diff --git a/alethzero/DappLoader.h b/alethzero/DappLoader.h
index 39176e750..f3ec40dd1 100644
--- a/alethzero/DappLoader.h
+++ b/alethzero/DappLoader.h
@@ -33,9 +33,12 @@
namespace dev
{
- class WebThreeDirect;
- class RLP;
-}
+
+class WebThreeDirect;
+class RLP;
+
+namespace az
+{
struct ManifestEntry
{
@@ -104,3 +107,5 @@ private:
std::string m_sessionKey;
};
+}
+}
diff --git a/alethzero/Debugger.cpp b/alethzero/Debugger.cpp
index fafa25b2e..ea6f782ad 100644
--- a/alethzero/Debugger.cpp
+++ b/alethzero/Debugger.cpp
@@ -29,7 +29,8 @@
#include "ui_Debugger.h"
using namespace std;
using namespace dev;
-using namespace dev::eth;
+using namespace az;
+using namespace eth;
Debugger::Debugger(Context* _c, QWidget* _parent):
QDialog(_parent),
diff --git a/alethzero/Debugger.h b/alethzero/Debugger.h
index 38ed973df..38a643deb 100644
--- a/alethzero/Debugger.h
+++ b/alethzero/Debugger.h
@@ -32,6 +32,12 @@
namespace Ui { class Debugger; }
+namespace dev
+{
+
+namespace az
+{
+
struct WorldState
{
uint64_t steps;
@@ -101,3 +107,6 @@ private:
DebugSession m_session;
Context* m_context;
};
+
+}
+}
diff --git a/alethzero/DownloadView.cpp b/alethzero/DownloadView.cpp
index 788a106d3..a29b1fd31 100644
--- a/alethzero/DownloadView.cpp
+++ b/alethzero/DownloadView.cpp
@@ -20,15 +20,14 @@
*/
#include "DownloadView.h"
-
#include
#include
#include
#include "Grapher.h"
-
using namespace std;
using namespace dev;
-using namespace dev::eth;
+using namespace az;
+using namespace eth;
SyncView::SyncView(QWidget* _p): QWidget(_p)
{
@@ -176,9 +175,6 @@ void SyncView::paintEvent(QPaintEvent*)
progress2 = hProgress2;
label = hLabel;
}
- else if (rect().height() / rect().width() > 5)
- {
- }
else
{
progress = pieProgress;
diff --git a/alethzero/DownloadView.h b/alethzero/DownloadView.h
index f3c8b1001..4ce5dd67a 100644
--- a/alethzero/DownloadView.h
+++ b/alethzero/DownloadView.h
@@ -31,9 +31,13 @@
#include
#endif
-namespace dev { namespace eth {
-class Client;
-}}
+namespace dev
+{
+
+namespace eth { class Client; }
+
+namespace az
+{
class SyncView: public QWidget
{
@@ -54,3 +58,6 @@ private:
unsigned m_lastSyncCount = 0;
bool m_wasEstimate = false;
};
+
+}
+}
diff --git a/alethzero/ExportState.cpp b/alethzero/ExportState.cpp
index d975dea14..1e243f5d5 100644
--- a/alethzero/ExportState.cpp
+++ b/alethzero/ExportState.cpp
@@ -25,10 +25,10 @@
#include
#include "MainWin.h"
#include "ui_ExportState.h"
-
using namespace std;
using namespace dev;
-using namespace dev::eth;
+using namespace az;
+using namespace eth;
ExportStateDialog::ExportStateDialog(Main* _parent):
QDialog(_parent),
@@ -46,7 +46,7 @@ ExportStateDialog::~ExportStateDialog()
{
}
-dev::eth::Client* ExportStateDialog::ethereum() const
+Client* ExportStateDialog::ethereum() const
{
return m_main->ethereum();
}
diff --git a/alethzero/ExportState.h b/alethzero/ExportState.h
index e8e045855..2dbe507d1 100644
--- a/alethzero/ExportState.h
+++ b/alethzero/ExportState.h
@@ -26,7 +26,14 @@
#include
namespace Ui { class ExportState; }
-namespace dev { namespace eth { class Client; } }
+
+namespace dev
+{
+
+namespace eth { class Client; }
+
+namespace az
+{
class Main;
@@ -44,7 +51,7 @@ private slots:
void on_saveButton_clicked();
private:
- dev::eth::Client* ethereum() const;
+ eth::Client* ethereum() const;
void fillBlocks();
void fillContracts();
void generateJSON();
@@ -53,5 +60,8 @@ private:
std::unique_ptr ui;
Main* m_main;
int m_recentBlocks = 0;
- dev::eth::BlockNumber m_block = dev::eth::LatestBlock;
+ eth::BlockNumber m_block = eth::LatestBlock;
};
+
+}
+}
diff --git a/alethzero/LogPanel.cpp b/alethzero/LogPanel.cpp
new file mode 100644
index 000000000..194265dba
--- /dev/null
+++ b/alethzero/LogPanel.cpp
@@ -0,0 +1,96 @@
+/*
+ This file is part of cpp-ethereum.
+
+ cpp-ethereum is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ cpp-ethereum is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpp-ethereum. If not, see .
+*/
+/** @file LogPanel.cpp
+ * @author Gav Wood
+ * @date 2015
+ */
+
+#include "LogPanel.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "ui_LogPanel.h"
+using namespace std;
+using namespace dev;
+using namespace az;
+using namespace eth;
+
+static QString filterOutTerminal(QString _s)
+{
+ return _s.replace(QRegExp("\x1b\\[(\\d;)?\\d+m"), "");
+}
+
+LogPanel::LogPanel(MainFace* _m):
+ Plugin(_m, "LogPanel"),
+ m_ui(new Ui::LogPanel)
+{
+ dock(Qt::RightDockWidgetArea, "Log")->setWidget(new QWidget);
+ m_ui->setupUi(dock()->widget());
+ connect(m_ui->verbosity, SIGNAL(valueChanged(int)), SLOT(on_verbosity_valueChanged()));
+
+ g_logPost = [=](string const& s, char const* c)
+ {
+ simpleDebugOut(s, c);
+ m_logLock.lock();
+ m_logHistory.append(filterOutTerminal(QString::fromStdString(s)) + "\n");
+ m_logChanged = true;
+ m_logLock.unlock();
+ };
+ startTimer(100);
+
+ on_verbosity_valueChanged();
+}
+
+LogPanel::~LogPanel()
+{
+ // Must do this here since otherwise m_ethereum'll be deleted (and therefore clearWatches() called by the destructor)
+ // *after* the client is dead.
+ g_logPost = simpleDebugOut;
+}
+
+void LogPanel::readSettings(QSettings const& _s)
+{
+ m_ui->verbosity->setValue(_s.value("verbosity", 1).toInt());
+}
+
+void LogPanel::writeSettings(QSettings& _s)
+{
+ _s.setValue("verbosity", m_ui->verbosity->value());
+}
+
+void LogPanel::timerEvent(QTimerEvent*)
+{
+ if (m_logChanged)
+ {
+ m_logLock.lock();
+ m_logChanged = false;
+ m_ui->log->appendPlainText(m_logHistory.mid(0, m_logHistory.length() - 1));
+ m_logHistory.clear();
+ m_logLock.unlock();
+ }
+}
+
+void LogPanel::on_verbosity_valueChanged()
+{
+ g_logVerbosity = m_ui->verbosity->value();
+ m_ui->verbosityLabel->setText(QString::number(g_logVerbosity));
+}
+
diff --git a/alethzero/LogPanel.h b/alethzero/LogPanel.h
new file mode 100644
index 000000000..ff21cdc51
--- /dev/null
+++ b/alethzero/LogPanel.h
@@ -0,0 +1,64 @@
+/*
+ This file is part of cpp-ethereum.
+
+ cpp-ethereum is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ cpp-ethereum is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpp-ethereum. If not, see .
+*/
+/** @file LogPanel.h
+ * @author Gav Wood
+ * @date 2015
+ */
+
+#pragma once
+
+#include
+#include
+#include
+#include
+#include "MainFace.h"
+
+namespace Ui
+{
+class LogPanel;
+}
+
+namespace dev
+{
+namespace az
+{
+
+class LogPanel: public QObject, public Plugin
+{
+ Q_OBJECT
+
+public:
+ LogPanel(MainFace* _m);
+ ~LogPanel();
+
+private slots:
+ void on_verbosity_valueChanged();
+
+private:
+ void timerEvent(QTimerEvent*) override;
+ void readSettings(QSettings const&) override;
+ void writeSettings(QSettings&) override;
+
+ Ui::LogPanel* m_ui;
+
+ QMutex m_logLock;
+ QString m_logHistory;
+ bool m_logChanged = true;
+};
+
+}
+}
diff --git a/alethzero/LogPanel.ui b/alethzero/LogPanel.ui
new file mode 100644
index 000000000..52e7d1dc2
--- /dev/null
+++ b/alethzero/LogPanel.ui
@@ -0,0 +1,99 @@
+
+
+ LogPanel
+
+
+
+ 0
+ 0
+ 834
+ 265
+
+
+
+ Form
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+ -
+
+
+
+ Ubuntu Mono
+
+
+
+ QFrame::NoFrame
+
+
+ QFrame::Plain
+
+
+ 0
+
+
+ QPlainTextEdit::NoWrap
+
+
+ true
+
+
+
+ -
+
+
+ 6
+
+
-
+
+
+ 20
+
+
+ 1
+
+
+ Qt::Vertical
+
+
+ QSlider::TicksBothSides
+
+
+
+ -
+
+
+
+ 20
+ 0
+
+
+
+ 20
+
+
+ Qt::AlignCenter
+
+
+
+
+
+
+
+
+
+
diff --git a/alethzero/Main.ui b/alethzero/Main.ui
index 0872aabe4..b059b4e07 100644
--- a/alethzero/Main.ui
+++ b/alethzero/Main.ui
@@ -135,13 +135,13 @@
24
-