2010-01-08 18:10 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* contrib/hbide/hbide.prg
* contrib/hbide/ideeditor.prg
* contrib/hbide/idemisc.prg
* contrib/hbide/ideprojmanager.prg
+ Enabled .PPO creation in a tab sharing the other sources.
So all other editing features are available to it.
.ppo is opened in separate tab than the original source.
.ppo is not included in "Recent Files" list and hance
it is not made available at next execution.
This commit is contained in:
@@ -17,6 +17,17 @@
|
||||
past entries belonging to author(s): Viktor Szakats.
|
||||
*/
|
||||
|
||||
2010-01-08 18:10 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
|
||||
* contrib/hbide/hbide.prg
|
||||
* contrib/hbide/ideeditor.prg
|
||||
* contrib/hbide/idemisc.prg
|
||||
* contrib/hbide/ideprojmanager.prg
|
||||
+ Enabled .PPO creation in a tab sharing the other sources.
|
||||
So all other editing features are available to it.
|
||||
.ppo is opened in separate tab than the original source.
|
||||
.ppo is not included in "Recent Files" list and hance
|
||||
it is not made available at next execution.
|
||||
|
||||
2010-01-09 01:39 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* config/global.mk
|
||||
! Fixed to not require HB_BIN_COMPILE is host and target
|
||||
|
||||
@@ -439,7 +439,7 @@ METHOD HbIde:execAction( cKey )
|
||||
CASE cKey == "Compile"
|
||||
//
|
||||
CASE cKey == "CompilePPO"
|
||||
::oPM:buildProject( '', .F., .F., .T. )
|
||||
::oPM:buildProject( '', .F., .F., .T., .T. )
|
||||
CASE cKey == "Properties"
|
||||
IF Empty( ::cWrkProject )
|
||||
MsgBox( 'No active project detected!' )
|
||||
@@ -711,7 +711,7 @@ METHOD HbIde:editSource( cSourceFile, nPos, nHPos, nVPos, cTheme, lAlert, lVisib
|
||||
::oED:setSourceVisible( cSourceFile )
|
||||
ENDIF
|
||||
|
||||
IF !Empty( cSourceFile )
|
||||
IF !Empty( cSourceFile ) .AND. !hbide_isSourcePPO( cSourceFile )
|
||||
hbide_mnuAddFileToMRU( Self, cSourceFile, INI_RECENTFILES )
|
||||
ENDIF
|
||||
|
||||
|
||||
@@ -228,9 +228,10 @@ METHOD IdeEditsManager:setSourceVisible( cSource )
|
||||
METHOD IdeEditsManager:setSourceVisibleByIndex( nIndex ) /* nIndex is 0 based */
|
||||
|
||||
IF ::qTabWidget:count() > 0 .AND. ::qTabWidget:count() > nIndex
|
||||
::qTabWidget:setCurrentIndex( nIndex )
|
||||
::getEditorByIndex( nIndex ):setDocumentProperties()
|
||||
nIndex := 0
|
||||
ENDIF
|
||||
::qTabWidget:setCurrentIndex( 0 )
|
||||
::getEditorByIndex( 0 ):setDocumentProperties()
|
||||
|
||||
RETURN .f.
|
||||
|
||||
@@ -599,7 +600,7 @@ METHOD IdeEditor:create( oIde, cSourceFile, nPos, nHPos, nVPos, cTheme )
|
||||
hb_fNameSplit( cSourceFile, @::cPath, @::cFile, @::cExt )
|
||||
|
||||
::cType := upper( strtran( ::cExt, ".", "" ) )
|
||||
::cType := iif( ::cType $ "PRG,C,CPP,H,CH", ::cType, "U" )
|
||||
::cType := iif( ::cType $ "PRG,C,CPP,H,CH,PPO", ::cType, "U" )
|
||||
|
||||
::buildTabPage( ::sourceFile )
|
||||
|
||||
@@ -648,8 +649,6 @@ METHOD IdeEditor:create( oIde, cSourceFile, nPos, nHPos, nVPos, cTheme )
|
||||
METHOD IdeEditor:setDocumentProperties()
|
||||
LOCAL qCursor
|
||||
|
||||
hbide_dbg( " ." )
|
||||
|
||||
qCursor := QTextCursor():configure( ::qEdit:textCursor() )
|
||||
|
||||
IF !( ::lLoaded ) /* First Time */
|
||||
@@ -677,8 +676,6 @@ METHOD IdeEditor:setDocumentProperties()
|
||||
|
||||
::oIde:manageFocusInEditor()
|
||||
|
||||
hbide_dbg( " ." )
|
||||
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
@@ -513,10 +513,9 @@ FUNCTION hbide_isValidText( cSourceFile )
|
||||
LOCAL cExt
|
||||
|
||||
hb_fNameSplit( cSourceFile, , , @cExt )
|
||||
cExt := lower( cExt )
|
||||
|
||||
RETURN ( cExt $ ".c,.cpp,.prg,.h,.ch,.txt,.log,.ini,.env,.ppo,"+;
|
||||
".cc,.hbc,.hbp,.hbm,.xml,.bat,.sh,.rc" )
|
||||
RETURN ( lower( cExt ) $ ".c,.cpp,.prg,.h,.ch,.txt,.log,.ini,.env,.ppo," + ;
|
||||
".cc,.hbc,.hbp,.hbm,.xml,.bat,.sh,.rc" )
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
@@ -524,9 +523,26 @@ FUNCTION hbide_isValidSource( cSourceFile )
|
||||
LOCAL cExt
|
||||
|
||||
hb_fNameSplit( cSourceFile, , , @cExt )
|
||||
cExt := lower( cExt )
|
||||
|
||||
RETURN ( cExt $ ".c,.cpp,.prg,.res,.rc" )
|
||||
RETURN ( lower( cExt ) $ ".c,.cpp,.prg,.res,.rc" )
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
FUNCTION hbide_isSourcePPO( cSourceFile )
|
||||
LOCAL cExt
|
||||
|
||||
hb_fNameSplit( cSourceFile, , , @cExt )
|
||||
|
||||
RETURN ( lower( cExt ) == ".ppo" )
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
FUNCTION hbide_isSourcePRG( cSourceFile )
|
||||
LOCAL cExt
|
||||
|
||||
hb_fNameSplit( cSourceFile, , , @cExt )
|
||||
|
||||
RETURN ( lower( cExt ) == ".prg" )
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@@ -94,6 +94,8 @@ CLASS IdeProjManager INHERIT IdeObject
|
||||
|
||||
DATA lLaunch INIT .f.
|
||||
DATA cProjectInProcess INIT ""
|
||||
DATA cPPO INIT ""
|
||||
DATA lPPO INIT .f.
|
||||
|
||||
METHOD new()
|
||||
METHOD create()
|
||||
@@ -636,14 +638,15 @@ METHOD IdeProjManager:buildProjectViaQt( cProject )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt )
|
||||
LOCAL cOutput, cErrors, n, aPrj, cHbpPath, aHbp, qStringList, qListSets
|
||||
LOCAL cTmp, nResult, nSeconds, cTargetFN, cPath, cFileName, lDelHbp
|
||||
LOCAL cOutput, cErrors, n, aPrj, cHbpPath, aHbp, qStringList, oEdit
|
||||
LOCAL cTmp, nResult, nSeconds, cTargetFN, lDelHbp
|
||||
|
||||
DEFAULT lLaunch TO .F.
|
||||
DEFAULT lRebuild TO .F.
|
||||
DEFAULT lPPO TO .F.
|
||||
DEFAULT lViaQt TO .F.
|
||||
|
||||
::lPPO := lPPO
|
||||
::lLaunch := lLaunch
|
||||
::cProjectInProcess := cProject
|
||||
|
||||
@@ -653,11 +656,9 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt )
|
||||
MsgBox( 'No file open issue to be compiled!' )
|
||||
RETURN Self
|
||||
End
|
||||
|
||||
IF empty( cProject )
|
||||
cProject := ::getCurrentProject()
|
||||
ENDIF
|
||||
|
||||
IF empty( cProject )
|
||||
RETURN Self
|
||||
ENDIF
|
||||
@@ -696,28 +697,29 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt )
|
||||
|
||||
aeval( aPrj[ PRJ_PRP_FLAGS, 2 ], {|e| aadd( aHbp, e ) } )
|
||||
|
||||
IF !( lPPO )
|
||||
IF !( ::lPPO )
|
||||
aeval( hbide_filesToSources( aPrj[ PRJ_PRP_SOURCES, 2 ] ), {|e| aadd( aHbp, e ) } )
|
||||
|
||||
ELSE
|
||||
aadd( aHbp, "-hbcmp -s -p" )
|
||||
IF !empty( oEdit := ::oED:getEditorCurrent() )
|
||||
IF hbide_isSourcePRG( oEdit:sourceFile )
|
||||
aadd( aHbp, "-hbcmp -s -p" )
|
||||
|
||||
n := ::getCurrentTab()
|
||||
// TODO: We have to test if the current file is part of a project, and we
|
||||
// pull your settings, even though this is not the active project - vailtom
|
||||
aadd( aHbp, hbide_pathToOSPath( oEdit:sourceFile ) )
|
||||
|
||||
hb_FNameSplit( ::aTabs[ n, TAB_SOURCEFILE ], @cPath, @cFileName, @cTmp )
|
||||
::cPPO := hbide_pathToOSPath( oEdit:cPath + oEdit:cFile + '.ppo' )
|
||||
FErase( ::cPPO )
|
||||
|
||||
IF !( lower( cTmp ) $ ".prg,?" )
|
||||
MsgBox( 'Operation not supported for this file type: "' + cTmp + '"' )
|
||||
RETURN Self
|
||||
ELSE
|
||||
MsgBox( 'Operation not supported for this file type: "' + cTmp + '"' )
|
||||
RETURN Self
|
||||
|
||||
ENDIF
|
||||
|
||||
lViaQt := .t. /* Donot know why it fails with Qt */
|
||||
ENDIF
|
||||
|
||||
cFileName := cPath + cFileName + '.ppo'
|
||||
|
||||
// TODO: We have to test if the current file is part of a project, and we
|
||||
// pull your settings, even though this is not the active project - vailtom
|
||||
aadd( aHbp, ::aTabs[ n, TAB_SOURCEFILE ] )
|
||||
|
||||
FErase( cFileName )
|
||||
ENDIF
|
||||
|
||||
IF !hbide_createTarget( cHbpPath, aHbp )
|
||||
@@ -756,18 +758,6 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt )
|
||||
::oOutputResult:oWidget:append( cTmp )
|
||||
::nStarted := seconds()
|
||||
|
||||
#if 0 /* Experiment */
|
||||
qStringList := QStringList():new()
|
||||
qStringList:append( "/k" )
|
||||
qStringList:append( "c:\batches\SetMinGW-harbour-E.bat" )
|
||||
qStringList:append( "hbMK2.exe -help" )
|
||||
::qProcess:startDetached_1( "cmd.exe", qStringList )
|
||||
#endif
|
||||
|
||||
|
||||
qListSets := QStringList():new()
|
||||
qListSets:append( "HB_WITH_QT=c:\qt\4.5.3\lib" )
|
||||
|
||||
#if 0 /* Mechanism to supply environment variables to called process */
|
||||
/* I do not know nixes but assume that Qt must be issueing proper */
|
||||
/* shell command for the target OS to set them. */
|
||||
@@ -775,14 +765,20 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt )
|
||||
/* and hence developer can choose any compiler of his choice. */
|
||||
/* */
|
||||
/* Actually, this was the intension in hbIDE.env I commited in IDE root */
|
||||
::qProcess:setEnvironment( qListSets )
|
||||
#endif
|
||||
qStringList := QStringList():new()
|
||||
qStringList:append( "HB_WITH_QT=c:\qt\4.5.3\lib" )
|
||||
::qProcess:setEnvironment( qStringList )
|
||||
|
||||
qStringList := QStringList():new()
|
||||
qStringList:append( [/c c:\batches\SetMinGW-harbour-E.bat && hbMK2.exe ] + cHbpPath )
|
||||
::qProcess:start( "cmd.exe", qStringList )
|
||||
#else
|
||||
|
||||
qStringList := QStringList():new()
|
||||
qStringList:append( cHbpPath )
|
||||
//
|
||||
::qProcess:start( "hbmk2", qStringList )
|
||||
|
||||
#endif
|
||||
ELSE
|
||||
cOutput := "" ; cErrors := ""
|
||||
nResult := hb_processRun( ( "hbmk2 " + cHbpPath ), , @cOutput, @cErrors )
|
||||
@@ -800,6 +796,10 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt )
|
||||
IF ( nResult == 0 ) .AND. ( lLaunch )
|
||||
::LaunchProject( cProject )
|
||||
ENDIF
|
||||
|
||||
IF ::lPPO .AND. hb_FileExists( ::cPPO )
|
||||
::oIde:editSource( ::cPPO )
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
ENDIF
|
||||
@@ -808,10 +808,6 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt )
|
||||
FErase( cHbpPath )
|
||||
ENDIF
|
||||
|
||||
IF lPPO .AND. hb_FileExists( cFileName )
|
||||
::oED:showPPO( cFileName )
|
||||
ENDIF
|
||||
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
@@ -866,6 +862,9 @@ METHOD IdeProjManager:readProcessInfo( nMode, i, ii )
|
||||
IF ::lLaunch
|
||||
::launchProject( ::cProjectInProcess )
|
||||
ENDIF
|
||||
IF ::lPPO .AND. hb_FileExists( ::cPPO )
|
||||
::oIde:editSource( ::cPPO )
|
||||
ENDIF
|
||||
ENDCASE
|
||||
|
||||
RETURN nil
|
||||
|
||||
Reference in New Issue
Block a user