2010-01-10 22:54 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)

+ contrib/hbide/resources/folder.png
    + Added new image to be placed on "Property Dialog"s
      folder selection push buttons.

  * contrib/hbide/resources/projectproperties.ui
    + Made resizable. Now it renders more usefulness.

  * contrib/hbide/hbide.prg
  * contrib/hbide/idedocks.prg
  * contrib/hbide/ideeditor.prg
  * contrib/hbide/idemisc.prg
  * contrib/hbide/ideobject.prg
  * contrib/hbide/ideprojmanager.prg
  * contrib/hbide/idesources.prg
    ! Fixed and corrected many artifacts.    
      Mainly in the area of project building, please test.
This commit is contained in:
Pritpal Bedi
2010-01-11 06:59:44 +00:00
parent d9c9010f87
commit 0ccafa6486
10 changed files with 649 additions and 716 deletions

View File

@@ -17,6 +17,24 @@
past entries belonging to author(s): Viktor Szakats.
*/
2010-01-10 22:54 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
+ contrib/hbide/resources/folder.png
+ Added new image to be placed on "Property Dialog"s
folder selection push buttons.
* contrib/hbide/resources/projectproperties.ui
+ Made resizable. Now it renders more usefulness.
* contrib/hbide/hbide.prg
* contrib/hbide/idedocks.prg
* contrib/hbide/ideeditor.prg
* contrib/hbide/idemisc.prg
* contrib/hbide/ideobject.prg
* contrib/hbide/ideprojmanager.prg
* contrib/hbide/idesources.prg
! Fixed and corrected many artifacts.
Mainly in the area of project building, please test.
2010-01-10 16:54 UTC-0300 Vailton Renato (vailtom gmail.com)
* contrib/hbide/ideactions.prg
+ Added new action "CloseOther" referenced in the menu, but missing in

View File

@@ -225,7 +225,6 @@ CLASS HbIde
METHOD manageItemSelected()
METHOD getCurrentTab()
METHOD getCurCursor()
METHOD addSourceInTree()
METHOD createTags()
METHOD manageFocusInEditor()
METHOD loadUI()
@@ -652,9 +651,9 @@ METHOD HbIde:updateProjectTree( aPrj, lRemove )
* Load previous aPath used to fill ::aProjData
* 03/01/2010 - 16:08:25 - vailtom
FOR j := 1 TO LEN( ::aProjData )
IF !hb_isChar( ::aProjData[ j, 5 ] ).OR. ; // It is not a char?
::aProjData[ j, TRE_TYPE ] != 'Path' .OR. ; // Is not an path?
::aProjData[ j, TRE_DATA ] != cProject // Is not from same project?
IF !hb_isChar( ::aProjData[ j, 5 ] ) .OR. ; // It is not a char?
::aProjData[ j, TRE_TYPE ] != 'Path' .OR. ; // Is not an path?
::aProjData[ j, TRE_DATA ] != cProject // Is not from same project?
LOOP
ENDIF
AAdd( aPath, { ::aProjData[ j, TRE_ORIGINAL ], ::aProjData[ j, 1 ]} )
@@ -737,33 +736,6 @@ METHOD HbIde:updateProjectTree( aPrj, lRemove )
/*----------------------------------------------------------------------*/
METHOD HbIde:addSourceInTree( cSourceFile )
LOCAL cPath, cPathA, cFile, cExt, n, oParent
LOCAL oGrand := ::oOpenedSources
IF Empty( cSourceFile )
RETURN nil
End
hb_fNameSplit( cSourceFile, @cPath, @cFile, @cExt )
cPathA := hbide_pathNormalized( cPath )
n := ascan( ::aEditorPath, {|e_| e_[ 2 ] == cPathA } )
IF n == 0
oParent := oGrand:addItem( cPath )
aadd( ::aProjData, { oParent, "Editor Path", oGrand, cPathA, cSourceFile } )
aadd( ::aEditorPath, { oParent, cPathA } )
ELSE
oParent := ::aEditorPath[ n,1 ]
ENDIF
aadd( ::aProjData, { oParent:addItem( cFile+cExt ), "Opened Source", oParent, ;
cSourceFile, hbide_pathNormalized( cSourceFile ) } )
RETURN Self
/*----------------------------------------------------------------------*/
METHOD HbIde:manageItemSelected( oXbpTreeItem )
LOCAL n, cHbi, aPrj

View File

