Browse Source

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

cl-refactor
Gav Wood 10 years ago
parent
commit
00868c0126
  1. 3
      alethzero/CMakeLists.txt
  2. 6
      alethzero/Main.ui
  3. 7
      alethzero/MainWin.cpp
  4. 1
      alethzero/MainWin.h
  5. 91
      alethzero/plugins/blockchain/ExportState.cpp
  6. 15
      alethzero/plugins/blockchain/ExportState.h
  7. 0
      alethzero/plugins/blockchain/ExportState.ui
  8. 2
      evmjit/libevmjit/Array.h
  9. 8
      evmjit/libevmjit/BasicBlock.cpp
  10. 86
      evmjit/libevmjit/Compiler.cpp
  11. 4
      evmjit/libevmjit/Compiler.h
  12. 2
      evmjit/libevmjit/Stack.cpp
  13. 24
      libjsqrc/ethereumjs/dist/web3-light.js
  14. 4
      libjsqrc/ethereumjs/dist/web3-light.min.js
  15. 24
      libjsqrc/ethereumjs/dist/web3.js
  16. 4
      libjsqrc/ethereumjs/dist/web3.js.map
  17. 4
      libjsqrc/ethereumjs/dist/web3.min.js
  18. 24
      libjsqrc/ethereumjs/lib/web3/shh.js
  19. 26
      mix/qml/Block.qml
  20. 21
      mix/qml/Watchers.qml
  21. BIN
      mix/qml/img/rightarrowcircle.png
  22. 1
      mix/res.qrc

3
alethzero/CMakeLists.txt

@ -42,7 +42,6 @@ qt5_wrap_ui(ui_Main.h Main.ui)
qt5_wrap_ui(ui_Connect.h Connect.ui)
qt5_wrap_ui(ui_Debugger.h Debugger.ui)
qt5_wrap_ui(ui_Transact.h Transact.ui)
qt5_wrap_ui(ui_ExportState.h ExportState.ui)
qt5_wrap_ui(ui_GetPassword.h GetPassword.ui)
qt5_wrap_ui(ui_GasPricing.h GasPricing.ui)
@ -60,7 +59,7 @@ endif ()
# eth_add_executable is defined in cmake/EthExecutableHelper.cmake
eth_add_executable(${EXECUTABLE}
ICON alethzero
UI_RESOURCES ${PLUGIN_UI} alethzero.icns Main.ui Connect.ui Debugger.ui Transact.ui ExportState.ui GetPassword.ui GasPricing.ui
UI_RESOURCES ${PLUGIN_UI} alethzero.icns Main.ui Connect.ui Debugger.ui Transact.ui GetPassword.ui GasPricing.ui
WIN_RESOURCES alethzero.rc
)

6
alethzero/Main.ui

@ -172,7 +172,6 @@
<addaction name="separator"/>
<addaction name="loadJS"/>
<addaction name="separator"/>
<addaction name="exportState"/>
</widget>
<widget class="QMenu" name="menuHelp">
<property name="title">
@ -1096,11 +1095,6 @@ font-size: 14pt</string>
<string>&amp;Load Javascript...</string>
</property>
</action>
<action name="exportState">
<property name="text">
<string>&amp;Export State...</string>
</property>
</action>
<action name="debugStepBack">
<property name="enabled">
<bool>false</bool>

7
alethzero/MainWin.cpp

