diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d686f9167e..ed37116aaa 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,33 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-04-05 09:04 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * contrib/hbxbp/hbpprocess.prg + + Implemented ::lDetached functionality to execute a process independent + from application's process. + + * contrib/hbide/resources/toolsutilities.ui + * contrib/hbide/resources/toolsutilities.uic + + * contrib/hbide/hbide.hbp + + Added ideshortcuts.prg + + * contrib/hbide/hbide.prg + * contrib/hbide/ideenviron.prg + * contrib/hbide/idemisc.prg + * contrib/hbide/idesaveload.prg + + contrib/hbide/ideshortcuts.prg + + Started "Public Methods" which will lead to define shortcuts by the user. + + * contrib/hbide/idethemes.prg + * contrib/hbide/idetools.prg + * contrib/hbide/idewizard.prg + + Reworked : from bottom up, the "Tools and Utilities" protcol. + Now it is possible to execute any type of file. It also + opens the door to host any language specific projects inside hbIDE. + + DETAILS: http://hbide.vouch.info/ ( Topid: Tools and Utilities ). + 2010-04-05 11:10 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/sddodbc/tests/test1.prg ! Fixed relative path to test.mdb after recent relocation. @@ -50,6 +77,17 @@ * config/ren_sfn.prg * Minor. +2010-04-04 10:37 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + + contrib/hbide/hbide.rc + + Added missing file. + + * contrib/hbide/idedocks.prg + * contrib/hbide/ideparseexpr.c + ! Minor formatting. + + * contrib/hbide/idestylesheets.prg + ! Subdued "active tab" color. + 2010-04-04 07:06 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbide/ideenviron.prg ! Fixed wrong variable assign. diff --git a/harbour/contrib/hbide/hbide.hbp b/harbour/contrib/hbide/hbide.hbp index 3ec852f2af..5e59a77329 100644 --- a/harbour/contrib/hbide/hbide.hbp +++ b/harbour/contrib/hbide/hbide.hbp @@ -6,6 +6,7 @@ -ohbide -ldflag={msvc}-nodefaultlib:msvcrt.lib -ldflag={msvc}-defaultlib:libcmt.lib +-icon={allwin}hbide.ico ../hbxbp/hbxbp.hbc @@ -33,5 +34,6 @@ idedocwriter.prg ideskeletons.prg idewizard.prg idetools.prg +ideshortcuts.prg + --icon={allwin}hbide.ico diff --git a/harbour/contrib/hbide/hbide.prg b/harbour/contrib/hbide/hbide.prg index 1e3b44b72f..134c232c26 100644 --- a/harbour/contrib/hbide/hbide.prg +++ b/harbour/contrib/hbide/hbide.prg @@ -127,29 +127,25 @@ CLASS HbIde DATA aParams DATA cProjIni - DATA oPM /* Project Manager */ - DATA oDK /* Main Window Components Manager */ DATA oAC /* Actions Manager */ + DATA oDK /* Main Window Components Manager */ + DATA oDW /* Document Writer Manager */ DATA oEM /* Editor Tabs Manager */ - DATA oSM /* Souces Manager */ - DATA oFR /* Find Replace Manager */ DATA oEV /* Available Environments */ + DATA oFF /* Find in Files Manager */ + DATA oFN /* Functions Tags Manager */ + DATA oFR /* Find Replace Manager */ DATA oHL /* Harbour Help Manager */ DATA oHM /* panel manager */ - DATA oFN /* Functions Tags Manager */ - DATA oDW /* Document Writer Manager */ + DATA oPM /* Project Manager */ + DATA oSM /* Souces Manager */ DATA oSK /* Skeletons Managet */ DATA oTM /* Plugin Tools Manager */ DATA oTH /* Themes Manager */ - DATA oFF /* Find in Files Manager */ - DATA oHelpDock - DATA oSkeltnDock - DATA oFindDock DATA nRunMode INIT HBIDE_RUN_MODE_INI DATA nAnimantionMode INIT HBIDE_ANIMATION_NONE - DATA oUI DATA aMeta INIT {} /* Holds current definition only */ @@ -203,12 +199,6 @@ CLASS HbIde DATA oFont DATA oProjTree DATA oEditTree - DATA oDockR - DATA oDockB - DATA oDockB1 - DATA oDockB2 - DATA oDockPT - DATA oDockED DATA oFuncList DATA oOutputResult DATA oCompileResult @@ -223,16 +213,26 @@ CLASS HbIde DATA oDlls DATA oProps DATA oGeneral + DATA oSearchReplace + DATA oMainToolbar + + DATA oDockR + DATA oDockB + DATA oDockB1 + DATA oDockB2 + DATA oDockPT + DATA oDockED DATA oThemesDock DATA oPropertiesDock DATA oEnvironDock - DATA oSearchReplace DATA oFuncDock DATA oDocViewDock DATA oDocWriteDock DATA oFunctionsDock DATA oSkltnsTreeDock - DATA oMainToolbar + DATA oHelpDock + DATA oSkeltnDock + DATA oFindDock DATA lProjTreeVisible INIT .t. DATA lDockRVisible INIT .f. @@ -304,13 +304,6 @@ CLASS HbIde METHOD execSourceAction( cKey ) METHOD execEditorAction( cKey ) - /* Methods to be evaluated as macros */ - METHOD getWord( lSelect ) - METHOD getLine( lSelect ) - METHOD getText() - // - METHOD evalMacro( cString ) - METHOD fetchAndExecMacro() METHOD showApplicationCursor( nCursor ) METHOD testPainter( qPainter ) @@ -754,9 +747,6 @@ METHOD HbIde:execAction( cKey ) CASE "Help" ::oHelpDock:show() EXIT - CASE "CommandPrompt" - ::fetchAndExecMacro() - EXIT ENDSWITCH ::manageFocusInEditor() @@ -1391,62 +1381,6 @@ METHOD HbIde:setCodec( cCodec ) RETURN Self -/*----------------------------------------------------------------------*/ -// Macro Compilable Methods -/*----------------------------------------------------------------------*/ - -METHOD HbIde:getWord( lSelect ) - RETURN ::oEM:getWord( lSelect ) - -METHOD HbIde:getLine( lSelect ) - RETURN ::oEM:getLine( lSelect ) - -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 - /*----------------------------------------------------------------------*/ METHOD HbIde:testPainter( qPainter ) diff --git a/harbour/contrib/hbide/ideenviron.prg b/harbour/contrib/hbide/ideenviron.prg index bda0c689ee..720ea85749 100644 --- a/harbour/contrib/hbide/ideenviron.prg +++ b/harbour/contrib/hbide/ideenviron.prg @@ -233,7 +233,7 @@ METHOD IdeEnvironments:execEnv( nMode, p ) DO CASE CASE nMode == 1 cPath := hbide_fetchAFile( ::oDlg, "Select location of hbmk2", ; - { { "Harbour Projects Builder - hbmk2", "*.*" } }, ::cWrkPathMK2 ) + { { "Harbour Projects Builder - hbmk2", "*" } }, ::cWrkPathMK2 ) IF !empty( cPath ) hb_fNameSplit( cPath, @cP ) ::oIde:cWrkPathMK2 := cP diff --git a/harbour/contrib/hbide/idemisc.prg b/harbour/contrib/hbide/idemisc.prg index f392a4d314..e3b41da7f8 100644 --- a/harbour/contrib/hbide/idemisc.prg +++ b/harbour/contrib/hbide/idemisc.prg @@ -720,13 +720,26 @@ STATIC FUNCTION hbide_buildRegExpressList( aRegList ) */ FUNCTION hbide_parseFNfromStatusMsg( cText, cFileName, nLine, lValidText ) LOCAL regLineN := hb_RegexComp( ".*(\(([0-9]+)\)|:([0-9]+):|\s([0-9]+):).*" ) - LOCAL aList, nPos + LOCAL aList, nPos, cLine, n DEFAULT lValidText TO .T. cFileName := '' nLine := 0 + /* Xbase++ */ + IF "XBT" $ cText + nPos := at( "(", cText ) + n := at( ")", cText ) + cFileName := substr( cText, 1, nPos - 1 ) + cLine := substr( cText, nPos + 1, n - 1 - nPos ) + n := at( ":", cLine ) + cLine := substr( cLine, 1, n - 1 ) + nLine := val( cLine ) + + RETURN !empty( cFileName ) + ENDIF + * Validate if current text is a error/warning/info message. * 29/12/2009 - 22:51:39 - vailtom IF lValidText @@ -770,8 +783,7 @@ FUNCTION hbide_parseFNfromStatusMsg( cText, cFileName, nLine, lValidText ) cFileName := strtran( cFileName, "(", "" ) cFileName := strtran( cFileName, ")", "" ) cFileName := alltrim( cFileName ) - - cFileName := strtran( cFileName, "\\", "/" ) && Fix for the BCC + cFileName := strtran( cFileName, "\\", "/" ) cFileName := strtran( cFileName, "\" , "/" ) IF ( nPos := Rat( ' ', cFileName ) ) <> 00 @@ -831,6 +843,8 @@ FUNCTION hbide_convertBuildStatusMsgToHtml( cText, oWidget ) IF !Empty( cLine ) IF ( nPos := aScan( aRegList, {| reg | !Empty( hb_RegEx( reg[ 2 ], cLine ) ) } ) ) > 0 cLine := '' + cLine + '' + ELSEIF "XBT" $ cLine + cLine := '' + cLine + '' ELSE cLine := "" + cLine + "" ENDIF @@ -2034,13 +2048,19 @@ FUNCTION hbide_parseToolComponents( cCompositeTool ) LOCAL a_ a_:= hb_atokens( cCompositeTool, "," ) - asize( a_, 3 ) + asize( a_, 6 ) DEFAULT a_[ 1 ] TO "" DEFAULT a_[ 2 ] TO "" DEFAULT a_[ 3 ] TO "" + DEFAULT a_[ 4 ] TO "" + DEFAULT a_[ 5 ] TO "" + DEFAULT a_[ 6 ] TO "" a_[ 1 ] := alltrim( a_[ 1 ] ) a_[ 2 ] := alltrim( a_[ 2 ] ) a_[ 3 ] := alltrim( a_[ 3 ] ) + a_[ 4 ] := alltrim( a_[ 4 ] ) + a_[ 5 ] := alltrim( a_[ 5 ] ) + a_[ 6 ] := alltrim( a_[ 6 ] ) RETURN a_ diff --git a/harbour/contrib/hbide/idesaveload.prg b/harbour/contrib/hbide/idesaveload.prg index a08d014b3a..4a53109e1b 100644 --- a/harbour/contrib/hbide/idesaveload.prg +++ b/harbour/contrib/hbide/idesaveload.prg @@ -214,7 +214,8 @@ hbide_dbg( "hbide_saveINI( oIde )", 0, oIde:nRunMode, oIde:cProjIni ) aadd( txt_, "[TOOLS]" ) aadd( txt_, " " ) FOR n := 1 TO len( oIde:aIni[ INI_TOOLS ] ) - s := oIde:aIni[ INI_TOOLS, n, 1 ] + "," + oIde:aIni[ INI_TOOLS, n, 2 ] + "," + oIde:aIni[ INI_TOOLS, n, 3 ] + "," + s := oIde:aIni[ INI_TOOLS, n, 1 ] + "," + oIde:aIni[ INI_TOOLS, n, 2 ] + "," + oIde:aIni[ INI_TOOLS, n, 3 ] + "," + ; + oIde:aIni[ INI_TOOLS, n, 4 ] + "," + oIde:aIni[ INI_TOOLS, n, 5 ] + "," + oIde:aIni[ INI_TOOLS, n, 6 ] + "," aadd( txt_, "tool_" + hb_ntos( n ) + "=" + s ) NEXT diff --git a/harbour/contrib/hbide/ideshortcuts.prg b/harbour/contrib/hbide/ideshortcuts.prg new file mode 100644 index 0000000000..6b049f3015 --- /dev/null +++ b/harbour/contrib/hbide/ideshortcuts.prg @@ -0,0 +1,177 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * + * Copyright 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 IDE + * + * Pritpal Bedi + * 04Apr2010 + */ +/*----------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ +/*----------------------------------------------------------------------*/ + +#include "hbide.ch" +#include "hbqt.ch" +#include "common.ch" +#include "hbclass.ch" + +/*----------------------------------------------------------------------*/ + +CLASS IdeShortcuts INHERIT IdeObject + + METHOD new( oIde ) + METHOD create( oIde ) + METHOD destroy() + + METHOD evalMacro( cString ) + METHOD fetchAndExecMacro() + + METHOD getWord( lSelect ) + METHOD getLine( lSelect ) + METHOD getText() + METHOD execTool( ... ) + + ENDCLASS + +/*----------------------------------------------------------------------*/ + +METHOD IdeShortcuts:new( oIde ) + + ::oIde := oIde + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeShortcuts:create( oIde ) + + DEFAULT oIde TO ::oIde + ::oIde := oIde + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeShortcuts:destroy() + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeShortcuts:execTool( ... ) + RETURN ::oTM:execTool( ... ) + +/*----------------------------------------------------------------------*/ + +METHOD IdeShortcuts:getWord( lSelect ) + RETURN ::oEM:getWord( lSelect ) + +/*----------------------------------------------------------------------*/ + +METHOD IdeShortcuts:getLine( lSelect ) + RETURN ::oEM:getLine( lSelect ) + +/*----------------------------------------------------------------------*/ + +METHOD IdeShortcuts:getText() + RETURN ::oEM:getText() + +/*----------------------------------------------------------------------*/ + +METHOD IdeShortcuts: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 + +/*----------------------------------------------------------------------*/ + +METHOD IdeShortcuts:fetchAndExecMacro() + LOCAL cStr + + cStr := hbide_fetchAString( ::oDlg:oWidget, "", "Macro", "Compilation" ) + IF !empty( cStr ) + ::evalMacro( cStr ) + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbide/idethemes.prg b/harbour/contrib/hbide/idethemes.prg index c725eb1590..e9c2593796 100644 --- a/harbour/contrib/hbide/idethemes.prg +++ b/harbour/contrib/hbide/idethemes.prg @@ -225,6 +225,7 @@ METHOD IdeThemes:create( oIde, cIniFile ) METHOD IdeThemes:destroy() + hbide_dbg( "-------------------------------------- Theme Manager 0 ------------------------------------------" ) IF !empty( ::oSL ) ::disConnect( ::oSL:qObj[ "listOptions" ], "doubleClicked(QModelIndex)" ) ::disConnect( ::oSL:qObj[ "buttonOk" ], "clicked()" ) @@ -236,12 +237,12 @@ METHOD IdeThemes:destroy() ::qHiliter := NIL ::qEdit := NIL - ::oThemesDock:oWidget:setWidget( QWidget():new() ) + //::oThemesDock:oWidget:setWidget( QWidget():new() ) IF !empty( ::oUI ) ::oUI:destroy() ENDIF ENDIF - + hbide_dbg( "-------------------------------------- Theme Manager 1 ------------------------------------------" ) RETURN Self /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbide/idetools.prg b/harbour/contrib/hbide/idetools.prg index 921846dc92..6f99b419f5 100644 --- a/harbour/contrib/hbide/idetools.prg +++ b/harbour/contrib/hbide/idetools.prg @@ -92,6 +92,7 @@ CLASS IdeToolsManager INHERIT IdeObject DATA aPanelsAct INIT {} DATA qPanelsButton DATA qPanelsMenu + DATA oProcess ACCESS aTools INLINE ::aINI[ INI_TOOLS ] @@ -102,10 +103,15 @@ CLASS IdeToolsManager INHERIT IdeObject METHOD execEvent( nMode, p ) METHOD clearList() METHOD populateList( aList ) - METHOD execTool( cName ) + METHOD execTool( ... ) + METHOD execToolByParams( cCmd, cParams, cStartIn, lCapture, lOpen ) + METHOD ini2controls( nIndex ) + METHOD controls2ini( nIndex ) METHOD buildToolsButton() METHOD buildPanelsButton() METHOD addPanelsMenu( cPrompt ) + METHOD showOutput( cOut, mp2, oHbp ) + METHOD finished( nEC, nES, oHbp ) ENDCLASS @@ -194,8 +200,47 @@ METHOD IdeToolsManager:show() /*----------------------------------------------------------------------*/ +METHOD IdeToolsManager:ini2controls( nIndex ) + + IF nIndex > 0 + ::oUI:q_editName : setText( ::aTools[ nIndex, 1 ] ) + ::oUI:q_editCmdLine : setText( ::aTools[ nIndex, 2 ] ) + ::oUI:q_editParams : setText( ::aTools[ nIndex, 3 ] ) + ::oUI:q_editStayIn : setText( ::aTools[ nIndex, 4 ] ) + ::oUI:q_checkCapture : setChecked( !empty( ::aTools[ nIndex, 5 ] ) ) + ::oUI:q_checkOpenCons: setChecked( !empty( ::aTools[ nIndex, 6 ] ) ) + ELSE + ::oUI:q_editName : setText( "" ) + ::oUI:q_editCmdLine : setText( "" ) + ::oUI:q_editParams : setText( "" ) + ::oUI:q_editStayIn : setText( "" ) + ::oUI:q_checkCapture : setChecked( .f. ) + ::oUI:q_checkOpenCons: setChecked( .f. ) + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeToolsManager:controls2ini( nIndex ) + + IF empty( nIndex ) + aadd( ::aINI[ INI_TOOLS ], {} ) + nIndex := len( ::aINI[ INI_TOOLS ] ) + ENDIF + + ::aINI[ INI_TOOLS, nIndex ] := { ::oUI:q_editName:text() , ; + hbide_pathNormalized( ::oUI:q_editCmdLine:text() ), ; + hbide_pathNormalized( ::oUI:q_editParams:text() ), ; + hbide_pathNormalized( ::oUI:q_editStayIn:text() ), ; + iif( ::oUI:q_checkCapture:isChecked(), "YES", "" ), ; + iif( ::oUI:q_checkOpenCons:isChecked(), "YES", "" ) } + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD IdeToolsManager:execEvent( nMode, p ) - LOCAL cFile, cFileName, nIndex, qItem, cName + LOCAL cFile, cFileName, nIndex, qItem, cName, nRow LOCAL aTools := ::aINI[ INI_TOOLS ] HB_SYMBOL_UNUSED( p ) @@ -205,22 +250,24 @@ METHOD IdeToolsManager:execEvent( nMode, p ) qItem := QListWidgetItem():from( ::oUI:q_listNames:currentItem() ) cName := qItem:text() IF ( nIndex := ascan( aTools, {|e_| e_[ 1 ] == cName } ) ) > 0 - ::oUI:q_editName : setText( aTools[ nIndex, 1 ] ) - ::oUI:q_editCmdLine : setText( aTools[ nIndex, 2 ] ) - ::oUI:q_editParams : setText( aTools[ nIndex, 3 ] ) + ::ini2Controls( nIndex ) ENDIF EXIT CASE buttonAdd_clicked - aadd( ::aINI[ INI_TOOLS ], { ::oUI:q_editName:text(), ::oUI:q_editCmdLine:text(), ::oUI:q_editParams:text() } ) - ::oUI:q_listNames:addItem( ::oUI:q_editName:text() ) + IF !empty( ::oUI:q_editName:text() ) + ::controls2ini() + ::oUI:q_listNames:addItem( ::oUI:q_editName:text() ) + ENDIF EXIT CASE buttonDelete_clicked - qItem := QListWidgetItem():from( ::oUI:q_listNames:currentItem() ) - cName := qItem:text() - IF ( nIndex := ascan( aTools, {|e_| e_[ 1 ] == cName } ) ) > 0 - hb_adel( ::aINI[ INI_TOOLS ], nIndex, .t. ) - ::clearList() - ::populateList() + IF ::oUI:q_listNames:currentRow() >= 0 + qItem := QListWidgetItem():from( ::oUI:q_listNames:currentItem() ) + cName := qItem:text() + IF ( nIndex := ascan( aTools, {|e_| e_[ 1 ] == cName } ) ) > 0 + hb_adel( ::aINI[ INI_TOOLS ], nIndex, .t. ) + ::clearList() + ::populateList() + ENDIF ENDIF EXIT CASE buttonUp_clicked @@ -228,25 +275,30 @@ METHOD IdeToolsManager:execEvent( nMode, p ) CASE buttonDown_clicked EXIT CASE buttonExec_clicked - qItem := QListWidgetItem():from( ::oUI:q_listNames:currentItem() ) - ::execTool( qItem:text() ) + IF ::oUI:q_listNames:currentRow() >= 0 + qItem := QListWidgetItem():from( ::oUI:q_listNames:currentItem() ) + ::execTool( qItem:text() ) + ENDIF EXIT CASE buttonBrowse_clicked IF !empty( cFile := hbide_fetchAFile( ::oDlg, "Select a Tool" ) ) hb_fNameSplit( cFile, , @cFileName ) + ::ini2controls() ::oUI:q_editName : setText( cFileName ) ::oUI:q_editCmdLine : setText( cFile ) - ::oUI:q_editParams : setText( "" ) ENDIF EXIT CASE buttonUpdate_clicked - qItem := QListWidgetItem():from( ::oUI:q_listNames:currentItem() ) - cName := qItem:text() + IF ( nRow := ::oUI:q_listNames:currentRow() ) >= 0 + qItem := QListWidgetItem():from( ::oUI:q_listNames:currentItem() ) + cName := qItem:text() - IF ( nIndex := ascan( aTools, {|e_| e_[ 1 ] == cName } ) ) > 0 - ::aINI[ INI_TOOLS, nIndex ] := { ::oUI:q_editName:text(), ::oUI:q_editCmdLine:text(), ::oUI:q_editParams:text() } - ::clearList() - ::populateList() + IF ( nIndex := ascan( aTools, {|e_| e_[ 1 ] == cName } ) ) > 0 + ::controls2ini( nIndex ) + ::clearList() + ::populateList() + ::oUI:q_listNames:setCurrentRow( nRow ) + ENDIF ENDIF EXIT CASE buttonClose_clicked @@ -279,30 +331,6 @@ METHOD IdeToolsManager:populateList( aList ) /*----------------------------------------------------------------------*/ -METHOD IdeToolsManager:execTool( cName ) - LOCAL nIndex, cCmd, cParams, qProcess, qStr - - IF ( nIndex := ascan( ::aTools, {|e_| e_[ 1 ] == cName } ) ) > 0 - cCmd := ::aTools[ nIndex, 2 ] - cParams := ::aTools[ nIndex, 3 ] - - qProcess := QProcess():new() - - IF !empty( cParams ) - qStr := QStringList():new() - qStr:append( cParams ) - qProcess:startDetached_1( cCmd, qStr ) - ELSE - qProcess:startDetached_2( cCmd ) - ENDIF - qProcess:waitForStarted() - qProcess := NIL - ENDIF - - RETURN Self - -/*----------------------------------------------------------------------*/ - METHOD IdeToolsManager:buildToolsButton() LOCAL a_, qAct @@ -355,3 +383,98 @@ METHOD IdeToolsManager:addPanelsMenu( cPrompt ) RETURN Self /*----------------------------------------------------------------------*/ + +METHOD IdeToolsManager:execToolByParams( cCmd, cParams, cStartIn, lCapture, lOpen ) + LOCAL cArg + + ::oProcess := HbpProcess():new() + + ::oProcess:output := {|cOut, mp2, oHbp| ::showOutput( cOut, mp2, oHbp ) } + ::oProcess:finished := {|nEC , nES, oHbp| ::finished( nEC, nES, oHbp ) } + ::oProcess:workingPath := cStartIn + ::oProcess:lDetached := !( lCapture ) + + IF empty( cCmd ) + cCmd := hbide_getShellCommand() + cArg := iif( hbide_getOS() == "nix", "", "/C " ) + ELSE + cArg := "" + ENDIF + cArg += cParams + + IF lCapture + IF lOpen + ::oDockB2:show() + ENDIF + ::oOutputResult:oWidget:clear() + ::oOutputResult:oWidget:append( cCmd ) + ::oOutputResult:oWidget:append( cArg ) + ::oOutputResult:oWidget:append( hbide_outputLine() ) + ENDIF + ::oProcess:addArg( cArg ) + ::oProcess:start( cCmd ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeToolsManager:execTool( ... ) + LOCAL nIndex, cCmd, cParams, cStayIn, lCapture, lOpen, aParam + + aParam := hb_aParams() + IF len( aParam ) == 1 + IF ( nIndex := ascan( ::aTools, {|e_| e_[ 1 ] == aParam[ 1 ] } ) ) > 0 + cCmd := hbide_pathToOSPath( ::aTools[ nIndex, 2 ] ) + cParams := ::aTools[ nIndex, 3 ] + cParams := iif( "http://" $ lower( cParams ), cParams, hbide_pathToOSPath( cParams ) ) + cStayIn := hbide_pathToOSPath( ::aTools[ nIndex, 4 ] ) + lCapture := ::aTools[ nIndex, 5 ] == "YES" + lOpen := ::aTools[ nIndex, 6 ] == "YES" + ENDIF + ELSEIF len( aParam ) > 1 + asize( aParam, 5 ) + + DEFAULT aParam[ 1 ] TO "" + DEFAULT aParam[ 2 ] TO "" + DEFAULT aParam[ 3 ] TO "" + DEFAULT aParam[ 4 ] TO "" + DEFAULT aParam[ 5 ] TO "" + + cCmd := hbide_pathToOSPath( aParam[ 1 ] ) + cParams := aParam[ 2 ] + cParams := iif( "http://" $ lower( cParams ), cParams, hbide_pathToOSPath( cParams ) ) + cStayIn := hbide_pathToOSPath( aParam[ 3 ] ) + lCapture := aParam[ 4 ] == "YES" + lOpen := aParam[ 5 ] == "YES" + ENDIF + + IF hb_isLogical( lCapture ) + ::execToolByParams( cCmd, cParams, cStayIn, lCapture, lOpen ) + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeToolsManager:showOutput( cOut, mp2, oHbp ) + + HB_SYMBOL_UNUSED( mp2 ) + HB_SYMBOL_UNUSED( oHbp ) + + hbide_convertBuildStatusMsgToHtml( cOut, ::oOutputResult:oWidget ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeToolsManager:finished( nEC, nES, oHbp ) + + HB_SYMBOL_UNUSED( oHbp ) + + ::oOutputResult:oWidget:append( hbide_outputLine() ) + ::oOutputResult:oWidget:append( "Finished: Exit Code = " + hb_ntos( nEC ) + " Status = " + hb_ntos( nES ) ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbide/idewizard.prg b/harbour/contrib/hbide/idewizard.prg index d0d1e8a3bd..47f365e137 100644 --- a/harbour/contrib/hbide/idewizard.prg +++ b/harbour/contrib/hbide/idewizard.prg @@ -77,8 +77,8 @@ /*----------------------------------------------------------------------*/ FUNCTION hbide_startOpenWizard() - STATIC oWz + oWz := IdeWizard():new():create() RETURN NIL diff --git a/harbour/contrib/hbide/resources/toolsutilities.ui b/harbour/contrib/hbide/resources/toolsutilities.ui index c18775b2c8..9a7cfd35b8 100644 --- a/harbour/contrib/hbide/resources/toolsutilities.ui +++ b/harbour/contrib/hbide/resources/toolsutilities.ui @@ -7,7 +7,7 @@ 0 0 280 - 403 + 425 @@ -17,30 +17,38 @@ 12 - 258 - 79 + 236 + 251 16 - Command Line: + Command Line ( Keep blank if excuted via terminal ) 12 - 276 + 254 255 20 + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Keep this field blank if a command prompt has to be invoked to execute the parameters. </span></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">This is useful for building any type of project hbIDE do not support yet.</span></p></body></html> + 12 - 210 + 194 53 16 @@ -53,7 +61,7 @@ 176 - 140 + 96 95 24 @@ -66,7 +74,7 @@ 12 - 368 + 392 149 24 @@ -79,7 +87,7 @@ 12 - 306 + 278 79 16 @@ -92,7 +100,7 @@ 176 - 226 + 210 95 24 @@ -105,7 +113,7 @@ 12 - 29 + 19 149 173 @@ -115,7 +123,7 @@ 176 - 28 + 18 95 24 @@ -128,7 +136,7 @@ 176 - 66 + 44 95 24 @@ -141,7 +149,7 @@ 12 - 348 + 376 253 16 @@ -154,7 +162,7 @@ 12 - 10 + 4 105 16 @@ -167,17 +175,28 @@ 12 - 324 + 296 253 20 + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Parameters list may contain batch files, compilers directives, linker commands, if this tool is used to build a project. </span></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Otherwise it may contain parameters passed to the executable supplied in "Command line" field.</span></p> +<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-weight:600;">NOTE</span></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">"/" or "\" characters are recognized as path separators and cannot be used as parameter delimiters for contained applications.</span></p></body></html> + 176 - 102 + 70 95 24 @@ -190,7 +209,7 @@ 172 - 368 + 392 95 24 @@ -203,7 +222,7 @@ 12 - 228 + 212 149 20 @@ -212,9 +231,9 @@ - 178 - 178 - 91 + 176 + 168 + 95 24 @@ -222,6 +241,85 @@ Execute + + + + 14 + 320 + 95 + 16 + + + + Start in: + + + + + + 14 + 338 + 251 + 20 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Before executing this utility hbIDE will make this path current and then will run the command lin. </p> +<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">This will specifically help the applications which are expecting a fixed environment for their proper execution.</p></body></html> + + + + + + 14 + 362 + 109 + 19 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">This flag initiates the process in the background and all output from the designated application is displayed in the "Output Console" at the bottom of editing area.</p> +<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">This feature is generally suitable for building any project.</p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The output recieved as such empowers you the same feature as if Harbour project has been compiled, i.e., double click on an error line will open the source in the editor.</p></body></html> + + + Capture Output ? + + + + + + 134 + 362 + 131 + 19 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If you check it, "Ouput Console" will be made visible the moment you will execute this utility. </p> +<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Alternatively you can open the Output Console anytime by clicking on relevant icon on right-toolbar.</p> +<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">This has the bearing on visiblity of the widget. The output will ever be routed therein no matter this box is checked or not.</p></body></html> + + + Open Output Console ? + + diff --git a/harbour/contrib/hbide/resources/toolsutilities.uic b/harbour/contrib/hbide/resources/toolsutilities.uic index bdff940874..d13b8e707c 100644 --- a/harbour/contrib/hbide/resources/toolsutilities.uic +++ b/harbour/contrib/hbide/resources/toolsutilities.uic @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading ui file 'toolsutilities.ui' ** -** Created: Sun Mar 21 11:24:09 2010 +** Created: Sun Apr 4 19:24:53 2010 ** by: Qt User Interface Compiler version 4.5.2 ** ** WARNING! All changes made in this file will be lost when recompiling ui file! @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -44,65 +45,81 @@ public: QPushButton *buttonClose; QLineEdit *editName; QPushButton *buttonExec; + QLabel *labelStayIn; + QLineEdit *editStayIn; + QCheckBox *checkCapture; + QCheckBox *checkOpenCons; void setupUi(QDialog *DialogTools) { if (DialogTools->objectName().isEmpty()) DialogTools->setObjectName(QString::fromUtf8("DialogTools")); - DialogTools->resize(280, 403); + DialogTools->resize(280, 425); labelCmdLine = new QLabel(DialogTools); labelCmdLine->setObjectName(QString::fromUtf8("labelCmdLine")); - labelCmdLine->setGeometry(QRect(12, 258, 79, 16)); + labelCmdLine->setGeometry(QRect(12, 236, 251, 16)); editCmdLine = new QLineEdit(DialogTools); editCmdLine->setObjectName(QString::fromUtf8("editCmdLine")); - editCmdLine->setGeometry(QRect(12, 276, 255, 20)); + editCmdLine->setGeometry(QRect(12, 254, 255, 20)); labelName = new QLabel(DialogTools); labelName->setObjectName(QString::fromUtf8("labelName")); - labelName->setGeometry(QRect(12, 210, 53, 16)); + labelName->setGeometry(QRect(12, 194, 53, 16)); buttonDown = new QPushButton(DialogTools); buttonDown->setObjectName(QString::fromUtf8("buttonDown")); - buttonDown->setGeometry(QRect(176, 140, 95, 24)); + buttonDown->setGeometry(QRect(176, 96, 95, 24)); buttonUpdate = new QPushButton(DialogTools); buttonUpdate->setObjectName(QString::fromUtf8("buttonUpdate")); - buttonUpdate->setGeometry(QRect(12, 368, 149, 24)); + buttonUpdate->setGeometry(QRect(12, 392, 149, 24)); labelParams = new QLabel(DialogTools); labelParams->setObjectName(QString::fromUtf8("labelParams")); - labelParams->setGeometry(QRect(12, 306, 79, 16)); + labelParams->setGeometry(QRect(12, 278, 79, 16)); buttonBrowse = new QPushButton(DialogTools); buttonBrowse->setObjectName(QString::fromUtf8("buttonBrowse")); - buttonBrowse->setGeometry(QRect(176, 226, 95, 24)); + buttonBrowse->setGeometry(QRect(176, 210, 95, 24)); listNames = new QListWidget(DialogTools); listNames->setObjectName(QString::fromUtf8("listNames")); - listNames->setGeometry(QRect(12, 29, 149, 173)); + listNames->setGeometry(QRect(12, 19, 149, 173)); buttonAdd = new QPushButton(DialogTools); buttonAdd->setObjectName(QString::fromUtf8("buttonAdd")); - buttonAdd->setGeometry(QRect(176, 28, 95, 24)); + buttonAdd->setGeometry(QRect(176, 18, 95, 24)); buttonDelete = new QPushButton(DialogTools); buttonDelete->setObjectName(QString::fromUtf8("buttonDelete")); - buttonDelete->setGeometry(QRect(176, 66, 95, 24)); + buttonDelete->setGeometry(QRect(176, 44, 95, 24)); line = new QFrame(DialogTools); line->setObjectName(QString::fromUtf8("line")); - line->setGeometry(QRect(12, 348, 253, 16)); + line->setGeometry(QRect(12, 376, 253, 16)); line->setFrameShape(QFrame::HLine); line->setFrameShadow(QFrame::Sunken); label = new QLabel(DialogTools); label->setObjectName(QString::fromUtf8("label")); - label->setGeometry(QRect(12, 10, 105, 16)); + label->setGeometry(QRect(12, 4, 105, 16)); editParams = new QLineEdit(DialogTools); editParams->setObjectName(QString::fromUtf8("editParams")); - editParams->setGeometry(QRect(12, 324, 253, 20)); + editParams->setGeometry(QRect(12, 296, 253, 20)); buttonUp = new QPushButton(DialogTools); buttonUp->setObjectName(QString::fromUtf8("buttonUp")); - buttonUp->setGeometry(QRect(176, 102, 95, 24)); + buttonUp->setGeometry(QRect(176, 70, 95, 24)); buttonClose = new QPushButton(DialogTools); buttonClose->setObjectName(QString::fromUtf8("buttonClose")); - buttonClose->setGeometry(QRect(172, 368, 95, 24)); + buttonClose->setGeometry(QRect(172, 392, 95, 24)); editName = new QLineEdit(DialogTools); editName->setObjectName(QString::fromUtf8("editName")); - editName->setGeometry(QRect(12, 228, 149, 20)); + editName->setGeometry(QRect(12, 212, 149, 20)); buttonExec = new QPushButton(DialogTools); buttonExec->setObjectName(QString::fromUtf8("buttonExec")); - buttonExec->setGeometry(QRect(178, 178, 91, 24)); + buttonExec->setGeometry(QRect(176, 168, 95, 24)); + labelStayIn = new QLabel(DialogTools); + labelStayIn->setObjectName(QString::fromUtf8("labelStayIn")); + labelStayIn->setGeometry(QRect(14, 320, 95, 16)); + editStayIn = new QLineEdit(DialogTools); + editStayIn->setObjectName(QString::fromUtf8("editStayIn")); + editStayIn->setGeometry(QRect(14, 338, 251, 20)); + checkCapture = new QCheckBox(DialogTools); + checkCapture->setObjectName(QString::fromUtf8("checkCapture")); + checkCapture->setGeometry(QRect(14, 362, 109, 19)); + checkOpenCons = new QCheckBox(DialogTools); + checkOpenCons->setObjectName(QString::fromUtf8("checkOpenCons")); + checkOpenCons->setGeometry(QRect(134, 362, 131, 19)); retranslateUi(DialogTools); @@ -112,7 +129,15 @@ public: void retranslateUi(QDialog *DialogTools) { DialogTools->setWindowTitle(QApplication::translate("DialogTools", "Tools & Utilities", 0, QApplication::UnicodeUTF8)); - labelCmdLine->setText(QApplication::translate("DialogTools", "Command Line:", 0, QApplication::UnicodeUTF8)); + labelCmdLine->setText(QApplication::translate("DialogTools", "Command Line ( Keep blank if excuted via terminal )", 0, QApplication::UnicodeUTF8)); +#ifndef QT_NO_TOOLTIP + editCmdLine->setToolTip(QApplication::translate("DialogTools", "\n" +"\n" +"

