diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 621fa05800..c70e212b76 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,23 @@ The license applies to all entries newer than 2009-04-28. */ +2011-06-17 12:18 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbide/setup.ui + * contrib/hbide/ideedit.prg + * contrib/hbide/ideeditor.prg + * contrib/hbide/idesaveload.prg + + Implemented: integration with Microsoft Visual SourceSafe for + version control. Current implementation only offers, Checkin, + Checkout, Undocheckout, Get Latest Version. Diff is not funtional + as it should be. + ; It is assumed that VSS is already installed on your system + and Project(s) and files are already setup for your sources. + The interface to carry-out these operations is right-click on + editing instance and choosing an action via "Source Control - VSS" + sub-menu. Your input will be highly valuable. + + ; Probably this will be my last commit before release 3.0.0. + 2011-06-17 20:27 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbgtinfo.ch * harbour/src/rtl/gtwvt/gtwvt.c diff --git a/harbour/contrib/hbide/ideedit.prg b/harbour/contrib/hbide/ideedit.prg index b3913b5a78..9fb2ec37a9 100644 --- a/harbour/contrib/hbide/ideedit.prg +++ b/harbour/contrib/hbide/ideedit.prg @@ -515,6 +515,21 @@ METHOD IdeEdit:execEvent( nMode, oEdit, p, p1 ) ::redo() ENDIF EXIT + CASE "Diff" + ::oEditor:vssExecute( "Diff" ) + EXIT + CASE "Get Latest Version" + ::oEditor:vssExecute( "Get" ) + EXIT + CASE "Checkin" + ::oEditor:vssExecute( "Checkin" ) + EXIT + CASE "Undo Checkout" + ::oEditor:vssExecute( "Undocheckout" ) + EXIT + CASE "Checkout" + ::oEditor:vssExecute( "Checkout" ) + EXIT ENDSWITCH EXIT diff --git a/harbour/contrib/hbide/ideeditor.prg b/harbour/contrib/hbide/ideeditor.prg index 503f30110e..1a9ab39808 100644 --- a/harbour/contrib/hbide/ideeditor.prg +++ b/harbour/contrib/hbide/ideeditor.prg @@ -81,6 +81,7 @@ CLASS IdeEditsManager INHERIT IdeObject DATA qContextMenu DATA qContextSub + DATA qSrcControlSub DATA aActions INIT {} DATA aProtos INIT {} @@ -251,6 +252,17 @@ METHOD IdeEditsManager:create( oIde ) aadd( ::aActions, { "Close Split" , ::qContextSub:addAction( "Close Split Window" ) } ) aadd( ::aActions, { "" , ::qContextSub:addSeparator() } ) aadd( ::aActions, { "Format" , ::qContextMenu:addAction( ::oFormatDock:oWidget:toggleViewAction() ) } ) + // + ::qSrcControlSub := ::qContextMenu:addMenu( "Source Control - VSS" ) + aadd( ::aActions, { "Get" , ::qSrcControlSub:addAction( "Get Latest Version" ) } ) + aadd( ::aActions, { "" , ::qSrcControlSub:addSeparator() } ) + aadd( ::aActions, { "Checkout" , ::qSrcControlSub:addAction( "Checkout" ) } ) + aadd( ::aActions, { "UndoCheckout" , ::qSrcControlSub:addAction( "Undo Checkout" ) } ) + aadd( ::aActions, { "" , ::qSrcControlSub:addSeparator() } ) + aadd( ::aActions, { "Checkin" , ::qSrcControlSub:addAction( "Checkin" ) } ) + aadd( ::aActions, { "" , ::qSrcControlSub:addSeparator() } ) + aadd( ::aActions, { "Diff" , ::qSrcControlSub:addAction( "Diff" ) } ) + /* Define code completer */ ::oIde:qProtoList := QStringList() @@ -1255,6 +1267,7 @@ CLASS IdeEditor INHERIT IdeObject METHOD prepareBufferToLoad( cBuffer ) METHOD prepareBufferToSave( cBuffer ) METHOD reload() + METHOD vssExecute( cAction ) ENDCLASS @@ -1534,6 +1547,42 @@ METHOD IdeEditor:prepareBufferToLoad( cBuffer ) /*----------------------------------------------------------------------*/ +METHOD IdeEditor:vssExecute( cAction ) + LOCAL cPath, cFile, cExt, cCmd, cC, oProcess, cBatch, cOutput := "" + LOCAL aCmd := {} + + IF ! empty( ::oINI:cVSSExe ) .AND. ! empty( ::oINI:cVSSDatabase ) + hb_fNameSplit( ::sourceFile, @cPath, @cFile, @cExt ) + + aadd( aCmd, "SET ssdir=" + hbide_pathToOSPath( ::oINI:cVSSDatabase ) ) + aadd( aCmd, "SET Force_dir=YES" ) + IF cAction == "Checkin" + aadd( aCmd, "call " + '"' + ::oINI:cVSSExe + '/ss.exe' + '" ' + cAction + " " + cFile + cExt + " -ChbIDE" ) + ELSEIF cAction == "Checkout" + aadd( aCmd, "call " + '"' + ::oINI:cVSSExe + '/ss.exe' + '" ' + cAction + " " + cFile + cExt + " -C-" ) + ELSE + aadd( aCmd, "call " + '"' + ::oINI:cVSSExe + '/ss.exe' + '" ' + cAction + " " + cFile + cExt ) + ENDIF + + cBatch := hbide_getShellCommandsTempFile( aCmd ) + + cCmd := hbide_getShellCommand() + cC := iif( hbide_getOS() == "nix", "", "/C " ) + + oProcess := HbpProcess():new() + // + oProcess:output := {|cOut| cOutput += cOut } + oProcess:finished := {|| iif( !empty( cOutput ), ::reload(), NIL ), MsgBox( cOutput ) } + oProcess:workingPath := hbide_pathToOSPath( cPath ) + + oProcess:addArg( cC + cBatch ) + oProcess:start( cCmd ) + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD IdeEditor:reload() LOCAL nAttr, nPos, qCursor, nHPos, nVPos diff --git a/harbour/contrib/hbide/idesaveload.prg b/harbour/contrib/hbide/idesaveload.prg index c84b8f3e0b..96f2428985 100644 --- a/harbour/contrib/hbide/idesaveload.prg +++ b/harbour/contrib/hbide/idesaveload.prg @@ -108,6 +108,9 @@ CLASS IdeINI INHERIT IdeObject DATA cPathSnippets INIT "" DATA cPathThemes INIT "" + DATA cVSSExe INIT "" + DATA cVSSDatabase INIT "" + DATA cCurrentProject INIT "" DATA cCurrentTheme INIT "" DATA cCurrentCodec INIT "" @@ -406,6 +409,8 @@ METHOD IdeINI:save( cHbideIni ) aadd( txt_, "ShowHideDocks" + "=" + iif( ::lShowHideDocks , "YES", "NO" ) ) aadd( txt_, "ChangeLog" + "=" + ::cChangeLog ) aadd( txt_, "UserChangeLog" + "=" + ::cUserChangeLog ) + aadd( txt_, "VSSExe" + "=" + ::cVSSExe ) + aadd( txt_, "VSSDatabase" + "=" + ::cVSSDatabase ) aadd( txt_, "" ) aadd( txt_, "[PROJECTS]" ) @@ -724,6 +729,10 @@ METHOD IdeINI:load( cHbideIni ) CASE "ShowHideDocks" ; ::lShowHideDocks := !( cVal == "NO" ) ; EXIT CASE "ChangeLog" ; ::cChangeLog := cVal ; EXIT CASE "UserChangeLog" ; ::cUserChangeLog := cVal ; EXIT + // + CASE "VSSExe" ; ::cVSSExe := cVal ; EXIT + CASE "VSSDatabase" ; ::cVSSDatabase := cVal ; EXIT + ENDSWITCH ENDIF @@ -1049,7 +1058,7 @@ CLASS IdeSetup INHERIT IdeObject DATA oINI DATA qOrgPalette DATA aItems INIT {} - DATA aTree INIT { "General", "Selections", "Font", "Paths", "Variables", "Dictionaries", "Themes", "Formatting" } + DATA aTree INIT { "General", "Selections", "Font", "Paths", "Variables", "Dictionaries", "Themes", "Formatting", "VSS" } DATA aStyles INIT { "cleanlooks", "windows", "windowsxp", ; "windowsvista", "cde", "motif", "plastique", "macintosh" } DATA aKeyItems INIT {} @@ -1161,6 +1170,10 @@ METHOD IdeSetup:setIcons() /* Dictionaries */ ::oUI:q_buttonDictPath : setIcon( hbide_image( "open" ) ) + /* VSS */ + ::oUI:q_buttonVSSExe : setIcon( hbide_image( "open" ) ) + ::oUI:q_buttonVSSDatabase : setIcon( hbide_image( "open" ) ) + RETURN Self /*----------------------------------------------------------------------*/ @@ -1232,6 +1245,9 @@ METHOD IdeSetup:disConnectSlots() ::oUI:q_comboRightTabPos :disconnect( "currentIndexChanged(int)" ) ::oUI:q_comboBottomTabPos :disconnect( "currentIndexChanged(int)" ) + ::oUI:q_buttonVSSExe :disconnect( "clicked()" ) + ::oUI:q_buttonVSSDatabase :disconnect( "clicked()" ) + RETURN Self /*----------------------------------------------------------------------*/ @@ -1302,6 +1318,9 @@ METHOD IdeSetup:connectSlots() ::oUI:q_comboRightTabPos :connect( "currentIndexChanged(int)", {|i| ::execEvent( "comboRightTabPos_currentIndexChanged" , i ) } ) ::oUI:q_comboBottomTabPos :connect( "currentIndexChanged(int)", {|i| ::execEvent( "comboBottomTabPos_currentIndexChanged", i ) } ) + ::oUI:q_buttonVSSExe :connect( "clicked()" , {| | ::execEvent( "buttonVSSExe_clicked" ) } ) + ::oUI:q_buttonVSSDatabase :connect( "clicked()" , {| | ::execEvent( "buttonVSSDatabase_clicked" ) } ) + RETURN Self /*----------------------------------------------------------------------*/ @@ -1452,6 +1471,9 @@ METHOD IdeSetup:populate() ::oUI:q_comboRightTabPos:setCurrentIndex( ::oINI:nDocksRightTabPos ) ::oUI:q_comboBottomTabPos:setCurrentIndex( ::oINI:nDocksBottomTabPos ) + ::oUI:q_editVSSExe:setText( ::oINI:cVSSExe ) + ::oUI:q_editVSSDatabase:setText( ::oINI:cVSSDatabase ) + ::connectSlots() ::pushThemesData() @@ -1764,6 +1786,18 @@ METHOD IdeSetup:execEvent( cEvent, p, p1 ) CASE "buttonIni_clicked" EXIT + CASE "buttonVSSExe_clicked" + IF ! empty( cPath := hbide_fetchADir( ::oDlg, "Visual SourceSafe Installation Path", ::oINI:cVSSExe ) ) + ::oINI:cVSSExe := cPath + ::oUI:q_editVSSExe:setText( hbide_pathStripLastSlash( cPath ) ) + ENDIF + EXIT + CASE "buttonVSSDatabase_clicked" + IF ! empty( cPath := hbide_fetchADir( ::oDlg, "Visual SourceSafe Database Path", ::oINI:cVSSDatabase ) ) + ::oINI:cVSSDatabase := cPath + ::oUI:q_editVSSDatabase:setText( hbide_pathStripLastSlash( cPath ) ) + ENDIF + EXIT CASE "buttonHrbRoot_clicked" IF ! empty( cPath := hbide_fetchADir( ::oDlg, "Harbour's Root Path", ::oINI:cPathHrbRoot ) ) ::oINI:cPathHrbRoot := cPath diff --git a/harbour/contrib/hbide/setup.ui b/harbour/contrib/hbide/setup.ui index 76a91de337..86abb328a6 100644 --- a/harbour/contrib/hbide/setup.ui +++ b/harbour/contrib/hbide/setup.ui @@ -41,7 +41,7 @@ - 1 + 8 @@ -3105,6 +3105,99 @@ + + + + + 0 + 0 + 349 + 365 + + + + + + + + + 12 + 12 + 61 + 16 + + + + Executable: + + + + + + 76 + 12 + 225 + 20 + + + + Path to VSS executable - ss.exe + + + + + + 312 + 12 + 25 + 20 + + + + ... + + + + + + 12 + 52 + 61 + 16 + + + + Database: + + + + + + 76 + 48 + 225 + 20 + + + + Path to VSS database where <srcsave.ini> resides + + + + + + 312 + 48 + 25 + 20 + + + + ... + + + +