@ -73,7 +73,6 @@
#include "DappLoader.h"
#include "DappHost.h"
#include "WebPage.h"
#include "ExportState.h"
#include "ui_Main.h"
#include "ui_GetPassword.h"
#include "ui_GasPricing.h"
@ -1030,12 +1029,6 @@ void Main::on_exportKey_triggered()
}
}
void Main::on_exportState_triggered()
{
ExportStateDialog dialog(this);
dialog.exec();
}
void Main::on_usePrivate_triggered()
{
QString pc;

1
alethzero/MainWin.h

@ -162,7 +162,6 @@ private slots:
// Tools
void on_newTransaction_triggered();
void on_loadJS_triggered();
void on_exportState_triggered();
// Stuff concerning the blocks/transactions/accounts panels
void on_ourAccounts_itemClicked(QListWidgetItem* _i);

91
alethzero/ExportState.cpp → alethzero/plugins/blockchain/ExportState.cpp

@ -19,77 +19,86 @@
* @date 2015
*/
#if ETH_FATDB
#include "ExportState.h"
#include <fstream>
#include <QFileDialog>
#include <QTextStream>
#include <libethereum/Client.h>
#include "MainWin.h"
#include "ui_ExportState.h"
using namespace std;
using namespace dev;
using namespace az;
using namespace eth;
ExportStateDialog::ExportStateDialog(Main* _parent):
QDialog(_parent),
ui(new Ui::ExportState),
m_main(_parent)
DEV_AZ_NOTE_PLUGIN(ExportStateDialog);
ExportStateDialog::ExportStateDialog(MainFace* _m):
QDialog(_m),
Plugin(_m, "Export State"),
m_ui(new Ui::ExportState)
{
ui->setupUi(this);
connect(ui->close, &QPushButton::clicked, this, &ExportStateDialog::close);
connect(ui->accounts, &QListWidget::itemSelectionChanged, this, &ExportStateDialog::generateJSON);
connect(ui->contracts, &QListWidget::itemSelectionChanged, this, &ExportStateDialog::generateJSON);
m_ui->setupUi(this);
connect(m_ui->close, &QPushButton::clicked, this, &ExportStateDialog::close);
connect(m_ui->accounts, &QListWidget::itemSelectionChanged, this, &ExportStateDialog::generateJSON);
connect(m_ui->contracts, &QListWidget::itemSelectionChanged, this, &ExportStateDialog::generateJSON);
fillBlocks();
connect(addMenuItem("Export State...", "menuTools", true), SIGNAL(triggered()), SLOT(exec()));
}
ExportStateDialog::~ExportStateDialog()
{
}
Client* ExportStateDialog::ethereum() const
}
void ExportStateDialog::showEvent(QShowEvent*)
{
return m_main->ethereum();
m_ui->block->clear();
m_ui->block->clearEditText();
m_ui->accounts->clear();
m_ui->contracts->clear();
fillBlocks();
}
void ExportStateDialog::on_block_editTextChanged()
{
QString text = ui->block->currentText();
int i = ui->block->count();
QString text = m_ui->block->currentText();
int i = m_ui->block->count();
while (i-- >= 0)
if (ui->block->itemText(i) == text)
if (m_ui->block->itemText(i) == text)
return;
fillBlocks();
}
void ExportStateDialog::on_block_currentIndexChanged(int _index)
{
m_block = ui->block->itemData(_index).toUInt();
m_block = m_ui->block->itemData(_index).toUInt();
fillContracts();
}
void ExportStateDialog::fillBlocks()
{
BlockChain const& bc = ethereum()->blockChain();
QStringList filters = ui->block->currentText().toLower().split(QRegExp("\\s+"), QString::SkipEmptyParts);
QStringList filters = m_ui->block->currentText().toLower().split(QRegExp("\\s+"), QString::SkipEmptyParts);
const unsigned numLastBlocks = 10;
if (ui->block->count() == 0)
if (m_ui->block->count() == 0)
{
unsigned i = numLastBlocks;
for (auto h = bc.currentHash(); bc.details(h) && i; h = bc.details(h).parent, --i)
{
auto d = bc.details(h);
ui->block->addItem(QString("#%1 %2").arg(d.number).arg(h.abridged().c_str()), d.number);
m_ui->block->addItem(QString("#%1 %2").arg(d.number).arg(h.abridged().c_str()), d.number);
if (h == bc.genesisHash())
break;
}
if (ui->block->currentIndex() < 0)
ui->block->setCurrentIndex(0);
if (m_ui->block->currentIndex() < 0)
m_ui->block->setCurrentIndex(0);
m_recentBlocks = numLastBlocks - i;
}
int i = ui->block->count();
int i = m_ui->block->count();
while (i > 0 && i >= m_recentBlocks)
ui->block->removeItem(i--);
m_ui->block->removeItem(i--);
h256Hash blocks;
for (QString f: filters)
@ -117,31 +126,31 @@ void ExportStateDialog::fillBlocks()
for (auto const& h: blocks)
{
auto d = bc.details(h);
ui->block->addItem(QString("#%1 %2").arg(d.number).arg(h.abridged().c_str()), d.number);
m_ui->block->addItem(QString("#%1 %2").arg(d.number).arg(h.abridged().c_str()), d.number);
}
}
void ExportStateDialog::fillContracts()
{
ui->accounts->clear();
ui->contracts->clear();
ui->accounts->setEnabled(true);
ui->contracts->setEnabled(true);
m_ui->accounts->clear();
m_ui->contracts->clear();
m_ui->accounts->setEnabled(true);
m_ui->contracts->setEnabled(true);
try
{
for (auto i: ethereum()->addresses(m_block))
{
string r = m_main->render(i);
(new QListWidgetItem(QString("%2: %1 [%3]").arg(formatBalance(ethereum()->balanceAt(i)).c_str()).arg(QString::fromStdString(r)).arg((unsigned)ethereum()->countAt(i)), ethereum()->codeAt(i).empty() ? ui->accounts : ui->contracts))
string r = main()->render(i);
(new QListWidgetItem(QString("%2: %1 [%3]").arg(formatBalance(ethereum()->balanceAt(i)).c_str()).arg(QString::fromStdString(r)).arg((unsigned)ethereum()->countAt(i)), ethereum()->codeAt(i).empty() ? m_ui->accounts : m_ui->contracts))
->setData(Qt::UserRole, QByteArray((char const*)i.data(), Address::size));
}
}
catch (InterfaceNotSupported const&)
{
ui->accounts->setEnabled(false);
ui->contracts->setEnabled(false);
ui->json->setEnabled(false);
ui->json->setText(QString("This feature requires compilation with FATDB support."));
m_ui->accounts->setEnabled(false);
m_ui->contracts->setEnabled(false);
m_ui->json->setEnabled(false);
m_ui->json->setText(QString("This feature requires compilation with FATDB support."));
}
}
@ -150,14 +159,14 @@ void ExportStateDialog::generateJSON()
std::stringstream json;
json << "{\n";
std::string prefix;
for(QListWidgetItem* item: ui->accounts->selectedItems())
for(QListWidgetItem* item: m_ui->accounts->selectedItems())
{
auto hba = item->data(Qt::UserRole).toByteArray();
auto address = Address((byte const*)hba.data(), Address::ConstructFromPointer);
json << prefix << "\t\"" << toHex(address.ref()) << "\": { \"wei\": \"" << ethereum()->balanceAt(address, m_block) << "\" }";
prefix = ",\n";
}
for(QListWidgetItem* item: ui->contracts->selectedItems())
for(QListWidgetItem* item: m_ui->contracts->selectedItems())
{
auto hba = item->data(Qt::UserRole).toByteArray();
auto address = Address((byte const*)hba.data(), Address::ConstructFromPointer);
@ -181,9 +190,9 @@ void ExportStateDialog::generateJSON()
json << "\n}";
json.flush();
ui->json->setEnabled(true);
ui->json->setText(QString::fromStdString(json.str()));
ui->saveButton->setEnabled(true);
m_ui->json->setEnabled(true);
m_ui->json->setText(QString::fromStdString(json.str()));
m_ui->saveButton->setEnabled(true);
}
void ExportStateDialog::on_saveButton_clicked()
@ -193,5 +202,7 @@ void ExportStateDialog::on_saveButton_clicked()
fn = fn.append(".json");
ofstream file(fn.toStdString());
if (file.is_open())
file << ui->json->toPlainText().toStdString();
file << m_ui->json->toPlainText().toStdString();
}
#endif //ETH_FATDB

