Browse Source

Merge pull request #968 from arkpar/mix_ux

mix: State list refactored
cl-refactor
Gav Wood 10 years ago
parent
commit
7329aa29fe
  1. 2
      mix/AppContext.cpp
  2. 45
      mix/AssemblyDebuggerControl.cpp
  3. 48
      mix/AssemblyDebuggerControl.h
  4. 1
      mix/ClientModel.h
  5. 8
      mix/CodeEditorExtensionManager.cpp
  6. 1
      mix/MixClient.cpp
  7. 48
      mix/StateListView.cpp
  8. 45
      mix/StateListView.h
  9. 13
      mix/qml/DebugInfoList.qml
  10. 54
      mix/qml/Debugger.qml
  11. 48
      mix/qml/MainContent.qml
  12. 58
      mix/qml/StateList.qml
  13. 10
      mix/qml/StateListModel.qml
  14. 70
      mix/qml/TransactionLog.qml
  15. 25
      mix/qml/main.qml

2
mix/AppContext.cpp

@ -84,7 +84,7 @@ void AppContext::load()
qmlRegisterType<CodeEditorExtensionManager>("CodeEditorExtensionManager", 1, 0, "CodeEditorExtensionManager"); qmlRegisterType<CodeEditorExtensionManager>("CodeEditorExtensionManager", 1, 0, "CodeEditorExtensionManager");
qmlRegisterType<HttpServer>("HttpServer", 1, 0, "HttpServer"); qmlRegisterType<HttpServer>("HttpServer", 1, 0, "HttpServer");
m_applicationEngine->load(QUrl("qrc:/qml/main.qml")); m_applicationEngine->load(QUrl("qrc:/qml/main.qml"));
QWindow *window = qobject_cast<QWindow *>(m_applicationEngine->rootObjects().at(0)); QWindow *window = qobject_cast<QWindow*>(m_applicationEngine->rootObjects().at(0));
window->setIcon(QIcon(":/res/mix_256x256x32.png")); window->setIcon(QIcon(":/res/mix_256x256x32.png"));
appLoaded(); appLoaded();
} }

45
mix/AssemblyDebuggerControl.cpp

@ -1,45 +0,0 @@
/*
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 <http://www.gnu.org/licenses/>.
*/
/** @file AssemblyDebuggerControl.cpp
* @author Yann yann@ethdev.com
* @date 2014
* display opcode debugging.
*/
#include <QDebug>
#include <QQmlContext>
#include <QQmlApplicationEngine>
#include "ClientModel.h"
#include "AssemblyDebuggerControl.h"
using namespace dev::mix;
AssemblyDebuggerControl::AssemblyDebuggerControl(AppContext* _context):
Extension(_context, ExtensionDisplayBehavior::RightView)
{
}
QString AssemblyDebuggerControl::contentUrl() const
{
return QStringLiteral("qrc:/qml/Debugger.qml");
}
QString AssemblyDebuggerControl::title() const
{
return QApplication::tr("Debugger");
}
void AssemblyDebuggerControl::start() const
{
}

48
mix/AssemblyDebuggerControl.h

@ -1,48 +0,0 @@
/*
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 <http://www.gnu.org/licenses/>.
*/
/** @file AssemblyDebuggerControl.h
* @author Yann yann@ethdev.com
* @date 2014
* Extension which display debugging steps in assembly code.
*/
#pragma once
#include <atomic>
#include "Extension.h"
namespace dev
{
namespace mix
{
class AppContext;
/**
* @brief Extension which display transaction creation or transaction call debugging.
*/
class AssemblyDebuggerControl: public Extension
{
Q_OBJECT
public:
AssemblyDebuggerControl(AppContext* _context);
~AssemblyDebuggerControl() {}
void start() const override;
QString title() const override;
QString contentUrl() const override;
};
}
}

1
mix/ClientModel.h

@ -26,6 +26,7 @@
#include <atomic> #include <atomic>
#include <map> #include <map>
#include <QString> #include <QString>
#include <QVariantMap>
#include "MachineStates.h" #include "MachineStates.h"
namespace dev namespace dev

8
mix/CodeEditorExtensionManager.cpp