Keep this field blank if a command prompt has to be invoked to execute the parameters.

\n" +"

This is useful for building any type of project hbIDE do not support yet.

", 0, QApplication::UnicodeUTF8)); +#endif // QT_NO_TOOLTIP labelName->setText(QApplication::translate("DialogTools", "Name:", 0, QApplication::UnicodeUTF8)); buttonDown->setText(QApplication::translate("DialogTools", "Down", 0, QApplication::UnicodeUTF8)); buttonUpdate->setText(QApplication::translate("DialogTools", "Update", 0, QApplication::UnicodeUTF8)); @@ -121,9 +146,57 @@ public: buttonAdd->setText(QApplication::translate("DialogTools", "Add", 0, QApplication::UnicodeUTF8)); buttonDelete->setText(QApplication::translate("DialogTools", "Delete", 0, QApplication::UnicodeUTF8)); label->setText(QApplication::translate("DialogTools", "Current Tools:", 0, QApplication::UnicodeUTF8)); +#ifndef QT_NO_TOOLTIP + editParams->setToolTip(QApplication::translate("DialogTools", "\n" +"\n" +"

Parameters list may contain batch files, compilers directives, linker commands, if this tool is used to build a project.

\n" +"

Otherwise it may contain parameters passed to the executable supplied in \"Command line\" field.

