2010-01-06 00:21 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* contrib/hbide/hbide.prg
* contrib/hbide/idedocks.prg
* contrib/hbide/idemisc.prg
* contrib/hbide/ideprojmanager.prg
! Many artifacts corrected.
! Build process is now very satisfying if selected an
option with right-click on project node in Project Tree window.
! Diabled gradients in any window. Is it ok to fine tune
the windows with plain colors ?
This commit is contained in:
@@ -17,6 +17,17 @@
|
||||
past entries belonging to author(s): Viktor Szakats.
|
||||
*/
|
||||
|
||||
2010-01-06 00:21 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
|
||||
* contrib/hbide/hbide.prg
|
||||
* contrib/hbide/idedocks.prg
|
||||
* contrib/hbide/idemisc.prg
|
||||
* contrib/hbide/ideprojmanager.prg
|
||||
! Many artifacts corrected.
|
||||
! Build process is now very satisfying if selected an
|
||||
option with right-click on project node in Project Tree window.
|
||||
! Diabled gradients in any window. Is it ok to fine tune
|
||||
the windows with plain colors ?
|
||||
|
||||
2010-01-06 08:33 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* INSTALL
|
||||
+ Added HB_TR_OUTPUT to DEBUG section.
|
||||
|
||||
@@ -675,7 +675,9 @@ METHOD HbIde:saveSource( nTab, lCancel, lAs )
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD HbIde:editSource( cSourceFile, nPos, nHPos, nVPos, cTheme )
|
||||
METHOD HbIde:editSource( cSourceFile, nPos, nHPos, nVPos, cTheme, lAlert )
|
||||
|
||||
DEFAULT lAlert TO .T.
|
||||
|
||||
IF !Empty( cSourceFile )
|
||||
IF !( hbide_isValidText( cSourceFile ) )
|
||||
@@ -686,9 +688,11 @@ METHOD HbIde:editSource( cSourceFile, nPos, nHPos, nVPos, cTheme )
|
||||
RETURN Self
|
||||
ENDIF
|
||||
IF ::oED:isOpen( cSourceFile )
|
||||
IF hbide_getYesNo( cSourceFile + " is already open.", ;
|
||||
"Want to re-load it again ?", "File Open Info!" )
|
||||
::oED:reLoad( cSourceFile )
|
||||
IF lAlert
|
||||
IF hbide_getYesNo( cSourceFile + " is already open.", ;
|
||||
"Want to re-load it again ?", "File Open Info!" )
|
||||
::oED:reLoad( cSourceFile )
|
||||
ENDIF
|
||||
ENDIF
|
||||
::oED:setSourceVisible( cSourceFile )
|
||||
RETURN Self
|
||||
@@ -1100,20 +1104,9 @@ METHOD HbIde:manageItemSelected( oXbpTreeItem )
|
||||
CASE ::aProjData[ n, TRE_TYPE ] == "Source File"
|
||||
cSource := ::aProjData[ n, TRE_ORIGINAL ]
|
||||
::editSource( cSource )
|
||||
#if 0
|
||||
cSource := ::aProjData[ n, TRE_ORIGINAL ]
|
||||
IF ( n := ascan( ::aTabs, {|e_| hbide_pathNormalized( e_[ TAB_SOURCEFILE ] ) == hbide_pathNormalized( cSource ) } ) ) == 0
|
||||
::editSource( cSource )
|
||||
ELSE
|
||||
::qTabWidget:setCurrentIndex( ::qTabWidget:indexOf( ::aTabs[ n, TAB_OTAB ]:oWidget ) )
|
||||
ENDIF
|
||||
#endif
|
||||
|
||||
CASE ::aProjData[ n, TRE_TYPE ] == "Opened Source"
|
||||
cSource := ::aProjData[ n, TRE_DATA ]
|
||||
IF ( n := ascan( ::aTabs, {|e_| hbide_pathNormalized( e_[ TAB_SOURCEFILE ] ) == hbide_pathNormalized( cSource ) } ) ) > 0
|
||||
::qTabWidget:setCurrentIndex( ::qTabWidget:indexOf( ::aTabs[ n, TAB_OTAB ]:oWidget ) )
|
||||
ENDIF
|
||||
::oED:setSourceVisible( ::aProjData[ n, TRE_DATA ] )
|
||||
|
||||
CASE ::aProjData[ n, TRE_TYPE ] == "Path"
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ METHOD IdeDocks:buildDialog()
|
||||
|
||||
::oDlg:setStyleSheet( GetStyleSheet( "QMainWindow" ) )
|
||||
|
||||
::oDlg:close := {|| MsgBox( "HbIDE is about to be closed!" ), .T. }
|
||||
::oDlg:close := {|| hbide_getYesNo( "hbIDE is about to be closed!", "Are you sure?" ) }
|
||||
::oDlg:oWidget:setDockOptions( QMainWindow_AllowTabbedDocks + QMainWindow_ForceTabbedDocks )
|
||||
::oDlg:oWidget:setTabPosition( Qt_BottomDockWidgetArea, QTabWidget_South )
|
||||
|
||||
@@ -194,7 +194,8 @@ METHOD IdeDocks:buildProjectTree()
|
||||
::oProjTree:hasLines := .T.
|
||||
::oProjTree:hasButtons := .T.
|
||||
::oProjTree:create( ::oDa, , { 0,0 }, { 10,10 }, , .t. )
|
||||
::oProjTree:setStyleSheet( GetStyleSheet( "QTreeWidget" ) )
|
||||
|
||||
* ::oProjTree:setStyleSheet( GetStyleSheet( "QTreeWidget" ) )
|
||||
|
||||
//::oProjTree:itemMarked := {|oItem| ::manageItemSelected( 0, oItem ), ::oCurProjItem := oItem }
|
||||
::oProjTree:itemMarked := {|oItem| ::oIde:oCurProjItem := oItem, ::oIde:manageFocusInEditor() }
|
||||
@@ -243,7 +244,8 @@ METHOD IdeDocks:buildEditorTree()
|
||||
::oEditTree:hasLines := .T.
|
||||
::oEditTree:hasButtons := .T.
|
||||
::oEditTree:create( ::oDa, , { 0,0 }, { 10,10 }, , .t. )
|
||||
::oEditTree:setStyleSheet( GetStyleSheet( "QTreeWidget" ) )
|
||||
|
||||
* ::oEditTree:setStyleSheet( GetStyleSheet( "QTreeWidget" ) )
|
||||
|
||||
//::oEditTree:itemMarked := {|oItem| ::manageItemSelected( 0, oItem ), ::oCurProjItem := oItem }
|
||||
::oEditTree:itemMarked := {|oItem| ::oIde:oCurProjItem := oItem, ::oIde:manageFocusInEditor() }
|
||||
@@ -281,7 +283,7 @@ METHOD IdeDocks:buildFuncList()
|
||||
::oDockR:oWidget:setFocusPolicy( Qt_NoFocus )
|
||||
|
||||
::oIde:oFuncList := XbpListBox():new( ::oDockR ):create( , , { 0,0 }, { 100,400 }, , .t. )
|
||||
::oFuncList:setStyleSheet( GetStyleSheet( "QListView" ) )
|
||||
* ::oFuncList:setStyleSheet( GetStyleSheet( "QListView" ) )
|
||||
|
||||
//::oFuncList:ItemMarked := {|mp1, mp2, oXbp| ::gotoFunction( mp1, mp2, oXbp ) }
|
||||
::oFuncList:ItemSelected := {|mp1, mp2, oXbp| ::oIde:gotoFunction( mp1, mp2, oXbp ) }
|
||||
@@ -385,7 +387,7 @@ METHOD IdeDocks:outputDoubleClicked( lSelected )
|
||||
cText := QTextBlock():configure( qCursor:block() ):text()
|
||||
|
||||
IF hbide_parseFNfromStatusMsg( cText, @cSource, @nLine, .T. )
|
||||
::oIde:editSource( cSource )
|
||||
::oIde:editSource( cSource, 0, 0, 0, NIL, .f. )
|
||||
qCursor := QTextCursor():configure( ::oIde:qCurEdit:textCursor() )
|
||||
nLine := iif( nLine < 1, 0, nLine - 1 )
|
||||
|
||||
|
||||
@@ -99,7 +99,6 @@ PROCEDURE hbide_justACall()
|
||||
|
||||
FUNCTION hbide_execPopup( aPops, aPos, qParent )
|
||||
LOCAL i, qPop, qPoint, qAct, cAct, xRet, pAct, a_
|
||||
//, nAct
|
||||
|
||||
qPop := QMenu():new( IIF( hb_isObject( qParent ), qParent, NIL ) )
|
||||
|
||||
@@ -114,12 +113,12 @@ FUNCTION hbide_execPopup( aPops, aPos, qParent )
|
||||
ENDIF
|
||||
ENDIF
|
||||
NEXT
|
||||
hbide_dbg( 1001 )
|
||||
|
||||
qPoint := QPoint():new( aPos[ 1 ], aPos[ 2 ] )
|
||||
pAct := qPop:exec_1( qPoint )
|
||||
hbide_dbg( 1002 )
|
||||
|
||||
qAct := QAction():configure( pAct )
|
||||
hbide_dbg( 1003 )
|
||||
|
||||
IF !empty( qAct:pPtr ) .and. !empty( cAct := qAct:text() )
|
||||
FOR EACH a_ IN aPops
|
||||
IF hb_isObject( a_[ 1 ] )
|
||||
@@ -135,7 +134,7 @@ hbide_dbg( 1003 )
|
||||
ENDIF
|
||||
NEXT
|
||||
ENDIF
|
||||
hbide_dbg( 1004 )
|
||||
|
||||
qPop:pPtr := 0
|
||||
|
||||
RETURN xRet
|
||||
@@ -699,11 +698,11 @@ FUNCTION hbide_convertBuildStatusMsgToHtml( cText, oWidget )
|
||||
FOR EACH cLine IN aLines
|
||||
|
||||
IF !Empty( cLine )
|
||||
nPos := aScan( aRegList, {| reg | !Empty( hb_RegEx( reg[ 2 ], cLine ) ) } )
|
||||
|
||||
IF ( nPos > 0 )
|
||||
IF ( nPos := aScan( aRegList, {| reg | !Empty( hb_RegEx( reg[ 2 ], cLine ) ) } ) ) > 0
|
||||
cLine := '<font color=' + aColors[ aRegList[nPos,1] ] + '>' + cLine + '</font>'
|
||||
End
|
||||
ELSE
|
||||
cLine := "<font color = black>" + cLine + "</font>"
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
oWidget:append( cLine )
|
||||
|
||||
@@ -78,8 +78,6 @@ CLASS IdeProjManager INHERIT IdeObject
|
||||
|
||||
DATA qProcess
|
||||
DATA nStarted INIT 0
|
||||
DATA cFileOut
|
||||
DATA cFileErr
|
||||
|
||||
METHOD new()
|
||||
METHOD create()
|
||||
@@ -721,18 +719,30 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt )
|
||||
qStringList:append( cHbpPath )
|
||||
|
||||
::qProcess := QProcess():new()
|
||||
::qProcess:setReadChannel( 1 )
|
||||
|
||||
//::cFileOut := hbide_pathToOSPath( cTargetFN + '.' + hb_md5( alltrim( str( seconds() ) ) ) + ".out" )
|
||||
::cFileOut := "xxx"
|
||||
//::cFileErr := hbide_pathToOSPath( cTargetFN + '.' + hb_md5( alltrim( str( seconds() ) ) ) + ".err" )
|
||||
::cFileErr := "yyy"
|
||||
#define CHN_BGN 1
|
||||
#define CHN_OUT 2
|
||||
#define CHN_ERR 3
|
||||
#define CHN_FIN 4
|
||||
#define CHN_STT 5
|
||||
#define CHN_ERE 6
|
||||
#define CHN_CLO 7
|
||||
#define CHN_BYT 8
|
||||
#define CHN_RCF 9
|
||||
#define CHN_REA 10
|
||||
|
||||
::qProcess:setStandardOutputFile( ::cFileOut )
|
||||
::qProcess:setStandardErrorFile( ::cFileErr )
|
||||
//Qt_Slots_Connect( ::pSlots, ::qProcess, "readyRead()" , {|o,i| ::readProcessInfo( CHN_REA, i, o ) } )
|
||||
Qt_Slots_Connect( ::pSlots, ::qProcess, "readChannelFinished()" , {|o,i| ::readProcessInfo( CHN_RCF, i, o ) } )
|
||||
Qt_Slots_Connect( ::pSlots, ::qProcess, "aboutToClose()" , {|o,i| ::readProcessInfo( CHN_CLO, i, o ) } )
|
||||
Qt_Slots_Connect( ::pSlots, ::qProcess, "bytesWritten(int)" , {|o,i| ::readProcessInfo( CHN_BYT, i, o ) } )
|
||||
Qt_Slots_Connect( ::pSlots, ::qProcess, "stateChanged(int)" , {|o,i| ::readProcessInfo( CHN_STT, i, o ) } )
|
||||
Qt_Slots_Connect( ::pSlots, ::qProcess, "error(int)" , {|o,i| ::readProcessInfo( CHN_ERE, i, o ) } )
|
||||
Qt_Slots_Connect( ::pSlots, ::qProcess, "started()" , {|o,i| ::readProcessInfo( CHN_BGN, o, i ) } )
|
||||
Qt_Slots_Connect( ::pSlots, ::qProcess, "readyReadStandardOutput()", {|o,i| ::readProcessInfo( CHN_OUT, i, o ) } )
|
||||
Qt_Slots_Connect( ::pSlots, ::qProcess, "readyReadStandardError()" , {|o,i| ::readProcessInfo( CHN_ERR, i, o ) } )
|
||||
Qt_Slots_Connect( ::pSlots, ::qProcess, "finished(int,int)" , {|o,i,ii| ::readProcessInfo( CHN_FIN, i, ii, o ) } )
|
||||
|
||||
Qt_Slots_Connect( ::pSlots, ::qProcess, "readyReadStandardOutput()", {|o,i| ::readProcessInfo( 2, i, o ) } )
|
||||
Qt_Slots_Connect( ::pSlots, ::qProcess, "readyReadStandardError()" , {|o,i| ::readProcessInfo( 3, i, o ) } )
|
||||
Qt_Slots_Connect( ::pSlots, ::qProcess, "finished(int,int)" , {|o,i,ii| ::readProcessInfo( 4, i, ii, o ) } )
|
||||
|
||||
::oOutputResult:oWidget:clear()
|
||||
::oOutputResult:oWidget:append( cTmp )
|
||||
@@ -774,41 +784,30 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeProjManager:readProcessInfo( nMode, i, ii )
|
||||
LOCAL cLine, cTmp
|
||||
LOCAL cLine, cTmp, nSize
|
||||
|
||||
nSize := 16384
|
||||
|
||||
DO CASE
|
||||
CASE nMode == 1
|
||||
CASE nMode == CHN_BGN
|
||||
|
||||
|
||||
CASE nMode == 2
|
||||
CASE nMode == CHN_OUT
|
||||
::qProcess:setReadChannel( 0 )
|
||||
cLine := space( 4096 )
|
||||
::qProcess:readLine( @cLine, 4096 )
|
||||
cLine := space( nSize )
|
||||
::qProcess:read( @cLine, nSize )
|
||||
IF !empty( cLine )
|
||||
::oOutputResult:oWidget:append( cLine )
|
||||
hbide_convertBuildStatusMsgToHtml( trim( cLine ), ::oOutputResult:oWidget )
|
||||
ENDIF
|
||||
|
||||
CASE nMode == 3
|
||||
CASE nMode == CHN_ERR
|
||||
::qProcess:setReadChannel( 1 )
|
||||
cLine := space( 4096 )
|
||||
::qProcess:readLine( @cLine, 4096 )
|
||||
|
||||
cLine := space( nSize )
|
||||
::qProcess:read( @cLine, nSize )
|
||||
IF !empty( cLine )
|
||||
IF ( "Warning" $ cLine )
|
||||
cLine := '<font color=blue>' + cLine + '</font>'
|
||||
ELSEIF ( "Error" $ cLine )
|
||||
cLine := '<font color=red>' + cLine + '</font>'
|
||||
ENDIF
|
||||
|
||||
::oOutputResult:oWidget:append( cLine )
|
||||
hbide_convertBuildStatusMsgToHtml( trim( cLine ), ::oOutputResult:oWidget )
|
||||
ENDIF
|
||||
|
||||
CASE nMode == 4
|
||||
cTmp := memoread( ::cFileOut )
|
||||
hbide_convertBuildStatusMsgToHtml( cTmp, ::oOutputResult:oWidget )
|
||||
cTmp := memoread( ::cFileErr )
|
||||
hbide_convertBuildStatusMsgToHtml( cTmp, ::oOutputResult:oWidget )
|
||||
|
||||
CASE nMode == CHN_FIN
|
||||
cTmp := hbide_outputLine() + CRLF
|
||||
cTmp += "Exit Code [ " + hb_ntos( i ) + " ] Exit Status [ " + hb_ntos( ii ) + " ] " +;
|
||||
"Finished at [ " + time() + " ] Done in [ " + hb_ntos( seconds() - ::nStarted ) +" Secs ]" + CRLF
|
||||
@@ -824,8 +823,6 @@ METHOD IdeProjManager:readProcessInfo( nMode, i, ii )
|
||||
::qProcess:pPtr := 0
|
||||
::qProcess := NIL
|
||||
|
||||
ferase( ::cFileOut )
|
||||
ferase( ::cFileErr )
|
||||
ENDCASE
|
||||
|
||||
RETURN nil
|
||||
|
||||
Reference in New Issue
Block a user