diff --git a/mix/MixClient.cpp b/mix/MixClient.cpp index f4b0c63a1..90b44b0e7 100644 --- a/mix/MixClient.cpp +++ b/mix/MixClient.cpp @@ -131,7 +131,6 @@ Transaction MixClient::replaceGas(Transaction const& _t, u256 const& _gas, Secre void MixClient::executeTransaction(Transaction const& _t, State& _state, bool _call, bool _gasAuto, Secret const& _secret) { -<<<<<<< HEAD Transaction t = _gasAuto ? replaceGas(_t, m_state.gasLimitRemaining()) : _t; // do debugging run first LastHashes lastHashes(256); diff --git a/mix/qml/Block.qml b/mix/qml/Block.qml index 0fa69f1bd..ba587e4a1 100644 --- a/mix/qml/Block.qml +++ b/mix/qml/Block.qml @@ -19,6 +19,7 @@ ColumnLayout property int trHeight: 30 spacing: 0 property int openedTr: 0 + property int blockIndex function calculateHeight() { @@ -117,7 +118,7 @@ ColumnLayout Image { id: saveStatusImage - source: "qrc:/qml/img/recycle-discard@2x.png" + source: "qrc:/qml/img/recyclediscard@2x.png" width: statusWidth fillMode: Image.PreserveAspectFit anchors.verticalCenter: parent.verticalCenter @@ -133,9 +134,9 @@ ColumnLayout onSaveStatusChanged: { if (saveStatus) - saveStatusImage.source = "qrc:/qml/img/recycle-keep@2x.png" + saveStatusImage.source = "qrc:/qml/img/recyclekeep@2x.png" else - saveStatusImage.source = "qrc:/qml/img/recycle-discard@2x.png" + saveStatusImage.source = "qrc:/qml/img/recyclediscard@2x.png" if (index >= 0) transactions.get(index).saveStatus = saveStatus @@ -245,14 +246,30 @@ ColumnLayout } } - Button + Rectangle { - id: debug Layout.preferredWidth: debugActionWidth - text: "debug" - onClicked: + Layout.preferredHeight: trHeight - 10 + color: "transparent" + Image { + source: "qrc:/qml/img/rightarrow@2x.png" + width: statusWidth + fillMode: Image.PreserveAspectFit + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + visible: transactions.get(index).recordIndex !== undefined + } + MouseArea { - clientModel.debugRecord(transactions.get(index).recordIndex); + anchors.fill: parent + onClicked: + { + if (transactions.get(index).recordIndex) + { + debugTrRequested = [ blockIndex, index ] + clientModel.debugRecord(transactions.get(index).recordIndex); + } + } } } } diff --git a/mix/qml/BlockChain.qml b/mix/qml/BlockChain.qml index b73d9acbb..75073860f 100644 --- a/mix/qml/BlockChain.qml +++ b/mix/qml/BlockChain.qml @@ -16,6 +16,7 @@ ColumnLayout { property variant model spacing: 0 property int previousWidth + property variant debugTrRequested: [] onWidthChanged: { @@ -62,7 +63,7 @@ ColumnLayout { Layout.preferredHeight: 25 Image { id: debugImage - source: "qrc:/qml/img/recycle-icon@2x.png" + source: "qrc:/qml/img/recycleicon@2x.png" Layout.preferredWidth: statusWidth Layout.preferredHeight: 25 fillMode: Image.PreserveAspectFit @@ -95,7 +96,7 @@ ColumnLayout { } Label { - text: "Action" + text: "" Layout.preferredWidth: debugActionWidth } } @@ -128,7 +129,7 @@ ColumnLayout { { return calculateHeight() } - + blockIndex: index transactions: { if (index >= 0) @@ -260,7 +261,7 @@ ColumnLayout { Layout.preferredWidth: 100 Layout.preferredHeight: 30 buttonShortcut: "" - sourceImg: "qrc:/qml/img/recycle-icon@2x.png" + sourceImg: "qrc:/qml/img/recycleicon@2x.png" } ScenarioButton { @@ -278,7 +279,7 @@ ColumnLayout { Layout.preferredWidth: 100 Layout.preferredHeight: 30 buttonShortcut: "" - sourceImg: "qrc:/qml/img/recycle-icon@2x.png" + sourceImg: "qrc:/qml/img/sendtransactionicon@2x.png" } Timer @@ -324,7 +325,7 @@ ColumnLayout { Layout.preferredWidth: 100 Layout.preferredHeight: 30 buttonShortcut: "" - sourceImg: "qrc:/qml/img/recycle-icon@2x.png" + sourceImg: "qrc:/qml/img/addblock@2x.png" } Connections @@ -380,7 +381,6 @@ ColumnLayout { itemTr.isFunctionCall = itemTr.functionId !== "" itemTr.returned = _r.returned itemTr.value = QEtherHelper.createEther(_r.value, QEther.Wei) - console.log("sender " + _r.sender) itemTr.sender = _r.sender itemTr.recordIndex = _r.recordIndex itemTr.logs = _r.logs @@ -401,7 +401,7 @@ ColumnLayout { Layout.preferredWidth: 100 Layout.preferredHeight: 30 buttonShortcut: "" - sourceImg: "qrc:/qml/img/recycle-icon@2x.png" + sourceImg: "qrc:/qml/img/newaccounticon@2x.png" } } } diff --git a/mix/qml/Debugger.qml b/mix/qml/Debugger.qml index 7827931b0..3a0ed61a4 100644 --- a/mix/qml/Debugger.qml +++ b/mix/qml/Debugger.qml @@ -11,7 +11,7 @@ import "." Rectangle { id: debugPanel - property alias debugSlider: statesSlider + property alias debugSlider: statesSlider property alias solLocals: solLocals property alias solStorage: solStorage property alias solCallStack: solCallStack @@ -39,6 +39,11 @@ Rectangle { machineStates.updateHeight(); } + function setTr(tr) + { + trName.text = tr.label + } + function displayCompilationErrorIfAny() { debugScrollArea.visible = false; @@ -104,28 +109,67 @@ Rectangle { property alias solLocalsHeightSettings: solLocalsRect.height } - Splitter { + ColumnLayout { id: debugScrollArea anchors.fill: parent - orientation: Qt.Vertical + //orientation: Qt.Vertical + spacing: 0 + RowLayout + { + Layout.preferredWidth: parent.width + Layout.preferredHeight: 30 + Rectangle + { + Layout.preferredWidth: parent.width + Layout.preferredHeight: parent.height + color: "transparent" + Text { + anchors.centerIn: parent + text: qsTr("Current Transaction") + } + + Rectangle + { + anchors.left: parent.left + anchors.leftMargin: 10 + width: 30 + height: parent.height + color: "transparent" + anchors.verticalCenter: parent.verticalCenter + Image { + source: "qrc:/qml/img/leftarrow@2x.png" + width: parent.width + fillMode: Image.PreserveAspectFit + anchors.centerIn: parent + } + MouseArea + { + anchors.fill: parent + onClicked: + { + Debugger.init(null); + panelClosed() + } + } + } + } + } - /*TransactionLog { - id: transactionLog - Layout.fillWidth: true - Layout.minimumHeight: 130 - height: 250 - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - anchors.leftMargin: machineStates.sideMargin - anchors.rightMargin: machineStates.sideMargin - anchors.topMargin: machineStates.sideMargin - }*/ - - Button + RowLayout { - text: qsTr("close") - onClicked: panelClosed() + Layout.preferredWidth: parent.width + Layout.preferredHeight: 30 + Rectangle + { + Layout.preferredWidth: parent.width + Layout.preferredHeight: parent.height + color: "#2C79D3" + Text { + id: trName + color: "white" + anchors.centerIn: parent + } + } } ScrollView @@ -170,32 +214,6 @@ Rectangle { spacing: 3 layoutDirection: Qt.LeftToRight - /*StepActionImage - { - id: playAction - enabledStateImg: "qrc:/qml/img/play_button.png" - disableStateImg: "qrc:/qml/img/play_button.png" - buttonLeft: true - onClicked: projectModel.stateListModel.runState(transactionLog.selectedStateIndex) - width: 23 - buttonShortcut: "Ctrl+Shift+F8" - buttonTooltip: qsTr("Start Debugging") - visible: true - Layout.alignment: Qt.AlignLeft - } - - StepActionImage - { - id: pauseAction - enabledStateImg: "qrc:/qml/img/stop_button2x.png" - disableStateImg: "qrc:/qml/img/stop_button2x.png" - onClicked: Debugger.init(null); - width: 23 - buttonShortcut: "Ctrl+Shift+F9" - buttonTooltip: qsTr("Stop Debugging") - visible: true - }*/ - StepActionImage { id: runBackAction; diff --git a/mix/qml/MainContent.qml b/mix/qml/MainContent.qml index 4af8ece46..21aed8af1 100644 --- a/mix/qml/MainContent.qml +++ b/mix/qml/MainContent.qml @@ -224,6 +224,10 @@ Rectangle { onDebugDataReady: { scenarioExe.visible = false debugPanel.visible = true + if (scenarioExe.bc.debugTrRequested) + { + debugPanel.setTr(scenarioExe.bc.model.blocks[scenarioExe.bc.debugTrRequested[0]].transactions[scenarioExe.bc.debugTrRequested[1]]) + } } } diff --git a/mix/qml/ScenarioExecution.qml b/mix/qml/ScenarioExecution.qml index d02e7d3f8..a5053e4d7 100644 --- a/mix/qml/ScenarioExecution.qml +++ b/mix/qml/ScenarioExecution.qml @@ -10,6 +10,7 @@ import "." Rectangle { color: "#ededed" + property alias bc: blockChain Connections { diff --git a/mix/qml/ScenarioLoader.qml b/mix/qml/ScenarioLoader.qml index 366813a7a..c659eb297 100644 --- a/mix/qml/ScenarioLoader.qml +++ b/mix/qml/ScenarioLoader.qml @@ -48,7 +48,7 @@ RowLayout width: 100 height: 30 buttonShortcut: "" - sourceImg: "qrc:/qml/img/restoreIcon@2x.png" + sourceImg: "qrc:/qml/img/restoreicon@2x.png" onClicked: { restore() } @@ -71,7 +71,7 @@ RowLayout width: 100 height: 30 buttonShortcut: "" - sourceImg: "qrc:/qml/img/saveIcon@2x.png" + sourceImg: "qrc:/qml/img/saveicon@2x.png" } ScenarioButton @@ -79,16 +79,13 @@ RowLayout id: duplicateScenario text: qsTr("Duplicate") onClicked: { - var state = JSON.parse(JSON.stringify(projectModel.stateListModel.getState(scenarioList.currentIndex))) - state.title = qsTr("Copy of ") + state.title; - projectModel.stateListModel.appendState(state) - projectModel.stateListModel.save() + projectModel.stateListModel.duplicateState(scenarioList.currentIndex) duplicated(state) } width: 100 height: 30 buttonShortcut: "" - sourceImg: "qrc:/qml/img/duplicateIcon@2x.png" + sourceImg: "qrc:/qml/img/duplicateicon@2x.png" } } } diff --git a/mix/qml/StateListModel.qml b/mix/qml/StateListModel.qml index dac3e0831..cb9688524 100644 --- a/mix/qml/StateListModel.qml +++ b/mix/qml/StateListModel.qml @@ -16,6 +16,7 @@ Item { property string defaultAccount: "cb73d9408c4720e230387d956eb0f829d8a4dd2c1055f96257167e14e7169074" //support for old project function fromPlainStateItem(s) { + console.log("ggg " + s) if (!s.accounts) s.accounts = [stateListModel.newAccount("1000000", QEther.Ether, defaultAccount)]; //support for old project if (!s.contracts) @@ -242,6 +243,15 @@ Item { return { name: name, secret: _secret, balance: QEtherHelper.createEther(_balance, _unit), address: address }; } + function duplicateState(index) + { + var state = stateList[index] + var item = fromPlainStateItem(toPlainStateItem(state)) + item.title = qsTr("Copy of") + " " + state.title + appendState(item) + save() + } + function createEmptyBlock() { return { @@ -380,11 +390,9 @@ Item { function reloadStateFromFromProject(index) { - console.log(JSON.stringify(data)) if (data) { var item = fromPlainStateItem(data.states[index]) - stateListModel.set(index, item) stateList[index] = item return item diff --git a/mix/qml/img/duplicateIcon.png b/mix/qml/img/duplicateIcon.png deleted file mode 100644 index b3a255420..000000000 Binary files a/mix/qml/img/duplicateIcon.png and /dev/null differ diff --git a/mix/qml/img/duplicateIcon@2x.png b/mix/qml/img/duplicateIcon@2x.png deleted file mode 100644 index d0f5274d3..000000000 Binary files a/mix/qml/img/duplicateIcon@2x.png and /dev/null differ diff --git a/mix/qml/img/recycle-discard.png b/mix/qml/img/recycle-discard.png deleted file mode 100644 index af1d09594..000000000 Binary files a/mix/qml/img/recycle-discard.png and /dev/null differ diff --git a/mix/qml/img/recycle-discard@2x.png b/mix/qml/img/recycle-discard@2x.png deleted file mode 100644 index c51c21d21..000000000 Binary files a/mix/qml/img/recycle-discard@2x.png and /dev/null differ diff --git a/mix/qml/img/recycle-icon.png b/mix/qml/img/recycle-icon.png deleted file mode 100644 index 2f5139ad8..000000000 Binary files a/mix/qml/img/recycle-icon.png and /dev/null differ diff --git a/mix/qml/img/recycle-icon@2x.png b/mix/qml/img/recycle-icon@2x.png deleted file mode 100644 index 75b590b2a..000000000 Binary files a/mix/qml/img/recycle-icon@2x.png and /dev/null differ diff --git a/mix/qml/img/recycle-keep.png b/mix/qml/img/recycle-keep.png deleted file mode 100644 index d9c39a6de..000000000 Binary files a/mix/qml/img/recycle-keep.png and /dev/null differ diff --git a/mix/qml/img/recycle-keep@2x.png b/mix/qml/img/recycle-keep@2x.png deleted file mode 100644 index 616fa5622..000000000 Binary files a/mix/qml/img/recycle-keep@2x.png and /dev/null differ diff --git a/mix/qml/img/restoreIcon.png b/mix/qml/img/restoreIcon.png deleted file mode 100644 index 9fc6e8f22..000000000 Binary files a/mix/qml/img/restoreIcon.png and /dev/null differ diff --git a/mix/qml/img/restoreIcon@2x.png b/mix/qml/img/restoreIcon@2x.png deleted file mode 100644 index 3160b0bf3..000000000 Binary files a/mix/qml/img/restoreIcon@2x.png and /dev/null differ diff --git a/mix/qml/img/saveIcon.png b/mix/qml/img/saveIcon.png deleted file mode 100644 index 46e17522b..000000000 Binary files a/mix/qml/img/saveIcon.png and /dev/null differ diff --git a/mix/qml/img/saveIcon@2x.png b/mix/qml/img/saveIcon@2x.png deleted file mode 100644 index 0f77a1af8..000000000 Binary files a/mix/qml/img/saveIcon@2x.png and /dev/null differ diff --git a/mix/res.qrc b/mix/res.qrc index e84f77d84..b50aa3d9f 100644 --- a/mix/res.qrc +++ b/mix/res.qrc @@ -68,17 +68,27 @@ qml/img/warningicon.png qml/img/warningicon@2x.png qml/QAddressView.qml - qml/img/recycle-discard.png - qml/img/recycle-discard@2x.png - qml/img/recycle-icon.png - qml/img/recycle-icon@2x.png - qml/img/recycle-keep.png - qml/img/recycle-keep@2x.png - qml/img/restoreIcon.png - qml/img/restoreIcon@2x.png - qml/img/saveIcon.png - qml/img/saveIcon@2x.png - qml/img/duplicateIcon.png - qml/img/duplicateIcon@2x.png + qml/img/addblock.png + qml/img/addblock@2x.png + qml/img/duplicateicon.png + qml/img/duplicateicon@2x.png + qml/img/leftarrow.png + qml/img/leftarrow@2x.png + qml/img/newaccounticon.png + qml/img/newaccounticon@2x.png + qml/img/recyclediscard.png + qml/img/recyclediscard@2x.png + qml/img/recycleicon.png + qml/img/recycleicon@2x.png + qml/img/recyclekeep.png + qml/img/recyclekeep@2x.png + qml/img/restoreicon.png + qml/img/restoreicon@2x.png + qml/img/rightarrow.png + qml/img/rightarrow@2x.png + qml/img/saveicon.png + qml/img/saveicon@2x.png + qml/img/sendtransactionicon.png + qml/img/sendtransactionicon@2x.png