\n" +"

\n" +"

NOTE

\n" +"

\"/\" or \"\\\" characters are recognized as path separators and cannot be used as parameter delimiters for contained applications.

", 0, QApplication::UnicodeUTF8)); +#endif // QT_NO_TOOLTIP buttonUp->setText(QApplication::translate("DialogTools", "Up", 0, QApplication::UnicodeUTF8)); buttonClose->setText(QApplication::translate("DialogTools", "Close", 0, QApplication::UnicodeUTF8)); buttonExec->setText(QApplication::translate("DialogTools", "Execute", 0, QApplication::UnicodeUTF8)); + labelStayIn->setText(QApplication::translate("DialogTools", "Start in:", 0, QApplication::UnicodeUTF8)); +#ifndef QT_NO_TOOLTIP + editStayIn->setToolTip(QApplication::translate("DialogTools", "\n" +"\n" +"

Before executing this utility hbIDE will make this path current and then will run the command lin.

\n" +"

\n" +"

This will specifically help the applications which are expecting a fixed environment for their proper execution.

", 0, QApplication::UnicodeUTF8)); +#endif // QT_NO_TOOLTIP +#ifndef QT_NO_TOOLTIP + checkCapture->setToolTip(QApplication::translate("DialogTools", "\n" +"\n" +"

