svn plugin: patch by Darius Blaszijk (issue #18257)

+ double clicking on listview in commit dialog opens the diff window
+ implemented commit message history
* improved sizing of save button in diff dialog 

git-svn-id: trunk@28838 -
This commit is contained in:
vincents 2010-12-30 10:38:26 +00:00
parent e975b38aab
commit 07207f0562
4 changed files with 92 additions and 25 deletions

View File

@ -12,8 +12,8 @@ object SVNDiffFrm: TSVNDiffFrm
LCLVersion = '0.9.29'
object ButtonPanel: TButtonPanel
Left = 6
Height = 34
Top = 426
Height = 37
Top = 423
Width = 605
OKButton.Name = 'OKButton'
OKButton.Caption = '&OK'
@ -30,13 +30,14 @@ object SVNDiffFrm: TSVNDiffFrm
ShowButtons = [pbOK]
object SaveButton: TBitBtn
Left = 6
Height = 22
Top = 6
Width = 101
Height = 29
Top = 8
Width = 109
Align = alLeft
AutoSize = True
BorderSpacing.Around = 6
Caption = 'SaveButton'
Constraints.MinHeight = 29
Glyph.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000683B1EFF834B
@ -81,7 +82,7 @@ object SVNDiffFrm: TSVNDiffFrm
object SVNDiffMemo: TMemo
Cursor = crHourGlass
Left = 6
Height = 414
Height = 411
Top = 6
Width = 605
Align = alClient

View File

@ -101,7 +101,7 @@ end;
procedure TSVNDiffFrm.FormCreate(Sender: TObject);
begin
SaveButton.Enabled := False;
SaveButton.Caption:=rsSave;
SaveButton.Caption := rsSave;
end;
procedure TSVNDiffFrm.SaveButtonClick(Sender: TObject);

View File

@ -6,14 +6,15 @@ object SVNStatusFrm: TSVNStatusFrm
Caption = 'SVNStatusFrm'
ClientHeight = 408
ClientWidth = 738
OnClose = FormClose
OnCreate = FormCreate
OnShow = FormShow
Position = poScreenCenter
LCLVersion = '0.9.29'
object ButtonPanel: TButtonPanel
Left = 6
Height = 34
Top = 368
Height = 37
Top = 365
Width = 726
OKButton.Name = 'OKButton'
OKButton.Caption = '&Commit'
@ -32,8 +33,8 @@ object SVNStatusFrm: TSVNStatusFrm
end
object SVNFileListView: TListView
Left = 6
Height = 274
Top = 88
Height = 178
Top = 181
Width = 726
Align = alClient
BorderSpacing.Left = 6
@ -43,41 +44,40 @@ object SVNStatusFrm: TSVNStatusFrm
Columns = <
item
AutoSize = True
Width = 6
Width = 10
end
item
AutoSize = True
Width = 12
Width = 10
end
item
AutoSize = True
Width = 12
Width = 10
end
item
AutoSize = True
Width = 12
Width = 10
end
item
AutoSize = True
Width = 12
Width = 10
end
item
AutoSize = True
Width = 12
Width = 10
end
item
AutoSize = True
Width = 12
Width = 10
end
item
AutoSize = True
Width = 12
Width = 10
end
item
AutoSize = True
Width = 12
Width = 628
end>
ItemIndex = -1
PopupMenu = PopupMenu1
RowSelect = True
SortColumn = 1
@ -85,11 +85,12 @@ object SVNStatusFrm: TSVNStatusFrm
TabOrder = 0
ViewStyle = vsReport
OnColumnClick = SVNFileListViewColumnClick
OnDblClick = mnuShowDiffClick
end
object SVNCommitMsgMemo: TMemo
Left = 6
Height = 77
Top = 6
Height = 135
Top = 41
Width = 726
Align = alTop
BorderSpacing.Left = 6
@ -102,11 +103,22 @@ object SVNStatusFrm: TSVNStatusFrm
Cursor = crVSplit
Left = 0
Height = 5
Top = 83
Top = 176
Width = 738
Align = alTop
ResizeAnchor = akTop
end
object SVNCommitMsgHistoryComboBox: TComboBox
Left = 6
Height = 29
Top = 6
Width = 726
Align = alTop
BorderSpacing.Around = 6
ItemHeight = 0
OnChange = SVNCommitMsgHistoryComboBoxChange
TabOrder = 4
end
object PopupMenu1: TPopupMenu
Images = ImageList
OnPopup = PopupMenu1Popup

View File

@ -25,13 +25,14 @@ interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Dialogs,
ComCtrls, StdCtrls, ButtonPanel, ExtCtrls, LCLProc, Process,
SVNClasses, Menus, LazIDEIntf;
SVNClasses, Menus, LazIDEIntf, BaseIDEIntf, LazConfigStorage;
type
{ TSVNStatusFrm }
TSVNStatusFrm = class(TForm)
ButtonPanel: TButtonPanel;
SVNCommitMsgHistoryComboBox: TComboBox;
ImageList: TImageList;
mnuOpen: TMenuItem;
mnuRemove: TMenuItem;
@ -42,6 +43,7 @@ type
Splitter: TSplitter;
SVNCommitMsgMemo: TMemo;
SVNFileListView: TListView;
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormShow(Sender: TObject);
@ -53,6 +55,7 @@ type
procedure OKButtonClick(Sender: TObject);
procedure PatchButtonClick(Sender: TObject);
procedure PopupMenu1Popup(Sender: TObject);
procedure SVNCommitMsgHistoryComboBoxChange(Sender: TObject);
procedure SVNFileListViewColumnClick(Sender: TObject; Column: TListColumn);
private
FRepositoryPath: string;
@ -177,6 +180,7 @@ begin
end;
procedure TSVNStatusFrm.mnuShowDiffClick(Sender: TObject);
begin
{$note implement opening file in source editor}
if Assigned(SVNFileListView.Selected) then
@ -273,6 +277,12 @@ begin
end;
end;
procedure TSVNStatusFrm.SVNCommitMsgHistoryComboBoxChange(Sender: TObject);
begin
with SVNCommitMsgHistoryComboBox do
SVNCommitMsgMemo.Text := Items[ItemIndex];
end;
procedure TSVNStatusFrm.SVNFileListViewColumnClick(Sender: TObject;
Column: TListColumn);
begin
@ -367,6 +377,11 @@ begin
end;
procedure TSVNStatusFrm.FormCreate(Sender: TObject);
var
Config: TConfigStorage;
count: integer;
i: integer;
s: string;
begin
mnuShowDiff.Caption := rsShowDiff;
mnuOpen.Caption := rsOpenFileInEditor;
@ -391,6 +406,45 @@ begin
ImageList.AddLazarusResource('menu_svn_diff');
ImageList.AddLazarusResource('menu_svn_revert');
try
Config := GetIDEConfigStorage('lazsvnpkg.xml', true);
count := Config.GetValue('HistoryCount', 0);
//limit to 100 entries
if count > 100 then count := 100;
for i := count downto 0 do
begin
s := Config.GetValue('Msg' + IntToStr(i), '');
if s <> '' then
SVNCommitMsgHistoryComboBox.Items.Add(s);
end;
finally
Config.Free;
end;
end;
procedure TSVNStatusFrm.FormClose(Sender: TObject; var CloseAction: TCloseAction);
var
Config: TConfigStorage;
count: integer;
i: integer;
s: string;
begin
if SVNCommitMsgMemo.Text <> '' then
begin
try
Config := GetIDEConfigStorage('lazsvnpkg.xml', true);
count := Config.GetValue('HistoryCount', 0);
Config.SetValue('HistoryCount', count + 1);
Config.SetValue('Msg' + IntToStr(count + 1), SVNCommitMsgMemo.Text);
finally
Config.Free;
end;
end;
end;
procedure TSVNStatusFrm.FormDestroy(Sender: TObject);