@ -7,13 +7,13 @@ import QtQuick.Dialogs 1.1
Item {
id: codeEditorView
property string currentDocumentId: ""
property string sourceInError
property int openDocCount: 0
signal documentEdit ( string documentId )
signal breakpointsChanged ( string documentId )
signal isCleanChanged ( var isClean , string documentId )
signal loadComplete
function getDocumentText ( documentId ) {
for ( var i = 0 ; i < openDocCount ; i ++ ) {
if ( editorListModel . get ( i ) . documentId === documentId ) {
@ -50,7 +50,6 @@ Item {
doLoadDocument ( editors . itemAt ( openDocCount ) . item , editorListModel . get ( openDocCount ) )
}
openDocCount ++ ;
}
function doLoadDocument ( editor , document ) {
@ -71,6 +70,7 @@ Item {
editor . onIsCleanChanged . connect ( function ( ) {
isCleanChanged ( editor . isClean , document . documentId ) ;
} ) ;
editor . sourceName = document . documentId ;
}
function getEditor ( documentId ) {
@ -135,8 +135,36 @@ Item {
editor . changeGeneration ( ) ;
}
function goToCompilationError ( ) {
if ( sourceInError === "" )
return ;
if ( currentDocumentId !== sourceInError )
projectModel . openDocument ( sourceInError ) ;
for ( var i = 0 ; i < openDocCount ; i ++ )
{
var doc = editorListModel . get ( i ) ;
if ( doc . isContract && doc . documentId === sourceInError )
{
var editor = editors . itemAt ( i ) . item ;
if ( editor )
editor . goToCompilationError ( ) ;
break ;
}
}
}
Component.onCompleted: projectModel . codeEditor = codeEditorView ;
Connections {
target: codeModel
onCompilationError: {
sourceInError = _sourceName ;
}
onCompilationComplete: {
sourceInError = "" ;
}
}
Connections {
target: projectModel
onDocumentOpened: {