From 377582ef4dbc9edc4d5c61a6ce6da3c143818929 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Wed, 3 Mar 2010 09:02:05 +0000 Subject: [PATCH] 2010-03-03 01:00 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbqt/hbqt_garbage.h * contrib/hbqt/THbQtUI.prg ! A massive effort to stream-line GPF at exit. At least now I know that it is caused by the way QLayout has relation with parent and children both. To some extent I am been able to cover it, but not completely, at least till now. * contrib/hbxbp/xbptreeview.prg + Implemented tooltip and changed the way context menu is fired. - contrib/hbide/projects/hbide.hbi ! Totally abandoned .hbi project protocol. * contrib/hbide/resources/environments.ui * contrib/hbide/resources/environments.uic * contrib/hbide/resources/projectpropertiesex.ui * contrib/hbide/resources/projectpropertiesex.uic * contrib/hbide/resources/themesex.ui * contrib/hbide/resources/themesex.uic ! Simplified layouts to cover GPFs at exit. * contrib/hbide/hbide.hbp + Added ideenviron.prg. * contrib/hbide/hbide.prg * contrib/hbide/idedocks.prg * contrib/hbide/ideeditor.prg + contrib/hbide/ideenviron.prg * contrib/hbide/idefindreplace.prg * contrib/hbide/ideharbourhelp.prg * contrib/hbide/idemisc.prg * contrib/hbide/ideobject.prg * contrib/hbide/ideprojmanager.prg * contrib/hbide/idesources.prg * contrib/hbide/idethemes.prg + Restructured project management. + Implemented: .hbp as project definition protocol. Exploited -3rd= token to keep hbIDE specific data. Now you can open any existing .hbp and build it out of the box. You must have set the build env beforehand OR take use of hbIDE's .env protocol. + Implemented: relative paths. The relative paths are are computed downwards and from .hbp location. Upper level paths still remain absolute. If your projects structure is well thought of, then this feature means this project tree is transferable across different OS's and drives. The relative paths posed many difficulties. The facts had to be resolved while search operations, while opening the files from Project Tree, and more. Now all are in perfect syncronization. + Managed: .hbp filters on source level and are handelled transparently. In Project Tree source is shown without filters. Search operations are also transparent. So, an entry like: {msvc|bcc}vouch/scandocument.prg is respected by hbIDE. ! The other changes: - Project Properties dialogs contents. It is now very simple to understand and manage. - Concept of meta-data is eliminated. - The output executable is automatically recognized from linker output. So "Destination folder" is kept for only "Launch" option which, in fact, does not know where executable is located. "Build & Launch" and "Rebuild & Launch" options do not look for "Destination folder" at all. - Project location is always pulled from .hbp file. It is not retained anywhere to make the project portable. - Many more facts I cannot recollect at present. ; TODO: {hbmk2} slot in hbide.env protocol to pass command-line parameters. ; NOTE: delete hbide.ini, idesettings.ini, all .hbi's and start with clean state. Regression is highly possible and I am eager to hear from you. This commit is just for stramlining project management, though there few other features implemented less important to mention. --- harbour/ChangeLog | 96 ++ harbour/contrib/hbide/hbide.hbp | 19 +- harbour/contrib/hbide/hbide.prg | 118 ++- harbour/contrib/hbide/idedocks.prg | 58 +- harbour/contrib/hbide/ideeditor.prg | 105 +- harbour/contrib/hbide/ideenviron.prg | 284 +++++ harbour/contrib/hbide/idefindreplace.prg | 14 +- harbour/contrib/hbide/ideharbourhelp.prg | 30 +- harbour/contrib/hbide/idemisc.prg | 133 ++- harbour/contrib/hbide/ideobject.prg | 3 + harbour/contrib/hbide/ideprojmanager.prg | 983 ++++++++---------- harbour/contrib/hbide/idesources.prg | 6 +- harbour/contrib/hbide/idethemes.prg | 35 +- harbour/contrib/hbide/projects/hbide.hbi | 44 - .../contrib/hbide/resources/environments.ui | 206 ++-- .../contrib/hbide/resources/environments.uic | 82 +- .../hbide/resources/projectpropertiesex.ui | 185 ++-- .../hbide/resources/projectpropertiesex.uic | 174 +--- harbour/contrib/hbide/resources/themesex.ui | 328 +++--- harbour/contrib/hbide/resources/themesex.uic | 169 ++- harbour/contrib/hbqt/THbQtUI.prg | 106 +- harbour/contrib/hbqt/hbqt_garbage.h | 2 - harbour/contrib/hbxbp/xbptreeview.prg | 37 +- 23 files changed, 1766 insertions(+), 1451 deletions(-) create mode 100644 harbour/contrib/hbide/ideenviron.prg delete mode 100644 harbour/contrib/hbide/projects/hbide.hbi diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b6a812ff42..b7130f7d92 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,102 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-03-03 01:00 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * contrib/hbqt/hbqt_garbage.h + * contrib/hbqt/THbQtUI.prg + ! A massive effort to stream-line GPF at exit. + At least now I know that it is caused by the way + QLayout has relation with parent and children both. + To some extent I am been able to cover it, but not + completely, at least till now. + + * contrib/hbxbp/xbptreeview.prg + + Implemented tooltip and changed the way context menu is fired. + + - contrib/hbide/projects/hbide.hbi + ! Totally abandoned .hbi project protocol. + + * contrib/hbide/resources/environments.ui + * contrib/hbide/resources/environments.uic + * contrib/hbide/resources/projectpropertiesex.ui + * contrib/hbide/resources/projectpropertiesex.uic + * contrib/hbide/resources/themesex.ui + * contrib/hbide/resources/themesex.uic + ! Simplified layouts to cover GPFs at exit. + + * contrib/hbide/hbide.hbp + + Added ideenviron.prg. + + * contrib/hbide/hbide.prg + * contrib/hbide/idedocks.prg + * contrib/hbide/ideeditor.prg + + contrib/hbide/ideenviron.prg + * contrib/hbide/idefindreplace.prg + * contrib/hbide/ideharbourhelp.prg + * contrib/hbide/idemisc.prg + * contrib/hbide/ideobject.prg + * contrib/hbide/ideprojmanager.prg + * contrib/hbide/idesources.prg + * contrib/hbide/idethemes.prg + + + Restructured project management. + + + Implemented: .hbp as project definition protocol. + Exploited -3rd= token to keep hbIDE specific data. + Now you can open any existing .hbp and build it + out of the box. You must have set the build env + beforehand OR take use of hbIDE's .env protocol. + + + Implemented: relative paths. The relative paths are + are computed downwards and from .hbp location. + Upper level paths still remain absolute. If your + projects structure is well thought of, then this + feature means this project tree is transferable + across different OS's and drives. + + The relative paths posed many difficulties. The + facts had to be resolved while search operations, + while opening the files from Project Tree, and more. + Now all are in perfect syncronization. + + + Managed: .hbp filters on source level and are + handelled transparently. In Project Tree source + is shown without filters. Search operations are + also transparent. So, an entry like: + {msvc|bcc}vouch/scandocument.prg + is respected by hbIDE. + + ! The other changes: + - Project Properties dialogs contents. + It is now very simple to understand and manage. + + - Concept of meta-data is eliminated. + + - The output executable is automatically recognized + from linker output. So "Destination folder" is + kept for only "Launch" option which, in fact, does + not know where executable is located. "Build & Launch" + and "Rebuild & Launch" options do not look for + "Destination folder" at all. + + - Project location is always pulled from .hbp file. + It is not retained anywhere to make the project + portable. + + - Many more facts I cannot recollect at present. + + ; TODO: {hbmk2} slot in hbide.env protocol to pass + command-line parameters. + + ; NOTE: delete hbide.ini, idesettings.ini, all .hbi's + and start with clean state. + + Regression is highly possible and I am eager + to hear from you. This commit is just for + stramlining project management, though there + few other features implemented less important + to mention. + 2010-03-03 03:13 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbmisc/hbeditc.c ! One fix to prev right away. (in former strcpy) diff --git a/harbour/contrib/hbide/hbide.hbp b/harbour/contrib/hbide/hbide.hbp index 791a82ba8f..6dea5bd5c0 100644 --- a/harbour/contrib/hbide/hbide.hbp +++ b/harbour/contrib/hbide/hbide.hbp @@ -1,19 +1,13 @@ -# -# $Id$ -# - -../hbxbp/hbxbp.hbc -inc - --w3 -es2 -gc3 - +-w3 +-es2 +-gc3 -ohbide - -# Trick to make QT 4.6 link using default Harbour build -ldflag={msvc}-nodefaultlib:msvcrt.lib -ldflag={msvc}-defaultlib:libcmt.lib - + +../hbxbp/hbxbp.hbc hbide.prg ideobject.prg idestylesheets.prg @@ -29,5 +23,8 @@ idethemes.prg ideprojmanager.prg idesources.prg ideharbourhelp.prg +ideenviron.prg ideparseexpr.c + + diff --git a/harbour/contrib/hbide/hbide.prg b/harbour/contrib/hbide/hbide.prg index 6cc6328591..1d5cef350c 100644 --- a/harbour/contrib/hbide/hbide.prg +++ b/harbour/contrib/hbide/hbide.prg @@ -79,6 +79,8 @@ #define UNU( x ) HB_SYMBOL_UNUSED( x ) +#define __HBIDE_DEBUG__ + /*----------------------------------------------------------------------*/ REQUEST HB_QT @@ -91,6 +93,11 @@ STATIC s_pathSep PROCEDURE Main( cProjIni ) LOCAL oIde + #ifdef __HBIDE_DEBUG__ + hb_setEnv( "HB_TR_DEBUG" , "HB_TR_ALWAYS" ) + hb_setEnv( "HB_TR_WINOUT", "YES" ) + #endif + /* Testing paths */ #ifdef __TESTING_PATHS__ hbide_dbg( hbmk2_PathMakeRelative( "C:\dev_projects", "C:\dev_sources\vouch\myfile.prg", .f. ) ) @@ -132,6 +139,7 @@ CLASS HbIde DATA oSkeltnDock DATA oSkeltnUI DATA oFindDock + DATA oHL DATA oUI @@ -179,6 +187,7 @@ CLASS HbIde DATA oMenu DATA oTBar DATA oStackedWidget + DATA oStackedWidgetMisc DATA oFont DATA oProjTree DATA oEditTree @@ -279,6 +288,15 @@ CLASS HbIde METHOD execEditorAction( cKey ) METHOD execWindowsAction( cKey ) + /* Methods to be evaluated as macros */ + METHOD getWord( lSelect ) + METHOD getLine( lSelect ) + METHOD getText() + // + METHOD evalMacro( cString ) + METHOD fetchAndExecMacro() + METHOD showApplicationCursor( nCursor ) + ENDCLASS /*----------------------------------------------------------------------*/ @@ -301,6 +319,21 @@ METHOD HbIde:new( cProjIni ) /*----------------------------------------------------------------------*/ +METHOD HbIde:showApplicationCursor( nCursor ) + + STATIC qCrs + + IF empty( nCursor ) + QApplication():restoreOverrideCursor() + ELSE + qCrs := QCursor():new( nCursor ) + QApplication():setOverrideCursor( qCrs ) + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD HbIde:create( cProjIni ) #if 1 LOCAL qPixmap, qSplash, nStart @@ -310,6 +343,7 @@ METHOD HbIde:create( cProjIni ) qSplash:setWindowFlags( hb_bitOr( Qt_WindowStaysOnTopHint, qSplash:windowFlags() ) ) qSplash:setPixmap( qPixmap ) qSplash:show() + ::showApplicationCursor( Qt_BusyCursor ) QApplication():processEvents() #endif @@ -348,12 +382,15 @@ METHOD HbIde:create( cProjIni ) /* Load IDE|User defined Themes */ hbide_loadThemes( Self ) + /* Harbour Help Object */ + ::oHL := ideHarbourHelp():new():create( Self ) + /* DOCKing windows and ancilliary windows */ ::oDK := IdeDocks():new():create( Self ) /* IDE's Main Window */ ::oDK:buildDialog() /* Actions */ - ::oAC := IdeActions():new( Self ):create() + ::oAC := IdeActions():new():create( Self ) /* Docking Widgets */ ::oDK:buildDockWidgets() /* Toolbar */ @@ -425,6 +462,7 @@ METHOD HbIde:create( cProjIni ) DO WHILE .t. QApplication():processEvents() IF seconds()-nStart > 5 + ::showApplicationCursor() qSplash:close() qSplash := NIL EXIT @@ -493,6 +531,8 @@ METHOD HbIde:create( cProjIni ) hbide_dbg( "Before ::oDlg:destroy()", memory( 1001 ), hbqt_getMemUsed() ) hbide_dbg( " " ) + ::oHL:destroy() + ::oThemes:destroy() ::oFindInFiles:destroy() ::oFR:destroy() ::oPM:destroy() @@ -593,6 +633,9 @@ METHOD HbIde:execAction( cKey ) CASE "Help" ::oHelpDock:show() EXIT + CASE "CommandPrompt" + ::fetchAndExecMacro() + EXIT ENDSWITCH ::manageFocusInEditor() @@ -922,6 +965,7 @@ METHOD HbIde:updateProjectTree( aPrj ) LOCAL oProject, n, oSource, oItem, nProjExists, oP, oParent, cPath oProject := IdeProject():new( Self, aPrj ) + IF empty( oProject:title ) RETURN Self ENDIF @@ -966,7 +1010,6 @@ METHOD HbIde:updateProjectTree( aPrj ) /* Reassign all children nodes */ FOR EACH cPath IN oProject:hPaths oItem := oParent:addItem( cPath:__enumKey() ) - oItem:oWidget:setTooltip( cPath:__enumKey() ) aadd( ::aProjData, { oItem, "Path", oParent, cPath:__enumKey(), oProject:title, oProject } ) NEXT /* Souces */ @@ -977,7 +1020,6 @@ METHOD HbIde:updateProjectTree( aPrj ) IF n > 0 oP := ::aProjData[ n, TRE_OITEM ] oItem := oP:addItem( oSource:file + oSource:ext ) - oItem:oWidget:setTooltip( oSource:file + oSource:ext ) aadd( ::aProjData, { oItem, "Source File", oP, oSource:original, oProject:title } ) ENDIF NEXT @@ -987,7 +1029,7 @@ METHOD HbIde:updateProjectTree( aPrj ) /*----------------------------------------------------------------------*/ METHOD HbIde:manageItemSelected( oXbpTreeItem ) - LOCAL n, cHbi, aPrj + LOCAL n, cHbp, aPrj IF oXbpTreeItem == ::oProjRoot n := -1 @@ -1004,13 +1046,13 @@ METHOD HbIde:manageItemSelected( oXbpTreeItem ) CASE ::aProjData[ n, TRE_TYPE ] == "Project Name" aPrj := ::aProjData[ n, 5 ] - cHbi := hbide_pathToOSPath( aPrj[ PRJ_PRP_PROPERTIES, 2, PRJ_PRP_LOCATION ] + s_pathSep + ; - aPrj[ PRJ_PRP_PROPERTIES, 2, PRJ_PRP_OUTPUT ] + ".hbi" ) + cHbp := hbide_pathToOSPath( aPrj[ PRJ_PRP_PROPERTIES, 2, PRJ_PRP_LOCATION ] + s_pathSep + ; + aPrj[ PRJ_PRP_PROPERTIES, 2, PRJ_PRP_OUTPUT ] + ".hbp" ) - ::oPM:loadProperties( cHbi, .f., .t., .f. ) + ::oPM:loadProperties( cHbp, .f., .t., .f. ) CASE ::aProjData[ n, TRE_TYPE ] == "Source File" - ::oSM:editSource( ::aProjData[ n, TRE_ORIGINAL ] ) + ::oSM:editSource( hbide_stripFilter( ::aProjData[ n, TRE_ORIGINAL ] ) ) CASE ::aProjData[ n, TRE_TYPE ] == "Opened Source" ::oEM:setSourceVisible( ::aProjData[ n, TRE_DATA ] ) @@ -1044,9 +1086,9 @@ METHOD HbIde:manageProjectContext( mp1, mp2, oXbpTreeItem ) CASE n == 0 // Source File - nothing to do CASE n == -2 // "Files" CASE n == -1 // Project Root - aadd( aPops, { "New Project" , {|| ::oPM:loadProperties( , .t., .t., .t. ) } } ) + aadd( aPops, { "New Project" , {|| ::oPM:loadProperties( NIL, .t., .t., .t. ) } } ) aadd( aPops, { "" } ) - aadd( aPops, { "Load Project" , {|| ::oPM:loadProperties( , .f., .f., .t. ) } } ) + aadd( aPops, { "Load Project" , {|| ::oPM:loadProperties( NIL, .f., .f., .t. ) } } ) aadd( aPops, { "" } ) // IF !empty( ::oEV:getNames() ) @@ -1062,7 +1104,7 @@ METHOD HbIde:manageProjectContext( mp1, mp2, oXbpTreeItem ) CASE ::aProjData[ n, TRE_TYPE ] == "Project Name" aPrj := ::aProjData[ n, TRE_DATA ] cHbi := aPrj[ PRJ_PRP_PROPERTIES, 2, PRJ_PRP_LOCATION ] + s_pathSep + ; - aPrj[ PRJ_PRP_PROPERTIES, 2, PRJ_PRP_OUTPUT ] + ".hbi" + aPrj[ PRJ_PRP_PROPERTIES, 2, PRJ_PRP_OUTPUT ] + ".hbp" cHbi := hbide_pathToOSPath( cHbi ) // IF Alltrim( Upper( ::cWrkProject ) ) != Alltrim( Upper( oXbpTreeItem:caption ) ) @@ -1261,13 +1303,59 @@ METHOD HbIde:setCodec( cCodec ) RETURN Self /*----------------------------------------------------------------------*/ +// Macro Compilable Methods +/*----------------------------------------------------------------------*/ -FUNCTION testPaths() +METHOD HbIde:getWord( lSelect ) + RETURN ::oEM:getWord( lSelect ) - hbide_dbg( hbide_pathProc( "C:\dev_sources\vouch\abc.prg", "C:\harbour\contrib\hbide\projects\hbide.hbi" ) ) - hbide_dbg( hbide_pathProc( "C:\harbour\contrib\hbide\projects\vouch\abc.prg", "C:\harbour\contrib\hbide\projects\hbide.hbi" ) ) +METHOD HbIde:getLine( lSelect ) + RETURN ::oEM:getLine( lSelect ) - RETURN NIL +METHOD HbIde:getText() + RETURN ::oEM:getText() /*----------------------------------------------------------------------*/ +METHOD HbIde:fetchAndExecMacro() + LOCAL cStr + + cStr := hbide_fetchAString( ::oDlg:oWidget, "", "Macro", "Compilation" ) + IF !empty( cStr ) + ::evalMacro( cStr ) + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD HbIde:evalMacro( cString ) + LOCAL bError := ErrorBlock( {|o| break( o ) } ) + LOCAL oErr, bBlock, n, cBlock, cParam + + IF ( n := at( "|", cString ) ) > 0 + cString := substr( cString, n + 1 ) + IF ( n := at( "|", cString ) ) == 0 + RETURN Self + ENDIF + cParam := substr( cString, 1, n - 1 ) + cString := substr( cString, n + 1 ) + cBlock := "{|o," + cParam + "|" + cString + " }" + ELSE + cBlock := "{|o| " + cString + " }" + ENDIF + cBlock := strtran( cBlock, "::", "o:" ) + + bBlock := &( cBlock ) + +hbide_dbg( cBlock ) + BEGIN SEQUENCE + eval( bBlock, self ) + RECOVER USING oErr + MsgBox( "Wrongly defined block. Syntax is |var| method_call( var ) --- " + oErr:description ) + END SEQUENCE + + ErrorBlock( bError ) + RETURN Self + +/*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbide/idedocks.prg b/harbour/contrib/hbide/idedocks.prg index 73ea1e306b..53e2add3a8 100644 --- a/harbour/contrib/hbide/idedocks.prg +++ b/harbour/contrib/hbide/idedocks.prg @@ -151,6 +151,23 @@ METHOD IdeDocks:destroy() LOCAL oUI := ::oIde:oSkeltnUI LOCAL qTBtn + ::disconnect( ::oOutputResult:oWidget , "copyAvailable(bool)" ) + + ::disconnect( ::oEnvironDock:oWidget , "visibilityChanged(bool)" ) + ::disconnect( ::oPropertiesDock:oWidget, "visibilityChanged(bool)" ) + ::disconnect( ::oThemesDock:oWidget , "visibilityChanged(bool)" ) + ::disconnect( ::oDocViewDock:oWidget , "visibilityChanged(bool)" ) + ::disconnect( ::oFindDock:oWidget , "visibilityChanged(bool)" ) + #if 0 /* Not Implemented */ + ::disconnect( ::oHelpDock:oWidget , "visibilityChanged(bool)" ) + ::disconnect( ::oDockPT:oWidget , "visibilityChanged(bool)" ) + ::disconnect( ::oDockED:oWidget , "visibilityChanged(bool)" ) + ::disconnect( ::oDockB2:oWidget , "visibilityChanged(bool)" ) + ::disconnect( ::oFuncDock:oWidget , "visibilityChanged(bool)" ) + ::disconnect( ::oSkeltnDock:oWidget , "visibilityChanged(bool)" ) + #endif + + /* ?? */ ::disconnect( oUI:q_buttonNew , "clicked()" ) ::disconnect( oUI:q_buttonRename, "clicked()" ) ::disconnect( oUI:q_buttonDelete, "clicked()" ) @@ -170,6 +187,10 @@ METHOD IdeDocks:destroy() qTBtn := NIL NEXT + FOR EACH qTBtn IN ::oIde:aMarkTBtns + ::disconnect( qTBtn, "clicked()" ) + NEXT + RETURN Self /*----------------------------------------------------------------------*/ @@ -271,7 +292,7 @@ METHOD IdeDocks:execEvent( nMode, p ) CASE nMode == dockDocViewer_visibilityChanged IF p - ::oDocViewDock:qtObject:show() + ::oHL:show() ENDIF CASE nMode == dockProperties_visibilityChanged @@ -281,7 +302,7 @@ METHOD IdeDocks:execEvent( nMode, p ) CASE nMode == docEnvironments_visibilityChanged IF p - ::oPM:manageEnvironments() + ::oEV:show() ENDIF CASE nMode == dockFindInFiles_visibilityChanged @@ -675,11 +696,6 @@ METHOD IdeDocks:buildProjectTree() /* Add dock widget to Main Window */ ::oDlg:oWidget:addDockWidget_1( Qt_LeftDockWidgetArea, ::oDockPT:oWidget, Qt_Vertical ) - IF ::oIde:aIni[ INI_HBIDE, ProjectTreeVisible ] == "NO" - ::oIde:lProjTreeVisible := .f. - ::oDockPT:hide() - ENDIF - RETURN Self /*----------------------------------------------------------------------*/ @@ -718,11 +734,6 @@ METHOD IdeDocks:buildEditorTree() /* Add dock widget to Main Window */ ::oDlg:oWidget:addDockWidget_1( Qt_LeftDockWidgetArea, ::oDockED:oWidget, Qt_Vertical ) - IF ::oIde:aIni[ INI_HBIDE, ProjectTreeVisible ] == "NO" - ::oIde:lProjTreeVisible := .f. - ::oDockED:hide() - ENDIF - RETURN Self /*----------------------------------------------------------------------*/ @@ -932,14 +943,23 @@ METHOD IdeDocks:buildDocViewer() ::oIde:oDocViewDock := ::getADockWidget( Qt_RightDockWidgetArea, "dockDocViewer", "Harbour Documentation", QDockWidget_DockWidgetFloatable ) ::oDlg:oWidget:addDockWidget_1( Qt_RightDockWidgetArea, ::oDocViewDock:oWidget, Qt_Horizontal ) - ::oDocViewDock:qtObject := ideHarbourHelp():new():create( ::oIde ) - ::connect( ::oDocViewDock:oWidget, "visibilityChanged(bool)", {|p| ::execEvent( dockDocViewer_visibilityChanged, p ) } ) RETURN Self /*----------------------------------------------------------------------*/ +METHOD IdeDocks:buildEnvironDock() + + ::oIde:oEnvironDock := ::getADockWidget( Qt_RightDockWidgetArea, "dockEnvironments", "Compiler Environments", QDockWidget_DockWidgetFloatable ) + ::oDlg:oWidget:addDockWidget_1( Qt_RightDockWidgetArea, ::oEnvironDock:oWidget, Qt_Horizontal ) + + ::connect( ::oEnvironDock:oWidget, "visibilityChanged(bool)", {|p| ::execEvent( docEnvironments_visibilityChanged, p ) } ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD IdeDocks:buildSkeletonWidget() LOCAL oUI @@ -1146,13 +1166,3 @@ METHOD IdeDocks:toggleBottomDocks() /*----------------------------------------------------------------------*/ -METHOD IdeDocks:buildEnvironDock() - - ::oIde:oEnvironDock := ::getADockWidget( Qt_RightDockWidgetArea, "dockEnvironments", "Compiler Environments", QDockWidget_DockWidgetFloatable ) - ::oDlg:oWidget:addDockWidget_1( Qt_RightDockWidgetArea, ::oEnvironDock:oWidget, Qt_Horizontal ) - - ::connect( ::oEnvironDock:oWidget, "visibilityChanged(bool)", {|p| ::execEvent( docEnvironments_visibilityChanged, p ) } ) - - RETURN Self - -/*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbide/ideeditor.prg b/harbour/contrib/hbide/ideeditor.prg index 81660e0588..af6540b945 100644 --- a/harbour/contrib/hbide/ideeditor.prg +++ b/harbour/contrib/hbide/ideeditor.prg @@ -146,6 +146,10 @@ CLASS IdeEditsManager INHERIT IdeObject METHOD toggleSelectionMode() METHOD toggleLineNumbers() + METHOD getText() + METHOD getWord( lSelect ) + METHOD getLine( lSelect ) + ENDCLASS /*----------------------------------------------------------------------*/ @@ -601,6 +605,39 @@ METHOD IdeEditsManager:toggleLineNumbers() /*----------------------------------------------------------------------*/ +METHOD IdeEditsManager:getText() + LOCAL oEdit, cText := "" + + IF !empty( oEdit := ::getEditObjectCurrent() ) + cText := oEdit:getText() + ENDIF + + RETURN cText + +/*----------------------------------------------------------------------*/ + +METHOD IdeEditsManager:getWord( lSelect ) + LOCAL oEdit, cText := "" + + IF !empty( oEdit := ::getEditObjectCurrent() ) + cText := oEdit:getWord( lSelect ) + ENDIF + + RETURN cText + +/*----------------------------------------------------------------------*/ + +METHOD IdeEditsManager:getLine( lSelect ) + LOCAL oEdit, cText := "" + + IF !empty( oEdit := ::getEditObjectCurrent() ) + cText := oEdit:getLine( lSelect ) + ENDIF + + RETURN cText + +/*----------------------------------------------------------------------*/ + METHOD IdeEditsManager:convertSelection( cKey ) LOCAL oEdit @@ -1093,7 +1130,7 @@ METHOD IdeEditor:create( oIde, cSourceFile, nPos, nHPos, nVPos, cTheme, cView ) METHOD IdeEditor:destroy() LOCAL n, oEdit -hbide_dbg( "IdeEditor:destroy()", 0, ::sourceFile ) +//hbide_dbg( "IdeEditor:destroy()", 0, ::sourceFile ) ::qHiliter := NIL @@ -1136,7 +1173,7 @@ hbide_dbg( "IdeEditor:destroy()", 0, ::sourceFile ) ::oIde:lDockRVisible := .f. ENDIF ENDIF -hbide_dbg( "IdeEditor:destroy()", 1, "-------------------------------------" ) +//hbide_dbg( "IdeEditor:destroy()", 1, "-------------------------------------" ) RETURN Self /*----------------------------------------------------------------------*/ @@ -1394,8 +1431,13 @@ CLASS IdeEdit INHERIT IdeObject METHOD handleCurrentIndent() METHOD handlePreviousWord( lUpdatePrevWord ) METHOD loadFuncHelp() + METHOD clickFuncHelp() METHOD toggleLineNumbers() + METHOD getWord( lSelect ) + METHOD getLine( lSelect ) + METHOD getText() + ENDCLASS /*----------------------------------------------------------------------*/ @@ -1544,7 +1586,7 @@ METHOD IdeEdit:execEvent( nMode, oEdit, p, p1 ) EXIT CASE selectionChanged - hbide_dbg( "selectionChanged()" ) + //hbide_dbg( "selectionChanged()" ) ::oEditor:qCqEdit := qEdit ::oEditor:qCoEdit := oEdit @@ -1698,6 +1740,7 @@ METHOD IdeEdit:execKeyEvent( nMode, nEvent, p ) CASE 1001 IF p == QEvent_MouseButtonDblClick ::lCopyWhenDblClicked := .t. + ::clickFuncHelp() ENDIF EXIT @@ -1867,6 +1910,60 @@ METHOD IdeEdit:caseInvert() /*----------------------------------------------------------------------*/ +METHOD IdeEdit:getText() + LOCAL qCursor := QTextCursor():configure( ::qEdit:textCursor() ) + + RETURN qCursor:selectedText() + +/*----------------------------------------------------------------------*/ + +METHOD IdeEdit:getWord( lSelect ) + LOCAL cText + LOCAL qCursor := QTextCursor():configure( ::qEdit:textCursor() ) + + DEFAULT lSelect TO .F. + + qCursor:select( QTextCursor_WordUnderCursor ) + cText := qCursor:selectedText() + + IF lSelect + ::qEdit:setTextCursor( qCursor ) + ENDIF + + RETURN cText + +/*----------------------------------------------------------------------*/ + +METHOD IdeEdit:getLine( lSelect ) + LOCAL cText + LOCAL qCursor := QTextCursor():configure( ::qEdit:textCursor() ) + + DEFAULT lSelect TO .F. + + qCursor:select( QTextCursor_LineUnderCursor ) + cText := qCursor:selectedText() + + IF lSelect + ::qEdit:setTextCursor( qCursor ) + ENDIF + + RETURN cText + +/*----------------------------------------------------------------------*/ + +METHOD IdeEdit:clickFuncHelp() + LOCAL cWord + + IF !empty( cWord := ::getWord( .f. ) ) + IF !empty( ::oDocViewDock:qtObject ) + ::oDocViewDock:qtObject:jumpToFunction( cWord ) + ENDIF + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD IdeEdit:loadFuncHelp() LOCAL qEdit, qCursor, qTextBlock, cText, cWord, nCol @@ -1877,7 +1974,7 @@ METHOD IdeEdit:loadFuncHelp() cText := qTextBlock:text() nCol := qCursor:columnNumber() cWord := hbide_getPreviousWord( cText, nCol ) -hbide_dbg( "IdeEdit:loadFuncHelp()", cWord ) + IF !empty( cWord ) IF !empty( ::oDocViewDock:qtObject ) ::oDocViewDock:qtObject:jumpToFunction( cWord ) diff --git a/harbour/contrib/hbide/ideenviron.prg b/harbour/contrib/hbide/ideenviron.prg new file mode 100644 index 0000000000..9351fd51b8 --- /dev/null +++ b/harbour/contrib/hbide/ideenviron.prg @@ -0,0 +1,284 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * + * Copyright 2009-2010 Pritpal Bedi + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ +/*----------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ +/* + * EkOnkar + * ( The LORD is ONE ) + * + * Harbour-Qt IDE + * + * Pritpal Bedi + * 01Mar2010 + */ +/*----------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ + +#include "hbide.ch" +#include "hbqt.ch" +#include "common.ch" +#include "hbclass.ch" + +/*----------------------------------------------------------------------*/ +// +// Class IdeEnvironments +// +/*----------------------------------------------------------------------*/ + +CLASS IdeEnvironments INHERIT IdeObject + + DATA cEnvFile + DATA aNames INIT {} + DATA aEnvrns INIT {} + DATA aShellContents INIT {} + DATA aCommons INIT {} + + METHOD new( oIDE, cEnvFile ) + METHOD create( oIDE, cEnvFile ) + METHOD destroy() + METHOD parse( cEnvFile ) + METHOD prepareBatch( cEnvName ) + METHOD getNames() INLINE ::aNames + METHOD saveEnv() + METHOD show() + METHOD execEnv( nMode, p ) + + ENDCLASS + +/*----------------------------------------------------------------------*/ + +METHOD IdeEnvironments:new( oIDE, cEnvFile ) + + ::oIDE := oIDE + ::cEnvFile := cEnvFile + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeEnvironments:create( oIDE, cEnvFile ) + + DEFAULT oIDE TO ::oIDE + DEFAULT cEnvFile TO ::cEnvFile + + ::oIDE := oIDE + ::cEnvFile := cEnvFile + + IF !empty( ::cEnvFile ) .AND. hb_fileExists( ::cEnvFile ) + ::parse( ::cEnvFile ) + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeEnvironments:destroy() +hbide_dbg(" ,,,,,, IdeEnvironments:destroy()", 0 ) + IF !empty( ::oUI ) +hbide_dbg("IdeEnvironments:destroy()", 1 ) + ::oUI:destroy() +hbide_dbg("IdeEnvironments:destroy()", 2 ) + ENDIF + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeEnvironments:parse( cEnvFile ) + LOCAL s, cPart, cEnv, a_, cKey, cVal + LOCAL aContents := hbide_readSource( cEnvFile ) + + ::aNames := {} + ::aEnvrns := {} + a_ := {} + cEnv := "" + + FOR EACH s IN aContents + s := alltrim( s ) + IF empty( s ) .OR. left( s, 1 ) == "#" /* Remark */ + LOOP + ENDIF + IF left( s, 1 ) == "[" + s := alltrim( strtran( s, "[", "" ) ) + s := alltrim( strtran( s, "]", "" ) ) + IF lower( s ) == "common" + cPart := "common" + ELSE + cPart := "environment" + IF ( s != cEnv ) .AND. !empty( cEnv ) + aadd( ::aNames, cEnv ) + aadd( ::aEnvrns, { cEnv, a_ } ) + ENDIF + cEnv := s + a_:= {} + ENDIF + ELSE + IF cPart == "common" + IF hbide_parseKeyValPair( s, @cKey, @cVal ) + aadd( ::aCommons, { lower( cKey ), cVal } ) /* Format Later */ + ENDIF + ELSEIF cPart == "environment" + IF hbide_parseFilter( s, @cKey, @cVal ) + aadd( a_, { lower( cKey ), cVal } ) + ENDIF + ENDIF + ENDIF + NEXT + IF !empty( cEnv ) .AND. !empty( a_ ) + aadd( ::aNames, cEnv ) + aadd( ::aEnvrns, { cKey, a_ } ) + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeEnvironments:prepareBatch( cEnvName ) + LOCAL n, s, a_, aCmd + LOCAL cFile := space( 255 ) + + IF ( n := ascan( ::aEnvrns, {|e_| e_[ 1 ] == cEnvName } ) ) > 0 + aCmd := {} + FOR EACH a_ IN ::aEnvrns[ n, 2 ] + s := a_[ 1 ] + IF s == "content" + aadd( aCmd, a_[ 2 ] ) + ENDIF + NEXT + cFile := hbide_getShellCommandsTempFile( aCmd ) + ENDIF + + RETURN cFile + +/*----------------------------------------------------------------------*/ + +METHOD IdeEnvironments:show() + + IF empty( ::oUI ) + ::oUI := HbQtUI():new( hbide_uic( "environments" ), ::oEnvironDock:oWidget ):build() + ::oEnvironDock:qtObject := Self //::oUI + ::oEnvironDock:oWidget:setWidget( ::oUI ) + + ::oUI:q_buttonPathMk2:setIcon( hbide_image( "folder" ) ) + ::oUI:q_buttonPathEnv:setIcon( hbide_image( "folder" ) ) + + ::oUI:signal( "buttonCn" , "clicked()", {|| ::oEnvironDock:hide() } ) + ::oUI:signal( "buttonSave" , "clicked()", {|| ::saveEnv() } ) + ::oUI:signal( "buttonSaveExit", "clicked()", {|| ::saveEnv(), ::oEnvironDock:hide() } ) + ::oUI:signal( "buttonPathMk2" , "clicked()", {|| ::execEnv( 1 ) } ) + ::oUI:signal( "buttonPathEnv" , "clicked()", {|| ::execEnv( 2 ) } ) + ENDIF + + ::oUI:q_editPathMk2 :setText( ::aINI[ INI_HBIDE, PathMk2 ] ) + ::oUI:q_editPathEnv :setText( ::aINI[ INI_HBIDE, PathEnv ] ) + ::oUI:q_editCompilers:setPlainText( hb_memoread( hbide_pathFile( ::aINI[ INI_HBIDE, PathEnv ], "hbide.env" ) ) ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeEnvironments:execEnv( nMode, p ) + LOCAL cPath, cP + + HB_SYMBOL_UNUSED( p ) + + DO CASE + CASE nMode == 1 + cPath := hbide_fetchAFile( ::oDlg, "Select location of hbmk2", ; + { { "Harbour Projects Builder - hbmk2", "*.exe" } }, ::cWrkPathMK2 ) + IF !empty( cPath ) + hb_fNameSplit( cPath, @cP ) + ::cWrkPathMK2 := cP + ::oUI:q_editPathMk2:setText( hbide_pathStripLastSlash( cP ) ) + ENDIF + + CASE nMode == 2 + cPath := hbide_fetchAFile( ::oDlg, "Select location of hbide.env", ; + { { "Harbour Projects", "*.env" } }, ::cWrkPathEnv ) + IF !empty( cPath ) + hb_fNameSplit( cPath, @cP ) + ::oIDE:cWrkPathEnv := cP + ::oUI:q_editPathEnv:setText( hbide_pathStripLastSlash( cP ) ) + + ::oUI:q_editCompilers:setPlainText( ; + hb_memoread( hbide_pathFile( ::oUI:q_editPathEnv:text(), "hbide.env" ) ) ) + ENDIF + + ENDCASE + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeEnvironments:saveEnv() + LOCAL cText, cPathMk2, cPathEnv, cEnvFile + LOCAL oUIEnv := ::oUI + + cPathMk2 := oUIEnv:q_editPathMk2:text() + cPathEnv := oUIEnv:q_editPathEnv:text() + + ::oIDE:aINI[ INI_HBIDE, PathMk2 ] := cPathMk2 + ::oIDE:aINI[ INI_HBIDE, PathEnv ] := cPathEnv + // + ::oIDE:cWrkPathMk2 := cPathMk2 + ::oIDE:cWrkPathEnv := cPathEnv + + IF !empty( cText := oUIEnv:q_editCompilers:toPlainText() ) + cEnvFile := hbide_pathFile( cPathEnv, "hbide.env" ) + hb_MemoWrit( cEnvFile, cText ) + + ::parse( cEnvFile ) + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbide/idefindreplace.prg b/harbour/contrib/hbide/idefindreplace.prg index 34f6f8f500..74970c6d6b 100644 --- a/harbour/contrib/hbide/idefindreplace.prg +++ b/harbour/contrib/hbide/idefindreplace.prg @@ -683,7 +683,6 @@ METHOD IdeFindInFiles:buildUI() ::oUI:q_comboExpr:setFocus() /* Attach all signals */ - ::connect( ::oUI:oWidget, "rejected()", {|| ::execEvent( "buttonClose" ) } ) // ::oUI:signal( "buttonClose" , "clicked()" , {| | ::execEvent( "buttonClose" ) } ) ::oUI:signal( "buttonFolder" , "clicked()" , {| | ::execEvent( "buttonFolder" ) } ) @@ -709,14 +708,6 @@ METHOD IdeFindInFiles:execEvent( cEvent, p ) CASE "buttonClose" ::oFindDock:hide() - #if 0 - IF ::lInDockWindow - ::oFindDock:hide() - ELSE - ::oIde:aIni[ INI_HBIDE, FindInFilesDialogGeometry ] := hbide_posAndSize( ::oUI:oWidget ) - ::destroy() - ENDIF - #endif EXIT CASE "comboFind" @@ -900,7 +891,7 @@ METHOD IdeFindInFiles:show() METHOD IdeFindInFiles:find() LOCAL lPrg, lC, lCpp, lH, lCh, lRc, a_ - LOCAL lTabs, lSubF, lSubP, cFolder, qItem, aFilter, cExt, cMask, cWrkFolder + LOCAL lTabs, lSubF, lSubP, cFolder, qItem, aFilter, cExt, cMask, cWrkFolder, cProjPath LOCAL nStart, nEnd, cSource, aDir, cProjTitle, aProjFiles LOCAL aOpenSrc := {} LOCAL aFolderSrc := {} @@ -977,9 +968,10 @@ METHOD IdeFindInFiles:find() FOR EACH cProjTitle IN aProjs a_:= {} IF !empty( aProjFiles := ::oPM:getSourcesByProjectTitle( cProjTitle ) ) + cProjPath := ::oPM:getProjectPathFromTitle( cProjTitle ) FOR EACH cSource IN aProjFiles IF hbide_isSourceOfType( cSource, aFilter ) - aadd( a_, cSource ) + aadd( a_, hbide_syncProjPath( cProjPath, hbide_stripFilter( cSource ) ) ) ENDIF NEXT ENDIF diff --git a/harbour/contrib/hbide/ideharbourhelp.prg b/harbour/contrib/hbide/ideharbourhelp.prg index 1021b9b191..7f8cd40e3c 100644 --- a/harbour/contrib/hbide/ideharbourhelp.prg +++ b/harbour/contrib/hbide/ideharbourhelp.prg @@ -219,7 +219,7 @@ METHOD IdeHarbourHelp:create( oIde ) METHOD IdeHarbourHelp:show() IF empty( ::oUI ) - ::oUI := HbQtUI():new( ::resPath + "docviewgenerator.uic", ::oDlg:oWidget ):build() + ::oUI := HbQtUI():new( hbide_uic( "docviewgenerator" ) ):build() ::oDocViewDock:oWidget:setWidget( ::oUI ) @@ -239,14 +239,12 @@ METHOD IdeHarbourHelp:show() METHOD IdeHarbourHelp:destroy() - IF empty( ::oUI ) - RETURN Self + IF !empty( ::oUI ) + ::destroyTrees() + + ::oUI:destroy() ENDIF - ::destroyTrees() - - ::oUI:destroy() - RETURN Self /*----------------------------------------------------------------------*/ @@ -592,6 +590,8 @@ METHOD IdeHarbourHelp:refreshDocTree() RETURN Self ENDIF + ::showApplicationCursor( Qt_BusyCursor ) + /* Clean Environment */ ::destroyTrees() ::oUI:q_treeDoc:clear() @@ -654,6 +654,8 @@ METHOD IdeHarbourHelp:refreshDocTree() ::oUI:q_treeDoc:expandItem( oRoot ) + ::showApplicationCursor() + RETURN Self /*----------------------------------------------------------------------*/ @@ -713,20 +715,6 @@ STATIC FUNCTION hbide_buildPathFromSubs( aSubs, nUpto ) /*----------------------------------------------------------------------*/ -STATIC FUNCTION hbide_stripRoot( cRoot, cPath ) - LOCAL cLRoot, cLPath, cP - - cLRoot := hbide_pathNormalized( cRoot, .t. ) - cLPath := hbide_pathNormalized( cPath, .t. ) - IF left( cLPath, len( cLRoot ) ) == cLRoot - cP := substr( cLPath, len( cRoot ) + 1 ) - RETURN cP - ENDIF - - RETURN cPath - -/*----------------------------------------------------------------------*/ - METHOD IdeHarbourHelp:populateIndex() LOCAL a_, qItem, oFunc, oParent, n LOCAL aUnq := {} diff --git a/harbour/contrib/hbide/idemisc.prg b/harbour/contrib/hbide/idemisc.prg index 41b25434ce..f60ff3e3d3 100644 --- a/harbour/contrib/hbide/idemisc.prg +++ b/harbour/contrib/hbide/idemisc.prg @@ -350,35 +350,53 @@ FUNCTION hbide_fetchHbiStructFromFile( cProject ) /*----------------------------------------------------------------------*/ +FUNCTION hbide_strip3rd( s ) + LOCAL n + IF ( n := at( "-3rd=", s ) ) > 0 + RETURN substr( s, n + 5 ) + ENDIF + RETURN s + +/*----------------------------------------------------------------------*/ + STATIC FUNCTION hbide_pullHbiStruct( a_ ) - LOCAL n, s, nPart, cKey, cVal, ss + LOCAL n, s, nPart, cKey, cVal, ss, c3rd LOCAL aPrp := { "Type", "Title", "Location", "WorkingFolder", "DestinationFolder", ; "Output", "LaunchParams", "LaunchProgram", "BackupFolder" } LOCAL a1_0 := afill( array( PRJ_PRP_PRP_VRBLS ), "" ) LOCAL a1_1 := {} - local a2_0 := {} - local a2_1 := {} - local a3_0 := {} - local a3_1 := {} - local a4_0 := {} - local a4_1 := {} + LOCAL a2_0 := {} + LOCAL a2_1 := {} + LOCAL a3_0 := {} + LOCAL a3_1 := {} + LOCAL a4_0 := {} + LOCAL a4_1 := {} + + IF ascan( a_, {|e| "-3rd=[ HBIDEVERSION ]" $ e } ) == 0 + c3rd := "" + ELSE + c3rd := "-3rd=" + ENDIF IF .t. FOR EACH ss IN a_ s := alltrim( ss ) - IF !empty( s ) DO CASE - CASE s == "[ PROPERTIES ]" + CASE s == c3rd + "[ HBIDEVERSION ]" + nPart := 0 + * nPart := PRJ_PRP_VERSION + CASE s == c3rd + "[ PROPERTIES ]" nPart := PRJ_PRP_PROPERTIES - CASE s == "[ FLAGS ]" + CASE s == c3rd + "[ FLAGS ]" nPart := PRJ_PRP_FLAGS - CASE s == "[ SOURCES ]" + CASE s == c3rd + "[ SOURCES ]" nPart := PRJ_PRP_SOURCES - CASE s == "[ METADATA ]" + CASE s == c3rd + "[ METADATA ]" nPart := PRJ_PRP_METADATA OTHERWISE + s := hbide_strip3rd( s ) DO CASE CASE nPart == PRJ_PRP_PROPERTIES IF ( n := at( "=", s ) ) > 0 @@ -395,6 +413,9 @@ STATIC FUNCTION hbide_pullHbiStruct( a_ ) aadd( a3_0, s ) CASE nPart == PRJ_PRP_METADATA + IF !empty( c3rd ) + s := strtran( s, c3rd, "" ) + ENDIF aadd( a4_0, s ) IF !( "#" == left( s,1 ) ) IF ( n := at( "=", s ) ) > 0 @@ -646,10 +667,15 @@ FUNCTION hbide_pathStripLastSlash( cPath ) /*----------------------------------------------------------------------*/ FUNCTION hbide_pathToOSPath( cPath ) + LOCAL n cPath := strtran( cPath, "/" , hb_osPathSeparator() ) cPath := strtran( cPath, "\" , hb_osPathSeparator() ) + IF ( n := at( ":", cPath ) ) > 0 + cPath := upper( substr( cPath, 1, n - 1 ) ) + substr( cPath, n ) + ENDIF + RETURN cPath /*----------------------------------------------------------------------*/ @@ -1270,10 +1296,6 @@ FUNCTION hbide_fetchHbpData( cHBPFileName ) aParamList := hbide_HBPGetParamList( cHBPFileName ) - hbide_dbg( "hbmk2 files" ) ; AEval( hbide_HBPParamListFilter( aParamList, HBIDE_HBP_PTYPE_FILES ), {| tmp | hbide_dbg( tmp ) } ) - hbide_dbg( "hbmk2 options" ) ; AEval( hbide_HBPParamListFilter( aParamList, HBIDE_HBP_PTYPE_OPTIONS ), {| tmp | hbide_dbg( tmp ) } ) - hbide_dbg( "hbide comments" ) ; AEval( hbide_HBPParamListFilter( aParamList, HBIDE_HBP_PTYPE_HBIDEPARAMS ), {| tmp | hbide_dbg( tmp ) } ) - RETURN { hbide_HBPParamListFilter( aParamList, HBIDE_HBP_PTYPE_OPTIONS ), ; hbide_HBPParamListFilter( aParamList, HBIDE_HBP_PTYPE_FILES ) } @@ -1621,3 +1643,82 @@ FUNCTION hbide_isPrevParent( cRoot, cPath ) /*----------------------------------------------------------------------*/ +FUNCTION hbide_space2amp( cStr ) + RETURN strtran( cStr, " ", chr( 38 ) ) + +/*----------------------------------------------------------------------*/ + +FUNCTION hbide_amp2space( cStr ) + RETURN strtran( cStr, chr( 38 ), " " ) + +/*----------------------------------------------------------------------*/ + +FUNCTION hbide_stripFilter( cSrc ) + LOCAL n, n1 + + DO WHILE .t. + IF ( n := at( "{", cSrc ) ) == 0 + EXIT + ENDIF + IF ( n1 := at( "}", cSrc ) ) == 0 + EXIT + ENDIF + cSrc := substr( cSrc, 1, n - 1 ) + substr( cSrc, n1 + 1 ) + ENDDO + + RETURN cSrc + +/*----------------------------------------------------------------------*/ + +FUNCTION hbide_stripRoot( cRoot, cPath ) + LOCAL cLRoot, cLPath, cP + + IF !empty( cRoot ) .AND. ! ( right( cRoot, 1 ) $ "/\" ) + cRoot += "/" + ENDIF + + cLRoot := hbide_pathNormalized( cRoot, .t. ) + cLPath := hbide_pathNormalized( cPath, .t. ) + IF left( cLPath, len( cLRoot ) ) == cLRoot + cP := substr( cLPath, len( cRoot ) + 1 ) + RETURN cP + ENDIF + + RETURN cPath + +/*----------------------------------------------------------------------*/ + +FUNCTION hbide_syncRoot( cRoot, cPath ) + LOCAL cPth, cFile, cExt + LOCAL cPathProc := hbide_pathProc( cRoot, cPath ) + + hb_fNameSplit( cPath, @cPth, @cFile, @cExt ) + +//hbide_dbg( "hbide_syncRoot( cRoot, cPath )", cPathProc, hbide_pathToOSpath( cPathProc + "/" + cFile + cExt ) ) + + RETURN hbide_pathToOSpath( cPathProc + "/" + cFile + cExt ) + +/*----------------------------------------------------------------------*/ + +FUNCTION hbide_array2cmdParams( aHbp ) + LOCAL cCmd := " " + + aeval( aHbp, {|e| cCmd += e + " " } ) + + RETURN cCmd + +/*----------------------------------------------------------------------*/ + +FUNCTION hbide_syncProjPath( cRoot, cSource ) + + IF left( cSource, 1 ) $ "./\" .OR. substr( cSource, 2, 1 ) == ":" + RETURN cSource + ENDIF + + IF !empty( cRoot ) .AND. ! ( right( cRoot, 1 ) $ "/\" ) + cRoot += "/" + ENDIF + + RETURN cRoot + cSource + +/*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbide/ideobject.prg b/harbour/contrib/hbide/ideobject.prg index ee2e7e4ead..a1970dbc9d 100644 --- a/harbour/contrib/hbide/ideobject.prg +++ b/harbour/contrib/hbide/ideobject.prg @@ -90,6 +90,7 @@ CLASS IdeObject ACCESS oAC INLINE ::oIde:oAC ACCESS oSM INLINE ::oIde:oSM ACCESS oEV INLINE ::oIde:oEV + ACCESS oHL INLINE ::oIde:oHL ACCESS oFindDock INLINE ::oIde:oFindDock ACCESS oFindInFiles INLINE ::oIde:oFindInFiles @@ -163,6 +164,7 @@ CLASS IdeObject ACCESS oDockB2 INLINE ::oIde:oDockB2 ACCESS oOutputResult INLINE ::oIde:oOutputResult ACCESS oStackedWidget INLINE ::oIde:oStackedWidget + ACCESS oStackedWidgetMisc INLINE ::oIde:oStackedWidgetMisc ACCESS oFrame INLINE ::oIde:oFrame ACCESS oHelpDock INLINE ::oIde:oHelpDock ACCESS oSkeltnDock INLINE ::oIde:oSkeltnDock @@ -203,6 +205,7 @@ CLASS IdeObject METHOD manageFocusInEditor( ... ) INLINE ::oIde:manageFocusInEditor( ... ) METHOD setCodec( ... ) INLINE ::oIde:setCodec( ... ) METHOD updateTitleBar( ... ) INLINE ::oIde:updateTitleBar( ... ) + METHOD showApplicationCursor( ... ) INLINE ::oIde:showApplicationCursor( ... ) METHOD editSource( ... ) INLINE ::oSM:editSource( ... ) METHOD getEditorByIndex( ... ) INLINE ::oSM:getEditorByIndex( ... ) diff --git a/harbour/contrib/hbide/ideprojmanager.prg b/harbour/contrib/hbide/ideprojmanager.prg index 4a2077b93f..ba4830171a 100644 --- a/harbour/contrib/hbide/ideprojmanager.prg +++ b/harbour/contrib/hbide/ideprojmanager.prg @@ -69,139 +69,6 @@ #include "common.ch" #include "hbclass.ch" -/*----------------------------------------------------------------------*/ -// -// Class IdeEnvironments -// -/*----------------------------------------------------------------------*/ - -CLASS IdeEnvironments - - DATA oIDE - DATA cEnvFile - DATA aNames INIT {} - DATA aEnvrns INIT {} - DATA aShellContents INIT {} - DATA aCommons INIT {} - - METHOD new( oIDE, cEnvFile ) - METHOD create( oIDE, cEnvFile ) - METHOD parse( aContents ) - METHOD prepareBatch( cEnviron ) - METHOD getNames() INLINE ::aNames - - ENDCLASS - -/*----------------------------------------------------------------------*/ - -METHOD IdeEnvironments:new( oIDE, cEnvFile ) - - ::oIDE := oIDE - ::cEnvFile := cEnvFile - - RETURN Self - -/*----------------------------------------------------------------------*/ - -METHOD IdeEnvironments:create( oIDE, cEnvFile ) - LOCAL a_ - - DEFAULT oIDE TO ::oIDE - DEFAULT cEnvFile TO ::cEnvFile - - ::oIDE := oIDE - ::cEnvFile := cEnvFile - - IF empty( ::cEnvFile ) .OR. !hb_fileExists( ::cEnvFile ) - RETURN Self - ENDIF - - a_:= hbide_readSource( ::cEnvFile ) - - ::parse( a_ ) - - RETURN Self - -/*----------------------------------------------------------------------*/ - -METHOD IdeEnvironments:parse( aContents ) - LOCAL s, cPart, cEnv, a_, cKey, cVal - - a_:= {} - cEnv := "" - FOR EACH s IN aContents - s := alltrim( s ) - IF empty( s ) .OR. left( s, 1 ) == "#" /* Remark */ - LOOP - ENDIF - IF left( s, 1 ) == "[" - s := alltrim( strtran( s, "[", "" ) ) - s := alltrim( strtran( s, "]", "" ) ) - IF lower( s ) == "common" - cPart := "common" - ELSE - cPart := "environment" - IF ( s != cEnv ) .AND. !empty( cEnv ) - aadd( ::aNames, cEnv ) - aadd( ::aEnvrns, { cEnv, a_ } ) - ENDIF - cEnv := s - a_:= {} - ENDIF - ELSE - IF cPart == "common" - IF hbide_parseKeyValPair( s, @cKey, @cVal ) - aadd( ::aCommons, { lower( cKey ), cVal } ) /* Format Later */ - ENDIF - ELSEIF cPart == "environment" - IF hbide_parseFilter( s, @cKey, @cVal ) - aadd( a_, { lower( cKey ), cVal } ) - ENDIF - ENDIF - ENDIF - NEXT - IF !empty( cEnv ) .AND. !empty( a_ ) - aadd( ::aNames, cEnv ) - aadd( ::aEnvrns, { cKey, a_ } ) - ENDIF - - RETURN Self - -/*----------------------------------------------------------------------*/ - -METHOD IdeEnvironments:prepareBatch( cEnviron ) - LOCAL n, s, a_, aCmd - LOCAL cFile := space( 255 ) - //LOCAL k, nHandle - - IF ( n := ascan( ::aEnvrns, {|e_| e_[ 1 ] == cEnviron } ) ) > 0 - aCmd := {} - FOR EACH a_ IN ::aEnvrns[ n, 2 ] - s := a_[ 1 ] - IF s == "content" - aadd( aCmd, a_[ 2 ] ) - ENDIF - NEXT - - cFile := hbide_getShellCommandsTempFile( aCmd ) - - #if 0 - IF ( nHandle := HB_FTempCreateEx( @cFile, NIL, "ide_", ".bat" ) ) > 0 - k := "" - FOR EACH a_ IN ::aEnvrns[ n, 2 ] - s := a_[ 1 ] - IF s == "content" - k += a_[ 2 ] + CRLF - ENDIF - NEXT - fWrite( nHandle, k ) - fClose( nHandle ) - ENDIF - #endif - ENDIF - - RETURN cFile - /*----------------------------------------------------------------------*/ // // Class IdeSource @@ -216,6 +83,7 @@ CLASS IdeSource DATA path DATA file DATA ext + DATA projPath METHOD new( cSource ) @@ -254,15 +122,14 @@ CLASS IdeProject DATA type INIT "Executable" DATA title INIT "" DATA location INIT hb_dirBase() + "projects" - DATA wrkDirectory INIT hb_dirBase() + "projects" - DATA destination INIT hb_dirBase() + "projects" - DATA outputName INIT hb_dirBase() + "projects" + DATA wrkDirectory INIT "" + DATA destination INIT "" + DATA outputName INIT "" DATA backup INIT "" DATA launchParams INIT "" DATA launchProgram INIT "" DATA hbpFlags INIT {} DATA sources INIT {} - DATA metaData INIT {} DATA dotHbp INIT "" DATA compilers INIT "" DATA cPathMk2 INIT hb_getenv( "HBIDE_DIR_HBMK2" ) @@ -270,10 +137,9 @@ CLASS IdeProject DATA hSources INIT {=>} DATA hPaths INIT {=>} DATA lPathAbs INIT .F. // Lets try relative paths first . xhp and hbp will be relative anyway + DATA projPath INIT "" METHOD new( oIDE, aProps ) - METHOD applyMeta( s ) - METHOD expandMeta( s ) ENDCLASS @@ -290,25 +156,24 @@ METHOD IdeProject:new( oIDE, aProps ) ::type := a_[ E_qPrjType ] ::title := a_[ E_oPrjTtl ] - ::location := a_[ E_oPrjLoc ] + * ::location := a_[ E_oPrjLoc ] ::wrkDirectory := a_[ E_oPrjWrk ] ::destination := a_[ E_oPrjDst ] ::outputName := a_[ E_oPrjOut ] ::launchParams := a_[ E_oPrjLau ] ::launchProgram := a_[ E_oPrjLEx ] + ::projPath := oIde:oPM:getProjectPathFromTitle( ::title ) + IF empty( ::projPath ) + ::projPath := hb_dirBase() /* In case of new project */ + ENDIF + ::location := ::projPath + ::hbpFlags := aclone( b_[ PRJ_PRP_FLAGS , 2 ] ) ::sources := aclone( b_[ PRJ_PRP_SOURCES , 2 ] ) - ::metaData := aclone( b_[ PRJ_PRP_METADATA, 2 ] ) ::dotHbp := "" ::compilers := "" - IF empty( ::destination ) - ::destination := ::location - ENDIF - IF empty( ::wrkDirectory ) - ::wrkDirectory := ::location - ENDIF IF !empty( oIDE:aINI[ INI_HBIDE, PathMk2 ] ) ::cPathMk2 := oIDE:aINI[ INI_HBIDE, PathMk2 ] ENDIF @@ -316,12 +181,11 @@ METHOD IdeProject:new( oIDE, aProps ) ::cPathEnv := oIDE:aINI[ INI_HBIDE, PathEnv ] ENDIF - FOR EACH a_ IN ::metaData - a_[ 2 ] := hbide_pathNormalized( a_[ 2 ], .f. ) - NEXT - FOR EACH cSource IN ::sources + cSource := hbide_syncProjPath( ::projPath, cSource ) + oSource := IdeSource():new( cSource ) + oSource:projPath := ::projPath ::hSources[ oSource:normalized ] := oSource ::hPaths[ oSource:path ] := NIL NEXT @@ -329,34 +193,6 @@ METHOD IdeProject:new( oIDE, aProps ) RETURN Self -/*----------------------------------------------------------------------*/ - -METHOD IdeProject:applyMeta( s ) - LOCAL k - LOCAL a_:= ::metaData - - IF ! Empty( a_ ) - FOR EACH k IN a_ - s := StrTran( hbide_pathNormalized( s, .f. ), k[ 2 ], k[ 1 ] ) - NEXT - ENDIF - - RETURN s - -/*----------------------------------------------------------------------*/ - -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 - /*----------------------------------------------------------------------*/ // IdeProjectManager /*----------------------------------------------------------------------*/ @@ -368,14 +204,19 @@ CLASS IdeProjManager INHERIT IdeObject DATA nStarted INIT 0 - DATA lLaunch INIT .f. + DATA lLaunch INIT .F. DATA cProjectInProcess INIT "" DATA cPPO INIT "" - DATA lPPO INIT .f. + DATA lPPO INIT .F. DATA oProject DATA cBatch DATA oProcess - DATA lSaveOK INIT .f. + DATA lSaveOK INIT .F. + + DATA cProjFileName INIT "" + DATA lNew INIT .F. + DATA lFetch INIT .T. + DATA lUpdateTree INIT .F. METHOD new( oIDE ) METHOD create( oIDE ) @@ -386,10 +227,10 @@ CLASS IdeProjManager INHERIT IdeObject METHOD fetchProperties() METHOD getProperties() METHOD sortSources( cMode ) - METHOD updateMetaData() METHOD save( lCanClose ) METHOD updateHbp( iIndex ) METHOD addSources() + METHOD getProjectsTitleList() METHOD setCurrentProject( cProjectName ) METHOD getCurrentProject( lAlert ) @@ -397,22 +238,22 @@ CLASS IdeProjManager INHERIT IdeObject METHOD getProjectProperties( cProjectTitle ) METHOD getProjectByFile( cProjectFile ) METHOD getProjectFileNameFromTitle( cProjectTitle ) + METHOD getProjectPathFromTitle( cProjectTitle ) METHOD getProjectByTitle( cProjectTitle ) METHOD getSourcesByProjectTitle( cProjectTitle ) METHOD removeProject( cProjectTitle ) METHOD closeProject( cProjectTitle ) METHOD promptForPath( cObjPathName, cTitle, cObjFileName, cObjPath2, cObjPath3 ) METHOD buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt ) - METHOD launchProject( cProject ) + METHOD launchProject( cProject, cExe ) METHOD showOutput( cOutput, mp2, oProcess ) METHOD finished( nExitCode, nExitStatus, oProcess ) - METHOD saveEnvironments() - METHOD manageEnvironments() METHOD loadXhpProject() - METHOD loadHbpProject() + METHOD loadHbpProject( cHbp ) METHOD isValidProjectLocation( lTell ) METHOD setProjectLocation( cPath ) METHOD buildInterface() + METHOD pullHbpData( cHbp ) ENDCLASS @@ -467,7 +308,7 @@ METHOD IdeProjManager:getProperties() IF ( n := ascan( ::aProjects, {|e_| e_[ 3, PRJ_PRP_PROPERTIES, 2, E_oPrjTtl ] == cTmp } ) ) > 0 aPrj := ::aProjects[ n, 3 ] cHbi := aPrj[ PRJ_PRP_PROPERTIES, 2, PRJ_PRP_LOCATION ] + ::pathSep + ; - aPrj[ PRJ_PRP_PROPERTIES, 2, PRJ_PRP_OUTPUT ] + ".hbi" + aPrj[ PRJ_PRP_PROPERTIES, 2, PRJ_PRP_OUTPUT ] + ".hbp" ::loadProperties( cHbi, .f., .t., .t. ) ELSE @@ -479,78 +320,351 @@ METHOD IdeProjManager:getProperties() /*----------------------------------------------------------------------*/ METHOD IdeProjManager:loadProperties( cProjFileName, lNew, lFetch, lUpdateTree ) - LOCAL n, t, cWrkProject + LOCAL nAlready DEFAULT cProjFileName TO "" DEFAULT lNew TO .F. DEFAULT lFetch TO .T. DEFAULT lUpdateTree TO .F. - /* Never touch original project file name */ + ::cProjFileName := cProjFileName + ::lNew := lNew + ::lFetch := lFetch + ::lUpdateTree := lUpdateTree - ::aPrjProps := {} - ::cSaveTo := "" + ::aPrjProps := {} + ::cSaveTo := "" + ::oProject := NIL IF lNew lFetch := .t. ELSE IF empty( cProjFileName ) - cProjFileName := hbide_fetchAFile( ::oDlg, "Load Project...", { { "Harbour IDE Projects (*.hbi)", "*.hbi" } } ) + cProjFileName := hbide_fetchAFile( ::oDlg, "Load Project...", { { "Harbour IDE Projects (*.hbp)", "*.hbp" } } ) ENDIF IF empty( cProjFileName ) RETURN Self ENDIF ENDIF - n := 0 - IF !empty( cProjFileName ) - cWrkProject := hbide_pathNormalized( cProjFileName ) /* normalize project name */ - IF ( n := ascan( ::aProjects, {|e_| hbide_pathNormalized( e_[ 1 ] ) == cWrkProject } ) ) > 0 - ::aPrjProps := ::aProjects[ n, 3 ] - t := ::aPrjProps[ PRJ_PRP_PROPERTIES, 2, E_qPrjType ] - ENDIF - IF empty( ::aPrjProps ) - ::aPrjProps := hbide_fetchHbiStructFromFile( hbide_pathToOSPath( cProjFileName ) ) - ENDIF - ::oIDE:aMeta := ::aPrjProps[ PRJ_PRP_METADATA, 2 ] + cProjFileName := hbide_pathToOSPath( cProjFileName ) + + nAlready := ascan( ::aProjects, {|e_| e_[ 1 ] == hbide_pathNormalized( cProjFileName ) } ) + + IF !empty( cProjFileName ) .AND. hb_fileExists( cProjFileName ) + ::aPrjProps := ::pullHbpData( hbide_pathToOSPath( cProjFileName ) ) ENDIF IF lFetch /* Access/Assign via this object */ ::oProject := IdeProject():new( ::oIDE, ::aPrjProps ) // - //::fetchProperties() - // + ::oPropertiesDock:hide() ::oPropertiesDock:show() - // - IF !empty( ::cSaveTo ) .and. hb_FileExists( ::cSaveTo ) - cProjFileName := ::cSaveTo - ::aPrjProps := hbide_fetchHbiStructFromFile( hbide_pathToOSPath( cProjFileName ) ) /* Reload from file */ - ENDIF - ENDIF - - IF lFetch .AND. empty( ::cSaveTo ) - RETURN Self - ENDIF - - IF n == 0 - aadd( ::oIDE:aProjects, { hbide_pathNormalized( cProjFileName ), cProjFileName, aclone( ::aPrjProps ) } ) - IF lUpdateTree - ::oIDE:updateProjectTree( ::aPrjProps ) - ENDIF - hbide_mnuAddFileToMRU( ::oIDE, cProjFileName, INI_RECENTPROJECTS ) ELSE - ::aProjects[ n, 3 ] := aclone( ::aPrjProps ) - IF lUpdateTree - ::oIDE:updateProjectTree( ::aPrjProps ) - ENDIF - IF lUpdateTree .AND. ::aPrjProps[ PRJ_PRP_PROPERTIES, 2, E_qPrjType ] <> t - MsgBox( "::removeProjectFromTree( ::aPrjProps )" ) + IF nAlready == 0 .AND. !empty( ::aPrjProps ) + aadd( ::oIDE:aProjects, { hbide_pathNormalized( cProjFileName ), cProjFileName, aclone( ::aPrjProps ) } ) + IF lUpdateTree + ::oIDE:updateProjectTree( ::aPrjProps ) + ENDIF + hbide_mnuAddFileToMRU( ::oIDE, cProjFileName, INI_RECENTPROJECTS ) + ELSE + ::aProjects[ nAlready, 3 ] := aclone( ::aPrjProps ) + IF lUpdateTree + ::oIDE:updateProjectTree( ::aPrjProps ) + ENDIF + #if 0 + IF lUpdateTree .AND. ::aPrjProps[ PRJ_PRP_PROPERTIES, 2, E_qPrjType ] <> t + MsgBox( "::removeProjectFromTree( ::aPrjProps )" ) + ENDIF + #endif ENDIF + ENDIF RETURN Self +/*----------------------------------------------------------------------*/ +// +// Without user-interface +// +METHOD IdeProjManager:pullHbpData( cHbp ) + LOCAL n, n1, s, cKey, cVal, aOptns, aFiles, c3rd, nL, aData, cHome, cOutName, cType + LOCAL aPrp := { ; + "hbide_type=" , ; + "hbide_title=" , ; + "hbide_workingfolder=" , ; + "hbide_destinationfolder=" , ; + "hbide_output=" , ; + "hbide_launchparams=" , ; + "hbide_launchprogram=" , ; + "hbide_backupfolder=" } + + LOCAL a1_0 := afill( array( PRJ_PRP_PRP_VRBLS ), "" ) + LOCAL a1_1 := {} + LOCAL a2_0 := {} + LOCAL a2_1 := {} + LOCAL a3_0 := {} + LOCAL a3_1 := {} + LOCAL a4_0 := {} + LOCAL a4_1 := {} + LOCAL a3rd := {} + + hb_fNameSplit( cHbp, @cHome, @cOutName ) + cHome := hbide_pathStripLastSlash( cHome ) + + c3rd := "-3rd=" + nL := len( c3rd ) + aData := hbide_fetchHbpData( cHbp ) + aOptns := aData[ 1 ] + aFiles := aData[ 2 ] + + FOR EACH s IN aFiles + s := hbide_stripRoot( cHome, s ) + NEXT + + IF ( n := ascan( aOptns, {|e| lower( e ) $ "-hbexec,-hblib,-hbdyn" } ) ) > 0 + cType := lower( aOptns[ n ] ) + cType := iif( cType == "-hblib", "Lib", iif( cType == "-hbdyn", "Dll", "Executable" ) ) + ELSE + cType := "Executable" + ENDIF + + /* Separate hbIDE specific flags */ + FOR EACH s IN aOptns + IF ( n := at( c3rd, s ) ) > 0 + IF ( n1 := hb_at( " ", s, n ) ) > 0 + aadd( a3rd, substr( s, n + nL, n1 - n - nL ) ) + s := substr( s, 1, n - 1 ) + substr( s, n1 ) + ELSE + aadd( a3rd, substr( s, n + nL ) ) + s := substr( s, 1, n - 1 ) + ENDIF + ENDIF + NEXT + + /* PRJ_PRP_PROPERTIES */ + FOR EACH s IN a3rd +//hbide_dbg( "3rd ", s ) + IF ( n := at( "=", s ) ) > 0 + cKey := alltrim( substr( s, 1, n-1 ) ) + cVal := alltrim( substr( s, n+1 ) ) + IF ( n := ascan( aPrp, cKey ) ) > 0 + a1_0[ n ] := hbide_amp2space( cVal ) + ENDIF + ENDIF + NEXT + + a1_0[ PRJ_PRP_TYPE ] := iif( empty( a1_0[ PRJ_PRP_TYPE ] ), cType , a1_0[ PRJ_PRP_TYPE ] ) + a1_0[ PRJ_PRP_TITLE ] := iif( empty( a1_0[ PRJ_PRP_TITLE ] ), cOutName, a1_0[ PRJ_PRP_TITLE ] ) + a1_0[ PRJ_PRP_OUTPUT ] := cOutName + a1_0[ PRJ_PRP_LOCATION ] := hbide_pathNormalized( cHome ) + + /* PRJ_PRP_FLAGS */ + FOR EACH s IN aOptns +//hbide_dbg( "FLAGS ", s ) + IF !empty( s ) + aadd( a2_0, s ) + ENDIF + NEXT + + /* PRJ_PRP_SOURCES */ + FOR EACH s IN aFiles +//hbide_dbg( "SOURCE ", s ) + aadd( a3_0, s ) + NEXT + + /* Properties */ + FOR EACH s IN a1_0 + aadd( a1_1, s ) + NEXT + + /* Flags */ + IF !empty( a2_0 ) + FOR EACH s IN a2_0 + aadd( a2_1, s ) + NEXT + ENDIF + + /* Sources */ + IF !empty( a3_0 ) + FOR EACH s IN a3_0 + IF !( "#" == left( s,1 ) ) .and. !empty( s ) + aadd( a3_1, hbide_stripRoot( cHome, hbide_stripFilter( s ) ) ) + ENDIF + NEXT + ENDIF + + RETURN { { a1_0, a1_1 }, { a2_0, a2_1 }, { a3_0, a3_1 }, { a4_0, a4_1 } } + +/*----------------------------------------------------------------------*/ + +METHOD IdeProjManager:loadHbpProject( cHbp ) + LOCAL aData, aOptns, aFiles, cHome, cOutName, cType, n, s + + IF empty( cHbp ) .OR. !hb_fileExists( cHbp ) + cHbp := hbide_fetchAFile( ::oDlg, "Selecet Harbour Project File", { { "Harbour Project Files", "*.hbp" } } ) + IF empty( cHbp ) + RETURN Self + ENDIF + ENDIF + hb_fNameSplit( cHbp, @cHome, @cOutName ) + cHome := hbide_pathStripLastSlash( cHome ) + + aData := hbide_fetchHbpData( cHbp ) + aOptns := aData[ 1 ] + aFiles := aData[ 2 ] + + FOR EACH s IN aFiles + s := hbide_stripRoot( cHome, s ) + NEXT + + IF ( n := ascan( aOptns, {|e| lower( e ) $ "-hbexec,-hblib,-hbdyn" } ) ) > 0 + cType := lower( aOptns[ n ] ) + ELSE + cType := "" + ENDIF + /* Basic Parsing is complete , parse paths from keywords */ + SWITCH cType + CASE "-hblib" + ::oUI:q_comboPrjType:setCurrentIndex( 1 ) + EXIT + CASE "-hbdyn" + ::oUI:q_comboPrjType:setCurrentIndex( 2 ) + EXIT + OTHERWISE + ::oUI:q_comboPrjType:setCurrentIndex( 0 ) + EXIT + ENDSWITCH + + ::oUI:q_editPrjTitle :setText( cOutName ) + ::oUI:q_editPrjLoctn :setText( hbide_pathNormalized( cHome ) ) +* ::oUI:q_editWrkFolder:setText( "" ) + ::oUI:q_editDstFolder:setText( "" ) /* To parse -o : but first fix path verification to honor filters */ +* ::oUI:q_editBackup :setText( "" ) + ::oUI:q_editOutName :setText( cOutName ) +* ::oUI:q_editLaunchParams:setText( cParams ) +* ::oUI:q_editLaunchExe:setText( cRun ) + + ::oUI:q_editFlags :setPlainText( hbide_arrayToMemo( aOptns ) ) + ::oUI:q_editSources:setPlainText( hbide_arrayToMemo( aFiles ) ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeProjManager:save( lCanClose ) + LOCAL a_, lOk, txt_, nAlready + LOCAL c3rd := "-3rd=" + + * Validate certain parameters before continuing ... (vailtom) + + IF Empty( ::oUI:q_editPrjTitle:text() ) + ::oUI:q_editPrjTitle:setText( ::oUI:q_editOutName:text() ) + ENDIF + + 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( ::oUI:q_editPrjLoctn:text(), 'Project Location' ) + ::oUI:q_editPrjLoctn:setFocus() + RETURN .F. + ENDIF + + txt_:= {} + // + aadd( txt_, c3rd + "hbide_version=" + "1.0" ) + aadd( txt_, c3rd + "hbide_type=" + { "Executable", "Lib", "Dll" }[ ::oUI:q_comboPrjType:currentIndex() + 1 ] ) + aadd( txt_, c3rd + "hbide_title=" + hbide_space2amp( ::oUI:q_editPrjTitle :text() ) ) + aadd( txt_, c3rd + "hbide_location=" + hbide_space2amp( ::oUI:q_editPrjLoctn :text() ) ) + aadd( txt_, c3rd + "hbide_workingfolder=" + hbide_space2amp( ::oUI:q_editWrkFolder :text() ) ) + aadd( txt_, c3rd + "hbide_destinationfolder=" + hbide_space2amp( ::oUI:q_editDstFolder :text() ) ) + aadd( txt_, c3rd + "hbide_output=" + hbide_space2amp( ::oUI:q_editOutName :text() ) ) + aadd( txt_, c3rd + "hbide_launchparams=" + hbide_space2amp( ::oUI:q_editLaunchParams:text() ) ) + aadd( txt_, c3rd + "hbide_launchprogram=" + hbide_space2amp( ::oUI:q_editLaunchExe :text() ) ) + aadd( txt_, c3rd + "hbide_backupfolder=" + hbide_space2amp( ::oUI:q_editBackup :text() ) ) + aadd( txt_, " " ) + a_:= hbide_memoToArray( ::oUI:q_editFlags:toPlainText() ) ; aeval( a_, {|e| aadd( txt_, e ) } ) + aadd( txt_, " " ) + a_:= hbide_memoToArray( ::oUI:q_editSources:toPlainText() ) ; aeval( a_, {|e| aadd( txt_, e ) } ) + aadd( txt_, " " ) + + ::cSaveTo := ::oUI:q_editPrjLoctn:text() + ::pathSep + ::oUI:q_editOutName:text() + ".hbp" + + ::cSaveTo := hbide_pathToOSPath( ::cSaveTo ) +hbide_dbg( ::lUpdateTree, ::cSaveTo ) + IF ( lOk := hbide_createTarget( ::cSaveTo, txt_ ) ) + ::aPrjProps := ::pullHbpData( hbide_pathToOSPath( ::cSaveTo ) ) + + IF ( nAlready := ascan( ::aProjects, {|e_| e_[ 1 ] == hbide_pathNormalized( ::cSaveTo ) } ) ) == 0 +hbide_dbg( nAlready, ::lUpdateTree, ::cSaveTo ) + aadd( ::oIDE:aProjects, { hbide_pathNormalized( ::cSaveTo ), ::cSaveTo, aclone( ::aPrjProps ) } ) + IF ::lUpdateTree + ::oIDE:updateProjectTree( ::aPrjProps ) + ENDIF + hbide_mnuAddFileToMRU( ::oIDE, ::cSaveTo, INI_RECENTPROJECTS ) + ELSE +hbide_dbg( nAlready, ::lUpdateTree, ::cSaveTo ) + ::aProjects[ nAlready, 3 ] := aclone( ::aPrjProps ) + IF ::lUpdateTree + ::oIDE:updateProjectTree( ::aPrjProps ) + ENDIF + ENDIF + + ELSE + MsgBox( 'Error saving project file: ' + ::cSaveTo, 'Error saving project ...' ) + + ENDIF + + IF lCanClose .AND. lOk + ::oPropertiesDock:hide() + ENDIF + + RETURN lOk + +/*----------------------------------------------------------------------*/ + +METHOD IdeProjManager:updateHbp( iIndex ) + LOCAL a_, txt_, s, cExt + + IF iIndex != 3 + RETURN nil + ENDIF + + txt_:= {} + + /* Flags */ + a_:= hb_atokens( ::oUI:q_editFlags:toPlainText(), _EOL ) + FOR EACH s IN a_ + s := alltrim( s ) + IF !( "#" == left( s,1 ) ) .and. !empty( s ) + aadd( txt_, s ) + ENDIF + NEXT + aadd( txt_, " " ) + + /* Sources */ + a_:= hb_atokens( ::oUI:q_editSources:toPlainText(), _EOL ) + FOR EACH s IN a_ + s := alltrim( s ) + IF !( "#" == left( s,1 ) ) .and. !empty( s ) + hb_FNameSplit( s, , , @cExt ) + IF lower( cExt ) $ ".c,.cpp,.prg,.rc,.res" + aadd( txt_, s ) + ENDIF + ENDIF + NEXT + aadd( txt_, " " ) + + /* Final assault */ + ::oUI:q_editHbp:setPlainText( hbide_arrayToMemo( txt_ ) ) + + RETURN txt_ + /*----------------------------------------------------------------------*/ METHOD IdeProjManager:fetchProperties() @@ -576,7 +690,6 @@ METHOD IdeProjManager:fetchProperties() ::oUI:q_editFlags :setPlainText( "" ) ::oUI:q_editSources :setPlainText( "" ) - ::oUI:q_editMetaData :setPlainText( "" ) ::oUI:q_editLaunchParams:setText( "" ) ::oUI:q_editLaunchExe:setText( "" ) @@ -596,16 +709,15 @@ METHOD IdeProjManager:fetchProperties() ::oUI:q_comboPrjType:setCurrentIndex( 0 ) ENDCASE - ::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_editBackup :setText( ::oProject:applyMeta( ::oProject:backup ) ) + ::oUI:q_editPrjTitle :setText( ::oProject:title ) + ::oUI:q_editPrjLoctn :setText( ::oProject:location ) + ::oUI:q_editWrkFolder:setText( ::oProject:wrkDirectory ) + ::oUI:q_editDstFolder:setText( ::oProject:destination ) + ::oUI:q_editBackup :setText( ::oProject:backup ) ::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 ] ) ) - ::oUI:q_editMetaData :setPlainText( hbide_arrayToMemo( ::aPrjProps[ PRJ_PRP_METADATA, 1 ] ) ) ::oUI:q_editLaunchParams:setText( ::oProject:launchParams ) ::oUI:q_editLaunchExe:setText( ::oProject:launchProgram ) @@ -638,7 +750,6 @@ METHOD IdeProjManager:buildInterface() ::oUI:q_buttonChooseDest :setIcon( cLukupPng ) ::oUI:q_buttonBackup :setIcon( cLukupPng ) ::oUI:q_buttonXmate :setIcon( hbide_image( "xmate" ) ) - ::oUI:q_buttonHbp :setIcon( hbide_image( "open" ) ) ::oUI:q_buttonSelect :setIcon( hbide_image( "open" ) ) ::oUI:q_buttonSort :setIcon( hbide_image( "sort" ) ) @@ -655,14 +766,12 @@ METHOD IdeProjManager:buildInterface() ::oUI:signal( "buttonSortOrg" , "clicked()", {|| ::sortSources( "org" ) } ) // ::oUI:signal( "tabWidget" , "currentChanged(int)", {|p| ::updateHbp( p ) } ) - ::oUI:signal( "editMetaData" , "textChanged()" , {|| ::updateMetaData() } ) ::oUI:signal( "buttonChoosePrjLoc", "clicked()", {|| ::PromptForPath( 'editPrjLoctn' , 'Choose Project Location...' ) } ) ::oUI:signal( "buttonChooseWd" , "clicked()", {|| ::PromptForPath( 'editWrkFolder', 'Choose Working Folder...' ) } ) ::oUI:signal( "buttonChooseDest" , "clicked()", {|| ::PromptForPath( 'editDstFolder', 'Choose Destination Folder...' ) } ) ::oUI:signal( "buttonBackup" , "clicked()", {|| ::PromptForPath( 'editBackup' , 'Choose Backup Folder...' ) } ) ::oUI:signal( "buttonXmate" , "clicked()", {|| ::loadXhpProject() } ) - ::oUI:signal( "buttonHbp" , "clicked()", {|| ::loadHbpProject() } ) ::oUI:signal( "editPrjLoctn" , "textChanged(QString)", {|cPath| ::setProjectLocation( cPath ) } ) @@ -670,148 +779,6 @@ METHOD IdeProjManager:buildInterface() /*----------------------------------------------------------------------*/ -METHOD IdeProjManager:save( lCanClose ) - LOCAL a_, lOk, cPath, txt_ - - * Validate certain parameters before continuing ... (vailtom) - - /* 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 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 - - /* 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 - - /* 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 = " + { "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() ) - aadd( txt_, "DestinationFolder = " + ::oUI:q_editDstFolder :text() ) - aadd( txt_, "Output = " + ::oUI:q_editOutName :text() ) - aadd( txt_, "LaunchParams = " + ::oUI:q_editLaunchParams:text() ) - aadd( txt_, "LaunchProgram = " + ::oUI:q_editLaunchExe :text() ) - aadd( txt_, "BackupFolder = " + ::oUI:q_editBackup :text() ) - aadd( txt_, " " ) - // - aadd( txt_, "[ FLAGS ]" ) - 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_, " " ) - 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_ ) - - ::cSaveTo := hbide_parseWithMetaData( ::oUI:q_editPrjLoctn:text(), a4_1 ) + ; - ::pathSep + ; - 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 is saved successfully: ' + ::cSaveTo, 'Saving project ...' ) - ELSE - MsgBox( 'Error saving project file: ' + ::cSaveTo, 'Error saving project ...' ) - ENDIF - - IF lCanClose .AND. lOk - ::oPropertiesDock:hide() - ENDIF - - RETURN lOk - -/*----------------------------------------------------------------------*/ - -METHOD IdeProjManager:loadHbpProject() - LOCAL cHbp, aData, aOptns, aFiles, cHome, cOutName, cType, n - - cHbp := hbide_fetchAFile( ::oDlg, "Selecet Harbour Project File", { { "Harbour Project Files", "*.hbp" } } ) - IF empty( cHbp ) - RETURN Self - ENDIF - hb_fNameSplit( cHbp, @cHome, @cOutName ) - cHome := hbide_pathStripLastSlash( cHome ) - - aData := hbide_fetchHbpData( cHbp ) - aOptns := aData[ 1 ] - aFiles := aData[ 2 ] - - IF ( n := ascan( aOptns, {|e| lower( e ) $ "-hbexec,-hblib,-hbdyn" } ) ) > 0 - cType := lower( aOptns[ n ] ) - ELSE - cType := "" - ENDIF - /* Basic Parsing is complete , parse paths from keywords */ - SWITCH cType - CASE "-hblib" - ::oUI:q_comboPrjType:setCurrentIndex( 1 ) - EXIT - CASE "-hbdyn" - ::oUI:q_comboPrjType:setCurrentIndex( 2 ) - EXIT - OTHERWISE - ::oUI:q_comboPrjType:setCurrentIndex( 0 ) - EXIT - ENDSWITCH - - ::oUI:q_editPrjTitle :setText( cOutName ) - ::oUI:q_editPrjLoctn :setText( cHome ) -* ::oUI:q_editWrkFolder:setText( "" ) - ::oUI:q_editDstFolder:setText( "" ) /* To parse -o : but first fix path verification to honor filters */ -* ::oUI:q_editBackup :setText( "" ) - ::oUI:q_editOutName :setText( cOutName ) -* ::oUI:q_editLaunchParams:setText( cParams ) -* ::oUI:q_editLaunchExe:setText( cRun ) - - ::oUI:q_editFlags :setPlainText( hbide_arrayToMemo( aOptns ) ) - ::oUI:q_editSources:setPlainText( hbide_arrayToMemo( aFiles ) ) - - RETURN Self - -/*----------------------------------------------------------------------*/ - METHOD IdeProjManager:loadXhpProject() LOCAL cXhp, a_, s, n, cPart, cKey, cVal LOCAL cHome, cOutname, cType, cDefine, cInclude @@ -976,104 +943,6 @@ METHOD IdeProjManager:loadXhpProject() /*----------------------------------------------------------------------*/ -METHOD IdeProjManager:manageEnvironments() - LOCAL oUIEnv - - IF empty( ::oEnvironDock:qtObject ) - oUIEnv := HbQtUI():new( ::resPath + "environments.uic", ::oEnvironDock:oWidget ):build() - ::oEnvironDock:qtObject := oUIEnv - ::oEnvironDock:oWidget:setWidget( oUIEnv ) - - oUIEnv:q_buttonPathMk2:setIcon( hbide_image( "folder" ) ) - oUIEnv:q_buttonPathEnv:setIcon( hbide_image( "folder" ) ) - - oUIEnv:signal( "buttonCn" , "clicked()", {|| ::oEnvironDock:hide() } ) - oUIEnv:signal( "buttonSave" , "clicked()", {|| ::saveEnvironments() } ) - oUIEnv:signal( "buttonSaveExit", "clicked()", {|| ::saveEnvironments(), ::oEnvironDock:hide() } ) - oUIEnv:signal( "buttonPathMk2" , "clicked()", {|| ::PromptForPath( 'editPathMk2', 'Choose hbmk2 Executable Folder...' ) } ) - oUIEnv:signal( "buttonPathEnv" , "clicked()", {|| ::PromptForPath( 'editPathEnv', 'Choose hbIDE.env Folder...' ), ; - ::oEnvironDock:qtObject:q_editCompilers:setPlainText( ; - hb_memoread( hbide_pathFile( ::oEnvironDock:qtObject:q_editPathEnv:text(), "hbide.env" ) ) ) } ) - ENDIF - - ::oEnvironDock:qtObject:q_editPathMk2 :setText( ::aINI[ INI_HBIDE, PathMk2 ] ) - ::oEnvironDock:qtObject:q_editPathEnv :setText( ::aINI[ INI_HBIDE, PathEnv ] ) - ::oEnvironDock:qtObject:q_editCompilers:setPlainText( hb_memoread( hbide_pathFile( ::aINI[ INI_HBIDE, PathEnv ], "hbide.env" ) ) ) - - RETURN Self - -/*----------------------------------------------------------------------*/ - -METHOD IdeProjManager:saveEnvironments() - LOCAL cText, cPathMk2, cPathEnv - LOCAL oUIEnv := ::oEnvironDock:qtObject - - cPathMk2 := oUIEnv:q_editPathMk2:text() - cPathEnv := oUIEnv:q_editPathEnv:text() - - ::oIDE:aINI[ INI_HBIDE, PathMk2 ] := cPathMk2 - ::oIDE:aINI[ INI_HBIDE, PathEnv ] := cPathEnv - // - ::oIDE:cWrkPathMk2 := cPathMk2 - ::oIDE:cWrkPathEnv := cPathEnv - - IF !empty( cText := oUIEnv:q_editCompilers:toPlainText() ) - hb_MemoWrit( hbide_pathFile( cPathEnv, "hbide.env" ), cText ) - ENDIF - - RETURN Self - -/*----------------------------------------------------------------------*/ - -METHOD IdeProjManager:updateHbp( iIndex ) - LOCAL a_, a4_1, txt_, s - LOCAL cExt - - IF iIndex != 3 - RETURN nil - ENDIF - - a_:= hb_atokens( strtran( ::oUI:q_editMetaData:toPlainText(), chr( 13 ) ), _EOL ) - a4_1 := hbide_setupMetaKeys( a_ ) - - txt_:= {} - /* This block will be absent when submitting to hbmk engine */ - aadd( txt_, "# " + hbide_parseWithMetaData( ::oUI:q_editWrkFolder:text(), a4_1 ) + ::pathSep + ; - hbide_parseWithMetaData( ::oUI:q_editOutName:text(), a4_1 ) + ".hbp" ) - aadd( txt_, " " ) - - /* Flags */ - a_:= hb_atokens( ::oUI:q_editFlags:toPlainText(), _EOL ) - FOR EACH s IN a_ - s := alltrim( s ) - IF !( "#" == left( s,1 ) ) .and. !empty( s ) - s := hbide_parseWithMetaData( s, a4_1 ) - aadd( txt_, s ) - ENDIF - NEXT - aadd( txt_, " " ) - - /* Sources */ - a_:= hb_atokens( ::oUI:q_editSources:toPlainText(), _EOL ) - FOR EACH s IN a_ - s := alltrim( s ) - IF !( "#" == left( s,1 ) ) .and. !empty( s ) - s := hbide_parseWithMetaData( s, a4_1 ) - hb_FNameSplit( s, , , @cExt ) - IF lower( cExt ) $ ".c,.cpp,.prg,.rc,.res" - aadd( txt_, s ) - ENDIF - ENDIF - NEXT - aadd( txt_, " " ) - - /* Final assault */ - ::oUI:q_editHbp:setPlainText( hbide_arrayToMemo( txt_ ) ) - - RETURN txt_ - -/*----------------------------------------------------------------------*/ - METHOD IdeProjManager:sortSources( cMode ) LOCAL a_, cTyp, s, d_, n LOCAL aSrc := { ".ch", ".prg", ".c", ".cpp", ".h", ".obj", ".o", ".lib", ".a", ".rc", ".res" } @@ -1083,11 +952,11 @@ METHOD IdeProjManager:sortSources( cMode ) a_:= hbide_memoToArray( ::oUI:q_editSources:toPlainText() ) IF cMode == "az" - asort( a_, , , {|e,f| lower( e ) < lower( f ) } ) + asort( a_, , , {|e,f| lower( hbide_stripFilter( e ) ) < lower( hbide_stripFilter( f ) ) } ) ELSEIF cMode == "za" - asort( a_, , , {|e,f| lower( f ) < lower( e ) } ) + asort( a_, , , {|e,f| lower( hbide_stripFilter( f ) ) < lower( hbide_stripFilter( e ) ) } ) ELSEIF cMode == "org" - asort( a_, , , {|e,f| lower( e ) < lower( f ) } ) + asort( a_, , , {|e,f| lower( hbide_stripFilter( e ) ) < lower( hbide_stripFilter( f ) ) } ) FOR EACH s IN a_ s := alltrim( s ) @@ -1105,18 +974,18 @@ METHOD IdeProjManager:sortSources( cMode ) a_:= {} FOR EACH d_ IN aTxt IF !empty( d_ ) - aadd( a_, " # " ) - aadd( a_, " # " + aSrc[ d_:__enumIndex() ] ) - aadd( a_, " # " ) + aadd( a_, " #" ) + aadd( a_, " #" + aSrc[ d_:__enumIndex() ] ) + aadd( a_, " #" ) FOR EACH s IN d_ aadd( a_, s ) NEXT ENDIF NEXT IF !empty( aRst ) - aadd( a_, " # " ) - aadd( a_, " # " + "Unrecognized..." ) - aadd( a_, " # " ) + aadd( a_, " #" ) + aadd( a_, " #" + "Unrecognized..." ) + aadd( a_, " #" ) FOR EACH s IN aRst aadd( a_, s ) NEXT @@ -1130,28 +999,6 @@ METHOD IdeProjManager:sortSources( cMode ) /*----------------------------------------------------------------------*/ -METHOD IdeProjManager:updateMetaData() - LOCAL a_, s, n, cKey, cVal - LOCAL a4_1 := {} - - 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:setProjectLocation( cPath ) IF ! hb_dirExists( cPath ) @@ -1189,21 +1036,18 @@ METHOD IdeProjManager:isValidProjectLocation( lTell ) /*----------------------------------------------------------------------*/ METHOD IdeProjManager:addSources() - LOCAL aFiles, a_, b_, a4_1, s + LOCAL aFiles, a_, b_, s IF ::isValidProjectLocation( .t. ) IF !empty( aFiles := ::oSM:selectSource( "openmany" ) ) - a_:= hbide_memoToArray( ::oUI:q_editMetaData:toPlainText() ) - a4_1 := hbide_setupMetaKeys( a_ ) - a_:= hbide_memoToArray( ::oUI:q_editSources:toPlainText() ) b_:={} - aeval( aFiles, {|e| aadd( b_, hbide_applyMetaData( e, a4_1 ) ) } ) + aeval( aFiles, {|e| aadd( b_, e ) } ) FOR EACH s IN b_ IF ascan( a_, s ) == 0 - aadd( a_, s ) + aadd( a_, hbide_stripRoot( ::oUI:q_editPrjLoctn:text(), s ) ) ENDIF NEXT @@ -1358,6 +1202,15 @@ METHOD IdeProjManager:getProjectByFile( cProjectFile ) /*----------------------------------------------------------------------*/ +METHOD IdeProjManager:getProjectPathFromTitle( cProjectTitle ) + LOCAL cPath + + hb_fNameSplit( ::getProjectFileNameFromTitle( cProjectTitle ), @cPath ) + + RETURN cPath + +/*----------------------------------------------------------------------*/ + METHOD IdeProjManager:getProjectFileNameFromTitle( cProjectTitle ) LOCAL n, cProjFileName := "" @@ -1436,7 +1289,7 @@ METHOD IdeProjManager:promptForPath( cObjPathName, cTitle, cObjFileName, cObjPat LOCAL cTemp, cPath, cFile IF hb_isObject( ::oProject ) - cTemp := ::oProject:expandMeta( ::oUI:qObj[ cObjPathName ]:Text() ) + cTemp := ::oUI:qObj[ cObjPathName ]:Text() ELSE cTemp := "" ENDIF @@ -1445,7 +1298,7 @@ METHOD IdeProjManager:promptForPath( cObjPathName, cTitle, cObjFileName, cObjPat cPath := hbide_fetchADir( ::oDlg, cTitle, cTemp ) ELSE - cTemp := hbide_fetchAFile( ::oDlg, cTitle, { { "Harbour IDE Projects", "*.hbi" } }, cTemp ) + cTemp := hbide_fetchAFile( ::oDlg, cTitle, { { "Harbour IDE Projects", "*.hbp" } }, cTemp ) IF !Empty( cTemp ) hb_fNameSplit( hbide_pathNormalized( cTemp, .f. ), @cPath, @cFile ) @@ -1458,9 +1311,6 @@ METHOD IdeProjManager:promptForPath( cObjPathName, cTitle, cObjFileName, cObjPat IF Right( cPath, 1 ) $ '/\' cPath := Left( cPath, Len( cPath ) - 1 ) ENDIF - IF hb_isObject( ::oProject ) - cPath := ::oProject:applyMeta( cPath ) - ENDIF ::oUI:qObj[ cObjPathName ]:setText( cPath ) IF hb_isChar( cObjPath2 ) .AND. Empty( ::oUI:qObj[ cObjPath2 ]:Text() ) @@ -1479,8 +1329,10 @@ METHOD IdeProjManager:promptForPath( cObjPathName, cTitle, cObjFileName, cObjPat /*----------------------------------------------------------------------*/ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt ) - LOCAL cHbpPath, oEdit, cHbpFN, cTmp, cTargetFN, cExeHbMk2, aHbp, cCmd, cC, cArg + LOCAL cHbpPath, oEdit, cHbpFN, cTmp, cExeHbMk2, aHbp, cCmd, cC, cArg + LOCAL cCmdParams + //cTargetFN aHbp := {} DEFAULT lLaunch TO .F. @@ -1508,8 +1360,10 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt ) ::oProject := ::getProjectByTitle( cProject ) - cTargetFN := hbide_pathFile( ::oProject:destination, iif( empty( ::oProject:outputName ), "_temp", ::oProject:outputName ) ) - cHbpFN := hbide_pathFile( ::oProject:wrkDirectory, iif( empty( ::oProject:outputName ), "_temp", ::oProject:outputName ) ) +// cTargetFN := hbide_pathFile( ::oProject:destination, iif( empty( ::oProject:outputName ), "_temp", ::oProject:outputName ) ) +// cTargetFN := hbide_pathFile( ::oProject:location , iif( empty( ::oProject:outputName ), "_temp", ::oProject:outputName ) ) + //cHbpFN := hbide_pathFile( ::oProject:wrkDirectory, iif( empty( ::oProject:outputName ), "_temp", ::oProject:outputName ) ) + cHbpFN := hbide_pathFile( ::oProject:location, iif( empty( ::oProject:outputName ), "_temp", ::oProject:outputName ) ) * cHbpPath := cHbpFN + iif( ::lPPO, '.' + hb_md5( hb_ntos( seconds() ) ), "" ) + ".hbp" cHbpPath := cHbpFN + iif( ::lPPO, '_tmp', "" ) + ".hbp" @@ -1521,17 +1375,14 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt ) ENDIF ENDIF - aadd( aHbp, "# User Supplied Flags" ) - aadd( aHbp, " " ) + #if 0 IF !empty( ::oProject:hbpFlags ) aeval( ::oProject:hbpFlags, {|e| aadd( aHbp, e ) } ) ENDIF + #endif - aadd( aHbp, " " ) - aadd( aHbp, "# hbIDE Supplied Flags" ) - aadd( aHbp, " " ) IF !( ::lPPO ) - aadd( aHbp, "-o" + cTargetFN ) + * aadd( aHbp, "-o" + cTargetFN ) * aadd( aHbp, "-workdir=" + ::oProject:wrkDirectory + "/${hb_plat}/${hb_comp}" ) ENDIF aadd( aHbp, "-q" ) @@ -1540,23 +1391,14 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt ) IF lRebuild aadd( aHbp, "-rebuild" ) ENDIF - aadd( aHbp, " " ) - IF !( ::lPPO ) - /* Add all sources to .hbp */ - aadd( aHbp, "# Source Files" ) - aadd( aHbp, " " ) - aeval( hbide_filesToSources( ::oProject:sources ), {|e| aadd( aHbp, e ) } ) - - ELSE + IF ::lPPO IF !empty( oEdit := ::oEM:getEditorCurrent() ) IF hbide_isSourcePRG( oEdit:sourceFile ) aadd( aHbp, "-hbcmp" ) aadd( aHbp, "-s" ) aadd( aHbp, "-p" ) - aadd( aHbp, " " ) - aadd( aHbp, "# Source File - PPO" ) - aadd( aHbp, " " ) + aadd( aHbp, "-hbraw" ) // 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 @@ -1575,11 +1417,10 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt ) ENDIF ENDIF - ::oIDE:lDockBVisible := .t. ::oDockB2:show() ::oOutputResult:oWidget:clear() - IF !hbide_createTarget( cHbpPath, aHbp ) + IF .f. ::oOutputResult:oWidget:append( 'Error saving: ' + cHbpPath ) ELSE @@ -1593,23 +1434,24 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt ) ::oIDE:oEV := IdeEnvironments():new():create( ::oIDE, hbide_pathFile( ::aINI[ INI_HBIDE, PathEnv ], "hbide.env" ) ) ::cBatch := ::oEV:prepareBatch( ::cWrkEnvironment ) - #if 0 /* This does not works - reason being it picks up hbmk2 from fixed location */ - cExeHbMk2 := hbide_pathFile( ::oProject:cPathMk2, "hbmk2" ) - #else /* This works properly */ - cExeHbMk2 := "hbmk2" /* Needs that path is already set before calling hbmk2 */ - #endif + + cExeHbMk2 := "hbmk2" /* Needs that path is already set before calling hbmk2 */ + + cCmdParams := hbide_array2cmdParams( aHbp ) ::oProcess := HbpProcess():new() // ::oProcess:output := {|cOut, mp2, oHbp| ::showOutput( cOut,mp2,oHbp ) } ::oProcess:finished := {|nEC , nES, oHbp| ::finished( nEC ,nES,oHbp ) } - ::oProcess:workingPath := hbide_pathToOSPath( ::oProject:wrkDirectory ) + ::oProcess:workingPath := hbide_pathToOSPath( ::oProject:location ) // +hbide_dbg( ::oProcess:workingPath ) cCmd := hbide_getShellCommand() cC := iif( hbide_getOS() == "nix", "", "/C " ) cArg := iif( empty( ::cBatch ), cC, cC + ::cBatch + " && " ) // - ::oProcess:addArg( cArg + cExeHbMk2 + " " + cHbpPath + iif( ::lPPO, " -hbraw", "" ) ) +hbide_dbg( cArg + cExeHbMk2 + " " + cHbpPath + cCmdParams ) + ::oProcess:addArg( cArg + cExeHbMk2 + " " + cHbpPath + cCmdParams ) ::oProcess:start( cCmd ) ENDIF @@ -1628,7 +1470,7 @@ METHOD IdeProjManager:showOutput( cOutput, mp2, oProcess ) /*----------------------------------------------------------------------*/ METHOD IdeProjManager:finished( nExitCode, nExitStatus, oProcess ) - LOCAL cTmp + LOCAL cTmp, n, n1, cTkn, cExe := "" hbide_justACall( oProcess ) @@ -1641,9 +1483,23 @@ METHOD IdeProjManager:finished( nExitCode, nExitStatus, oProcess ) ferase( ::cBatch ) + cTmp := ::oOutputResult:oWidget:toPlainText() + IF ( n := at( "-out:", cTmp ) ) > 0 + n1 := hb_at( " ", cTmp, n ) + cExe := substr( cExe, n + 5, n1 - n - 5 ) +hbide_dbg( cTmp ) + ELSE + cTkn := "hbmk2: Target up to date: " + IF ( n := at( cTkn, cTmp ) ) > 0 + n1 := hb_at( ".exe", cTmp, n + len( cTkn ) ) + cExe := substr( cTmp, n + len( cTkn ), n1 - n - len( cTkn ) + 4 ) +hbide_dbg( cExe ) + ENDIF + ENDIF + IF ::lLaunch IF nExitCode == 0 - ::launchProject( ::cProjectInProcess ) + ::launchProject( ::cProjectInProcess, cExe ) ELSE ::oOutputResult:oWidget:append( "Sorry, cannot launch project because of errors..." ) ENDIF @@ -1659,8 +1515,8 @@ METHOD IdeProjManager:finished( nExitCode, nExitStatus, oProcess ) * Launch selected project. * 03/01/2010 - 09:24:50 */ -METHOD IdeProjManager:launchProject( cProject ) - LOCAL cTargetFN, cTmp, oProject, qProcess, qStr +METHOD IdeProjManager:launchProject( cProject, cExe ) + LOCAL cTargetFN, cTmp, oProject, qProcess, qStr, cExt IF empty( cProject ) cProject := ::oPM:getCurrentProject() @@ -1671,12 +1527,19 @@ METHOD IdeProjManager:launchProject( cProject ) oProject := ::getProjectByTitle( cProject ) - cTargetFN := hbide_pathFile( oProject:destination, iif( empty( oProject:outputName ), "_temp", oProject:outputName ) ) -#ifdef __PLATFORM__WINDOWS - IF oProject:type == "Executable" - cTargetFN += '.exe' + IF !empty( cExe ) + hb_fNameSplit( cExe, , , @cExt ) + ENDIF + IF !empty( cExt ) .AND. lower( cExt ) == ".exe" + cTargetFN := cExe + ELSE + cTargetFN := hbide_pathFile( oProject:destination, iif( empty( oProject:outputName ), "_temp", oProject:outputName ) ) + #ifdef __PLATFORM__WINDOWS + IF oProject:type == "Executable" + cTargetFN += '.exe' + ENDIF + #endif ENDIF -#endif IF !hb_FileExists( cTargetFN ) cTmp := "Launch application error: file not found " + cTargetFN + "!" @@ -1695,7 +1558,6 @@ METHOD IdeProjManager:launchProject( cProject ) qProcess:startDetached_2( cTargetFN ) ENDIF qProcess:waitForStarted() - qProcess:pPtr := NIL qProcess := NIL #else @@ -1716,3 +1578,4 @@ METHOD IdeProjManager:launchProject( cProject ) /*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbide/idesources.prg b/harbour/contrib/hbide/idesources.prg index aa13c8db4d..26de7d5313 100644 --- a/harbour/contrib/hbide/idesources.prg +++ b/harbour/contrib/hbide/idesources.prg @@ -248,7 +248,7 @@ METHOD IdeSourcesManager:closeSource( nTab, lCanCancel, lCanceled ) LOCAL lSave, n, oEditor DEFAULT nTab TO ::oEM:getTabCurrent() -hbide_dbg( "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<", 0 ) +//hbide_dbg( "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<", 0 ) IF !empty( oEditor := ::oEM:getEditorByTabPosition( nTab ) ) DEFAULT lCanCancel TO .F. @@ -275,9 +275,9 @@ hbide_dbg( "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<", 0 ) RETURN .F. ENDIF ENDIF -hbide_dbg( "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<", 1, "before: oEditor:destroy()" ) +//hbide_dbg( "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<", 1, "before: oEditor:destroy()" ) oEditor:destroy() -hbide_dbg( "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<", 2, "after: oEditor:destroy()" ) +//hbide_dbg( "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<", 2, "after: oEditor:destroy()" ) ::oIde:updateTitleBar() ENDIF diff --git a/harbour/contrib/hbide/idethemes.prg b/harbour/contrib/hbide/idethemes.prg index 3e0d13ba58..42619ae1d7 100644 --- a/harbour/contrib/hbide/idethemes.prg +++ b/harbour/contrib/hbide/idethemes.prg @@ -218,7 +218,10 @@ METHOD IdeThemes:create( oIde, cIniFile ) METHOD IdeThemes:destroy() LOCAL qAct - IF !empty( ::oThemes ) + IF !empty( ::oUI ) + ::qHiliter := NIL + ::qEdit := NIL + FOR EACH qAct IN ::aApplyAct ::disconnect( qAct, "triggered(bool)" ) qAct := NIL @@ -226,7 +229,12 @@ METHOD IdeThemes:destroy() ::qMenuApply := NIL ::aApplyAct := NIL - ::oUI:destroy() + ::oThemesDock:oWidget:setWidget( QWidget():new() ) +hbide_dbg( 0,1,"IdeThemes:destroy()" ) + IF !empty( ::oUI ) + ::oUI:destroy() +hbide_dbg( 1,1,"IdeThemes:destroy()" ) + ENDIF ENDIF RETURN Self @@ -424,7 +432,7 @@ METHOD IdeThemes:setSyntaxHilighting( qEdit, cTheme, lNew ) ::setForeBackGround( qEdit, cTheme ) - qHiliter := HBQSyntaxHighlighter():new()// qEdit:document() ) + qHiliter := HBQSyntaxHighlighter():new() FOR EACH a_ IN ::aPatterns IF !empty( aAttr := ::getThemeAttribute( a_[ 1 ], cTheme ) ) @@ -442,14 +450,17 @@ METHOD IdeThemes:setSyntaxHilighting( qEdit, cTheme, lNew ) /*----------------------------------------------------------------------*/ METHOD IdeThemes:show() + #if 0 LOCAL qAct + #endif IF empty( ::oUI ) ::lCreating := .t. - ::oUI := HbQtUI():new( ::oIde:resPath + "themesex.uic", ::oThemesDock:oWidget ):build() + //::oUI := HbQtUI():new( hbide_uic( "themesex" ), ::oThemesDock:oWidget ):build() + ::oUI := HbQtUI():new( hbide_uic( "themesex" ) ):build() - ::oThemesDock:qtObject := ::oUI + //::oThemesDock:qtObject := Self ::oThemesDock:oWidget:setWidget( ::oUI ) ::oUI:signal( "comboThemes" , "currentIndexChanged(int)", {|i| ::nCurTheme := i+1, ::setTheme( i ) } ) @@ -466,12 +477,11 @@ METHOD IdeThemes:show() ::oUI:signal( "buttonClose" , "clicked()" , {|| ::oThemesDock:hide() } ) - * ::oIde:setPosAndSizeByIni( ::oUI:oWidget, ThemesDialogGeometry ) - /* Fill Themes Dialog Values */ + #if 0 ::oUI:setWindowTitle( GetKeyValue( ::aControls, "dialogTitle" ) ) // - ::oUI:qObj[ "labelItem" ]:setText( GetKeyValue( ::aControls, "labelItem" , "Item" ) ) + ::oUI:qObj[ "labelItems" ]:setText( GetKeyValue( ::aControls, "labelItems" , "Items" ) ) ::oUI:qObj[ "labelTheme" ]:setText( GetKeyValue( ::aControls, "labelTheme" , "Theme" ) ) // ::oUI:qObj[ "checkItalic" ]:setText( GetKeyValue( ::aControls, "checkItalic" , "Italic" ) ) @@ -483,7 +493,9 @@ METHOD IdeThemes:show() ::oUI:qObj[ "buttonSaveAs" ]:setText( GetKeyValue( ::aControls, "buttonSaveAs" , "SaveAs" ) ) ::oUI:qObj[ "buttonClose" ]:setText( GetKeyValue( ::aControls, "buttonClose" , "Close" ) ) ::oUI:qObj[ "buttonCopy" ]:setText( GetKeyValue( ::aControls, "buttonCopy" , "Copy" ) ) + #endif + #if 0 ::qMenuApply := QMenu():new() // qAct := QAction():new( ::qMenuApply ) @@ -502,11 +514,12 @@ METHOD IdeThemes:show() aadd( ::aApplyAct, qAct ) // ::oUI:q_buttonApply:setMenu( ::qMenuApply ) + #endif - aeval( ::aThemes, {|e_| ::oUI:qObj[ "comboThemes" ]:addItem( e_[ 1 ] ) } ) - aeval( ::aItems , {|e_| ::oUI:qObj[ "comboItems" ]:addItem( e_[ 2 ] ) } ) + aeval( ::aThemes, {|e_| ::oUI:q_comboThemes:addItem( e_[ 1 ] ) } ) + aeval( ::aItems , {|e_| ::oUI:q_comboItems:addItem( e_[ 2 ] ) } ) - ::qEdit := ::oUI:qObj[ "plainThemeText" ] + ::qEdit := ::oUI:q_plainThemeText ::qEdit:setPlainText( GetSource() ) ::qEdit:setLineWrapMode( QTextEdit_NoWrap ) ::qEdit:setFont( ::oIde:oFont:oWidget ) diff --git a/harbour/contrib/hbide/projects/hbide.hbi b/harbour/contrib/hbide/projects/hbide.hbi deleted file mode 100644 index 2e3fdf81ca..0000000000 --- a/harbour/contrib/hbide/projects/hbide.hbi +++ /dev/null @@ -1,44 +0,0 @@ -[ PROPERTIES ] -Type = Executable -Title = Harbour-Qt IDE -Location = projects -WorkingFolder = projects -DestinationFolder = projects -Output = hbide -LaunchParams = -LaunchProgram = -BackupFolder = - -[ FLAGS ] -../../hbxbp/hbxbp.hbc --inc --w3 --es2 --workdir=projects/${hb_plat}/${hb_comp}/hbide - -[ SOURCES ] -# -hbide.prg -ideobject.prg -idestylesheets.prg -idetags.prg -idemisc.prg -ideactions.prg -ideeditor.prg -idefindreplace.prg -idedocks.prg -idesaveload.prg -iderequests.prg -idethemes.prg -ideprojmanager.prg -idesources.prg -# -ideparseexpr.c -# -hbide.ch -hbide.ini - -[ METADATA ] -# -IdeSrc = hb_dirBase() - diff --git a/harbour/contrib/hbide/resources/environments.ui b/harbour/contrib/hbide/resources/environments.ui index e1c9bc8b74..41ab53f091 100644 --- a/harbour/contrib/hbide/resources/environments.ui +++ b/harbour/contrib/hbide/resources/environments.ui @@ -13,8 +13,8 @@ Form - - + + 0 @@ -23,8 +23,72 @@ Environments - - + + + + + + 100 + 0 + + + + + 100 + 16777215 + + + + Path to hbmk2 + + + + + + + + + + + 0 + 0 + + + + + + + + + + + + 100 + 0 + + + + + 100 + 16777215 + + + + Path to hbide.env + + + + + + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> @@ -45,115 +109,39 @@ p, li { white-space: pre-wrap; } - - - - - - - 100 - 0 - - - - - 100 - 16777215 - - - - Path to hbmk2 - - - - - - - - - - - 0 - 0 - - - - - - - - - - - - - - - - 100 - 0 - - - - - 100 - 16777215 - - - - Path to hbIDE.env - - - - - - - - - - - - - - - - - - - - - Save and Exit - - - - - - - Save - - - false - - - true - - - - - - - Cancel - - - false - - - - + + + + Save and Exit + + + + + + + Save + + + false + + + true + + + + + + + Cancel + + + false + + diff --git a/harbour/contrib/hbide/resources/environments.uic b/harbour/contrib/hbide/resources/environments.uic index 425f53eca8..0f7533c041 100644 --- a/harbour/contrib/hbide/resources/environments.uic +++ b/harbour/contrib/hbide/resources/environments.uic @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading ui file 'environments.ui' ** -** Created: Wed Feb 24 16:25:24 2010 +** Created: Mon Mar 1 13:02:17 2010 ** by: Qt User Interface Compiler version 4.5.2 ** ** WARNING! All changes made in this file will be lost when recompiling ui file! @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -23,7 +22,6 @@ #include #include #include -#include #include QT_BEGIN_NAMESPACE @@ -31,20 +29,17 @@ QT_BEGIN_NAMESPACE class Ui_FormEnvironments { public: - QVBoxLayout *verticalLayout; + QGridLayout *gridLayout_2; QTabWidget *tabWidgetEnv; QWidget *tabCompilers; - QGridLayout *gridLayout_5; - QPlainTextEdit *editCompilers; - QHBoxLayout *horizontalLayoutHbmk2; - QLabel *labelPathHbmk2; + QGridLayout *gridLayout; + QLabel *labelPathMk2; QLineEdit *editPathMk2; QToolButton *buttonPathMk2; - QHBoxLayout *horizontalLayoutEnv; QLabel *labelPathEnv; QLineEdit *editPathEnv; QToolButton *buttonPathEnv; - QHBoxLayout *horizontalLayoutEnvButtons; + QPlainTextEdit *editCompilers; QPushButton *buttonSaveExit; QPushButton *buttonSave; QPushButton *buttonCn; @@ -54,91 +49,76 @@ public: if (FormEnvironments->objectName().isEmpty()) FormEnvironments->setObjectName(QString::fromUtf8("FormEnvironments")); FormEnvironments->resize(367, 519); - verticalLayout = new QVBoxLayout(FormEnvironments); - verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); + gridLayout_2 = new QGridLayout(FormEnvironments); + gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2")); tabWidgetEnv = new QTabWidget(FormEnvironments); tabWidgetEnv->setObjectName(QString::fromUtf8("tabWidgetEnv")); tabCompilers = new QWidget(); tabCompilers->setObjectName(QString::fromUtf8("tabCompilers")); - gridLayout_5 = new QGridLayout(tabCompilers); - gridLayout_5->setObjectName(QString::fromUtf8("gridLayout_5")); - editCompilers = new QPlainTextEdit(tabCompilers); - editCompilers->setObjectName(QString::fromUtf8("editCompilers")); - editCompilers->setLineWrapMode(QPlainTextEdit::NoWrap); + gridLayout = new QGridLayout(tabCompilers); + gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + labelPathMk2 = new QLabel(tabCompilers); + labelPathMk2->setObjectName(QString::fromUtf8("labelPathMk2")); + labelPathMk2->setMinimumSize(QSize(100, 0)); + labelPathMk2->setMaximumSize(QSize(100, 16777215)); - gridLayout_5->addWidget(editCompilers, 2, 1, 1, 1); - - horizontalLayoutHbmk2 = new QHBoxLayout(); - horizontalLayoutHbmk2->setObjectName(QString::fromUtf8("horizontalLayoutHbmk2")); - labelPathHbmk2 = new QLabel(tabCompilers); - labelPathHbmk2->setObjectName(QString::fromUtf8("labelPathHbmk2")); - labelPathHbmk2->setMinimumSize(QSize(100, 0)); - labelPathHbmk2->setMaximumSize(QSize(100, 16777215)); - - horizontalLayoutHbmk2->addWidget(labelPathHbmk2); + gridLayout->addWidget(labelPathMk2, 0, 0, 1, 1); editPathMk2 = new QLineEdit(tabCompilers); editPathMk2->setObjectName(QString::fromUtf8("editPathMk2")); - horizontalLayoutHbmk2->addWidget(editPathMk2); + gridLayout->addWidget(editPathMk2, 0, 1, 1, 1); buttonPathMk2 = new QToolButton(tabCompilers); buttonPathMk2->setObjectName(QString::fromUtf8("buttonPathMk2")); buttonPathMk2->setMinimumSize(QSize(0, 0)); - horizontalLayoutHbmk2->addWidget(buttonPathMk2); + gridLayout->addWidget(buttonPathMk2, 0, 2, 1, 1); - - gridLayout_5->addLayout(horizontalLayoutHbmk2, 0, 1, 1, 1); - - horizontalLayoutEnv = new QHBoxLayout(); - horizontalLayoutEnv->setObjectName(QString::fromUtf8("horizontalLayoutEnv")); labelPathEnv = new QLabel(tabCompilers); labelPathEnv->setObjectName(QString::fromUtf8("labelPathEnv")); labelPathEnv->setMinimumSize(QSize(100, 0)); labelPathEnv->setMaximumSize(QSize(100, 16777215)); - horizontalLayoutEnv->addWidget(labelPathEnv); + gridLayout->addWidget(labelPathEnv, 1, 0, 1, 1); editPathEnv = new QLineEdit(tabCompilers); editPathEnv->setObjectName(QString::fromUtf8("editPathEnv")); - horizontalLayoutEnv->addWidget(editPathEnv); + gridLayout->addWidget(editPathEnv, 1, 1, 1, 1); buttonPathEnv = new QToolButton(tabCompilers); buttonPathEnv->setObjectName(QString::fromUtf8("buttonPathEnv")); - horizontalLayoutEnv->addWidget(buttonPathEnv); + gridLayout->addWidget(buttonPathEnv, 1, 2, 1, 1); + editCompilers = new QPlainTextEdit(tabCompilers); + editCompilers->setObjectName(QString::fromUtf8("editCompilers")); + editCompilers->setLineWrapMode(QPlainTextEdit::NoWrap); - gridLayout_5->addLayout(horizontalLayoutEnv, 1, 1, 1, 1); + gridLayout->addWidget(editCompilers, 2, 0, 1, 3); tabWidgetEnv->addTab(tabCompilers, QString()); - verticalLayout->addWidget(tabWidgetEnv); + gridLayout_2->addWidget(tabWidgetEnv, 0, 0, 1, 3); - horizontalLayoutEnvButtons = new QHBoxLayout(); - horizontalLayoutEnvButtons->setObjectName(QString::fromUtf8("horizontalLayoutEnvButtons")); buttonSaveExit = new QPushButton(FormEnvironments); buttonSaveExit->setObjectName(QString::fromUtf8("buttonSaveExit")); - horizontalLayoutEnvButtons->addWidget(buttonSaveExit); + gridLayout_2->addWidget(buttonSaveExit, 1, 0, 1, 1); buttonSave = new QPushButton(FormEnvironments); buttonSave->setObjectName(QString::fromUtf8("buttonSave")); buttonSave->setAutoDefault(false); buttonSave->setDefault(true); - horizontalLayoutEnvButtons->addWidget(buttonSave); + gridLayout_2->addWidget(buttonSave, 1, 1, 1, 1); buttonCn = new QPushButton(FormEnvironments); buttonCn->setObjectName(QString::fromUtf8("buttonCn")); buttonCn->setAutoDefault(false); - horizontalLayoutEnvButtons->addWidget(buttonCn); - - - verticalLayout->addLayout(horizontalLayoutEnvButtons); + gridLayout_2->addWidget(buttonCn, 1, 2, 1, 1); retranslateUi(FormEnvironments); @@ -152,6 +132,10 @@ public: void retranslateUi(QWidget *FormEnvironments) { FormEnvironments->setWindowTitle(QApplication::translate("FormEnvironments", "Form", 0, QApplication::UnicodeUTF8)); + labelPathMk2->setText(QApplication::translate("FormEnvironments", "Path to hbmk2", 0, QApplication::UnicodeUTF8)); + buttonPathMk2->setText(QString()); + labelPathEnv->setText(QApplication::translate("FormEnvironments", "Path to hbide.env", 0, QApplication::UnicodeUTF8)); + buttonPathEnv->setText(QString()); #ifndef QT_NO_TOOLTIP editCompilers->setToolTip(QApplication::translate("FormEnvironments", "\n" "\n" "