@ -26,8 +26,6 @@
#include <QQmlComponent> #include <QQmlComponent>
#include <QQuickTextDocument> #include <QQuickTextDocument>
#include "StatusPane.h" #include "StatusPane.h"
#include "AssemblyDebuggerControl.h"
#include "StateListView.h"
#include "AppContext.h" #include "AppContext.h"
#include "MixApplication.h" #include "MixApplication.h"
#include "CodeModel.h" #include "CodeModel.h"
@ -56,13 +54,9 @@ void CodeEditorExtensionManager::loadEditor(QQuickItem* _editor)
void CodeEditorExtensionManager::initExtensions() void CodeEditorExtensionManager::initExtensions()
{ {
std::shared_ptr<StatusPane> output = std::make_shared<StatusPane>(m_appContext); std::shared_ptr<StatusPane> output = std::make_shared<StatusPane>(m_appContext);
std::shared_ptr<AssemblyDebuggerControl> debug = std::make_shared<AssemblyDebuggerControl>(m_appContext);
std::shared_ptr<StateListView> stateList = std::make_shared<StateListView>(m_appContext);
QObject::connect(m_appContext->codeModel(), &CodeModel::compilationComplete, this, &CodeEditorExtensionManager::applyCodeHighlight); QObject::connect(m_appContext->codeModel(), &CodeModel::compilationComplete, this, &CodeEditorExtensionManager::applyCodeHighlight);
initExtension(output); initExtension(output);
initExtension(debug);
initExtension(stateList);
} }
void CodeEditorExtensionManager::initExtension(std::shared_ptr<Extension> _ext) void CodeEditorExtensionManager::initExtension(std::shared_ptr<Extension> _ext)
@ -94,10 +88,10 @@ void CodeEditorExtensionManager::applyCodeHighlight()
void CodeEditorExtensionManager::setRightView(QQuickItem* _rightView) void CodeEditorExtensionManager::setRightView(QQuickItem* _rightView)
{ {
m_rightView = _rightView; m_rightView = _rightView;
initExtensions(); //TODO: move this to a proper place
} }
void CodeEditorExtensionManager::setHeaderView(QQuickItem* _headerView) void CodeEditorExtensionManager::setHeaderView(QQuickItem* _headerView)
{ {
m_headerView = _headerView; m_headerView = _headerView;
initExtensions(); //TODO: move this to a proper place
} }

1
mix/MixClient.cpp

@ -205,7 +205,6 @@ void MixClient::mine()
m_state.completeMine(); m_state.completeMine();
bc().import(m_state.blockData(), m_stateDB); bc().import(m_state.blockData(), m_stateDB);
m_state.sync(bc()); m_state.sync(bc());
//m_state.cleanup(true);
m_startState = m_state; m_startState = m_state;
m_executions.emplace_back(std::move(m_pendingExecutions)); m_executions.emplace_back(std::move(m_pendingExecutions));
h256Set changed { dev::eth::PendingChangedFilter, dev::eth::ChainChangedFilter }; h256Set changed { dev::eth::PendingChangedFilter, dev::eth::ChainChangedFilter };

48
mix/StateListView.cpp

@ -1,48 +0,0 @@
/*
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 <http://www.gnu.org/licenses/>.
*/
/** @file StateListView.cpp
* @author Arkadiy Paronyan arkadiy@ethdev.com
* @date 2014
* Ethereum IDE client.
*/
#include <QQuickItem>
#include <QApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QDebug>
#include "StateListView.h"
using namespace dev::mix;
StateListView::StateListView(AppContext* _context): Extension(_context, ExtensionDisplayBehavior::RightView)
{
}
QString StateListView::contentUrl() const
{
return QStringLiteral("qrc:/qml/StateList.qml");
}
QString StateListView::title() const
{
return QApplication::tr("States");
}
void StateListView::start() const
{
}

45
mix/StateListView.h

@ -1,45 +0,0 @@
/*
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 <http://www.gnu.org/licenses/>.
*/
/** @file StateListView.h
* @author Arkadiy Paronyan arkadiy@ethdev.com
* @date 2014
* Ethereum IDE client.
*/
#pragma once
#include <memory>
#include <QTextDocument>
#include "Extension.h"
namespace dev
{
namespace mix
{
/// State list control
class StateListView: public Extension
{
Q_OBJECT
public:
StateListView(AppContext* _context);
void start() const override;
QString title() const override;
QString contentUrl() const override;
};
}
}

