diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c4b48fb255..6dc6f2bce9 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,12 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-01-11 08:12 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * contrib/hbide/ideeditor.prg + * contrib/hbide/idesources.prg + * contrib/hbide/resources/projectproperties.ui + ! Re-worked "New" file management. + 2010-01-11 16:24 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + harbour/contrib/hbnetio/tests/netiot02.prg + added yet another example of NETIO client. diff --git a/harbour/contrib/hbide/ideeditor.prg b/harbour/contrib/hbide/ideeditor.prg index 7f9c96faed..cf81cea72c 100644 --- a/harbour/contrib/hbide/ideeditor.prg +++ b/harbour/contrib/hbide/ideeditor.prg @@ -646,6 +646,7 @@ CLASS IdeEditor INHERIT IdeObject DATA nVPos INIT 0 DATA nID + DATA aTab INIT {} DATA qCursor METHOD new() @@ -668,6 +669,13 @@ CLASS IdeEditor INHERIT IdeObject METHOD IdeEditor:new( oIde, cSourceFile, nPos, nHPos, nVPos, cTheme ) + DEFAULT oIde TO ::oIde + DEFAULT cSourceFile TO ::sourceFile + DEFAULT nPos TO ::nPos + DEFAULT nHPos TO ::nHPos + DEFAULT nVPos TO ::nVPos + DEFAULT cTheme TO ::cTheme + ::oIde := oIde ::sourceFile := cSourceFile ::nPos := nPos @@ -744,12 +752,12 @@ METHOD IdeEditor:create( oIde, cSourceFile, nPos, nHPos, nVPos, cTheme ) ::qCursor := QTextCursor():configure( ::qEdit:textCursor() ) /* Populate Tabs Array */ - aadd( ::aTabs, { ::oTab, ::qEdit, ::qHiliter, ::qLayout, ::sourceFile, ::qDocument, Self } ) + ::aTab := { ::oTab, ::qEdit, ::qHiliter, ::qLayout, ::sourceFile, ::qDocument, Self } + aadd( ::aTabs, ::aTab ) ::oIde:nCurTab := len( ::oIde:aTabs ) /* Populate right at creation */ - //::oIde:addSourceInTree( ::sourceFile ) ::oEM:addSourceInTree( ::sourceFile ) ::qTabWidget:setStyleSheet( GetStyleSheet( "QTabWidget" ) ) @@ -910,7 +918,7 @@ METHOD IdeEditor:closeTab( mp1, mp2, oXbp ) * Requested tab exists? IF !Empty( mp2 ) - ::oIde:closeSource( mp2 ) + ::oSM:closeSource( mp2 ) ENDIF RETURN Self diff --git a/harbour/contrib/hbide/idesources.prg b/harbour/contrib/hbide/idesources.prg index dc511aaf7b..bd7f39bd01 100644 --- a/harbour/contrib/hbide/idesources.prg +++ b/harbour/contrib/hbide/idesources.prg @@ -130,7 +130,7 @@ METHOD IdeSourcesManager:loadSources() */ METHOD IdeSourcesManager:saveSource( nTab, lCancel, lAs ) LOCAL oEdit, lNew, cBuffer, qDocument, nIndex, cSource - LOCAL cFileToSave, cFile, cExt, cNewFile + LOCAL cFileToSave, cFile, cExt, cNewFile, oItem DEFAULT nTab TO ::oIde:getCurrentTab() DEFAULT lAs TO .F. @@ -138,6 +138,7 @@ METHOD IdeSourcesManager:saveSource( nTab, lCancel, lAs ) lCancel := .F. IF !empty( oEdit := ::oEM:getEditorByTabPosition( nTab ) ) + nIndex := ::qTabWidget:indexOf( oEdit:oTab:oWidget ) cSource := oEdit:sourceFile lNew := Empty( cSource ) .OR. lAs @@ -157,40 +158,44 @@ METHOD IdeSourcesManager:saveSource( nTab, lCancel, lAs ) cFileToSave := iif( lNew, cNewFile, cSource ) qDocument := oEdit:qDocument - cBuffer := oEdit:qEdit:toPlainText() /* * 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() + // IF !hb_memowrit( cFileToSave, cBuffer ) MsgBox( "Error saving the file " + oEdit:sourceFile + ".",, 'Error saving file!' ) lCancel := .T. RETURN .F. ENDIF - IF lNew - hb_fNameSplit( cFileToSave, , @cFile, @cExt ) + hb_fNameSplit( cFileToSave, , @cFile, @cExt ) - ::aTabs[ nTab, TAB_SOURCEFILE ] := cFileToSave - oEdit:sourceFile := cFileToSave + IF lNew + oEdit:aTab[ TAB_SOURCEFILE ] := cFileToSave + oEdit:sourceFile := cFileToSave oEdit:oTab:Caption := cFile + cExt - ::qTabWidget:setTabText( nIndex, cFile + cExt ) - ::qTabWidget:setTabTooltip( nIndex, cSource ) - ENDIF - IF empty( cSource ) - /* The file is not populated in editors tree. Inject */ - ::addSourceInTree( oEdit:sourceFile ) - ELSEIF lNew - /* Rename the existing nodes in tree */ + ::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() - nIndex := ::qTabWidget:indexOf( oEdit:oTab:oWidget ) ::qTabWidget:setTabIcon( nIndex, ::resPath + "tabunmodified.png" ) ::oSBar:getItem( SB_PNL_MODIFIED ):caption := " " ENDIF diff --git a/harbour/contrib/hbide/resources/projectproperties.ui b/harbour/contrib/hbide/resources/projectproperties.ui index 0fa01a40eb..cd1b3bb8bb 100644 --- a/harbour/contrib/hbide/resources/projectproperties.ui +++ b/harbour/contrib/hbide/resources/projectproperties.ui @@ -26,7 +26,7 @@ - 1 + 0