@ -3,6 +3,7 @@ import QtQuick.Controls.Styles 1.1
import QtQuick . Controls 1.1
import QtQuick . Dialogs 1.1
import QtQuick . Layouts 1.1
import Qt . labs . settings 1.0
import "js/Debugger.js" as Debugger
import "js/ErrorLocationFormater.js" as ErrorLocationFormater
@ -20,7 +21,13 @@ Rectangle {
Debugger . moveSelection ( - 1 ) ;
}
function update ( )
onVisibleChanged:
{
if ( visible )
forceActiveFocus ( ) ;
}
function update ( giveFocus )
{
if ( statusPane . result . successful )
{
@ -39,11 +46,13 @@ Rectangle {
errorDetail . text = errorInfo . errorDetail ;
errorLine . text = errorInfo . errorLine ;
}
if ( giveFocus )
forceActiveFocus ( ) ;
}
Connections {
target: codeModel
onCompilationComplete: update ( )
onCompilationComplete: update ( false )
}
Rectangle
@ -95,413 +104,456 @@ Rectangle {
}
}
Flickable {
property int firstColumnWidth: 17 0
property int firstColumnWidth: 18 0
property int secondColumnWidth: 250
id: debugScrollArea
flickableDirection: Flickable . VerticalFlick
anchors.fill: parent
contentHeight: machineStates . height + 300
contentWidth: machineStates . width
GridLayout
contentHeight: 4000
contentWidth: parent . width
Rectangle
{
property int sideMargin: 10
id: machineStates
anchors.top: parent . top
anchors.topMargin: 15
anchors.left: parent . left ;
anchors.leftMargin: machineStates . sideMargin
anchors.right: parent . right ;
anchors.rightMargin: machineStates . sideMargin
flow: GridLayout . TopToBottom
rowSpacing: 15
RowLayout {
/ / s t e p b u t t o n + s l i d e r
spacing: machineStates . sideMargin
height: 27
width: debugPanel . width
Rectangle
{
height: parent . height
color: "transparent"
width: debugScrollArea . firstColumnWidth
RowLayout {
anchors.horizontalCenter: parent . horizontalCenter
id: jumpButtons
spacing: 3
StepActionImage
{
id: jumpOutBackAction ;
enabledStateImg: "qrc:/qml/img/jumpoutback.png"
disableStateImg: "qrc:/qml/img/jumpoutbackdisabled.png"
onClicked: Debugger . stepOutBack ( )
width: 25
height: 27
}
anchors.fill: parent
ColumnLayout
{
property int sideMargin: 10
id: machineStates
anchors.top: parent . top
anchors.topMargin: 15
anchors.left: parent . left ;
anchors.leftMargin: machineStates . sideMargin
anchors.right: parent . right ;
anchors.rightMargin: machineStates . sideMargin
anchors.fill: parent
Layout.fillWidth: true
Layout.fillHeight: true
RowLayout {
/ / s t e p b u t t o n + s l i d e r
id: buttonRow
spacing: machineStates . sideMargin
height: 27
Layout.fillWidth: true
StepActionImage
{
id: jumpIntoBackAction
enabledStateImg: "qrc:/qml/img/jumpintoback.png"
disableStateImg: "qrc:/qml/img/jumpintobackdisabled.png"
onClicked: Debugger . stepIntoBack ( )
width: 25
height: 27
}
Rectangle
{
height: parent . height
color: "transparent"
width: debugScrollArea . firstColumnWidth
RowLayout {
anchors.horizontalCenter: parent . horizontalCenter
id: jumpButtons
spacing: 3
StepActionImage
{
id: jumpOutBackAction ;
enabledStateImg: "qrc:/qml/img/jumpoutback.png"
disableStateImg: "qrc:/qml/img/jumpoutbackdisabled.png"
onClicked: Debugger . stepOutBack ( )
width: 28
height: 30
buttonTooltip: qsTr ( "Step Out Back" )
}
StepActionImage
{
id: jumpOverBackAction
enabledStateImg: "qrc:/qml/img/jumpoverback.png"
disableStateImg: "qrc:/qml/img/jumpoverbackdisabled.png"
onClicked: Debugger . stepOverBack ( )
width: 25
height: 27
}
StepActionImage
{
id: jumpIntoBackAction
enabledStateImg: "qrc:/qml/img/jumpintoback.png"
disableStateImg: "qrc:/qml/img/jumpintobackdisabled.png"
onClicked: Debugger . stepIntoBack ( )
width: 28
height: 30
buttonTooltip: qsTr ( "Step Into Back" )
}
StepActionImage
{
id: jumpOverForwardAction
enabledStateImg: "qrc:/qml/img/jumpoverforward.png"
disableStateImg: "qrc:/qml/img/jumpoverforwarddisabled.png"
onClicked: Debugger . stepOverForward ( )
width: 25
height: 27
}
StepActionImage
{
id: jumpOverBackAction
enabledStateImg: "qrc:/qml/img/jumpoverback.png"
disableStateImg: "qrc:/qml/img/jumpoverbackdisabled.png"
onClicked: Debugger . stepOverBack ( )
width: 28
height: 30
buttonTooltip: qsTr ( "Step Over Back" )
}
StepActionImage
{
id: jumpIntoForwardAction
enabledStateImg: "qrc:/qml/img/jumpintoforward.png"
disableStateImg: "qrc:/qml/img/jumpintoforwarddisabled.png"
onClicked: Debugger . stepIntoForward ( )
width: 25
height: 27
}
StepActionImage
{
id: jumpOverForwardAction
enabledStateImg: "qrc:/qml/img/jumpoverforward.png"
disableStateImg: "qrc:/qml/img/jumpoverforwarddisabled.png"
onClicked: Debugger . stepOverForward ( )
width: 28
height: 30
buttonTooltip: qsTr ( "Step Over Forward" )
}
StepActionImage
{
id: jumpOutForwardAction
enabledStateImg: "qrc:/qml/img/jumpoutforward.png"
disableStateImg: "qrc:/qml/img/jumpoutforwarddisabled.png"
onClicked: Debugger . stepOutForward ( )
width: 25
height: 27
StepActionImage
{
id: jumpIntoForwardAction
enabledStateImg: "qrc:/qml/img/jumpintoforward.png"
disableStateImg: "qrc:/qml/img/jumpintoforwarddisabled.png"
onClicked: Debugger . stepIntoForward ( )
width: 28
height: 30
buttonTooltip: qsTr ( "Step Into Forward" )
}
StepActionImage
{
id: jumpOutForwardAction
enabledStateImg: "qrc:/qml/img/jumpoutforward.png"
disableStateImg: "qrc:/qml/img/jumpoutforwarddisabled.png"
onClicked: Debugger . stepOutForward ( )
width: 28
height: 30
buttonTooltip: qsTr ( "Step Out Forward" )
}
}
}
}
Rectangle {
color: "transparent"
width: debugScrollArea . secondColumnWidth
height: parent . height
Slider {
id: statesSlider
anchors.fill: parent
tickmarksEnabled: true
stepSize: 1.0
onValueChanged: Debugger . jumpTo ( value ) ;
style: SliderStyle {
groove: Rectangle {
implicitHeight: 3
color: "#7da4cd"
radius: 8
}
handle: Rectangle {
anchors.centerIn: parent
color: control . pressed ? "white" : "lightgray"
border.color: "gray"
border.width: 2
implicitWidth: 10
implicitHeight: 10
radius: 12
Rectangle {
color: "transparent"
Layout.fillWidth: true
height: parent . height
Slider {
id: statesSlider
anchors.fill: parent
tickmarksEnabled: true
stepSize: 1.0
onValueChanged: Debugger . jumpTo ( value ) ;
style: SliderStyle {
groove: Rectangle {
implicitHeight: 3
color: "#7da4cd"
radius: 8
}
handle: Rectangle {
anchors.centerIn: parent
color: control . pressed ? "white" : "lightgray"
border.color: "gray"
border.width: 2
implicitWidth: 10
implicitHeight: 10
radius: 12
}
}
}
}
}
}
RowLayout {
/ / A s s e m b l y c o d e
width: debugPanel . width
height: 405
spacing: machineStates . sideMargin
RowLayout {
/ / A s s e m b l y c o d e
id: assemblyCodeRow
Layout.fillWidth: true
height: 405
implicitHeight: 405
spacing: machineStates . sideMargin
Rectangle
{
width: debugScrollArea . firstColumnWidth
height: parent . height
border.width: 3
border.color: "#deddd9"
color: "white"
anchors.top: parent . top
ListView {
anchors.fill: parent
anchors.leftMargin: 3
anchors.rightMargin: 3
anchors.topMargin: 3
anchors.bottomMargin: 3
clip: true
id: statesList
delegate: renderDelegate
highlight: highlightBar
highlightFollowsCurrentItem: true
}
Component {
id: highlightBar
Rectangle {
radius: 4
height: statesList . currentItem . height
width: statesList . currentItem . width ;
color: "#4A90E2"
Behavior on y { SpringAnimation { spring: 2 ; damping: 0.1 } }
Rectangle
{
id: stateListContainer
width: debugScrollArea . firstColumnWidth
height: parent . height
border.width: 3
border.color: "#deddd9"
color: "white"
anchors.top: parent . top
ListView {
anchors.fill: parent
anchors.leftMargin: 3
anchors.rightMargin: 3
anchors.topMargin: 3
anchors.bottomMargin: 3
clip: true
id: statesList
delegate: renderDelegate
highlight: highlightBar
highlightFollowsCurrentItem: false
}
}
Component {
id: renderDelegate
RowLayout {
id: wrapperItem
height: 20
width: parent . width
spacing: 5
Text {
anchors.left: parent . left
anchors.leftMargin: 10
width: 15
color: "#b2b3ae"
text: line . split ( ' ' ) [ 0 ]
font.pointSize: 9
id: id
wrapMode: Text . NoWrap
Component {
id: highlightBar
Rectangle {
radius: 4
height: statesList . currentItem . height
width: statesList . currentItem . width ;
y: statesList . currentItem . y
color: "#4A90E2"
Behavior on y {
PropertyAnimation { properties: "y" ; easing.type: Easing . InOutQuad ; duration: 50 }
}
}
Text {
wrapMode: Text . NoWrap
color: parent . ListView . isCurrentItem ? "white" : "black"
text: line . replace ( line . split ( ' ' ) [ 0 ] , '' )
anchors.left: id . right
font.pointSize: 9
}
Component {
id: renderDelegate
RowLayout {
id: wrapperItem
height: 20
width: parent . width
spacing: 5
Text {
anchors.left: parent . left
anchors.leftMargin: 10
width: 15
color: "#b2b3ae"
text: line . split ( ' ' ) [ 0 ]
font.pointSize: 9
id: id
wrapMode: Text . NoWrap
}
Text {
wrapMode: Text . NoWrap
color: parent . ListView . isCurrentItem ? "white" : "black"
text: line . replace ( line . split ( ' ' ) [ 0 ] , '' )
anchors.left: id . right
font.pointSize: 9
}
}
}
}
}
ColumnLayout {
width: debugScrollArea . secondColumnWidth
height: parent . height
/ / C o l u m n L a y o u t {
Rectangle {
/ / I n f o
width: parent . width
id: basicInfoColumn
height: 125
color: "transparent"
ColumnLayout {
spacing: 0
Layout.fillWidth: true
height: parent . height / / - 2 * s t a t e L i s t C o n t a i n e r . b o r d e r . w i d t h
ColumnLayout
{
width: parent . width
height: parent . height
anchors.fill: parent
spacing: 0
DebugBasicInfo {
id: currentStep
titleStr: qsTr ( "Current step" )
titleStr: qsTr ( "Current Step" )
Layout.fillWidth: true
height: 30
}
DebugBasicInfo {
id: mem
titleStr: qsTr ( "Adding memory" )
titleStr: qsTr ( "Adding Memory" )
Layout.fillWidth: true
height: 30
}
DebugBasicInfo {
id: stepCost
titleStr: qsTr ( "Step cost" )
titleStr: qsTr ( "Step Cost" )
Layout.fillWidth: true
height: 30
}
DebugBasicInfo {
id: gasSpent
titleStr: qsTr ( "Total gas spent" )
titleStr: qsTr ( "Total Gas Spent" )
Layout.fillWidth: true
height: 30
}
DebugInfoList
{
Layout.fillHeight: true
Layout.fillWidth: true
id: stack
collapsible: false
title : qsTr ( "Stack" )
itemDelegate: Item {
id: renderedItem
height: 25
width: parent . width
RowLayout
{
anchors.fill: parent
Rectangle
{
id: indexColumn
color: "#f7f7f7"
Layout.fillWidth: true
Layout.minimumWidth: 30
Layout.preferredWidth: 30
Layout.maximumWidth: 30
Layout.minimumHeight: parent . height
Text {
anchors.centerIn: parent
anchors.leftMargin: 5
font.family: "monospace"
color: "#4a4a4a"
text: model . index ;
font.pointSize: 9
}
}
Rectangle
{
anchors.left: indexColumn . right
Layout.fillWidth: true
Layout.minimumWidth: 15
Layout.preferredWidth: 15
Layout.maximumWidth: 60
Layout.minimumHeight: parent . height
Text {
anchors.left: parent . left
anchors.leftMargin: 5
font.family: "monospace"
anchors.verticalCenter: parent . verticalCenter
color: "#4a4a4a"
text: modelData
font.pointSize: 9
}
}
}
Rectangle {
id: separator
width: parent . width ;
height: 1 ;
color: "#cccccc"
anchors.bottom: parent . bottom
}
}
}
}
}
}
Rectangle {
/ / S t a c k
height: 275
width: parent . width
color: "transparent"
SplitView
{
id: splitInfoList
Layout.fillHeight: true
Layout.fillWidth: true
Settings {
id: splitSettings
property alias storageHeightSettings: storageRect . height
property alias memoryDumpHeightSettings: memoryRect . height
property alias callDataHeightSettings: callDataRect . height
}
orientation: Qt . Vertical
width: debugPanel . width - 2 * machineStates . sideMargin
Rectangle
{
id: storageRect
width: parent . width
Layout.minimumHeight: 25
Layout.maximumHeight: 223
height: 25
DebugInfoList
{
id: stack
width: parent . width
height: parent . height
collapsible: false
title : qsTr ( "Stack" )
itemDelegate: Item {
id: renderedItem
id: storage
anchors.fill: parent
collapsible: true
title : qsTr ( "Storage" )
itemDelegate:
Item {
height: 27
width: parent . width
width: parent . width ;
RowLayout
{
anchors.fill: parent
id: row
width: parent . width
height: 26
Rectangle
{
id: indexColumn
color: "#f7f7f7"
Layout.fillWidth: true
Layout.minimumWidth: 30
Layout.preferredWidth: 30
Layout.maximumWidth: 30
Layout.minimumWidth: parent . width / 2
Layout.preferredWidth: parent . width / 2
Layout.maximumWidth: parent . width / 2
Layout.minimumHeight: parent . height
Layout.maximumHeight: parent . height
Text {
anchors.centerIn: parent
anchors.verticalCenter: parent . verticalCenter
anchors.left: parent . left
font.family: "monospace"
anchors.leftMargin: 5
color: "#8b8b8b"
text: model . index ;
color: "#4a4a4a "
text: modelData . split ( ' ' ) [ 0 ] . substring ( 0 , 10 ) ;
font.pointSize: 9
}
}
Rectangle
{
anchors.left: indexColumn . right
color: "transparent"
Layout.fillWidth: true
Layout.minimumWidth: 15
Layout.preferredWidth: 15
Layout.maximumWidth: 60
Layout.minimumWidth: parent . width / 2
Layout.preferredWidth: parent . width / 2
Layout.maximumWidth: parent . width / 2
Layout.minimumHeight: parent . height
Layout.maximumHeight: parent . height
Text {
anchors.left: parent . left
anchors.leftMargin: 5
width: parent . width - 5
wrapMode: Text . Wrap
anchors.left: parent . left
font.family: "monospace"
anchors.verticalCenter: parent . verticalCenter
color: "#8b8b8b"
text: modelData
color: "#4a4a4a "
text: modelData . split ( ' ' ) [ 1 ] . substring ( 0 , 10 ) ;
font.pointSize: 9
}
}
}
Rectangle {
id: separator
width: parent . width ;
height: 1 ;
color: "#cccccc"
anchors.bottom: parent . bottom
}
anchors.top: row . bottom
width: parent . width ;
height: 1 ;
color: "#cccccc"
anchors.bottom: parent . bottom
}
}
}
}
}
}
Rectangle {
width: debugPanel . width - 2 * machineStates . sideMargin
height: 2 ;
color: "#e3e3e3"
radius: 3
}
DebugInfoList
{
id: storage
width: debugPanel . width - 2 * machineStates . sideMargin
height: 223
collapsible: true
title : qsTr ( "Storage" )
itemDelegate:
Item {
height: 27
width: parent . width ;
RowLayout
Rectangle
{
id: row
id: memoryRect ;
height: 25
width: parent . width
height: 26
Rectangle
{
color: "#f7f7f7"
Layout.fillWidth: true
Layout.minimumWidth: parent . width / 2
Layout.preferredWidth: parent . width / 2
Layout.maximumWidth: parent . width / 2
Layout.minimumHeight: parent . height
Layout.maximumHeight: parent . height
Text {
anchors.verticalCenter: parent . verticalCenter
anchors.left: parent . left
anchors.leftMargin: 5
color: "#8b8b8b"
text: modelData . split ( ' ' ) [ 0 ] . substring ( 0 , 10 ) ;
font.pointSize: 9
Layout.minimumHeight: 25
Layout.maximumHeight: 223
DebugInfoList {
id: memoryDump
anchors.fill: parent
collapsible: true
title: qsTr ( "Memory Dump" )
itemDelegate:
Item {
height: 29
width: parent . width - 3 ;
ItemDelegateDataDump { }
}
}
Rectangle
{
color: "transparent"
Layout.fillWidth: true
Layout.minimumWidth: parent . width / 2
Layout.preferredWidth: parent . width / 2
Layout.maximumWidth: parent . width / 2
Layout.minimumHeight: parent . height
Layout.maximumHeight: parent . height
Text {
anchors.leftMargin: 5
width: parent . width - 5
wrapMode: Text . Wrap
anchors.left: parent . left
anchors.verticalCenter: parent . verticalCenter
color: "#8b8b8b"
text: modelData . split ( ' ' ) [ 1 ] . substring ( 0 , 10 ) ;
font.pointSize: 9
}
Rectangle
{
id: callDataRect
height: 25
width: parent . width
Layout.minimumHeight: 25
Layout.maximumHeight: 223
DebugInfoList {
id: callDataDump
anchors.fill: parent
collapsible: true
title: qsTr ( "Call Data" )
itemDelegate:
Item {
height: 29
width: parent . width - 3 ;
ItemDelegateDataDump { }
}
}
}
Rectangle {
anchors.top: row . bottom
width: parent . width ;
height: 1 ;
color: "#cccccc"
anchors.bottom: parent . bottom
}
}
}
Rectangle {
width: debugPanel . width - 2 * machineStates . sideMargin
height: 2 ;
color: "#e3e3e3"
radius: 3
}
DebugInfoList {
id: memoryDump
width: debugPanel . width - 2 * machineStates . sideMargin
height: 223
collapsible: true
title: qsTr ( "Memory Dump" )
itemDelegate:
Item {
height: 29
width: parent . width - 3 ;
ItemDelegateDataDump { }
}
}
Rectangle {
width: debugPanel . width - 2 * machineStates . sideMargin
height: 2 ;
color: "#e3e3e3"
radius: 3
}
DebugInfoList {
id: callDataDump
width: debugPanel . width - 2 * machineStates . sideMargin
height: 223
collapsible: true
title: qsTr ( "Call data" )
itemDelegate:
Item {
height: 29
width: parent . width - 3 ;
ItemDelegateDataDump { }
Rectangle
{
width: parent . width
Layout.minimumHeight: 25
color: "transparent"
}
}
}
}