13
mix/qml/DebugInfoList.qml

@ -9,7 +9,7 @@ ColumnLayout {
property variant listModel; property variant listModel;
property bool collapsible; property bool collapsible;
property bool enableSelection; property bool enableSelection;
property real storedHeight; property real storedHeight: 0;
property Component itemDelegate property Component itemDelegate
signal rowActivated(int index) signal rowActivated(int index)
spacing: 0 spacing: 0
@ -104,6 +104,17 @@ ColumnLayout {
selectionMode: enableSelection ? SelectionMode.SingleSelection : SelectionMode.NoSelection selectionMode: enableSelection ? SelectionMode.SingleSelection : SelectionMode.NoSelection
headerDelegate: null headerDelegate: null
itemDelegate: root.itemDelegate itemDelegate: root.itemDelegate
onHeightChanged: {
if (height <= 0 && collapsible) {
if (storedHeight <= 0)
storedHeight = 200;
storageContainer.state = "collapsed";
}
else if (height > 0 && storageContainer.state == "collapsed") {
//TODO: fix increasing size
//storageContainer.state = "";
}
}
TableViewColumn { TableViewColumn {
role: "modelData" role: "modelData"
width: parent.width width: parent.width

54
mix/qml/Debugger.qml

@ -9,8 +9,10 @@ import "js/ErrorLocationFormater.js" as ErrorLocationFormater
Rectangle { Rectangle {
id: debugPanel id: debugPanel
property alias transactionLog : transactionLog
objectName: "debugPanel" objectName: "debugPanel"
anchors.fill: parent;
color: "#ededed" color: "#ededed"
clip: true clip: true
@ -22,7 +24,7 @@ Rectangle {
function update(data, giveFocus) function update(data, giveFocus)
{ {
if (statusPane.result.successful) if (statusPane && statusPane.result.successful)
{ {
Debugger.init(data); Debugger.init(data);
debugScrollArea.visible = true; debugScrollArea.visible = true;
@ -62,6 +64,7 @@ Rectangle {
property alias storageHeightSettings: storageRect.height property alias storageHeightSettings: storageRect.height
property alias memoryDumpHeightSettings: memoryRect.height property alias memoryDumpHeightSettings: memoryRect.height
property alias callDataHeightSettings: callDataRect.height property alias callDataHeightSettings: callDataRect.height
property alias transactionLogVisible: transactionLog.visible
} }
Rectangle Rectangle
@ -113,45 +116,41 @@ Rectangle {
} }
} }
ScrollView { SplitView {
id: debugScrollArea id: debugScrollArea
anchors.fill: parent anchors.fill: parent
orientation: Qt.Vertical
handleDelegate: Rectangle {
height: machineStates.sideMargin
color: "transparent"
}
SplitView TransactionLog {
id: transactionLog
Layout.fillWidth: true
Layout.minimumHeight: 60
height: 250
}
ScrollView
{ {
property int sideMargin: 10 property int sideMargin: 10
id: machineStates id: machineStates
anchors.top: parent.top Layout.fillWidth: true
anchors.topMargin: 15 Layout.fillHeight: true
anchors.left: parent.left;
anchors.leftMargin: machineStates.sideMargin
width: debugScrollArea.width - machineStates.sideMargin * 2 - 20;
orientation: Qt.Vertical
handleDelegate: Rectangle {
height: machineStates.sideMargin
color: "transparent"
}
function updateHeight() { function updateHeight() {
machineStates.height = transactionLog.childrenRect.height + buttonRow.childrenRect.height + assemblyCodeRow.childrenRect.height + statesLayout.height = buttonRow.childrenRect.height + assemblyCodeRow.childrenRect.height +
callStackRect.childrenRect.height + storageRect.childrenRect.height + memoryRect.childrenRect.height + callDataRect.childrenRect.height + 120; callStackRect.childrenRect.height + storageRect.childrenRect.height + memoryRect.childrenRect.height + callDataRect.childrenRect.height + 120;
} }
Component.onCompleted: updateHeight(); Component.onCompleted: updateHeight();
TransactionLog {
id: transactionLog
Layout.fillWidth: true
Layout.minimumHeight: 60
height: 250
}
ColumnLayout { ColumnLayout {
Layout.fillWidth: true
Layout.fillHeight: true
id: statesLayout id: statesLayout
anchors.top: parent.top
anchors.topMargin: 15
anchors.left: parent.left;
anchors.leftMargin: machineStates.sideMargin
width: debugScrollArea.width - machineStates.sideMargin * 2 - 20;
spacing: machineStates.sideMargin spacing: machineStates.sideMargin
Rectangle { Rectangle {
@ -550,7 +549,6 @@ Rectangle {
} }
} }
} }
} }
Rectangle Rectangle

48
mix/qml/MainContent.qml

@ -10,7 +10,6 @@ import "js/TransactionHelper.js" as TransactionHelper
import "." import "."
Rectangle { Rectangle {
objectName: "mainContent" objectName: "mainContent"
signal keyPressed(variant event) signal keyPressed(variant event)
focus: true focus: true
@ -22,11 +21,12 @@ Rectangle {
anchors.fill: parent anchors.fill: parent
id: root id: root
property alias rightViewVisible : rightView.visible property alias rightViewVisible: rightView.visible
property alias webViewVisible : webPreview.visible property alias webViewVisible: webPreview.visible
property alias projectViewVisible : projectList.visible property alias projectViewVisible: projectList.visible
property alias runOnProjectLoad : mainSettings.runOnProjectLoad property alias runOnProjectLoad: mainSettings.runOnProjectLoad
property bool webViewHorizontal : codeWebSplitter.orientation === Qt.Vertical //vertical splitter positions elements vertically, splits screen horizontally property alias rightPane: rightView
property bool webViewHorizontal: codeWebSplitter.orientation === Qt.Vertical //vertical splitter positions elements vertically, splits screen horizontally
property bool firstCompile: true property bool firstCompile: true
Connections { Connections {
@ -77,7 +77,6 @@ Rectangle {
CodeEditorExtensionManager { CodeEditorExtensionManager {
headerView: headerPaneTabs; headerView: headerPaneTabs;
rightView: rightPaneTabs;
} }
Settings { Settings {
@ -185,46 +184,13 @@ Rectangle {
} }
} }
Rectangle { Debugger {
visible: false; visible: false;
id: rightView; id: rightView;
Layout.fillHeight: true Layout.fillHeight: true
Keys.onEscapePressed: visible = false Keys.onEscapePressed: visible = false
height: parent.height;
width: 515
Layout.minimumWidth: 515 Layout.minimumWidth: 515
anchors.right: parent.right anchors.right: parent.right
Rectangle {
anchors.fill: parent;
id: rightPaneView
TabView {
id: rightPaneTabs
tabsVisible: true
antialiasing: true
anchors.fill: parent
style: TabViewStyle {
frameOverlap: 1
tabBar:
Rectangle {
color: "#ededed"
id: background
}
tab: Rectangle {
color: "#ededed"
implicitWidth: 80
implicitHeight: 20
radius: 2
Text {
anchors.centerIn: parent
text: styleData.title
color: styleData.selected ? "#7da4cd" : "#202020"
}
}
frame: Rectangle {
}
}
}
}
} }
} }
} }

58
mix/qml/StateList.qml

@ -3,60 +3,66 @@ import QtQuick.Controls.Styles 1.1
import QtQuick.Controls 1.1 import QtQuick.Controls 1.1
import QtQuick.Dialogs 1.1 import QtQuick.Dialogs 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Window 2.0
Rectangle { Window {
color: "#ededed"
id: stateListContainer id: stateListContainer
focus: true modality: Qt.WindowModal
anchors.topMargin: 10
anchors.left: parent.left
height: parent.height
width: parent.width
ListView { width: 640
id: list height: 480
anchors.top: parent.top
height: parent.height
width: parent.width
model: projectModel.stateListModel
delegate: renderDelegate
}
Button { visible: false
anchors.bottom: parent.bottom ColumnLayout
action: addStateAction {
anchors.fill: parent
TableView {
id: list
Layout.fillHeight: true
Layout.fillWidth: true
model: projectModel.stateListModel
itemDelegate: renderDelegate
headerDelegate: null
TableViewColumn {
role: "title"
title: qsTr("State")
width: list.width
}
}
Button {
anchors.bottom: parent.bottom
action: addStateAction
}
} }
Component { Component {
id: renderDelegate id: renderDelegate
Item { Item {
id: wrapperItem
height: 20
width: parent.width
RowLayout { RowLayout {
anchors.fill: parent anchors.fill: parent
Text { Text {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
text: title text: styleData.value
font.pointSize: 12 font.pointSize: 12
verticalAlignment: Text.AlignBottom verticalAlignment: Text.AlignBottom
} }
ToolButton { ToolButton {
text: qsTr("Edit"); text: qsTr("Edit");
Layout.fillHeight: true Layout.fillHeight: true
onClicked: list.model.editState(index); onClicked: list.model.editState(styleData.row);
} }
ToolButton { ToolButton {
visible: list.model.count - 1 != index visible: list.model.defaultStateIndex !== styleData.row
text: qsTr("Delete"); text: qsTr("Delete");
Layout.fillHeight: true Layout.fillHeight: true
onClicked: list.model.deleteState(index); onClicked: list.model.deleteState(styleData.row);
} }
ToolButton { ToolButton {
text: qsTr("Run"); text: qsTr("Run");
Layout.fillHeight: true Layout.fillHeight: true
onClicked: list.model.runState(index); onClicked: list.model.runState(styleData.row);
} }
} }
} }

10
mix/qml/StateListModel.qml

@ -8,7 +8,6 @@ import "js/QEtherHelper.js" as QEtherHelper
Item { Item {
property int defaultStateIndex: 0
property alias model: stateListModel property alias model: stateListModel
property var stateList: [] property var stateList: []
@ -111,7 +110,7 @@ Item {
for(var i = 0; i < stateListModel.count; i++) { for(var i = 0; i < stateListModel.count; i++) {
projectData.states.push(toPlainStateItem(stateList[i])); projectData.states.push(toPlainStateItem(stateList[i]));
} }
projectData.defaultStateIndex = defaultStateIndex; projectData.defaultStateIndex = stateListModel.defaultStateIndex;
} }
onNewProject: { onNewProject: {
var state = toPlainStateItem(stateListModel.createDefaultState()); var state = toPlainStateItem(stateListModel.createDefaultState());
@ -127,12 +126,12 @@ Item {
var item = stateDialog.getItem(); var item = stateDialog.getItem();
if (stateDialog.stateIndex < stateListModel.count) { if (stateDialog.stateIndex < stateListModel.count) {
if (stateDialog.isDefault) if (stateDialog.isDefault)
defaultStateIndex = stateIndex; stateListModel.defaultStateIndex = stateIndex;
stateList[stateDialog.stateIndex] = item; stateList[stateDialog.stateIndex] = item;
stateListModel.set(stateDialog.stateIndex, item); stateListModel.set(stateDialog.stateIndex, item);
} else { } else {
if (stateDialog.isDefault) if (stateDialog.isDefault)
defaultStateIndex = 0; stateListModel.defaultStateIndex = 0;
stateList.push(item); stateList.push(item);
stateListModel.append(item); stateListModel.append(item);
} }
@ -149,8 +148,10 @@ Item {
ListModel { ListModel {
id: stateListModel id: stateListModel
property int defaultStateIndex: 0
signal defaultStateChanged; signal defaultStateChanged;
signal stateListModelReady; signal stateListModelReady;
signal stateRun(int index)
function defaultTransactionItem() { function defaultTransactionItem() {
return { return {
@ -205,6 +206,7 @@ Item {
function runState(index) { function runState(index) {
var item = stateList[index]; var item = stateList[index];
clientModel.setupState(item); clientModel.setupState(item);
stateRun(index);
} }
function deleteState(index) { function deleteState(index) {

70
mix/qml/TransactionLog.qml

@ -5,13 +5,69 @@ import QtQuick.Dialogs 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
Item { Item {
Action {
id: addStateAction
text: "Add State"
shortcut: "Ctrl+Alt+T"
enabled: codeModel.hasContract && !clientModel.running;
onTriggered: projectModel.stateListModel.addState();
}
Action {
id: editStateAction
text: "Edit State"
shortcut: "Ctrl+Alt+T"
enabled: codeModel.hasContract && !clientModel.running && statesCombo.currentIndex >= 0 && projectModel.stateListModel.count > 0;
onTriggered: projectModel.stateListModel.editState(statesCombo.currentIndex);
}
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
CheckBox { RowLayout {
id: recording
text: qsTr("Record transactions"); ComboBox {
checked: true id: statesCombo
Layout.fillWidth: true model: projectModel.stateListModel
width: 150
editable: false
textRole: "title"
onActivated: {
model.runState(index);
}
Connections {
target: projectModel.stateListModel
onStateRun: {
if (statesCombo.currentIndex !== index)
statesCombo.currentIndex = index;
}
}
}
Button
{
anchors.rightMargin: 9
anchors.verticalCenter: parent.verticalCenter
action: editStateAction
}
Button
{
anchors.rightMargin: 9
anchors.verticalCenter: parent.verticalCenter
action: addStateAction
}
Button
{
anchors.rightMargin: 9
anchors.verticalCenter: parent.verticalCenter
action: mineAction
}
CheckBox {
id: recording
text: qsTr("Record transactions");
checked: true
Layout.fillWidth: true
}
} }
TableView { TableView {
Layout.fillWidth: true Layout.fillWidth: true
@ -31,7 +87,7 @@ Item {
TableViewColumn { TableViewColumn {
role: "contract" role: "contract"
title: qsTr("Contract") title: qsTr("Contract")
width: 120 width: 100
} }
TableViewColumn { TableViewColumn {
role: "function" role: "function"
@ -41,7 +97,7 @@ Item {
TableViewColumn { TableViewColumn {
role: "value" role: "value"
title: qsTr("Value") title: qsTr("Value")
width: 120 width: 60
} }
TableViewColumn { TableViewColumn {
role: "address" role: "address"

25
mix/qml/main.qml

@ -15,7 +15,7 @@ ApplicationWindow {
height: 800 height: 800
minimumWidth: 400 minimumWidth: 400
minimumHeight: 300 minimumHeight: 300
title: qsTr("mix") title: qsTr("Mix")
menuBar: MenuBar { menuBar: MenuBar {
Menu { Menu {
@ -40,6 +40,8 @@ ApplicationWindow {
MenuItem { action: debugRunAction } MenuItem { action: debugRunAction }
MenuItem { action: mineAction } MenuItem { action: mineAction }
MenuSeparator {} MenuSeparator {}
MenuItem { action: editStatesAction }
MenuSeparator {}
MenuItem { action: toggleRunOnLoadAction } MenuItem { action: toggleRunOnLoadAction }
} }
Menu { Menu {
@ -49,6 +51,7 @@ ApplicationWindow {
MenuSeparator {} MenuSeparator {}
MenuItem { action: toggleProjectNavigatorAction } MenuItem { action: toggleProjectNavigatorAction }
MenuItem { action: showHideRightPanelAction } MenuItem { action: showHideRightPanelAction }
MenuItem { action: toggleTransactionLogAction }
MenuItem { action: toggleWebPreviewAction } MenuItem { action: toggleWebPreviewAction }
MenuItem { action: toggleWebPreviewOrientationAction } MenuItem { action: toggleWebPreviewOrientationAction }
} }
@ -92,6 +95,17 @@ ApplicationWindow {
enabled: codeModel.hasContract && !clientModel.running &&!clientModel.mining enabled: codeModel.hasContract && !clientModel.running &&!clientModel.mining
} }
StateList {
id: stateList
}
Action {
id: editStatesAction
text: qsTr("Edit States")
shortcut: "Ctrl+Alt+E"
onTriggered: stateList.show();
}
Connections { Connections {
target: projectModel.stateListModel target: projectModel.stateListModel
@ -121,6 +135,15 @@ ApplicationWindow {
onTriggered: mainContent.toggleWebPreview(); onTriggered: mainContent.toggleWebPreview();
} }
Action {
id: toggleTransactionLogAction
text: qsTr("Show States and Transactions")
shortcut: "Alt+1"
checkable: true
checked: mainContent.rightPane.transactionLog.visible
onTriggered: mainContent.rightPane.transactionLog.visible = !mainContent.rightPane.transactionLog.visible
}
Action { Action {
id: toggleProjectNavigatorAction id: toggleProjectNavigatorAction
text: qsTr("Show Project Navigator") text: qsTr("Show Project Navigator")

Loading…
Cancel
Save