@@ -381,28 +381,21 @@ METHOD IdeDocks:outputDoubleClicked( lSelected )
LOCAL cSource, nLine
IF lSelected
::nPass++
IF ::nPass == 1
qCursor := QTextCursor():configure( ::oOutputResult:oWidget:textCursor() )
cText := QTextBlock():configure( qCursor:block() ):text()
qCursor := QTextCursor():configure( ::oOutputResult:oWidget:textCursor() )
cText := QTextBlock():configure( qCursor:block() ):text()
IF hbide_parseFNfromStatusMsg( cText, @cSource, @nLine, .T. )
::oSM:editSource( cSource, 0, 0, 0, NIL, .f. )
qCursor := QTextCursor():configure( ::oIde:qCurEdit:textCursor() )
nLine := iif( nLine < 1, 0, nLine - 1 )
IF hbide_parseFNfromStatusMsg( cText, @cSource, @nLine, .T. )
::oSM:editSource( cSource, 0, 0, 0, NIL, .f. )
qCursor := QTextCursor():configure( ::oIde:qCurEdit:textCursor() )
nLine := iif( nLine < 1, 0, nLine - 1 )
qCursor:setPosition( 0 )
qCursor:movePosition( QTextCursor_Down, QTextCursor_MoveAnchor, nLine )
::oIde:qCurEdit:setTextCursor( qCursor )
::oIde:manageFocusInEditor()
hbide_dbg( "............", cSource, cText )
ENDIF
ENDIF
IF ::nPass >= 2
::nPass := 0
qCursor:setPosition( 0 )
qCursor:movePosition( QTextCursor_Down, QTextCursor_MoveAnchor, nLine )
::oIde:qCurEdit:setTextCursor( qCursor )
::oIde:manageFocusInEditor()
ENDIF
ENDIF
RETURN nLine
/*----------------------------------------------------------------------*/

View File

@@ -116,6 +116,8 @@ CLASS IdeEditsManager INHERIT IdeObject
METHOD prepareTabWidget()
METHOD exeBlock()
METHOD addSourceInTree()
METHOD removeSourceInTree()
ENDCLASS
@@ -172,6 +174,45 @@ METHOD IdeEditsManager:prepareTabWidget()
/*----------------------------------------------------------------------*/
METHOD IdeEditsManager:removeSourceInTree( cSourceFile )
LOCAL n
IF !Empty( cSourceFile )
IF ( n := aScan( ::aProjData, {|e_| e_[ TRE_ORIGINAL ] == cSourceFile .AND. e_[ 2 ] == "Opened Source" } ) ) > 0
::aProjData[ n,3 ]:delItem( ::oIde:aProjData[ n,1 ] )
hb_adel( ::aProjData, n, .T. )
ENDIF
ENDIF
RETURN Self
/*----------------------------------------------------------------------*/
METHOD IdeEditsManager:addSourceInTree( cSourceFile )
LOCAL cPath, cPathA, cFile, cExt, n, oParent
LOCAL oGrand := ::oOpenedSources
IF Empty( cSourceFile )
RETURN nil
End
hb_fNameSplit( cSourceFile, @cPath, @cFile, @cExt )
cPathA := hbide_pathNormalized( cPath )
IF ( n := ascan( ::aEditorPath, {|e_| e_[ 2 ] == cPathA } ) ) == 0
oParent := oGrand:addItem( cPath )
aadd( ::aProjData, { oParent, "Editor Path", oGrand, cPathA, cSourceFile } )
aadd( ::aEditorPath, { oParent, cPathA } )
ELSE
oParent := ::aEditorPath[ n,1 ]
ENDIF
aadd( ::aProjData, { oParent:addItem( cFile + cExt ), "Opened Source", oParent, ;
cSourceFile, hbide_pathNormalized( cSourceFile ) } )
RETURN Self
/*----------------------------------------------------------------------*/
METHOD IdeEditsManager:exeBlock( nMode, p )
//LOCAL qObj
@@ -708,7 +749,8 @@ METHOD IdeEditor:create( oIde, cSourceFile, nPos, nHPos, nVPos, cTheme )
::oIde:nCurTab := len( ::oIde:aTabs )
/* Populate right at creation */
::oIde:addSourceInTree( ::sourceFile )
//::oIde:addSourceInTree( ::sourceFile )
::oEM:addSourceInTree( ::sourceFile )
::qTabWidget:setStyleSheet( GetStyleSheet( "QTabWidget" ) )
::setTabImage()
@@ -874,7 +916,6 @@ METHOD IdeEditor:closeTab( mp1, mp2, oXbp )
RETURN Self
/*----------------------------------------------------------------------*/
/*
* Remove the tab of the main screen and clean the objects from memory.Note that
* this function does not question the User if he wants to save or not the
@@ -887,7 +928,6 @@ METHOD IdeEditor:removeTabPage()
LOCAL n
n := aScan( ::oIde:aTabs, {|e_| e_[ TAB_OEDITOR ]:nID == ::nID } )
IF n > 0
hb_aDel( ::oIde:aTabs, n, .T. )
ENDIF
@@ -895,13 +935,11 @@ METHOD IdeEditor:removeTabPage()
n := ::oIde:qTabWidget:indexOf( ::oTab:oWidget )
::oIde:qTabWidget:removeTab( n )
/* Destroy all objects */
// { oTab, qEdit, qHiliter, qLayout, cSourceFile, qDocument }
//
IF !Empty( ::qEdit )
Qt_Slots_disConnect( ::pSlots, ::qEdit, "textChanged()" )
Qt_Slots_disConnect( ::pSlots, ::qEdit, "cursorPositionChanged()" )
/* To avoid recursive calls on invalid pointers */
ENDIF
IF !Empty( ::qDocument )
@@ -927,29 +965,12 @@ METHOD IdeEditor:removeTabPage()
::oIde:oFuncList:clear()
ENDIF
IF !Empty( ::oTab )
// ::oTab:Destroy()
// ::oTab:pPtr := 0
// ::oTab := nil
ENDIF
IF ( n := aScan( ::oIde:aProjData, {|e_| e_[ 4 ] == cSource } ) ) > 0
::aProjData[ n,3 ]:delItem( ::oIde:aProjData[ n,1 ] )
hb_aDel( ::aProjData, n, .T. )
ENDIF
::oEM:removeSourceInTree( cSource )
IF ( n := aScan( ::oIde:aEdits, {|e_| e_:nID == ::nID } ) ) > 0
hb_aDel( ::oIde:aEdits, n, .T. )
ENDIF
/*
* TOFIX: Release memory from these objects & arrays
*
* aTabs - OK
* aSources
* aEdits - OK
*
*/
IF ::qTabWidget:count() == 0
IF ::lDockRVisible
::oDockR:hide()