Project location is the folder where project definition file .hbi will be stored. <Project Location> plus <Output Name> will comprise the full file name with .hbp extension.

", 0, QApplication::UnicodeUTF8)); -#endif // QT_NO_TOOLTIP - label_4->setText(QApplication::translate("FormProjectPropEx", "Working Folder:", 0, QApplication::UnicodeUTF8)); -#ifndef QT_NO_TOOLTIP - editWrkFolder->setToolTip(QApplication::translate("FormProjectPropEx", "\n" -"\n" -"

Working folder will be used to host HBMK2 compliant <Output Name> plus <hbp> and will be designated as current folder when HBMK2 will be invoked.

", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_TOOLTIP label_5->setText(QApplication::translate("FormProjectPropEx", "Destination Folder:", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP @@ -398,15 +372,6 @@ public: "

Destination folder is a compatibility slot and is reserved to place the <Output> .exe .a .lib.

\n" "

But currently this functionality will be achieved through the -o compiler flag.

", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_TOOLTIP - label_9->setText(QApplication::translate("FormProjectPropEx", "Compile/Link Flags:", 0, QApplication::UnicodeUTF8)); -#ifndef QT_NO_TOOLTIP - editFlags->setToolTip(QApplication::translate("FormProjectPropEx", "\n" -"\n" -"

