Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r33 - branches/SOPTIM/src/tsvnWizard.pas

delphiaddinfortortoisesvn
Discussion topic

Hide all messages in topic

All messages in topic

svn commit: r33 - branches/SOPTIM/src/tsvnWizard.pas

Author otto_noll
Full name Otto Noll
Date 2009-01-05 05:05:03 PST
Message Author: otto_noll
Date: 2009-01-05 05:05:02-0800
New Revision: 33

Modified:
   branches/SOPTIM/src/​tsvnWizard.pas

Log:
Added "Add" to context menu

Modified: branches/SOPTIM/src/​tsvnWizard.pas
Url: http://delphiaddinfo​rtortoisesvn.tigris.​org/source/browse/de​lphiaddinfortortoise​svn/branches/SOPTIM/​src/tsvnWizard.pas?v​iew=diff&pathrev​=33&r1=32&r2​=33
====================​====================​====================​==================
--- branches/SOPTIM/src/​tsvnWizard.pas (original)
+++ branches/SOPTIM/src/​tsvnWizard.pas 2009-01-05 05:05:02-0800
@@ -18,6 +18,7 @@
         SVN_REPOSITORY_BROWSER,
         SVN_SETTINGS,
         SVN_ABOUT,
+ SVN_ADD,
         SVN_DIFF
     );
 type TTortoiseSVN = class(TNotifierObject, IOTANotifier, IOTAWizard)
@@ -202,7 +203,7 @@
           MItem.Visible := True;
           PMenu.Items.Add(MItem);
           //Creating Submenu of the Popupmenu
- for J:= SVN_About to SVN_DIFF do begin
+ for J:= SVN_ABOUT to SVN_DIFF do begin
             bmp:= TBitmap.create;
             try
               bmp.LoadFromResourceName( HInstance, getBitmapName(J) );
@@ -236,10 +237,12 @@
     files:= TStringList.create;
     (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_About​))) as TMenuItem).Enabled := true;
     (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_DIFF)​)) as TMenuItem).Enabled := false;
+ (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_ADD))​) as TMenuItem).Enabled := false;
     GetCurrentModuleFile​List(files);
     if files.Count > 0 then
     begin
       (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_DIFF)​)) as TMenuItem).Enabled := true;
+ (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_ADD))​) as TMenuItem).Enabled := true;
     end;
 end;
 
@@ -278,6 +281,8 @@
             Result:= 'settings';
         SVN_ABOUT:
             Result:= 'about';
+ SVN_ADD:
+ Result:= 'add';
     end;
 end;
 
@@ -306,6 +311,8 @@
             Result:= '&Settings...';
         SVN_ABOUT:
             Result:= '&About...';
+ SVN_ADD:
+ Result:= 'Add...';
     end;
 end;
 
@@ -327,6 +334,8 @@
         SVN_ADD_SANDBOX:
             if GetCurrentProject <> nil then
                 Result:= vsEnabled;
+ SVN_ADD:
+ ;// this verb state is updated by TTortoiseSVN.CheckOn_Popup
         SVN_UPDATE_TO_SANDBOX:
             if GetCurrentProject <> nil then
                 Result:= vsEnabled;
@@ -334,8 +343,7 @@
             if GetCurrentProject <> nil then
                 Result:= vsEnabled;
         SVN_DIFF:
- // this verb state is updated by TTortoiseSVN.CheckOn_Popup
- ;
+ ;//this verb state is updated by TTortoiseSVN.CheckOn_Popup
         SVN_REVERT_SANDBOX:
             if GetCurrentProject <> nil then
                 Result:= vsEnabled;
@@ -370,6 +378,20 @@
         SVN_ADD_SANDBOX:
             if project <> nil then
                 TSVNExec( '/command:add /notempfile /path:' + AnsiQuotedStr( ExtractFilePath(proj​ect.GetFileName), '"' ) );
+ SVN_ADD:
+ if project <> nil then
+ begin
+ if MessageDlg( 'The file '+AnsiQuotedStr(Extr​actFileName(GetCurre​ntModuleFileList(TSt​ringList.create)[0])​,'"')+' will be saved before add. Continue?', mtConfirmation, [mbYes, mbNo], 0 ) = mrYes then
+ begin
+ if SaveForegroundEditorFile() then
+ begin
+ if GetCurrentModuleFile​List(TStringList.cre​ate).Count > 1 then
+ TSVNExec( '/command:add /notempfile /path:' + AnsiQuotedStr( ExtractFileName(GetC​urrentModuleFileList​(TStringList.create)​[0] ), '"' ) )
+ else if GetCurrentModuleFile​List(TStringList.cre​ate).Count = 1 then
+ TSVNExec( '/command:add /notempfile /path:' + AnsiQuotedStr(GetCur​rentModuleFileList(T​StringList.create)[0​], '"' ) );
+ end;
+ end;
+ end;
         SVN_UPDATE_TO_SANDBOX:
             if project <> nil then
                 if MessageDlg( 'All project files will be saved before update. Continue?', mtConfirmation, [mbYes, mbNo], 0 ) = mrYes then begin
Messages per page: