2010-04-10 16:11 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* contrib/hbide/idedocks.prg
* contrib/hbide/ideenviron.prg
* contrib/hbide/idefindreplace.prg
* contrib/hbide/idemisc.prg
* contrib/hbide/ideprojmanager.prg
* contrib/hbide/ideshortcuts.prg
* contrib/hbide/idesources.prg
* contrib/hbxbp/hbpprocess.prg
! Fixed error when double-click on build output was causing GPF
if no editor tab is in focus, i.e., Welcome tabs are visible.
- Removed some loggings.
% Reworked how build commands are called. Now only one batch file
is sent to the process engine to fire and rest is contained
into that batch file. It probably may solve *nix issue where
a .sh is not executed or any other command with long list of params.
This commit is contained in:
@@ -17,6 +17,26 @@
|
||||
past entries belonging to author(s): Viktor Szakats.
|
||||
*/
|
||||
|
||||
2010-04-10 16:11 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
|
||||
* contrib/hbide/idedocks.prg
|
||||
* contrib/hbide/ideenviron.prg
|
||||
* contrib/hbide/idefindreplace.prg
|
||||
* contrib/hbide/idemisc.prg
|
||||
* contrib/hbide/ideprojmanager.prg
|
||||
* contrib/hbide/ideshortcuts.prg
|
||||
* contrib/hbide/idesources.prg
|
||||
* contrib/hbxbp/hbpprocess.prg
|
||||
|
||||
! Fixed error when double-click on build output was causing GPF
|
||||
if no editor tab is in focus, i.e., Welcome tabs are visible.
|
||||
|
||||
- Removed some loggings.
|
||||
|
||||
% Reworked how build commands are called. Now only one batch file
|
||||
is sent to the process engine to fire and rest is contained
|
||||
into that batch file. It probably may solve *nix issue where
|
||||
a .sh is not executed or any other command with long list of params.
|
||||
|
||||
2010-04-10 12:04 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
|
||||
* contrib/hbxbp/xbpdialog.prg
|
||||
+ Added :sysMenu instance variable picked from Shum's example.
|
||||
|
||||
@@ -852,15 +852,16 @@ METHOD IdeDocks:outputDoubleClicked( lSelected )
|
||||
cText := QTextBlock():configure( qCursor:block() ):text()
|
||||
|
||||
IF hbide_parseFNfromStatusMsg( cText, @cSource, @nLine, .T. )
|
||||
::oSM:editSource( cSource, 0, 0, 0, NIL, NIL, .f., .t. )
|
||||
qCursor := QTextCursor():configure( ::oIde:qCurEdit:textCursor() )
|
||||
nLine := iif( nLine < 1, 0, nLine - 1 )
|
||||
IF ::oSM:editSource( cSource, 0, 0, 0, NIL, NIL, .f., .t. )
|
||||
qCursor := QTextCursor():configure( ::oIde:qCurEdit:textCursor() )
|
||||
nLine := iif( nLine < 1, 0, nLine - 1 )
|
||||
|
||||
qCursor:setPosition( 0 )
|
||||
qCursor:movePosition( QTextCursor_Down, QTextCursor_MoveAnchor, nLine )
|
||||
::oIde:qCurEdit:setTextCursor( qCursor )
|
||||
::oIde:qCurEdit:centerCursor()
|
||||
::oIde:manageFocusInEditor()
|
||||
qCursor:setPosition( 0 )
|
||||
qCursor:movePosition( QTextCursor_Down, QTextCursor_MoveAnchor, nLine )
|
||||
::oIde:qCurEdit:setTextCursor( qCursor )
|
||||
::oIde:qCurEdit:centerCursor()
|
||||
::oIde:manageFocusInEditor()
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
|
||||
@@ -123,11 +123,9 @@ METHOD IdeEnvironments:create( oIDE, cEnvFile )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
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
|
||||
|
||||
@@ -183,21 +181,18 @@ METHOD IdeEnvironments:parse( cEnvFile )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeEnvironments:prepareBatch( cEnvName )
|
||||
LOCAL n, s, a_, aCmd
|
||||
LOCAL cFile := space( 255 )
|
||||
LOCAL n, s, a_, aCmd := {}
|
||||
|
||||
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
|
||||
RETURN hbide_getShellCommandsTempFile( aCmd )
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ METHOD IdeSearchReplace:create( oIde )
|
||||
|
||||
::oUI:q_checkReplace:setEnabled( .f. )
|
||||
::oUI:q_frameReplace:hide()
|
||||
hbide_dbg("========================================================================IdeSearchReplace:create()" )
|
||||
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
@@ -604,7 +604,7 @@ FUNCTION hbide_isValidText( cSourceFile )
|
||||
hb_fNameSplit( cSourceFile, , , @cExt )
|
||||
|
||||
RETURN ( lower( cExt ) $ ".c,.cpp,.prg,.h,.ch,.txt,.log,.ini,.env,.ppo," + ;
|
||||
".cc,.hbc,.hbp,.hbm,.xml,.bat,.sh,.rc,.ui,.bak" )
|
||||
".cc,.hbc,.hbp,.hbm,.xml,.bat,.sh,.rc,.ui,.uic,.bak,.fmg" )
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
@@ -1452,7 +1452,7 @@ FUNCTION hbide_outputLine( cLine, nOccur )
|
||||
DEFAULT cLine TO "-"
|
||||
DEFAULT nOccur TO 100
|
||||
|
||||
RETURN replicate( cLine, nOccur )
|
||||
RETURN "<font color=lightgreen>" + replicate( cLine, nOccur ) + "</font>"
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@@ -257,6 +257,7 @@ CLASS IdeProjManager INHERIT IdeObject
|
||||
METHOD buildInterface()
|
||||
METHOD pullHbpData( cHbp )
|
||||
METHOD synchronizeAlienProject( cProjFileName )
|
||||
METHOD outputText( cText )
|
||||
|
||||
METHOD harbourFlags()
|
||||
METHOD hbmk2Flags()
|
||||
@@ -1136,7 +1137,8 @@ METHOD IdeProjManager:promptForPath( cObjPathName, cTitle, cObjFileName, cObjPat
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt )
|
||||
LOCAL cHbpPath, oEdit, cHbpFN, cTmp, cExeHbMk2, aHbp, cCmd, cC, cArg, oSource, cCmdParams
|
||||
LOCAL cHbpPath, oEdit, cHbpFN, cTmp, cExeHbMk2, aHbp, cCmd, cC, oSource, cCmdParams, cBuf
|
||||
LOCAL cbRed := "<font color=blue>", ceRed := "</font>"
|
||||
|
||||
aHbp := {}
|
||||
|
||||
@@ -1220,13 +1222,13 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt )
|
||||
::oOutputResult:oWidget:append( 'Error saving: ' + cHbpPath )
|
||||
|
||||
ELSE
|
||||
cTmp := hbide_outputLine() + CRLF + ;
|
||||
"Project [ " + cProject + " ] " + ;
|
||||
::oOutputResult:oWidget:append( hbide_outputLine() )
|
||||
cTmp := "Project [ " + cProject + " ] " + ;
|
||||
"Launch [ " + iif( lLaunch , 'Yes', 'No' ) + " ] " + ;
|
||||
"Rebuild [ " + iif( lRebuild, 'Yes', 'No' ) + " ] " + ;
|
||||
"Started [ " + time() + " ]" + CRLF + ;
|
||||
hbide_outputLine() + CRLF
|
||||
"Started [ " + time() + " ]"
|
||||
::oOutputResult:oWidget:append( cTmp )
|
||||
::oOutputResult:oWidget:append( hbide_outputLine() )
|
||||
|
||||
::oIDE:oEV := IdeEnvironments():new():create( ::oIDE, hbide_pathFile( ::aINI[ INI_HBIDE, PathEnv ], "hbide.env" ) )
|
||||
::cBatch := ::oEV:prepareBatch( ::cWrkEnvironment )
|
||||
@@ -1241,16 +1243,23 @@ METHOD IdeProjManager:buildProject( cProject, lLaunch, lRebuild, lPPO, lViaQt )
|
||||
::oProcess:finished := {|nEC , nES, oHbp| ::finished( nEC ,nES,oHbp ) }
|
||||
::oProcess:workingPath := hbide_pathToOSPath( ::oProject:location )
|
||||
//
|
||||
|
||||
cCmd := hbide_getShellCommand()
|
||||
cC := iif( hbide_getOS() == "nix", "", "/C " )
|
||||
cArg := iif( empty( ::cBatch ), cC, cC + ::cBatch + " && " )
|
||||
cC := iif( hbide_getOS() == "nix", "-c ", "/C " )
|
||||
|
||||
IF hb_fileExists( ::cBatch )
|
||||
cBuf := memoread( ::cBatch )
|
||||
cBuf += hb_osNewLine() + cExeHbMk2 + " " + cHbpPath + cCmdParams + hb_osNewLine()
|
||||
hb_memowrit( ::cBatch, cBuf )
|
||||
ENDIF
|
||||
//
|
||||
::oOutputResult:oWidget:append( ::cBatch + iif( hb_fileExists( ::cBatch ), " : Exists", " : Do Not Exists" ) )
|
||||
::oOutputResult:oWidget:append( cArg + cExeHbMk2 + " " + cHbpPath + cCmdParams )
|
||||
::oOutputResult:oWidget:append( hbide_outputLine() )
|
||||
::outputText( cbRed + "Batch File " + iif( hb_fileExists( ::cBatch ), " Exists", " : doesn't Exist" ) + " => " + ceRed + trim( ::cBatch ) )
|
||||
::outputText( cbRed + "Batch File Contents => " + ceRed )
|
||||
::outputText( memoread( ::cBatch ) )
|
||||
::outputText( cbRed + "Command => " + ceRed + cCmd )
|
||||
::outputText( cbRed + "Arguments => " + ceRed + cC + ::cBatch )
|
||||
::outputText( hbide_outputLine() )
|
||||
//
|
||||
::oProcess:addArg( cArg + cExeHbMk2 + " " + cHbpPath + cCmdParams )
|
||||
::oProcess:addArg( cC + ::cBatch )
|
||||
::oProcess:start( cCmd )
|
||||
ENDIF
|
||||
|
||||
@@ -1273,12 +1282,11 @@ METHOD IdeProjManager:finished( nExitCode, nExitStatus, oProcess )
|
||||
|
||||
hbide_justACall( oProcess )
|
||||
|
||||
cTmp := hbide_outputLine() + CRLF
|
||||
cTmp += "Exit Code [ " + hb_ntos( nExitCode ) + " ] Exit Status [ " + hb_ntos( nExitStatus ) + " ] " +;
|
||||
"Finished at [ " + time() + " ] Done in [ " + hb_ntos( seconds() - oProcess:started ) +" Secs ]" + CRLF
|
||||
cTmp += hbide_outputLine() + CRLF
|
||||
|
||||
::oOutputResult:oWidget:append( cTmp )
|
||||
::outputText( hbide_outputLine() )
|
||||
cTmp := "Exit Code [ " + hb_ntos( nExitCode ) + " ] Exit Status [ " + hb_ntos( nExitStatus ) + " ] " +;
|
||||
"Finished at [ " + time() + " ] Done in [ " + hb_ntos( seconds() - oProcess:started ) +" Secs ]"
|
||||
::outputText( cTmp )
|
||||
::outputText( hbide_outputLine() )
|
||||
|
||||
ferase( ::cBatch )
|
||||
|
||||
@@ -1291,7 +1299,6 @@ METHOD IdeProjManager:finished( nExitCode, nExitStatus, oProcess )
|
||||
cT := ".exe" // Chr( 13 )
|
||||
n1 := hb_at( cT, cTmp, n + len( cTkn ) )
|
||||
cExe := substr( cTmp, n + len( cTkn ), n1 - n - len( cTkn ) + len( cT ) )
|
||||
HB_TRACE( HB_TR_ALWAYS, 1, cTkn, cExe )
|
||||
ENDIF
|
||||
ENDIF
|
||||
IF empty( cExe )
|
||||
@@ -1300,14 +1307,32 @@ HB_TRACE( HB_TR_ALWAYS, 1, cTkn, cExe )
|
||||
cT := ".exe" // Chr( 13 )
|
||||
n1 := hb_at( cT, cTmp, n + len( cTkn ) )
|
||||
cExe := substr( cTmp, n + len( cTkn ), n1 - n - len( cTkn ) + len( cT ) )
|
||||
HB_TRACE( HB_TR_ALWAYS, 2, cTkn, cExe )
|
||||
ENDIF
|
||||
ENDIF
|
||||
IF empty( cExe )
|
||||
cTkn := "hbmk2: Linker command:"
|
||||
IF ( n := at( cTkn, cTmp ) ) > 0
|
||||
cTmp := alltrim( substr( cTmp, n + len( cTkn ) ) )
|
||||
IF ( n := at( "-o", cTmp ) ) > 0
|
||||
IF ( n1 := hb_at( " ", cTmp, n ) ) > 0
|
||||
cExe := alltrim( substr( cTmp, n + 2, n1 - n - 2 ) )
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
::outputText( " " )
|
||||
IF empty( cExe )
|
||||
::outputText( "<font color=red>" + "Executable could not been detected from linker output!" + "</font>" )
|
||||
ELSE
|
||||
::outputText( "<font color=blue>" + "Detected exeutable => " + cExe + "</font>" )
|
||||
ENDIF
|
||||
::outputText( " " )
|
||||
|
||||
IF nExitCode == 0
|
||||
::launchProject( ::cProjectInProcess, cExe )
|
||||
ELSE
|
||||
::oOutputResult:oWidget:append( "Sorry, cannot launch project because of errors..." )
|
||||
::outputText( "Sorry, cannot launch project because of errors..." )
|
||||
ENDIF
|
||||
ENDIF
|
||||
IF ::lPPO .AND. hb_FileExists( ::cPPO )
|
||||
@@ -1345,6 +1370,9 @@ METHOD IdeProjManager:launchProject( cProject, cExe )
|
||||
cTargetFN += '.exe'
|
||||
ENDIF
|
||||
#endif
|
||||
IF !hb_FileExists( cTargetFN )
|
||||
cTargetFN := oProject:launchProgram
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
IF !hb_FileExists( cTargetFN )
|
||||
@@ -1384,6 +1412,14 @@ METHOD IdeProjManager:launchProject( cProject, cExe )
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeProjManager:outputText( cText )
|
||||
|
||||
::oOutputResult:oWidget:append( cText )
|
||||
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeProjManager:harbourFlags()
|
||||
LOCAL a_:= {}
|
||||
|
||||
|
||||
@@ -89,6 +89,14 @@ CLASS IdeShortcuts INHERIT IdeObject
|
||||
DATA aDftSCuts INIT {}
|
||||
DATA aDftSCutsItms INIT {}
|
||||
|
||||
DATA cName
|
||||
DATA cKey
|
||||
DATA cAlt
|
||||
DATA cCtrl
|
||||
DATA cShift
|
||||
DATA cMenu
|
||||
DATA cBlock
|
||||
|
||||
METHOD new( oIde )
|
||||
METHOD create( oIde )
|
||||
METHOD destroy()
|
||||
@@ -113,6 +121,12 @@ CLASS IdeShortcuts INHERIT IdeObject
|
||||
METHOD populateDftSCuts()
|
||||
METHOD populateKeys()
|
||||
METHOD populateMethods()
|
||||
METHOD checkDuplicate( cKey, cAlt, cCtrl, cShift, nRow )
|
||||
METHOD controls2vrbls()
|
||||
METHOD vrbls2controls( nRow )
|
||||
METHOD array2controls( nRow )
|
||||
METHOD array2table( nRow, a_ )
|
||||
METHOD vrbls2array( nRow )
|
||||
|
||||
ENDCLASS
|
||||
|
||||
@@ -183,31 +197,32 @@ METHOD IdeShortcuts:show()
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeShortcuts:execEvent( nMode, p )
|
||||
LOCAL nRow, nKey, cKey
|
||||
LOCAL nRow
|
||||
|
||||
SWITCH nMode
|
||||
CASE buttonNew_clicked
|
||||
|
||||
IF .t.
|
||||
::controls2vrbls()
|
||||
IF !( ::checkDuplicate( ::cKey, ::cAlt, ::cCtrl, ::cShift ) )
|
||||
aadd( ::aDftSCuts, { ::cName, ::cKey, ::cAlt, ::cCtrl, ::cShift, ::cMenu, ::cBlock } )
|
||||
aadd( ::aDftSCutsItms, array( 5 ) )
|
||||
::oUI:q_tableMacros:setRowCount( ::oUI:q_tableMacros:rowCount() + 1 )
|
||||
::array2table( len( ::aDftSCuts ), { ::cName, ::cKey, ::cAlt, ::cCtrl, ::cShift, ::cMenu, ::cBlock } )
|
||||
ELSE
|
||||
MsgBox( "Current shortcut is already defined!" )
|
||||
ENDIF
|
||||
ENDIF
|
||||
EXIT
|
||||
|
||||
CASE buttonSet_clicked
|
||||
nRow := ::oUI:q_tableMacros:currentRow()
|
||||
IF nRow >= 0 .AND. nRow < len( ::aDftSCuts )
|
||||
nRow++
|
||||
::aDftSCuts[ nRow, 1 ] := ::oUI:q_editName:text()
|
||||
::aDftSCuts[ nRow, 2 ] := ::aKeys[ ::oUI:q_comboKey:currentIndex() + 1, 2 ]
|
||||
::aDftSCuts[ nRow, 3 ] := iif( ::oUI:q_checkAlt :isChecked(), "YES", "NO" )
|
||||
::aDftSCuts[ nRow, 4 ] := iif( ::oUI:q_checkCtrl :isChecked(), "YES", "NO" )
|
||||
::aDftSCuts[ nRow, 5 ] := iif( ::oUI:q_checkShift:isChecked(), "YES", "NO" )
|
||||
::aDftSCuts[ nRow, 6 ] := ::oUI:q_editMenu:text()
|
||||
::aDftSCuts[ nRow, 7 ] := ::oUI:q_plainBlock:toPlainText()
|
||||
|
||||
::aDftSCutsItms[ nRow, 1 ]:setText( ::aDftSCuts[ nRow, 1 ] )
|
||||
::aDftSCutsItms[ nRow, 2 ]:setText( ::aDftSCuts[ nRow, 2 ] )
|
||||
::aDftSCutsItms[ nRow, 3 ]:setIcon( hbide_image( iif( ::aDftSCuts[ nRow, 3 ] == "YES", "check", "" ) ) )
|
||||
::aDftSCutsItms[ nRow, 4 ]:setIcon( hbide_image( iif( ::aDftSCuts[ nRow, 4 ] == "YES", "check", "" ) ) )
|
||||
::aDftSCutsItms[ nRow, 5 ]:setIcon( hbide_image( iif( ::aDftSCuts[ nRow, 5 ] == "YES", "check", "" ) ) )
|
||||
|
||||
::controls2vrbls()
|
||||
IF !( ::checkDuplicate( ::cKey, ::cAlt, ::cCtrl, ::cShift, nRow ) )
|
||||
::vrbls2array( nRow )
|
||||
::vrbls2controls( nRow )
|
||||
ENDIF
|
||||
ENDIF
|
||||
EXIT
|
||||
CASE tableMacros_itemDoubleClicked
|
||||
@@ -217,21 +232,7 @@ METHOD IdeShortcuts:execEvent( nMode, p )
|
||||
nRow := ::oUI:q_tableMacros:currentRow()
|
||||
IF nRow >= 0 .AND. nRow < len( ::aDftSCuts )
|
||||
nRow++
|
||||
|
||||
::oUI:q_editName:setText( ::aDftSCuts[ nRow, 1 ] )
|
||||
|
||||
cKey := ::aDftSCuts[ nRow, 2 ]
|
||||
IF ( nKey := ascan( ::aKeys, {|e_| e_[ 2 ] == cKey } ) ) > 0
|
||||
::oUI:q_comboKey:setCurrentIndex( nKey - 1 )
|
||||
ENDIF
|
||||
|
||||
::oUI:q_checkAlt :setChecked( ::aDftSCuts[ nRow, 3 ] == "YES" )
|
||||
::oUI:q_checkCtrl :setChecked( ::aDftSCuts[ nRow, 4 ] == "YES" )
|
||||
::oUI:q_checkShift:setChecked( ::aDftSCuts[ nRow, 5 ] == "YES" )
|
||||
|
||||
::oUI:q_editMenu:setText( ::aDftSCuts[ nRow, 6 ] )
|
||||
|
||||
::oUI:q_plainBlock:setPlainText( ::aDftSCuts[ nRow, 7 ] )
|
||||
::array2controls( nRow )
|
||||
ENDIF
|
||||
EXIT
|
||||
CASE listMethods_itemDoubleClicked
|
||||
@@ -247,6 +248,132 @@ METHOD IdeShortcuts:execEvent( nMode, p )
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeShortcuts:array2controls( nRow )
|
||||
LOCAL cKey, nKey
|
||||
|
||||
::oUI:q_editName:setText( ::aDftSCuts[ nRow, 1 ] )
|
||||
|
||||
cKey := ::aDftSCuts[ nRow, 2 ]
|
||||
IF ( nKey := ascan( ::aKeys, {|e_| e_[ 2 ] == cKey } ) ) > 0
|
||||
::oUI:q_comboKey:setCurrentIndex( nKey - 1 )
|
||||
ENDIF
|
||||
|
||||
::oUI:q_checkAlt :setChecked( ::aDftSCuts[ nRow, 3 ] == "YES" )
|
||||
::oUI:q_checkCtrl :setChecked( ::aDftSCuts[ nRow, 4 ] == "YES" )
|
||||
::oUI:q_checkShift:setChecked( ::aDftSCuts[ nRow, 5 ] == "YES" )
|
||||
|
||||
::oUI:q_editMenu:setText( ::aDftSCuts[ nRow, 6 ] )
|
||||
|
||||
::oUI:q_plainBlock:setPlainText( ::aDftSCuts[ nRow, 7 ] )
|
||||
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeShortcuts:vrbls2array( nRow )
|
||||
|
||||
IF nRow == NIL
|
||||
aadd( ::aDftSCuts, array( 7 ) )
|
||||
nRow := len( ::aDftSCuts )
|
||||
ENDIF
|
||||
|
||||
::aDftSCuts[ nRow, 1 ] := ::cName
|
||||
::aDftSCuts[ nRow, 2 ] := ::cKey
|
||||
::aDftSCuts[ nRow, 3 ] := ::cAlt
|
||||
::aDftSCuts[ nRow, 4 ] := ::cCtrl
|
||||
::aDftSCuts[ nRow, 5 ] := ::cShift
|
||||
::aDftSCuts[ nRow, 6 ] := ::cMenu
|
||||
::aDftSCuts[ nRow, 7 ] := ::cBlock
|
||||
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeShortcuts:vrbls2controls( nRow )
|
||||
|
||||
::aDftSCutsItms[ nRow, 1 ]:setText( ::cName )
|
||||
::aDftSCutsItms[ nRow, 2 ]:setText( ::cKey )
|
||||
::aDftSCutsItms[ nRow, 3 ]:setIcon( hbide_image( iif( ::cAlt == "YES", "check", "" ) ) )
|
||||
::aDftSCutsItms[ nRow, 4 ]:setIcon( hbide_image( iif( ::cCtrl == "YES", "check", "" ) ) )
|
||||
::aDftSCutsItms[ nRow, 5 ]:setIcon( hbide_image( iif( ::cShift == "YES", "check", "" ) ) )
|
||||
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeShortcuts:array2table( nRow, a_ )
|
||||
LOCAL q1, q2, q3, q4, q5
|
||||
LOCAL oTbl := ::oUI:q_tableMacros
|
||||
LOCAL n := nRow - 1
|
||||
|
||||
q1 := QTableWidgetItem():new()
|
||||
q1:setText( a_[ 1 ] )
|
||||
oTbl:setItem( n, 0, q1 )
|
||||
|
||||
q2 := QTableWidgetItem():new()
|
||||
q2:setText( a_[ 2 ] )
|
||||
oTbl:setItem( n, 1, q2 )
|
||||
|
||||
q3 := QTableWidgetItem():new()
|
||||
q3:setIcon( iif( a_[ 3 ] == "YES", hbide_image( "check" ), "" ) )
|
||||
oTbl:setItem( n, 2, q3 )
|
||||
|
||||
q4 := QTableWidgetItem():new()
|
||||
q4:setIcon( iif( a_[ 4 ] == "YES", hbide_image( "check" ), "" ) )
|
||||
oTbl:setItem( n, 3, q4 )
|
||||
|
||||
q5 := QTableWidgetItem():new()
|
||||
q5:setIcon( iif( a_[ 5 ] == "YES", hbide_image( "check" ), "" ) )
|
||||
oTbl:setItem( n, 4, q5 )
|
||||
|
||||
oTbl:setRowHeight( n, 16 )
|
||||
|
||||
::aDftSCutsItms[ nRow, 1 ] := q1
|
||||
::aDftSCutsItms[ nRow, 2 ] := q2
|
||||
::aDftSCutsItms[ nRow, 3 ] := q3
|
||||
::aDftSCutsItms[ nRow, 4 ] := q4
|
||||
::aDftSCutsItms[ nRow, 5 ] := q5
|
||||
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeShortcuts:controls2vrbls()
|
||||
|
||||
::cName := ::oUI:q_editName:text()
|
||||
::cKey := ::aKeys[ ::oUI:q_comboKey:currentIndex() + 1, 2 ]
|
||||
::cAlt := iif( ::oUI:q_checkAlt :isChecked(), "YES", "NO" )
|
||||
::cCtrl := iif( ::oUI:q_checkCtrl :isChecked(), "YES", "NO" )
|
||||
::cShift := iif( ::oUI:q_checkShift:isChecked(), "YES", "NO" )
|
||||
::cMenu := ::oUI:q_editMenu:text()
|
||||
::cBlock := ::oUI:q_plainBlock:toPlainText()
|
||||
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeShortcuts:checkDuplicate( cKey, cAlt, cCtrl, cShift, nRow )
|
||||
LOCAL lYes, e_
|
||||
|
||||
IF empty( nRow )
|
||||
lYes := ascan( ::aDftSCuts, {|e_| e_[ 2 ] == cKey .AND. e_[ 3 ] == cAlt .AND. ;
|
||||
e_[ 4 ] == cCtrl .AND. e_[ 5 ] == cShift } ) > 0
|
||||
ELSE
|
||||
lYes := .f.
|
||||
FOR EACH e_ IN ::aDftSCuts
|
||||
IF e_:__enumIndex() != nRow
|
||||
IF e_[ 2 ] == cKey .AND. e_[ 3 ] == cAlt .AND. e_[ 4 ] == cCtrl .AND. e_[ 5 ] == cShift
|
||||
lYes := .t.
|
||||
EXIT
|
||||
ENDIF
|
||||
ENDIF
|
||||
NEXT
|
||||
ENDIF
|
||||
|
||||
RETURN lYes
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeShortcuts:buildUI()
|
||||
LOCAL oTbl, n, qItm
|
||||
LOCAL hdr_:= { { "Name", 190 }, { "Key", 50 }, { "Alt", 30 }, { "Ctrl", 30 }, { "Shift", 30 } }
|
||||
@@ -306,37 +433,17 @@ METHOD IdeShortcuts:populateData( nMode )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD IdeShortcuts:populateDftSCuts()
|
||||
LOCAL a_, q1,q2,q3,q4,q5, n
|
||||
LOCAL a_, nRow
|
||||
LOCAL oTbl := ::oUI:q_tableMacros
|
||||
|
||||
oTbl:setRowCount( len( ::aDftSCuts ) )
|
||||
|
||||
n := 0
|
||||
nRow := 0
|
||||
FOR EACH a_ IN ::aDftSCuts
|
||||
q1 := QTableWidgetItem():new()
|
||||
q1:setText( a_[ 1 ] )
|
||||
oTbl:setItem( n, 0, q1 )
|
||||
|
||||
q2 := QTableWidgetItem():new()
|
||||
q2:setText( a_[ 2 ] )
|
||||
oTbl:setItem( n, 1, q2 )
|
||||
|
||||
q3 := QTableWidgetItem():new()
|
||||
q3:setIcon( iif( a_[ 3 ] == "YES", hbide_image( "check" ), "" ) )
|
||||
oTbl:setItem( n, 2, q3 )
|
||||
|
||||
q4 := QTableWidgetItem():new()
|
||||
q4:setIcon( iif( a_[ 4 ] == "YES", hbide_image( "check" ), "" ) )
|
||||
oTbl:setItem( n, 3, q4 )
|
||||
|
||||
q5 := QTableWidgetItem():new()
|
||||
q5:setIcon( iif( a_[ 5 ] == "YES", hbide_image( "check" ), "" ) )
|
||||
oTbl:setItem( n, 4, q5 )
|
||||
|
||||
oTbl:setRowHeight( n, 16 )
|
||||
nRow++
|
||||
aadd( ::aDftSCutsItms, array( 5 ) )
|
||||
::array2table( nRow, a_ )
|
||||
QApplication():processEvents()
|
||||
aadd( ::aDftSCutsItms, { q1, q2, q3, q4, q5 } )
|
||||
n++
|
||||
NEXT
|
||||
|
||||
RETURN Self
|
||||
|
||||
@@ -239,10 +239,10 @@ METHOD IdeSourcesManager:editSource( cSourceFile, nPos, nHPos, nVPos, cTheme, cV
|
||||
IF !Empty( cSourceFile )
|
||||
IF !( hbide_isValidText( cSourceFile ) )
|
||||
MsgBox( 'File type unknown or unsupported: ' + cSourceFile )
|
||||
RETURN Self
|
||||
RETURN .f.
|
||||
ELSEIF !hb_FileExists( cSourceFile )
|
||||
MsgBox( 'File not found: ' + cSourceFile )
|
||||
RETURN Self
|
||||
RETURN .f.
|
||||
ENDIF
|
||||
IF ::oEM:isOpen( cSourceFile )
|
||||
IF lAlert
|
||||
@@ -252,7 +252,7 @@ METHOD IdeSourcesManager:editSource( cSourceFile, nPos, nHPos, nVPos, cTheme, cV
|
||||
ENDIF
|
||||
ENDIF
|
||||
::oEM:setSourceVisible( cSourceFile )
|
||||
RETURN Self
|
||||
RETURN .t.
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
@@ -269,7 +269,7 @@ METHOD IdeSourcesManager:editSource( cSourceFile, nPos, nHPos, nVPos, cTheme, cV
|
||||
hbide_mnuAddFileToMRU( Self, cSourceFile, INI_RECENTFILES )
|
||||
ENDIF
|
||||
|
||||
RETURN Self
|
||||
RETURN .t.
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@@ -244,8 +244,8 @@ METHOD HbpProcess:read( nMode, i, ii )
|
||||
|
||||
DO CASE
|
||||
CASE nMode == CHN_BGN
|
||||
::outputMe( "Starting in: " + CurDir() + " : " + ::qProcess:workingDirectory() )
|
||||
|
||||
::outputMe( "CurDir() => " + CurDir() + " Starting in => " + ::qProcess:workingDirectory() )
|
||||
|
||||
CASE nMode == CHN_OUT
|
||||
::qProcess:setReadChannel( 0 )
|
||||
cLine := space( nSize )
|
||||
|
||||
Reference in New Issue
Block a user