This flag initiates the process in the background and all output from the designated application is displayed in the \"Output Console\" at the bottom of editing area.

\n" +"

\n" +"

This feature is generally suitable for building any projec" + "t.

\n" +"

The output recieved as such empowers you the same feature as if Harbour project has been compiled, i.e., double click on an error line will open the source in the editor.

", 0, QApplication::UnicodeUTF8)); +#endif // QT_NO_TOOLTIP + checkCapture->setText(QApplication::translate("DialogTools", "Capture Output ?", 0, QApplication::UnicodeUTF8)); +#ifndef QT_NO_TOOLTIP + checkOpenCons->setToolTip(QApplication::translate("DialogTools", "\n" +"\n" +"

If you check it, \"Ouput Console\" will be made visible the moment you will execute this utility.

\n" +"

\n" +"

Alternatively you can open the Output Console anytime by clicking on relevant icon on right-toolbar.

\n" +"

\n" +"

This has the bearing on visiblity of the widget. The output will ever be routed therein no matter this box is checked or not.

", 0, QApplication::UnicodeUTF8)); +#endif // QT_NO_TOOLTIP + checkOpenCons->setText(QApplication::translate("DialogTools", "Open Output Console ?", 0, QApplication::UnicodeUTF8)); Q_UNUSED(DialogTools); } // retranslateUi diff --git a/harbour/contrib/hbxbp/hbpprocess.prg b/harbour/contrib/hbxbp/hbpprocess.prg index 23144f4f05..8c4e404491 100644 --- a/harbour/contrib/hbxbp/hbpprocess.prg +++ b/harbour/contrib/hbxbp/hbpprocess.prg @@ -91,7 +91,7 @@ CLASS HbpProcess DATA cShellCmd - DATA lDetatched INIT .f. + DATA lDetached INIT .f. METHOD new( cShellCmd ) METHOD create( cShellCmd ) @@ -195,32 +195,42 @@ METHOD HbpProcess:start( cShellCmd ) ::cShellCmd := cShellCmd ::qProcess := QProcess():new() - ::qProcess:setReadChannel( 1 ) #if 0 - Qt_Slots_Connect( ::pSlots, ::qProcess, "readyRead()" , {|i| ::read( CHN_REA, i ) } ) - Qt_Slots_Connect( ::pSlots, ::qProcess, "readChannelFinished()" , {|i| ::read( CHN_RCF, i ) } ) - Qt_Slots_Connect( ::pSlots, ::qProcess, "aboutToClose()" , {|i| ::read( CHN_CLO, i ) } ) - Qt_Slots_Connect( ::pSlots, ::qProcess, "bytesWritten(int)" , {|i| ::read( CHN_BYT, i ) } ) - Qt_Slots_Connect( ::pSlots, ::qProcess, "stateChanged(int)" , {|i| ::read( CHN_STT, i ) } ) - Qt_Slots_Connect( ::pSlots, ::qProcess, "error(int)" , {|i| ::read( CHN_ERE, i ) } ) + Qt_Slots_Connect( ::pSlots, ::qProcess, "readyRead()" , {|i| ::read( CHN_REA, i ) } ) + Qt_Slots_Connect( ::pSlots, ::qProcess, "readChannelFinished()" , {|i| ::read( CHN_RCF, i ) } ) + Qt_Slots_Connect( ::pSlots, ::qProcess, "aboutToClose()" , {|i| ::read( CHN_CLO, i ) } ) + Qt_Slots_Connect( ::pSlots, ::qProcess, "bytesWritten(int)" , {|i| ::read( CHN_BYT, i ) } ) + Qt_Slots_Connect( ::pSlots, ::qProcess, "stateChanged(int)" , {|i| ::read( CHN_STT, i ) } ) + Qt_Slots_Connect( ::pSlots, ::qProcess, "error(int)" , {|i| ::read( CHN_ERE, i ) } ) + #else + IF !( ::lDetached ) + Qt_Slots_Connect( ::pSlots, ::qProcess, "started()" , {|i| ::read( CHN_BGN, i ) } ) + Qt_Slots_Connect( ::pSlots, ::qProcess, "readyReadStandardOutput()", {|i| ::read( CHN_OUT, i ) } ) + Qt_Slots_Connect( ::pSlots, ::qProcess, "readyReadStandardError()" , {|i| ::read( CHN_ERR, i ) } ) + Qt_Slots_Connect( ::pSlots, ::qProcess, "finished(int,int)" , {|i,ii| ::read( CHN_FIN, i, ii ) } ) + ENDIF #endif - Qt_Slots_Connect( ::pSlots, ::qProcess, "started()" , {|i| ::read( CHN_BGN, i ) } ) - Qt_Slots_Connect( ::pSlots, ::qProcess, "readyReadStandardOutput()", {|i| ::read( CHN_OUT, i ) } ) - Qt_Slots_Connect( ::pSlots, ::qProcess, "readyReadStandardError()" , {|i| ::read( CHN_ERR, i ) } ) - Qt_Slots_Connect( ::pSlots, ::qProcess, "finished(int,int)" , {|i,ii| ::read( CHN_FIN, i, ii ) } ) - IF !empty( ::cWrkDirectory ) ::qProcess:setWorkingDirectory( ::cWrkDirectory ) ENDIF ::nStarted := seconds() - IF !empty( ::qStrList ) - ::qProcess:start( ::cShellCmd, ::qStrList ) + IF ::lDetached + IF !empty( ::qStrList ) + ::qProcess:startDetached_1( ::cShellCmd, ::qStrList ) + ELSE + ::qProcess:startDetached_2( ::cShellCmd ) + ENDIF + ::qProcess:waitForStarted() ELSE - ::qProcess:start_1( ::cShellCmd ) + IF !empty( ::qStrList ) + ::qProcess:start( ::cShellCmd, ::qStrList ) + ELSE + ::qProcess:start_1( ::cShellCmd ) + ENDIF ENDIF RETURN Self