15
alethzero/ExportState.h → alethzero/plugins/blockchain/ExportState.h

@ -21,9 +21,12 @@
#pragma once
#if ETH_FATDB
#include <memory>
#include <QDialog>
#include <libethcore/Common.h>
#include "MainFace.h"
namespace Ui { class ExportState; }
@ -35,14 +38,13 @@ namespace eth { class Client; }
namespace az
{
class Main;
class ExportStateDialog: public QDialog
class ExportStateDialog: public QDialog, public Plugin
{
Q_OBJECT
public:
explicit ExportStateDialog(Main* _parent = 0);
ExportStateDialog(MainFace* _m);
virtual ~ExportStateDialog();
private slots:
@ -51,17 +53,18 @@ private slots:
void on_saveButton_clicked();
private:
eth::Client* ethereum() const;
void showEvent(QShowEvent* _event) override;
void fillBlocks();
void fillContracts();
void generateJSON();
private:
std::unique_ptr<Ui::ExportState> ui;
Main* m_main;
std::unique_ptr<Ui::ExportState> m_ui;
int m_recentBlocks = 0;
eth::BlockNumber m_block = eth::LatestBlock;
};
}
}
#endif //ETH_FATDB

0
alethzero/ExportState.ui → alethzero/plugins/blockchain/ExportState.ui

