diff --git a/mix/ClientModel.h b/mix/ClientModel.h index 729d6acf6..63731badf 100644 --- a/mix/ClientModel.h +++ b/mix/ClientModel.h @@ -72,7 +72,7 @@ class TransactionLogEntry: public QObject /// Transaction block number Q_PROPERTY(unsigned block MEMBER m_block CONSTANT) /// Transaction index within the block - Q_PROPERTY(unsigned index MEMBER m_index CONSTANT) + Q_PROPERTY(unsigned tindex MEMBER m_index CONSTANT) /// Contract name if any Q_PROPERTY(QString contract MEMBER m_contract CONSTANT) /// Function name if any diff --git a/mix/qml/TransactionLog.qml b/mix/qml/TransactionLog.qml index 6079366bb..53135b92c 100644 --- a/mix/qml/TransactionLog.qml +++ b/mix/qml/TransactionLog.qml @@ -5,53 +5,63 @@ import QtQuick.Dialogs 1.1 import QtQuick.Layouts 1.1 Item { - TableView { + ColumnLayout { anchors.fill: parent - model: logModel - - TableViewColumn { - role: "block" - title: qsTr("Block") - width: 40 - } - TableViewColumn { - role: "index" - title: qsTr("Index") - width: 40 - } - TableViewColumn { - role: "contract" - title: qsTr("Contract") - width: 120 - } - TableViewColumn { - role: "function" - title: qsTr("Function") - width: 120 - } - TableViewColumn { - role: "value" - title: qsTr("Value") - width: 120 + CheckBox { + id: recording + text: qsTr("Record transactions"); + checked: true + Layout.fillWidth: true } - TableViewColumn { - role: "address" - title: qsTr("Address") - width: 120 - } - TableViewColumn { - role: "returned" - title: qsTr("Returned") - width: 120 - } - onActivated: { - var item = logModel.get(row); - clientModel.debugTransaction(item.block, item.index); - } - Keys.onPressed: { - if ((event.modifiers & Qt.ControlModifier) && event.key === Qt.Key_C && currentRow >=0 && currentRow < logModel.count) { - var item = logModel.get(currentRow); - appContext.toClipboard(item.returned); + TableView { + Layout.fillWidth: true + Layout.fillHeight: true + model: logModel + + TableViewColumn { + role: "block" + title: qsTr("Block") + width: 40 + } + TableViewColumn { + role: "tindex" + title: qsTr("Index") + width: 40 + } + TableViewColumn { + role: "contract" + title: qsTr("Contract") + width: 120 + } + TableViewColumn { + role: "function" + title: qsTr("Function") + width: 120 + } + TableViewColumn { + role: "value" + title: qsTr("Value") + width: 120 + } + TableViewColumn { + role: "address" + title: qsTr("Address") + width: 120 + } + TableViewColumn { + role: "returned" + title: qsTr("Returned") + width: 120 + } + onActivated: { + var item = logModel.get(row); + clientModel.debugTransaction(item.block, item.index); + } + Keys.onPressed: { + if ((event.modifiers & Qt.ControlModifier) && event.key === Qt.Key_C && currentRow >=0 && currentRow < logModel.count) { + var item = logModel.get(currentRow); + appContext.toClipboard(item.returned); + } } } } @@ -66,7 +76,8 @@ Item { logModel.clear(); } onNewTransaction: { - logModel.append(_tr); + if (recording.checked) + logModel.append(_tr); } }