Compiler/Linker flags may include all commands except the source files list. Additional libraries can be included here.

", 0, QApplication::UnicodeUTF8)); -#endif // QT_NO_TOOLTIP - editFlags->setStyleSheet(QString()); label_7->setText(QApplication::translate("FormProjectPropEx", "Launch Parameters:", 0, QApplication::UnicodeUTF8)); label_8->setText(QApplication::translate("FormProjectPropEx", "Launch Program:", 0, QApplication::UnicodeUTF8)); label_13->setText(QApplication::translate("FormProjectPropEx", "Backup Location:", 0, QApplication::UnicodeUTF8)); @@ -421,25 +386,6 @@ public: buttonChoosePrjLoc->setText(QApplication::translate("FormProjectPropEx", "...", 0, QApplication::UnicodeUTF8)); buttonBackup->setText(QApplication::translate("FormProjectPropEx", "...", 0, QApplication::UnicodeUTF8)); buttonChooseDest->setText(QApplication::translate("FormProjectPropEx", "...", 0, QApplication::UnicodeUTF8)); - buttonChooseWd->setText(QApplication::translate("FormProjectPropEx", "...", 0, QApplication::UnicodeUTF8)); -#ifndef QT_NO_TOOLTIP - buttonHbp->setToolTip(QApplication::translate("FormProjectPropEx", "\n" -"\n" -"