2
evmjit/libevmjit/Array.h

@ -58,7 +58,7 @@ private:
llvm::Function* createExtendFunc();
llvm::Function* getReallocFunc();
LazyFunction m_pushFunc = {[this](){ return createArrayPushFunc(); }}; // TODO: If works on MSVC, remove form initialization list
LazyFunction m_pushFunc = {[this](){ return createArrayPushFunc(); }};
LazyFunction m_setFunc = {[this](){ return createArraySetFunc(); }};
LazyFunction m_getPtrFunc = {[this](){ return createGetPtrFunc(); }};
LazyFunction m_getFunc = {[this](){ return createArrayGetFunc(); }};

8
evmjit/libevmjit/BasicBlock.cpp

@ -110,11 +110,13 @@ void LocalStack::set(size_t _index, llvm::Value* _word)
void LocalStack::finalize(llvm::IRBuilder<>& _builder, llvm::BasicBlock& _bb)
{
auto blockTerminator = _bb.getTerminator();
assert(blockTerminator);
if (blockTerminator->getOpcode() != llvm::Instruction::Ret)
if (!blockTerminator || blockTerminator->getOpcode() != llvm::Instruction::Ret)
{
// Not needed in case of ret instruction. Ret invalidates the stack.
_builder.SetInsertPoint(blockTerminator);
if (blockTerminator)
_builder.SetInsertPoint(blockTerminator);
else
_builder.SetInsertPoint(&_bb);
// Update items fetched from global stack ignoring the poped ones
assert(m_globalPops <= m_input.size()); // pop() always does get()

86
evmjit/libevmjit/Compiler.cpp

@ -29,6 +29,8 @@ namespace eth
namespace jit
{
static const auto c_destIdxLabel = "destIdx";
Compiler::Compiler(Options const& _options):
m_options(_options),
m_builder(llvm::getGlobalContext())
@ -93,21 +95,34 @@ std::vector<BasicBlock> Compiler::createBasicBlocks(code_iterator _codeBegin, co
return blocks;
}
void Compiler::fillJumpTable()
void Compiler::resolveJumps()
{
assert(m_jumpTableBB);
if (llvm::pred_empty(m_jumpTableBB))
{
m_jumpTableBB->eraseFromParent(); // remove if unused
return;
}
// TODO: Extend this function as `resolveJumps()` and fill gaps in branch instructions.
auto target = llvm::cast<llvm::PHINode>(m_jumpTableBB->begin());
for (auto pred: llvm::predecessors(m_jumpTableBB))
// Iterate through all EVM instructions blocks (skip first 4 - special blocks).
for (auto it = std::next(m_mainFunc->begin(), 4); it != m_mainFunc->end(); ++it)
{
auto targetMd = llvm::cast<llvm::LocalAsMetadata>(pred->getTerminator()->getMetadata("target")->getOperand(0));
target->addIncoming(targetMd->getValue(), pred);
auto jumpTable = llvm::cast<llvm::SwitchInst>(m_jumpTableBB->getTerminator());
auto jumpTableInput = llvm::cast<llvm::PHINode>(m_jumpTableBB->begin());
auto nextBlock = it->getNextNode() != m_mainFunc->end() ? it->getNextNode() : m_stopBB;
auto term = it->getTerminator();
if (!term) // Block may have no terminator if the next instruction is a jump destination.
llvm::IRBuilder<>{it}.CreateBr(nextBlock);
else if (auto jump = llvm::dyn_cast<llvm::BranchInst>(term))
if (jump->getSuccessor(0) == m_jumpTableBB)
{
auto destIdx = llvm::cast<llvm::ValueAsMetadata>(jump->getMetadata(c_destIdxLabel)->getOperand(0))->getValue();
if (auto constant = llvm::dyn_cast<llvm::ConstantInt>(destIdx))
{
// If destination index is a constant do direct jump to the destination block.
auto bb = jumpTable->findCaseValue(constant).getCaseSuccessor();
jump->setSuccessor(0, bb);
}
else
jumpTableInput->addIncoming(destIdx, it); // Fill up PHI node
if (jump->isConditional())
jump->setSuccessor(1, nextBlock); // Set next block for conditional jumps
}
}
}
@ -160,13 +175,8 @@ std::unique_ptr<llvm::Module> Compiler::compile(code_iterator _begin, code_itera
auto firstBB = blocks.empty() ? m_stopBB : blocks.front().llvm();
m_builder.CreateCondBr(normalFlow, firstBB, m_abortBB, Type::expectTrue);
for (auto it = blocks.begin(); it != blocks.end(); ++it)
{
// TODO: Rewrite
auto nextIt = it + 1;
auto nextBasicBlock = (nextIt != blocks.end()) ? nextIt->llvm() : nullptr; // TODO: What with Stop block?
compileBasicBlock(*it, runtimeManager, arith, memory, ext, gasMeter, nextBasicBlock, stack, jumpTable);
}
for (auto& block: blocks)
compileBasicBlock(block, runtimeManager, arith, memory, ext, gasMeter, stack);
// Code for special blocks:
m_builder.SetInsertPoint(m_stopBB);
@ -175,19 +185,15 @@ std::unique_ptr<llvm::Module> Compiler::compile(code_iterator _begin, code_itera
m_builder.SetInsertPoint(m_abortBB);
runtimeManager.exit(ReturnCode::OutOfGas);
fillJumpTable();
resolveJumps();
return module;
}
void Compiler::compileBasicBlock(BasicBlock& _basicBlock, RuntimeManager& _runtimeManager,
Arith256& _arith, Memory& _memory, Ext& _ext, GasMeter& _gasMeter, llvm::BasicBlock* _nextBasicBlock, Stack& _globalStack,
llvm::SwitchInst& jumpTable)
Arith256& _arith, Memory& _memory, Ext& _ext, GasMeter& _gasMeter, Stack& _globalStack)
{
if (!_nextBasicBlock) // this is the last block in the code
_nextBasicBlock = m_stopBB;
m_builder.SetInsertPoint(_basicBlock.llvm());
LocalStack stack{_globalStack};
@ -556,24 +562,16 @@ void Compiler::compileBasicBlock(BasicBlock& _basicBlock, RuntimeManager& _runti
case Instruction::JUMP:
case Instruction::JUMPI:
{
auto jumpBlock = m_jumpTableBB;
auto target = stack.pop();
auto destIdx = llvm::MDNode::get(m_builder.getContext(), llvm::ValueAsMetadata::get(stack.pop()));
// Create branch instruction, initially to jump table.
// Destination will be optimized with direct jump during jump resolving if destination index is a constant.
auto jumpInst = (inst == Instruction::JUMP) ?
m_builder.CreateBr(jumpBlock) :
m_builder.CreateCondBr(m_builder.CreateICmpNE(stack.pop(), Constant::get(0), "jump.check"), jumpBlock, _nextBasicBlock);
m_builder.CreateBr(m_jumpTableBB) :
m_builder.CreateCondBr(m_builder.CreateICmpNE(stack.pop(), Constant::get(0), "jump.check"), m_jumpTableBB, nullptr);
if (auto constant = llvm::dyn_cast<llvm::ConstantInt>(target))
{
// If target index is a constant do direct jump to the target block.
auto bb = jumpTable.findCaseValue(constant).getCaseSuccessor();
jumpInst->setSuccessor(0, bb);
}
else
{
// Attach medatada to branch instruction with information about target index.
auto targetMd = llvm::MDNode::get(jumpInst->getContext(), llvm::LocalAsMetadata::get(target));
jumpInst->setMetadata("target", targetMd);
}
// Attach medatada to branch instruction with information about destination index.
jumpInst->setMetadata(c_destIdxLabel, destIdx);
break;
}
@ -790,10 +788,6 @@ void Compiler::compileBasicBlock(BasicBlock& _basicBlock, RuntimeManager& _runti
_gasMeter.commitCostBlock();
// Block may have no terminator if the next instruction is a jump destination.
if (!_basicBlock.llvm()->getTerminator())
m_builder.CreateBr(_nextBasicBlock);
stack.finalize(m_builder, *_basicBlock.llvm()); // TODO: Use references
m_builder.SetInsertPoint(_basicBlock.llvm()->getFirstNonPHI()); // TODO: Move to LocalStack::finalize

4
evmjit/libevmjit/Compiler.h

@ -31,9 +31,9 @@ private:
std::vector<BasicBlock> createBasicBlocks(code_iterator _begin, code_iterator _end, llvm::SwitchInst& _switchInst);
void compileBasicBlock(BasicBlock& _basicBlock, class RuntimeManager& _runtimeManager, class Arith256& _arith, class Memory& _memory, class Ext& _ext, class GasMeter& _gasMeter,
llvm::BasicBlock* _nextBasicBlock, class Stack& _globalStack, llvm::SwitchInst& _jumpTable);
class Stack& _globalStack);
void fillJumpTable();
void resolveJumps();
/// Compiler options
Options const& m_options;

2
evmjit/libevmjit/Stack.cpp

@ -7,8 +7,6 @@
#include "RuntimeManager.h"
#include "Utils.h"
#include <set> // DEBUG only
namespace dev
{
namespace eth

24
libjsqrc/ethereumjs/dist/web3-light.js

@ -4577,12 +4577,34 @@ var addToGroup = new Method({
params: 0
});
var newFilter = new Method({
name: 'newFilter',
call: 'shh_newFilter',
params: 1
});
var getFilterChanges = new Method({
name: 'getFilterChanges',
call: 'shh_getFilterChanges',
params: 1
});
var getMessages = new Method({
name: 'getMessages',
call: 'shh_getMessages',
params: 1
})
var methods = [
post,
newIdentity,
hasIdentity,
newGroup,
addToGroup
addToGroup,
newFilter,
getFilterChanges,
getMessages
];
module.exports = {

4
libjsqrc/ethereumjs/dist/web3-light.min.js

File diff suppressed because one or more lines are too long

24
libjsqrc/ethereumjs/dist/web3.js

@ -4577,12 +4577,34 @@ var addToGroup = new Method({
params: 0
});
var newFilter = new Method({
name: 'newFilter',
call: 'shh_newFilter',
params: 1
});
var getFilterChanges = new Method({
name: 'getFilterChanges',
call: 'shh_getFilterChanges',
params: 1
});
var getMessages = new Method({
name: 'getMessages',
call: 'shh_getMessages',
params: 1
})
var methods = [
post,
newIdentity,
hasIdentity,
newGroup,
addToGroup
addToGroup,
newFilter,
getFilterChanges,
getMessages
];
module.exports = {

4
libjsqrc/ethereumjs/dist/web3.js.map

File diff suppressed because one or more lines are too long

4
libjsqrc/ethereumjs/dist/web3.min.js

File diff suppressed because one or more lines are too long

24
libjsqrc/ethereumjs/lib/web3/shh.js

@ -54,12 +54,34 @@ var addToGroup = new Method({
params: 0
});
var newFilter = new Method({
name: 'newFilter',
call: 'shh_newFilter',
params: 1
});
var getFilterChanges = new Method({
name: 'getFilterChanges',
call: 'shh_getFilterChanges',
params: 1
});
var getMessages = new Method({
name: 'getMessages',
call: 'shh_getMessages',
params: 1
})
var methods = [
post,
newIdentity,
hasIdentity,
newGroup,
addToGroup
addToGroup,
newFilter,
getFilterChanges,
getMessages
];
module.exports = {

26
mix/qml/Block.qml

@ -23,6 +23,11 @@ ColumnLayout
property int blockIndex
property variant scenario
property string labelColor: "#414141"
property string selectedBlockColor: "#accbf2"
property string selectedBlockForeground: "#445e7f"
property int scenarioIndex
signal txSelected(var txIndex)
@ -105,14 +110,15 @@ ColumnLayout
}
}
Label
{
text: qsTr("EDIT")
color: "#1397da"
Image {
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: 14
visible: number === -2
source: "qrc:/qml/img/edit_combox.png"
height: 15
fillMode: Image.PreserveAspectFit
MouseArea
{
anchors.fill: parent
@ -122,6 +128,7 @@ ColumnLayout
projectModel.stateListModel.editState(scenarioIndex)
}
}
}
}
}
@ -237,11 +244,12 @@ ColumnLayout
function select()
{
rowContentTr.selected = true
rowContentTr.color = "#4F4F4F"
hash.color = "#EAB920"
func.color = "#EAB920"
rowContentTr.selected = true
rowContentTr.color = selectedBlockColor
hash.color = selectedBlockForeground
func.color = selectedBlockForeground
txSelected(index)
}
function deselect()
@ -345,7 +353,7 @@ ColumnLayout
Image {
id: debugImg
source: "qrc:/qml/img/rightarrow@2x.png"
source: "qrc:/qml/img/rightarrowcircle.png"
width: debugActionWidth
fillMode: Image.PreserveAspectFit
anchors.horizontalCenter: parent.horizontalCenter

21
mix/qml/Watchers.qml

@ -12,13 +12,16 @@ import "js/QEtherHelper.js" as QEtherHelper
import "."
Rectangle {
color: "#4F4F4F"
color: selectedBlockColor
property variant tx
property variant currentState
property variant bc
property var blockIndex
property var txIndex
property string selectedBlockColor: "#accbf2"
property string selectedBlockForeground: "#445e7f"
function clear()
{
from.text = ""
@ -83,11 +86,11 @@ Rectangle {
id: fromLabel
text: qsTr("from")
visible: false
color: "#EAB920"
color: selectedBlockForeground
}
Label {
id: from
color: "#EAB920"
color: selectedBlockForeground
elide: Text.ElideRight
maximumLineCount: 1
clip: true
@ -97,11 +100,11 @@ Rectangle {
id: toLabel
text: qsTr("to")
visible: false
color: "#EAB920"
color: selectedBlockForeground
}
Label {
id: to
color: "#EAB920"
color: selectedBlockForeground
elide: Text.ElideRight
maximumLineCount: 1
clip: true
@ -109,7 +112,7 @@ Rectangle {
}
Label {
id: value
color: "#EAB920"
color: selectedBlockForeground
font.italic: true
clip: true
}
@ -118,9 +121,9 @@ Rectangle {
Image {
anchors.right: rowHeader.parent.right
anchors.top: rowHeader.parent.top
anchors.topMargin: -3
source: "qrc:/qml/img/edittransaction2.png"
height: 30
anchors.topMargin: 5
source: "qrc:/qml/img/edit_combox.png"
height: 15
fillMode: Image.PreserveAspectFit
visible: from.text !== ""
MouseArea

BIN
mix/qml/img/rightarrowcircle.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

1
mix/res.qrc

@ -86,6 +86,7 @@
<file>qml/img/restoreicon@2x.png</file>
<file>qml/img/rightarrow.png</file>
<file>qml/img/rightarrow@2x.png</file>
<file>qml/img/rightarrowcircle.png</file>
<file>qml/img/saveicon.png</file>
<file>qml/img/saveicon@2x.png</file>
<file>qml/img/sendtransactionicon.png</file>

Loading…
Cancel
Save