View File

@@ -501,13 +501,14 @@ FUNCTION hbide_isValidPath( cPath, cPathDescr )
IF hb_dirExists( cPath )
RETURN .T.
End
ENDIF
IF empty( cPathDescr )
MsgBox( 'The specified path is invalid "' + cPath + '"' )
ELSE
MsgBox( 'The specified path is invalid for ' + cPathDescr + ': "' + cPath + '"' )
End
//MsgBox( 'The specified path is invalid for ' + cPathDescr + ': "' + cPath + '"' )
MsgBox( 'The specified path is invalid for : "' + cPath + '"', cPathDescr )
ENDIF
RETURN .F.
/*----------------------------------------------------------------------*/

View File

@@ -88,55 +88,50 @@ CLASS IdeObject
ACCESS aMeta INLINE ::oIde:aMeta
ACCESS qCurEdit INLINE ::oIde:qCurEdit
ACCESS oCurEditor INLINE ::oIde:oCurEditor
ACCESS qTabWidget INLINE ::oIde:oDA:oTabWidget:oWidget
ACCESS qBrushWrkProject INLINE ::oIde:qBrushWrkProject
ACCESS cWrkProject INLINE ::oIde:cWrkProject
ACCESS cWrkTheme INLINE ::oIde:cWrkTheme
ACCESS aProjects INLINE ::oIde:aProjects
ACCESS aINI INLINE ::oIde:aINI
ACCESS aEdits INLINE ::oIde:aEdits
ACCESS aSources INLINE ::oIde:aSources
ACCESS oFont INLINE ::oIde:oFont
ACCESS oThemes INLINE ::oIde:oThemes
ACCESS oSBar INLINE ::oIde:oSBar
ACCESS oDlg INLINE ::oIde:oDlg
ACCESS qDlg INLINE ::oIde:oDlg:oWidget
ACCESS oDA INLINE ::oIde:oDA
ACCESS qCurEdit INLINE ::oIde:qCurEdit
ACCESS oCurEditor INLINE ::oIde:oCurEditor
ACCESS qTabWidget INLINE ::oIde:oDA:oTabWidget:oWidget
ACCESS qBrushWrkProject INLINE ::oIde:qBrushWrkProject
ACCESS cWrkProject INLINE ::oIde:cWrkProject
ACCESS cWrkTheme INLINE ::oIde:cWrkTheme
ACCESS resPath INLINE ::oIde:resPath
ACCESS pathSep INLINE ::oIde:pathSep
ACCESS aProjects INLINE ::oIde:aProjects
ACCESS aINI INLINE ::oIde:aINI
ACCESS aEdits INLINE ::oIde:aEdits
ACCESS aSources INLINE ::oIde:aSources
ACCESS aEditorPath INLINE ::oIde:aEditorPath
ACCESS aProjData INLINE ::oIde:aProjData
ACCESS aTabs INLINE ::oIde:aTabs
ACCESS oDockPT INLINE ::oIde:oDockPT
ACCESS oProjTree INLINE ::oIde:oProjTree
ACCESS oProjRoot INLINE ::oIde:oProjRoot
ACCESS aProjData INLINE ::oIde:aProjData
ACCESS oDockED INLINE ::oIde:oDockED
ACCESS oEditTree INLINE ::oIde:oEditTree
ACCESS oOpenedSources INLINE ::oIde:oOpenedSources
ACCESS oDockR INLINE ::oIde:oDockR
ACCESS oFuncList INLINE ::oIde:oFuncList
ACCESS oDockB INLINE ::oIde:oDockB
ACCESS oCompileResult INLINE ::oIde:oCompileResult
ACCESS oDockB1 INLINE ::oIde:oDockB1
ACCESS oLinkResult INLINE ::oIde:oLinkResult
ACCESS oDockB2 INLINE ::oIde:oDockB2
ACCESS oOutputResult INLINE ::oIde:oOutputResult
ACCESS resPath INLINE ::oIde:resPath
ACCESS pathSep INLINE ::oIde:pathSep
ACCESS oFont INLINE ::oIde:oFont
ACCESS oThemes INLINE ::oIde:oThemes
ACCESS aTabs INLINE ::oIde:aTabs
ACCESS lProjTreeVisible INLINE ::oIde:lProjTreeVisible
ACCESS lDockRVisible INLINE ::oIde:lDockRVisible
ACCESS lDockBVisible INLINE ::oIde:lDockBVisible
ACCESS lTabCloseRequested INLINE ::oIde:lTabCloseRequested
ACCESS oSBar INLINE ::oIde:oSBar
DATA aSlots INIT {}
DATA aEvents INIT {}