Loading a .hbp project file is essentially a

\n" -"

task of redefining its flow and contents order.

\n" -"

hbIDE rewrites the existing .hbp file if the

\n" -"

\"Project Location\" points to same folder

\n" -"

where your such loaded .hbp resides.

\n" -"

So

\n" -"

take care to change the \"Project Location\"

\n" -"

to different folder than home folder of .hbp.

\n" -"

This is done at the time of \"Build\" proces" - "s.

", 0, QApplication::UnicodeUTF8)); -#endif // QT_NO_TOOLTIP - buttonHbp->setText(QApplication::translate("FormProjectPropEx", "...", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP buttonXmate->setToolTip(QApplication::translate("FormProjectPropEx", "\n" "\n" +"

Working folder will be used to host HBMK2 compliant <Output Name> plus <hbp> and will be designated as current folder when HBMK2 will be invoked.

", 0, QApplication::UnicodeUTF8)); +#endif // QT_NO_TOOLTIP + labelInitFolder->setText(QApplication::translate("FormProjectPropEx", "Start In:", 0, QApplication::UnicodeUTF8)); + buttonChooseWd->setText(QApplication::translate("FormProjectPropEx", "...", 0, QApplication::UnicodeUTF8)); tabWidget->setTabText(tabWidget->indexOf(tabGeneral), QApplication::translate("FormProjectPropEx", "General", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP editSources->setToolTip(QApplication::translate("FormProjectPropEx", "\n" @@ -483,23 +438,8 @@ public: #endif // QT_NO_TOOLTIP buttonSortOrg->setText(QString()); tabWidget->setTabText(tabWidget->indexOf(tabFiles), QApplication::translate("FormProjectPropEx", "Sources", 0, QApplication::UnicodeUTF8)); - editMetaHelp->setStyleSheet(QApplication::translate("FormProjectPropEx", "background-color: rgb(171, 171, 171);", 0, QApplication::UnicodeUTF8)); - editMetaHelp->setPlainText(QApplication::translate("FormProjectPropEx", "HBIDE will employ the concept of meta-data which will be used to parse the paths or other info supplied to the interface.\n" -"\n" -"Usually meta-key is enclosed in curly braces, but due to the fact that HBMK2 already exploits it, HBIDE will recognize meta-key in angled brackets.\n" -"\n" -"Please enter meta-keys and their values like :\n" -" MySourcePath = c:/dev_sources/vouch\n" -"in the QTextEdit below. Then whereever you will supply any key anywhere in the input fields of HBIDE interface, just enclose it in angled brackets like :\n" -" /vouch.prg.\n" -"Note that keys are case sensitive. So MySourcePath <> MYSOURCEPath.\n" -"\n" -"HBIDE internally employs few keys which are shown below and are always include in the project. These accompany the value as its relevance and not as literal.\n" -"\n" -"Enjoy\n" -"Pritpal Bedi", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP - editMetaData->setToolTip(QApplication::translate("FormProjectPropEx", "\n" + editFlags->setToolTip(QApplication::translate("FormProjectPropEx", "\n" "\n" @@ -508,8 +448,8 @@ public: "ent:0px;\">

\n" "

The expression is evaluated only once and keeps its value until the HBIDE interface is closed. In case of any error, the expression string itself is returned.

", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_TOOLTIP - editMetaData->setStyleSheet(QString()); - tabWidget->setTabText(tabWidget->indexOf(tabMeta), QApplication::translate("FormProjectPropEx", "Meta Data", 0, QApplication::UnicodeUTF8)); + editFlags->setStyleSheet(QString()); + tabWidget->setTabText(tabWidget->indexOf(tabFlags), QApplication::translate("FormProjectPropEx", "Flags", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP editHbp->setToolTip(QApplication::translate("FormProjectPropEx", "\n" "