From 031c55a8017fbd5e1e5c44ee9547379da640fa32 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Tue, 29 Jun 2010 18:27:55 +0000 Subject: [PATCH] 2010-06-29 11:21 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbide/ideactions.prg - Removed: "Insert Randome Name" option in . Actually inserting any text can be accomplished through macros. * contrib/hbide/idesources.prg % Fixed: "Save all sources" option of menu. A fatal one. Thanks to Reinaldo for reporting. --- harbour/ChangeLog | 9 +++ harbour/contrib/hbide/ideactions.prg | 2 +- harbour/contrib/hbide/idesources.prg | 115 ++++++++++++++------------- 3 files changed, 69 insertions(+), 57 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 4f2be2e157..106e8660f3 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,15 @@ The license applies to all entries newer than 2009-04-28. */ +2010-06-29 11:21 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbide/ideactions.prg + - Removed: "Insert Randome Name" option in . + Actually inserting any text can be accomplished through macros. + + * contrib/hbide/idesources.prg + % Fixed: "Save all sources" option of menu. A fatal one. + Thanks to Reinaldo for reporting. + 2010-06-29 09:31 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbide/hbide.qrc + Added: "runscript" icon. diff --git a/harbour/contrib/hbide/ideactions.prg b/harbour/contrib/hbide/ideactions.prg index d46475c16d..190c04fb8b 100644 --- a/harbour/contrib/hbide/ideactions.prg +++ b/harbour/contrib/hbide/ideactions.prg @@ -501,7 +501,7 @@ METHOD IdeActions:buildMainMenu() oSubMenu2:addItem( { ::getAction( "InsertSeparator" ), {|| oIde:execAction( "InsertSeparator" ) } } ) hbide_menuAddSep( oSubMenu ) oSubMenu2:addItem( { ::getAction( "InsertDateTime" ), {|| oIde:execAction( "InsertDateTime" ) } } ) - oSubMenu2:addItem( { ::getAction( "InsertRandomName" ), {|| oIde:execAction( "InsertRandomName" ) } } ) +// oSubMenu2:addItem( { ::getAction( "InsertRandomName" ), {|| oIde:execAction( "InsertRandomName" ) } } ) oSubMenu2:addItem( { ::getAction( "InsertExternalFile" ), {|| oIde:execAction( "InsertExternalFile" ) } } ) oMenuBar:addItem( { oSubMenu2, _T( "~Insert" ) } ) diff --git a/harbour/contrib/hbide/idesources.prg b/harbour/contrib/hbide/idesources.prg index 5de278430a..670ceebf5a 100644 --- a/harbour/contrib/hbide/idesources.prg +++ b/harbour/contrib/hbide/idesources.prg @@ -166,66 +166,69 @@ METHOD IdeSourcesManager:saveSource( nTab, lCancel, lAs ) nIndex := ::qTabWidget:indexOf( oEdit:oTab:oWidget ) cSource := oEdit:sourceFile - lNew := Empty( cSource ) .OR. lAs - IF lNew - cNewFile := ::selectSource( 'save', ; - iif( !Empty( cSource ), cSource, hb_dirBase() + "projects\" ),; - "Save " + oEdit:oTab:caption + " as..." ) - IF empty( cNewFile ) - // will check later what decision to take - RETURN .f. - ENDIF - IF hbide_pathNormalized( cNewFile ) == hbide_pathNormalized( cSource ) - lNew := .f. - ENDIF - ENDIF + IF !Empty( oEdit:sourceFile ) .AND. oEdit:lLoaded .AND. oEdit:qDocument:isModified() - cFileToSave := iif( lNew, cNewFile, cSource ) - qDocument := oEdit:qDocument - - /* - * If the burn process fails, we should change the name of the previous file. - * 01/01/2010 - 21:24:41 - vailtom - */ - //cBuffer := oEdit:qEdit:toPlainText() - cBuffer := oEdit:prepareBufferToSave( oEdit:qEdit:toPlainText() ) - // - IF !hb_memowrit( cFileToSave, cBuffer ) - MsgBox( "Error saving the file " + oEdit:sourceFile + ".",, 'Error saving file!' ) - lCancel := .T. - RETURN .F. - ENDIF - - hb_fNameSplit( cFileToSave, , @cFile, @cExt ) - - IF lNew - oEdit:sourceFile := cFileToSave - - oEdit:oTab:Caption := cFile + cExt - - ::qTabWidget:setTabText( nIndex, cFile + cExt ) - ::qTabWidget:setTabTooltip( nIndex, cFileToSave ) - - IF empty( cSource ) - /* The file is not populated in editors tree. Inject */ - ::oEM:addSourceInTree( oEdit:sourceFile ) - ELSEIF lAs - /* Rename the existing nodes in tree */ - IF !empty( oItem := hbide_findProjTreeItem( ::oIde, oEdit:sourceFile, "Opened Source" ) ) - oItem:oWidget:caption := cFile + cExt + lNew := Empty( cSource ) .OR. lAs + IF lNew + cNewFile := ::selectSource( 'save', ; + iif( !Empty( cSource ), cSource, hb_dirBase() + "projects\" ),; + "Save " + oEdit:oTab:caption + " as..." ) + IF empty( cNewFile ) + // will check later what decision to take + RETURN .f. + ENDIF + IF hbide_pathNormalized( cNewFile ) == hbide_pathNormalized( cSource ) + lNew := .f. ENDIF ENDIF + + cFileToSave := iif( lNew, cNewFile, cSource ) + qDocument := oEdit:qDocument + + /* + * If the burn process fails, we should change the name of the previous file. + * 01/01/2010 - 21:24:41 - vailtom + */ + //cBuffer := oEdit:qEdit:toPlainText() + cBuffer := oEdit:prepareBufferToSave( oEdit:qEdit:toPlainText() ) + // + IF !hb_memowrit( cFileToSave, cBuffer ) + MsgBox( "Error saving the file " + oEdit:sourceFile + ".",, 'Error saving file!' ) + lCancel := .T. + RETURN .F. + ENDIF + + hb_fNameSplit( cFileToSave, , @cFile, @cExt ) + + IF lNew + oEdit:sourceFile := cFileToSave + + oEdit:oTab:Caption := cFile + cExt + + ::qTabWidget:setTabText( nIndex, cFile + cExt ) + ::qTabWidget:setTabTooltip( nIndex, cFileToSave ) + + IF empty( cSource ) + /* The file is not populated in editors tree. Inject */ + ::oEM:addSourceInTree( oEdit:sourceFile ) + ELSEIF lAs + /* Rename the existing nodes in tree */ + IF !empty( oItem := hbide_findProjTreeItem( ::oIde, oEdit:sourceFile, "Opened Source" ) ) + oItem:oWidget:caption := cFile + cExt + ENDIF + ENDIF + ENDIF + + qDocument:setModified( .f. ) + ::oIde:aSources := { oEdit:sourceFile } + ::createTags() + ::updateFuncList() + ::qTabWidget:setTabIcon( nIndex, ::resPath + "tabunmodified.png" ) + ::oDK:setStatusText( SB_PNL_MODIFIED, " " ) + + cFileTemp := hbide_pathToOSPath( oEdit:cPath + oEdit:cFile + oEdit:cExt + ".tmp" ) + ferase( cFileTemp ) ENDIF - - qDocument:setModified( .f. ) - ::oIde:aSources := { oEdit:sourceFile } - ::createTags() - ::updateFuncList() - ::qTabWidget:setTabIcon( nIndex, ::resPath + "tabunmodified.png" ) - ::oDK:setStatusText( SB_PNL_MODIFIED, " " ) - - cFileTemp := hbide_pathToOSPath( oEdit:cPath + oEdit:cFile + oEdit:cExt + ".tmp" ) - ferase( cFileTemp ) ENDIF RETURN .T.