diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d1b8e053bf..934b0bb65a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,15 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-01-10 16:54 UTC-0300 Vailton Renato (vailtom gmail.com) + * contrib/hbide/ideactions.prg + + Added new action "CloseOther" referenced in the menu, but missing in + IdeActions:loadActions() + + * contrib/hbide/idesources.prg + ! Rewritten the method closeAllOthers() because the old code did not work + properly. Please test and report. + 2010-01-10 07:34 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbide/idedocks.prg * contrib/hbide/ideobject.prg diff --git a/harbour/contrib/hbide/ideactions.prg b/harbour/contrib/hbide/ideactions.prg index 7443a6ac14..6775d120be 100644 --- a/harbour/contrib/hbide/ideactions.prg +++ b/harbour/contrib/hbide/ideactions.prg @@ -247,6 +247,7 @@ METHOD IdeActions:loadActions() aadd( aAct, { "SaveAs" , "Save ~As" , "saveas" , "" , "No", "Yes" } ) aadd( aAct, { "SaveAll" , "Save A~ll" , "saveall" , "Sh+^s", "No", "Yes" } ) aadd( aAct, { "CloseAll" , "Clos~e All" , "closeall" , "" , "No", "Yes" } ) + aadd( aAct, { "CloseOther" , "Close Ot~hers" , "closeexcept" , "" , "No", "Yes" } ) aadd( aAct, { "Revert" , "~Revert to Saved" , "" , "Sh+^R", "No", "Yes" } ) aadd( aAct, { "ExportHTML" , "~Export to HTML" , "exporthtml" , "" , "No", "Yes" } ) aadd( aAct, { "InsertDateTime" , "~Date && Time" , "insert-datetime", "Sh+F7", "No", "Yes" } ) diff --git a/harbour/contrib/hbide/idesources.prg b/harbour/contrib/hbide/idesources.prg index a467aaeacd..f5fc21b81f 100644 --- a/harbour/contrib/hbide/idesources.prg +++ b/harbour/contrib/hbide/idesources.prg @@ -305,19 +305,40 @@ METHOD IdeSourcesManager:closeAllSources() /*----------------------------------------------------------------------*/ /* * Close all opened files except current. - * 02/01/2010 - 15:47:19 + * 02/01/2010 - 15:47:19 - vailtom */ METHOD IdeSourcesManager:closeAllOthers( nTab ) - LOCAL lCanceled, a_ + LOCAL lCanceled + LOCAL oEdit + LOCAL nID - FOR EACH a_ IN ::aTabs - IF a_:__enumIndex() != nTab - ::closeSource( a_:__enumIndex(), .T., @lCanceled ) - IF lCanceled - RETURN .f. - ENDIF - ENDIF - NEXT + DEFAULT nTab TO ::oIde:getCurrentTab() + + IF empty( oEdit := ::oEM:getEditorByTabPosition( nTab ) ) + RETURN .F. + ENDIF + + nID := oEdit:nID + nTab:= 0 + + * Finally now we will close all tabs. + DO WHILE ( ++nTab <= Len( ::aTabs ) ) + + oEdit := ::oEM:getEditorByTabPosition( nTab ) + + IF empty(oEdit) .OR. oEdit:nID == nID + LOOP + ENDIF + + IF ::closeSource( nTab, .T., @lCanceled ) + nTab -- + LOOP + ENDIF + + IF lCanceled + RETURN .F. + ENDIF + ENDDO RETURN .T.