View File

@@ -106,21 +106,53 @@ CLASS IdeProject
DATA compilers INIT ""
METHOD new()
METHOD applyMeta( s )
METHOD expandMeta( s )
ENDCLASS
/*----------------------------------------------------------------------*/
METHOD IdeProject:expandMeta( s )
LOCAL k
LOCAL a_:= ::metaData
IF ! Empty( a_ )
FOR EACH k IN a_ DESCEND
s := StrTran( hbide_pathNormalized( s, .f. ), k[ 1 ], k[ 2 ] )
NEXT
ENDIF
RETURN s
/*----------------------------------------------------------------------*/
METHOD IdeProject:applyMeta( s )
LOCAL k
LOCAL a_:= ::metaData
//LOCAL ss := s
IF ! Empty( a_ )
FOR EACH k IN a_
s := StrTran( hbide_pathNormalized( s, .f. ), k[ 2 ], k[ 1 ] )
NEXT
ENDIF
//MsgBox( ss + " => " + s )
RETURN s
/*----------------------------------------------------------------------*/
METHOD IdeProject:new( aProps )
LOCAL b_, a_
IF hb_isArray( aProps )
IF hb_isArray( aProps ) .AND. !empty( aProps )
::aProjProps := aProps
b_:= aProps[ 3 ]
b_:= aProps
::normalizedName := b_[ 1 ]
::fileName := b_[ 2 ]
//::normalizedName := b_[ 1 ]
//::fileName := b_[ 2 ]
a_:= b_[ PRJ_PRP_PROPERTIES, 2 ]
@@ -133,17 +165,22 @@ METHOD IdeProject:new( aProps )
::launchParams := a_[ E_oPrjLau ]
::launchProgram := a_[ E_oPrjLEx ]
::hbpFlags := b_[ PRJ_PRP_FLAGS , 2 ]
::sources := b_[ PRJ_PRP_SOURCES , 2 ]
::metaData := b_[ PRJ_PRP_METADATA, 2 ]
::hbpFlags := aclone( b_[ PRJ_PRP_FLAGS , 2 ] )
::sources := aclone( b_[ PRJ_PRP_SOURCES , 2 ] )
::metaData := aclone( b_[ PRJ_PRP_METADATA, 2 ] )
::dotHbp := ""
::compilers := ""
FOR EACH a_ IN ::metaData
a_[ 2 ] := hbide_pathNormalized( a_[ 2 ], .f. )
NEXT
ENDIF
RETURN Self
/*----------------------------------------------------------------------*/
// IdeProjectManager
/*----------------------------------------------------------------------*/
CLASS IdeProjManager INHERIT IdeObject
@@ -178,8 +215,10 @@ CLASS IdeProjManager INHERIT IdeObject
METHOD buildProject()
METHOD readProcessInfo()
METHOD getProjectProperties()
METHOD getProject()
METHOD getProjectByTitle()
METHOD getProjectByFile()
METHOD buildProcess()
METHOD updateMetaData()
ENDCLASS
@@ -258,6 +297,9 @@ METHOD IdeProjManager:loadProperties( cProjFileName, lNew, lFetch, lUpdateTree )
ENDIF
IF lFetch
/* Access/Assign via this object */
::oProject := IdeProject():new( ::aPrjProps )
//
::fetchProperties()
IF !empty( ::cSaveTo ) .and. hb_FileExists( ::cSaveTo )
cProjFileName := ::cSaveTo
@@ -266,7 +308,7 @@ METHOD IdeProjManager:loadProperties( cProjFileName, lNew, lFetch, lUpdateTree )
ENDIF
IF n == 0
aadd( ::oIde:aProjects, { lower( cProjFileName ), cProjFileName, aclone( ::aPrjProps ) } )
aadd( ::oIde:aProjects, { hbide_pathNormalized( cProjFileName ), cProjFileName, aclone( ::aPrjProps ) } )
IF lUpdateTree
::oIde:updateProjectTree( ::aPrjProps )
ENDIF
@@ -286,6 +328,7 @@ METHOD IdeProjManager:loadProperties( cProjFileName, lNew, lFetch, lUpdateTree )
/*----------------------------------------------------------------------*/
METHOD IdeProjManager:fetchProperties()
LOCAL cLukupPng
LOCAL cPrjLoc := hb_dirBase() + "projects"
::oUI := XbpQtUiLoader():new( ::oDlg )
@@ -307,18 +350,21 @@ METHOD IdeProjManager:fetchProperties()
::oUI:q_comboPrjType:setCurrentIndex( 0 )
ENDCASE
::oUI:q_buttonChoosePrjLoc:setIcon( ::resPath + "lookup.png" )
::oUI:q_buttonChooseWd:setIcon( ::resPath + "lookup.png" )
::oUI:q_buttonChooseDest:setIcon( ::resPath + "lookup.png" )
cLukupPng := ::resPath + "folder.png"
::oUI:q_buttonChoosePrjLoc:setIcon( cLukupPng )
::oUI:q_buttonChooseWd:setIcon( cLukupPng )
::oUI:q_buttonChooseDest:setIcon( cLukupPng )
::oUI:signal( "buttonCn" , "clicked()", {|| ::oUI:oWidget:close() } )
::oUI:signal( "buttonSave" , "clicked()", {|| ::save( .F. ) } )
::oUI:signal( "buttonSaveExit" , "clicked()", {|| ::save( .T. ) } )
::oUI:signal( "buttonSelect" , "clicked()", {|| ::addSources() } )
::oUI:signal( "tabWidget" , "currentChanged(int)", {|o,p| ::updateHbp( p, o ) } )
::oUI:signal( "editMetaData" , "textChanged()", {|o| ::updateMetaData( o ) } )
::oUI:signal( "buttonChoosePrjLoc", "clicked()", {|| ::PromptForPath( 'editPrjLoctn', 'Choose the Project Location...', 'editOutName', "editWrkFolder", "editDstFolder" ) } )
::oUI:signal( "buttonChooseWd" , "clicked()", {|| ::PromptForPath( 'editWrkFolder', 'Choose a Working Folder...' ) } )
::oUI:signal( "buttonChoosePrjLoc", "clicked()", {|| ::PromptForPath( 'editPrjLoctn', 'Choose the Project Location...' ) } )//, ;
// 'editOutName', "editWrkFolder", "editDstFolder" ) } )
::oUI:signal( "buttonChooseWd" , "clicked()", {|| ::PromptForPath( 'editWrkFolder', 'Choose a Working Folder...' ) } )
::oUI:signal( "buttonChooseDest" , "clicked()", {|| ::PromptForPath( 'editDstFolder', 'Choose a Destination Folder...' ) } )
IF empty( ::aPrjProps )
@@ -327,14 +373,14 @@ METHOD IdeProjManager:fetchProperties()
* will adjust the other parameters. (vailtoms)
* 25/12/2009 - 20:40:22
*/
::oUI:q_editPrjLoctn:setText( StrTran( cPrjLoc, '\', '/' ) )
::oUI:q_editPrjLoctn:setText( hbide_pathNormalized( cPrjLoc, .F. ) )
ELSE
::oUI:q_editPrjTitle:setText( ::aPrjProps[ PRJ_PRP_PROPERTIES, 1, PRJ_PRP_TITLE ] )
::oUI:q_editPrjLoctn:setText( ::aPrjProps[ PRJ_PRP_PROPERTIES, 1, PRJ_PRP_LOCATION ] )
::oUI:q_editWrkFolder:setText( ::aPrjProps[ PRJ_PRP_PROPERTIES, 1, PRJ_PRP_WRKFOLDER ] )
::oUI:q_editDstFolder:setText( ::aPrjProps[ PRJ_PRP_PROPERTIES, 1, PRJ_PRP_DSTFOLDER ] )
::oUI:q_editOutName:setText( ::aPrjProps[ PRJ_PRP_PROPERTIES, 1, PRJ_PRP_OUTPUT ] )
::oUI:q_editPrjTitle:setText( ::oProject:applyMeta( ::oProject:title ) )
::oUI:q_editPrjLoctn:setText( ::oProject:applyMeta( ::oProject:location ) )
::oUI:q_editWrkFolder:setText( ::oProject:applyMeta( ::oProject:wrkDirectory ) )
::oUI:q_editDstFolder:setText( ::oProject:applyMeta( ::oProject:destination ) )
::oUI:q_editOutName:setText( ::oProject:outputName )
::oUI:q_editFlags:setPlainText( hbide_arrayToMemo( ::aPrjProps[ PRJ_PRP_FLAGS , 1 ] ) )
::oUI:q_editSources:setPlainText( hbide_arrayToMemo( ::aPrjProps[ PRJ_PRP_SOURCES , 1 ] ) )
@@ -354,7 +400,7 @@ METHOD IdeProjManager:fetchProperties()
::oUI:oWidget:setWindowTitle( 'Properties for "' + ::oUI:q_editPrjTitle:Text() + '"' )
ENDIF
::setPosByIni( ::oUI:oWidget, PropsDialogGeometry )
::setPosAndSizeByIni( ::oUI:oWidget, PropsDialogGeometry )
//
::oUI:exec()
//
@@ -369,42 +415,74 @@ METHOD IdeProjManager:fetchProperties()
/*----------------------------------------------------------------------*/
METHOD IdeProjManager:updateMetaData()
LOCAL a_, s, n, cKey, cVal
LOCAL a4_1 := {}
hbide_dbg( "updateMetaData" )
a_:= hbide_memoToArray( ::oUI:q_editMetaData:toPlainText() )
FOR EACH s IN a_
IF !( "#" == left( s,1 ) )
IF ( n := at( "=", s ) ) > 0
cKey := alltrim( substr( s, 1, n-1 ) )
cVal := hbide_evalAsString( alltrim( substr( s, n+1 ) ) )
aadd( a4_1, { "<"+ cKey +">", cVal } )
ENDIF
ENDIF
NEXT
::oProject:metaData := a4_1
RETURN Self
/*----------------------------------------------------------------------*/
METHOD IdeProjManager:save( lCanClose )
LOCAL a_, a4_1, lOk
LOCAL typ_:= { "Executable", "Lib", "Dll" }
LOCAL txt_:= {}
LOCAL a_, lOk, cPath, txt_
* Validate certain parameters before continuing ... (vailtom)
IF Empty( ::oUI:q_editOutName:text() )
IF Empty( ::oUI:q_editPrjTitle:text() )
MsgBox( 'Invalid Output FileName!' )
::oUI:q_editOutName:setFocus()
RETURN .F.
ENDIF
::oUI:q_editOutName:setText( ::oUI:q_editPrjTitle:text() )
ENDIF
/* Title cannot be the output name, but reverse is possible
--------------------------------------------------------
We must also consider that user may be building the project in parts
OR may be basic definition must be in place
*/
IF Empty( ::oUI:q_editPrjTitle:text() )
::oUI:q_editPrjTitle:setText( ::oUI:q_editOutName:text() )
ENDIF
IF !hbide_isValidPath( ::oUI:q_editPrjLoctn:text(), 'Project Location' )
IF Empty( ::oUI:q_editOutName:text() )
MsgBox( 'Invalid Output FileName' )
::oUI:q_editOutName:setFocus()
RETURN .F.
ENDIF
/* This must be valid, we cannot skip */
IF !hbide_isValidPath( ::oProject:expandMeta( ::oUI:q_editPrjLoctn:text() ), 'Project Location' )
::oUI:q_editPrjLoctn:setFocus()
RETURN .F.
ENDIF
IF !hbide_isValidPath( ::oUI:q_editWrkFolder:text(), 'Working Folder' )
::oUI:q_editWrkFolder:setText( ::oUI:q_editPrjLoctn:text() )
RETURN .F.
/* This we can skip now: later at project building we can check: TO:RECONSIDER */
IF !empty( cPath := ::oUI:q_editWrkFolder:text() )
IF !hbide_isValidPath( ::oProject:expandMeta( cPath ), 'Working Folder' )
// ::oUI:q_editWrkFolder:setText( ::oUI:q_editPrjLoctn:text() )
RETURN .F.
ENDIF
ENDIF
IF !hbide_isValidPath( ::oUI:q_editDstFolder:text(), 'Destination Folder' )
::oUI:q_editDstFolder:setText( ::oUI:q_editPrjLoctn:text() )
RETURN .F.
/* This we can skip now: later at project building we can check: TO:RECONSIDER */
IF !empty( cPath := ::oUI:q_editDstFolder:text() )
IF !hbide_isValidPath( ::oProject:expandMeta( cPath ), 'Destination Folder' )
// ::oUI:q_editDstFolder:setText( ::oUI:q_editPrjLoctn:text() )
RETURN .F.
ENDIF
ENDIF
txt_:= {}
//
aadd( txt_, "[ PROPERTIES ]" )
aadd( txt_, "Type = " + typ_[ ::oUI:q_comboPrjType:currentIndex()+1 ] )
aadd( txt_, "Type = " + { "Executable", "Lib", "Dll" }[ ::oUI:q_comboPrjType:currentIndex()+1 ] )
aadd( txt_, "Title = " + ::oUI:q_editPrjTitle:text() )
aadd( txt_, "Location = " + ::oUI:q_editPrjLoctn:text() )
aadd( txt_, "WorkingFolder = " + ::oUI:q_editWrkFolder:text() )
@@ -413,14 +491,15 @@ METHOD IdeProjManager:save( lCanClose )
aadd( txt_, "LaunchParams = " + ::oUI:q_editLaunchParams:text() )
aadd( txt_, "LaunchProgram = " + ::oUI:q_editLaunchExe:text() )
aadd( txt_, " " )
//
aadd( txt_, "[ FLAGS ]" )
a_:= hbide_memoToArray( ::oUI:q_editFlags:toPlainText() ); aeval( a_, {|e| aadd( txt_, e ) } ) ; aadd( txt_, " " )
a_:= hbide_memoToArray( ::oUI:q_editFlags:toPlainText() ) ; aeval( a_, {|e| aadd( txt_, e ) } ) ; aadd( txt_, " " )
aadd( txt_, "[ SOURCES ]" )
a_:= hbide_memoToArray( ::oUI:q_editSources:toPlainText() ); aeval( a_, {|e| aadd( txt_, e ) } ) ; aadd( txt_, " " )
a_:= hbide_memoToArray( ::oUI:q_editSources:toPlainText() ) ; aeval( a_, {|e| aadd( txt_, e ) } ) ; aadd( txt_, " " )
aadd( txt_, "[ METADATA ]" )
a_:= hbide_memoToArray( ::oUI:q_editMetaData:toPlainText() ); aeval( a_, {|e| aadd( txt_, e ) } ) ; aadd( txt_, " " )
#if 0
/* Setup Meta Keys */
a4_1 := hbide_setupMetaKeys( a_ )
@@ -429,6 +508,13 @@ METHOD IdeProjManager:save( lCanClose )
hbide_parseWithMetaData( ::oUI:q_editOutName:text(), a4_1 ) + ;
".hbi"
::cSaveTo := hbide_pathToOSPath( ::cSaveTo )
#endif
::cSaveTo := ::oProject:expandMeta( ::oUI:q_editPrjLoctn:text() ) + ;
::pathSep + ;
::oProject:expandMeta( ::oUI:q_editOutName:text() ) + ;
".hbi"
::cSaveTo := hbide_pathToOSPath( ::cSaveTo )
IF ( lOk := hbide_createTarget( ::cSaveTo, txt_ ) )
*MsgBox( 'The project file was saved successfully: ' + ::cSaveTo, 'Saving project ...' )
@@ -497,7 +583,7 @@ METHOD IdeProjManager:updateHbp( iIndex )
METHOD IdeProjManager:addSources()
LOCAL aFiles, a_, b_, a4_1, s
IF !empty( aFiles := ::selectSource( "openmany" ) )
IF !empty( aFiles := ::oSM:selectSource( "openmany" ) )
a_:= hbide_memoToArray( ::oUI:q_editMetaData:toPlainText() )
a4_1 := hbide_setupMetaKeys( a_ )
@@ -627,10 +713,10 @@ METHOD IdeProjManager:selectCurrentProject()
/*----------------------------------------------------------------------*/
METHOD IdeProjManager:getProjectProperties( cProject )
METHOD IdeProjManager:getProjectProperties( cProjectTitle )
LOCAL n
IF ( n := ascan( ::aProjects, {|e_, x| x := e_[ 3 ], x[ 1, 2, PRJ_PRP_TITLE ] == cProject } ) ) > 0
IF ( n := ascan( ::aProjects, {|e_, x| x := e_[ 3 ], x[ 1, 2, PRJ_PRP_TITLE ] == cProjectTitle } ) ) > 0
RETURN ::aProjects[ n, 3 ]
ENDIF
@@ -638,10 +724,12 @@ METHOD IdeProjManager:getProjectProperties( cProject )
/*----------------------------------------------------------------------*/
METHOD IdeProjManager:getProject( cProject )
METHOD IdeProjManager:getProjectByFile( cProjectFile )
LOCAL n, aProj
IF ( n := ascan( ::aProjects, {|e_, x| x := e_[ 3 ], x[ 1, 2, PRJ_PRP_TITLE ] == cProject } ) ) > 0
cProjectFile := hbide_pathNormalized( cProjectFile )
IF ( n := ascan( ::aProjects, {|e_| e_[ 1 ] == cProjectFile } ) ) > 0
aProj := ::aProjects[ n ]
ENDIF
@@ -649,6 +737,17 @@ METHOD IdeProjManager:getProject( cProject )
/*----------------------------------------------------------------------*/
METHOD IdeProjManager:getProjectByTitle( cProjectTitle )
LOCAL n, aProj
IF ( n := ascan( ::aProjects, {|e_, x| x := e_[ 3 ], x[ 1, 2, PRJ_PRP_TITLE ] == cProjectTitle } ) ) > 0
aProj := ::aProjects[ n, 3 ]
ENDIF
RETURN IdeProject():new( aProj )
/*----------------------------------------------------------------------*/
METHOD IdeProjManager:closeProject( cProject )
LOCAL nPos
@@ -660,14 +759,11 @@ METHOD IdeProjManager:closeProject( cProject )
DEFAULT cProject TO ::getCurrentProject()
nPos := ascan( ::aProjects, {|e_| e_[ 3, PRJ_PRP_PROPERTIES, 2, E_oPrjTtl ] == cProject } )
IF ( nPos < 0 )
MsgBox( 'Invalid project: "' + cProject + '"' )
RETURN Self
ENDIF
* aadd( ::aProjects, { lower( cProject ), cProject, aclone( ::aPrjProps ) } )
::aPrjProps := {}
::updateProjectTree( ::aProjects[ nPos, 3 ], .T. )
hb_adel( ::aProjects, nPos, .T. )
@@ -682,28 +778,28 @@ METHOD IdeProjManager:closeProject( cProject )
METHOD IdeProjManager:promptForPath( cObjPathName, cTitle, cObjFileName, cObjPath2, cObjPath3 )
LOCAL cTemp, cPath, cFile
cTemp := ::oProject:expandMeta( ::oUI:qObj[ cObjPathName ]:Text() )
IF !hb_isChar( cObjFileName )
cTemp := ::oUI:qObj[ cObjPathName ]:Text()
cPath := hbide_fetchADir( ::oDlg, cTitle, cTemp )
cPath := StrTran( cPath, "\", "/" )
ELSE
cTemp := ::oUI:qObj[ cObjPathName ]:Text()
cTemp := hbide_fetchAFile( ::oDlg, cTitle, { { "Harbour IDE Projects", "*.hbi" } }, cTemp )
IF !Empty( cTemp )
cTemp := strtran( cTemp, "\", '/' )
hb_fNameSplit( cTemp, @cPath, @cFile )
hb_fNameSplit( hbide_pathNormalized( cTemp, .f. ), @cPath, @cFile )
::oUI:qObj[ cObjFileName ]:setText( cFile )
ENDIF
ENDIF
IF !Empty( cPath )
IF Right( cPath, 1 ) == '/'
IF Right( cPath, 1 ) $ '/\'
cPath := Left( cPath, Len( cPath ) - 1 )
ENDIF
cPath := ::oProject:applyMeta( cPath )
::oUI:qObj[ cObjPathName ]:setText( cPath )
IF hb_isChar( cObjPath2 ) .AND. Empty( ::oUI:qObj[ cObjPath2 ]:Text() )
@@ -749,7 +845,7 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt )
lRebuild := .t.
ENDIF
::oProject := ::getProject( cProject )
::oProject := ::getProjectByTitle( cProject )
//cTargetFN := aPrj[ PRJ_PRP_PROPERTIES, 2, PRJ_PRP_LOCATION ] + ::pathSep + aPrj[ PRJ_PRP_PROPERTIES, 2, PRJ_PRP_OUTPUT ]
cTargetFN := hbide_pathToOSPath( ::oProject:location + ::pathSep + ;

View File

@@ -318,15 +318,15 @@ METHOD IdeSourcesManager:closeAllOthers( nTab )
RETURN .F.
ENDIF
nID := oEdit:nID
nTab:= 0
nID := oEdit:nID
nTab := 0
* Finally now we will close all tabs.
DO WHILE ( ++nTab <= Len( ::aTabs ) )
oEdit := ::oEM:getEditorByTabPosition( nTab )
IF empty(oEdit) .OR. oEdit:nID == nID
oEdit := ::oEM:getEditorByTabPosition( nTab )
IF empty( oEdit ) .OR. oEdit:nID == nID
LOOP
ENDIF
@@ -380,7 +380,7 @@ METHOD IdeSourcesManager:revertSource( nTab )
IF nTab < 1
RETURN .F.
End
ENDIF
IF !::aTabs[ nTab, TAB_QDOCUMENT ]:isModified()
* File has not changed, ignore the question to User

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

File diff suppressed because it is too large Load Diff