mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-05 09:18:42 +02:00
Diff tool: remove Save button, change "Diff" to "Compare files", try to prevent people creating invalid patches with it.
git-svn-id: trunk@46027 -
This commit is contained in:
parent
4a1e95898b
commit
30cd69fe8f
@ -5,16 +5,16 @@ object DiffDlg: TDiffDlg
|
||||
Width = 598
|
||||
HelpType = htKeyword
|
||||
BorderIcons = [biSystemMenu]
|
||||
Caption = 'Diff dialog'
|
||||
Caption = 'Compare files'
|
||||
ClientHeight = 522
|
||||
ClientWidth = 598
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '0.9.31'
|
||||
LCLVersion = '1.3'
|
||||
object Text1GroupBox: TGroupBox
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = Owner
|
||||
Left = 6
|
||||
Height = 53
|
||||
Height = 57
|
||||
Top = 6
|
||||
Width = 586
|
||||
Align = alTop
|
||||
@ -22,7 +22,7 @@ object DiffDlg: TDiffDlg
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Text1GroupBox'
|
||||
ClientHeight = 36
|
||||
ClientHeight = 38
|
||||
ClientWidth = 582
|
||||
TabOrder = 0
|
||||
object Text1Combobox: TComboBox
|
||||
@ -30,9 +30,9 @@ object DiffDlg: TDiffDlg
|
||||
AnchorSideTop.Control = Text1GroupBox
|
||||
AnchorSideRight.Control = Text1FileOpenButton
|
||||
Left = 6
|
||||
Height = 23
|
||||
Height = 25
|
||||
Top = 6
|
||||
Width = 316
|
||||
Width = 320
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
@ -47,10 +47,10 @@ object DiffDlg: TDiffDlg
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = Text1GroupBox
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 372
|
||||
Height = 26
|
||||
Top = 4
|
||||
Width = 204
|
||||
Left = 376
|
||||
Height = 21
|
||||
Top = 8
|
||||
Width = 200
|
||||
Anchors = [akTop, akRight]
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Right = 6
|
||||
@ -64,8 +64,8 @@ object DiffDlg: TDiffDlg
|
||||
AnchorSideRight.Control = Text1OnlySelectionCheckBox
|
||||
AnchorSideBottom.Control = Text1Combobox
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 328
|
||||
Height = 23
|
||||
Left = 332
|
||||
Height = 25
|
||||
Top = 6
|
||||
Width = 32
|
||||
Anchors = [akTop, akRight, akBottom]
|
||||
@ -78,14 +78,14 @@ object DiffDlg: TDiffDlg
|
||||
object Text2GroupBox: TGroupBox
|
||||
AnchorSideTop.Control = Text1GroupBox
|
||||
Left = 6
|
||||
Height = 53
|
||||
Top = 65
|
||||
Height = 57
|
||||
Top = 69
|
||||
Width = 586
|
||||
Align = alTop
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Text2GroupBox'
|
||||
ClientHeight = 36
|
||||
ClientHeight = 38
|
||||
ClientWidth = 582
|
||||
TabOrder = 1
|
||||
object Text2Combobox: TComboBox
|
||||
@ -93,9 +93,9 @@ object DiffDlg: TDiffDlg
|
||||
AnchorSideTop.Control = Text2GroupBox
|
||||
AnchorSideRight.Control = Text2FileOpenButton
|
||||
Left = 6
|
||||
Height = 23
|
||||
Height = 25
|
||||
Top = 6
|
||||
Width = 316
|
||||
Width = 320
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
@ -110,10 +110,10 @@ object DiffDlg: TDiffDlg
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = Text2GroupBox
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 372
|
||||
Height = 26
|
||||
Top = 4
|
||||
Width = 204
|
||||
Left = 376
|
||||
Height = 21
|
||||
Top = 8
|
||||
Width = 200
|
||||
Anchors = [akTop, akRight]
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Right = 6
|
||||
@ -127,8 +127,8 @@ object DiffDlg: TDiffDlg
|
||||
AnchorSideRight.Control = Text2OnlySelectionCheckBox
|
||||
AnchorSideBottom.Control = Text2Combobox
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 328
|
||||
Height = 23
|
||||
Left = 332
|
||||
Height = 25
|
||||
Top = 6
|
||||
Width = 32
|
||||
Anchors = [akTop, akRight, akBottom]
|
||||
@ -147,7 +147,7 @@ object DiffDlg: TDiffDlg
|
||||
AnchorSideBottom.Control = ProgressBar1
|
||||
Left = 6
|
||||
Height = 109
|
||||
Top = 345
|
||||
Top = 344
|
||||
Width = 586
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
AutoFill = True
|
||||
@ -170,8 +170,8 @@ object DiffDlg: TDiffDlg
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideBottom.Control = OptionsGroupBox
|
||||
Left = 6
|
||||
Height = 215
|
||||
Top = 124
|
||||
Height = 206
|
||||
Top = 132
|
||||
Width = 586
|
||||
Align = alTop
|
||||
BorderSpacing.Around = 6
|
||||
@ -189,50 +189,24 @@ object DiffDlg: TDiffDlg
|
||||
Gutter.Width = 55
|
||||
Gutter.MouseActions = <
|
||||
item
|
||||
Shift = []
|
||||
ShiftMask = []
|
||||
Button = mbLeft
|
||||
ClickCount = ccAny
|
||||
ClickDir = cdDown
|
||||
Command = 13
|
||||
MoveCaret = False
|
||||
Option = 0
|
||||
Priority = 0
|
||||
Command = emcOnMainGutterClick
|
||||
end
|
||||
item
|
||||
Shift = []
|
||||
ShiftMask = []
|
||||
Button = mbRight
|
||||
ClickCount = ccSingle
|
||||
ClickDir = cdUp
|
||||
Command = 12
|
||||
MoveCaret = False
|
||||
Option = 0
|
||||
Priority = 0
|
||||
Command = emcContextMenu
|
||||
end>
|
||||
RightGutter.Width = 0
|
||||
RightGutter.MouseActions = <
|
||||
item
|
||||
Shift = []
|
||||
ShiftMask = []
|
||||
Button = mbLeft
|
||||
ClickCount = ccAny
|
||||
ClickDir = cdDown
|
||||
Command = 13
|
||||
MoveCaret = False
|
||||
Option = 0
|
||||
Priority = 0
|
||||
Command = emcOnMainGutterClick
|
||||
end
|
||||
item
|
||||
Shift = []
|
||||
ShiftMask = []
|
||||
Button = mbRight
|
||||
ClickCount = ccSingle
|
||||
ClickDir = cdUp
|
||||
Command = 12
|
||||
MoveCaret = False
|
||||
Option = 0
|
||||
Priority = 0
|
||||
Command = emcContextMenu
|
||||
end>
|
||||
Highlighter = SynDiffSyn1
|
||||
Keystrokes = <
|
||||
@ -558,141 +532,113 @@ object DiffDlg: TDiffDlg
|
||||
end>
|
||||
MouseActions = <
|
||||
item
|
||||
Shift = []
|
||||
ShiftMask = [ssShift, ssAlt]
|
||||
Button = mbLeft
|
||||
ClickCount = ccSingle
|
||||
ClickDir = cdDown
|
||||
Command = 1
|
||||
Command = emcStartSelections
|
||||
MoveCaret = True
|
||||
Option = 0
|
||||
Priority = 0
|
||||
end
|
||||
item
|
||||
Shift = [ssShift]
|
||||
ShiftMask = [ssShift, ssAlt]
|
||||
Button = mbLeft
|
||||
ClickCount = ccSingle
|
||||
ClickDir = cdDown
|
||||
Command = 1
|
||||
Command = emcStartSelections
|
||||
MoveCaret = True
|
||||
Option = 1
|
||||
Priority = 0
|
||||
end
|
||||
item
|
||||
Shift = [ssAlt]
|
||||
ShiftMask = [ssShift, ssAlt]
|
||||
Button = mbLeft
|
||||
ClickCount = ccSingle
|
||||
ClickDir = cdDown
|
||||
Command = 3
|
||||
Command = emcStartColumnSelections
|
||||
MoveCaret = True
|
||||
Option = 0
|
||||
Priority = 0
|
||||
end
|
||||
item
|
||||
Shift = [ssShift, ssAlt]
|
||||
ShiftMask = [ssShift, ssAlt]
|
||||
Button = mbLeft
|
||||
ClickCount = ccSingle
|
||||
ClickDir = cdDown
|
||||
Command = 3
|
||||
Command = emcStartColumnSelections
|
||||
MoveCaret = True
|
||||
Option = 1
|
||||
Priority = 0
|
||||
end
|
||||
item
|
||||
Shift = []
|
||||
ShiftMask = []
|
||||
Button = mbRight
|
||||
ClickCount = ccSingle
|
||||
ClickDir = cdUp
|
||||
Command = 12
|
||||
MoveCaret = False
|
||||
Option = 0
|
||||
Priority = 0
|
||||
Command = emcContextMenu
|
||||
end
|
||||
item
|
||||
Shift = []
|
||||
ShiftMask = []
|
||||
Button = mbLeft
|
||||
ClickCount = ccDouble
|
||||
ClickDir = cdDown
|
||||
Command = 6
|
||||
Command = emcSelectWord
|
||||
MoveCaret = True
|
||||
Option = 0
|
||||
Priority = 0
|
||||
end
|
||||
item
|
||||
Shift = []
|
||||
ShiftMask = []
|
||||
Button = mbLeft
|
||||
ClickCount = ccTriple
|
||||
ClickDir = cdDown
|
||||
Command = 7
|
||||
Command = emcSelectLine
|
||||
MoveCaret = True
|
||||
Option = 0
|
||||
Priority = 0
|
||||
end
|
||||
item
|
||||
Shift = []
|
||||
ShiftMask = []
|
||||
Button = mbLeft
|
||||
ClickCount = ccQuad
|
||||
ClickDir = cdDown
|
||||
Command = 8
|
||||
Command = emcSelectPara
|
||||
MoveCaret = True
|
||||
Option = 0
|
||||
Priority = 0
|
||||
end
|
||||
item
|
||||
Shift = []
|
||||
ShiftMask = []
|
||||
Button = mbMiddle
|
||||
ClickCount = ccSingle
|
||||
ClickDir = cdDown
|
||||
Command = 10
|
||||
Command = emcPasteSelection
|
||||
MoveCaret = True
|
||||
Option = 0
|
||||
Priority = 0
|
||||
end
|
||||
item
|
||||
Shift = [ssCtrl]
|
||||
ShiftMask = [ssShift, ssAlt, ssCtrl]
|
||||
Button = mbLeft
|
||||
ClickCount = ccSingle
|
||||
ClickDir = cdUp
|
||||
Command = 11
|
||||
MoveCaret = False
|
||||
Option = 0
|
||||
Priority = 0
|
||||
Command = emcMouseLink
|
||||
end>
|
||||
MouseTextActions = <>
|
||||
MouseSelActions = <
|
||||
item
|
||||
Shift = []
|
||||
ShiftMask = []
|
||||
Button = mbLeft
|
||||
ClickCount = ccSingle
|
||||
ClickDir = cdDown
|
||||
Command = 9
|
||||
MoveCaret = False
|
||||
Option = 0
|
||||
Priority = 0
|
||||
Command = emcStartDragMove
|
||||
end>
|
||||
Lines.Strings = (
|
||||
'DiffSynEdit'
|
||||
)
|
||||
VisibleSpecialChars = [vscSpace, vscTabAtLast]
|
||||
SelectedColor.FrameEdges = sfeAround
|
||||
SelectedColor.BackPriority = 50
|
||||
SelectedColor.ForePriority = 50
|
||||
SelectedColor.FramePriority = 50
|
||||
SelectedColor.BoldPriority = 50
|
||||
SelectedColor.ItalicPriority = 50
|
||||
SelectedColor.UnderlinePriority = 50
|
||||
SelectedColor.StrikeOutPriority = 50
|
||||
IncrementColor.FrameEdges = sfeAround
|
||||
HighlightAllColor.FrameEdges = sfeAround
|
||||
BracketHighlightStyle = sbhsBoth
|
||||
BracketMatchColor.Background = clNone
|
||||
BracketMatchColor.Foreground = clNone
|
||||
BracketMatchColor.FrameEdges = sfeAround
|
||||
BracketMatchColor.Style = [fsBold]
|
||||
FoldedCodeColor.Background = clNone
|
||||
FoldedCodeColor.Foreground = clGray
|
||||
FoldedCodeColor.FrameColor = clGray
|
||||
FoldedCodeColor.FrameEdges = sfeAround
|
||||
MouseLinkColor.Background = clNone
|
||||
MouseLinkColor.Foreground = clBlue
|
||||
MouseLinkColor.FrameEdges = sfeAround
|
||||
LineHighlightColor.Background = clNone
|
||||
LineHighlightColor.Foreground = clNone
|
||||
LineHighlightColor.FrameEdges = sfeAround
|
||||
inline TSynGutterPartList
|
||||
object TSynGutterMarks
|
||||
Width = 24
|
||||
MouseActions = <>
|
||||
end
|
||||
object TSynGutterLineNumber
|
||||
Width = 15
|
||||
MouseActions = <>
|
||||
MarkupInfo.Background = clBtnFace
|
||||
MarkupInfo.Foreground = clNone
|
||||
MarkupInfo.FrameEdges = sfeAround
|
||||
DigitCount = 2
|
||||
ShowOnlyLineNumbersMultiplesOf = 1
|
||||
ZeroStart = False
|
||||
@ -700,35 +646,29 @@ object DiffDlg: TDiffDlg
|
||||
end
|
||||
object TSynGutterChanges
|
||||
Width = 4
|
||||
MouseActions = <>
|
||||
ModifiedColor = 59900
|
||||
SavedColor = clGreen
|
||||
end
|
||||
object TSynGutterSeparator
|
||||
Width = 2
|
||||
MouseActions = <>
|
||||
MarkupInfo.Background = clWhite
|
||||
MarkupInfo.Foreground = clGray
|
||||
MarkupInfo.FrameEdges = sfeAround
|
||||
end
|
||||
object TSynGutterCodeFolding
|
||||
MouseActions = <
|
||||
item
|
||||
Shift = []
|
||||
ShiftMask = []
|
||||
Button = mbRight
|
||||
ClickCount = ccSingle
|
||||
ClickDir = cdUp
|
||||
Command = 16
|
||||
MoveCaret = False
|
||||
Option = 0
|
||||
Priority = 0
|
||||
Command = emcCodeFoldContextMenu
|
||||
end
|
||||
item
|
||||
Shift = []
|
||||
ShiftMask = [ssShift]
|
||||
Button = mbMiddle
|
||||
ClickCount = ccAny
|
||||
ClickDir = cdDown
|
||||
Command = 14
|
||||
MoveCaret = False
|
||||
Option = 0
|
||||
Priority = 0
|
||||
Command = emcCodeFoldCollaps
|
||||
end
|
||||
item
|
||||
Shift = [ssShift]
|
||||
@ -736,103 +676,65 @@ object DiffDlg: TDiffDlg
|
||||
Button = mbMiddle
|
||||
ClickCount = ccAny
|
||||
ClickDir = cdDown
|
||||
Command = 14
|
||||
MoveCaret = False
|
||||
Command = emcCodeFoldCollaps
|
||||
Option = 1
|
||||
Priority = 0
|
||||
end
|
||||
item
|
||||
Shift = []
|
||||
ShiftMask = []
|
||||
Button = mbLeft
|
||||
ClickCount = ccAny
|
||||
ClickDir = cdDown
|
||||
Command = 0
|
||||
MoveCaret = False
|
||||
Option = 0
|
||||
Priority = 0
|
||||
Command = emcNone
|
||||
end>
|
||||
MarkupInfo.Background = clNone
|
||||
MarkupInfo.Foreground = clGray
|
||||
MarkupInfo.FrameEdges = sfeAround
|
||||
MouseActionsExpanded = <
|
||||
item
|
||||
Shift = []
|
||||
ShiftMask = []
|
||||
Button = mbLeft
|
||||
ClickCount = ccAny
|
||||
ClickDir = cdDown
|
||||
Command = 14
|
||||
MoveCaret = False
|
||||
Option = 0
|
||||
Priority = 0
|
||||
Command = emcCodeFoldCollaps
|
||||
end>
|
||||
MouseActionsCollapsed = <
|
||||
item
|
||||
Shift = [ssCtrl]
|
||||
ShiftMask = [ssCtrl]
|
||||
Button = mbLeft
|
||||
ClickCount = ccAny
|
||||
ClickDir = cdDown
|
||||
Command = 15
|
||||
MoveCaret = False
|
||||
Option = 0
|
||||
Priority = 0
|
||||
Command = emcCodeFoldExpand
|
||||
end
|
||||
item
|
||||
Shift = []
|
||||
ShiftMask = [ssCtrl]
|
||||
Button = mbLeft
|
||||
ClickCount = ccAny
|
||||
ClickDir = cdDown
|
||||
Command = 15
|
||||
MoveCaret = False
|
||||
Command = emcCodeFoldExpand
|
||||
Option = 1
|
||||
Priority = 0
|
||||
end>
|
||||
end
|
||||
end
|
||||
end
|
||||
object SaveDiffButton: TBitBtn
|
||||
object OpenInEditorButton: TBitBtn
|
||||
AnchorSideRight.Control = CloseButton
|
||||
AnchorSideBottom.Control = Owner
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 459
|
||||
Height = 25
|
||||
Top = 491
|
||||
Width = 64
|
||||
Anchors = [akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Save Diff'
|
||||
NumGlyphs = 0
|
||||
OnClick = SaveDiffButtonClick
|
||||
TabOrder = 4
|
||||
end
|
||||
object OpenInEditorButton: TBitBtn
|
||||
AnchorSideRight.Control = SaveDiffButton
|
||||
AnchorSideBottom.Control = Owner
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 320
|
||||
Height = 25
|
||||
Top = 491
|
||||
Width = 133
|
||||
Left = 373
|
||||
Height = 26
|
||||
Top = 490
|
||||
Width = 137
|
||||
Anchors = [akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'OpenInEditorButton'
|
||||
ModalResult = 6
|
||||
NumGlyphs = 0
|
||||
TabOrder = 5
|
||||
TabOrder = 4
|
||||
end
|
||||
object CloseButton: TBitBtn
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = Owner
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 529
|
||||
Height = 26
|
||||
Top = 490
|
||||
Width = 63
|
||||
Left = 516
|
||||
Height = 27
|
||||
Top = 489
|
||||
Width = 76
|
||||
Anchors = [akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 6
|
||||
@ -840,25 +742,23 @@ object DiffDlg: TDiffDlg
|
||||
Caption = '&Close'
|
||||
Kind = bkClose
|
||||
ModalResult = 2
|
||||
NumGlyphs = 0
|
||||
TabOrder = 6
|
||||
TabOrder = 5
|
||||
end
|
||||
object HelpButton: TBitBtn
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideBottom.Control = Owner
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 26
|
||||
Top = 490
|
||||
Width = 57
|
||||
Height = 33
|
||||
Top = 483
|
||||
Width = 76
|
||||
Anchors = [akLeft, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 6
|
||||
Caption = '&Help'
|
||||
Kind = bkHelp
|
||||
NumGlyphs = 0
|
||||
OnClick = HelpButtonClick
|
||||
TabOrder = 7
|
||||
TabOrder = 6
|
||||
end
|
||||
object ProgressBar1: TProgressBar
|
||||
AnchorSideLeft.Control = Owner
|
||||
@ -867,36 +767,29 @@ object DiffDlg: TDiffDlg
|
||||
AnchorSideBottom.Control = CloseButton
|
||||
Left = 6
|
||||
Height = 24
|
||||
Top = 460
|
||||
Width = 466
|
||||
Top = 459
|
||||
Width = 462
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
BorderSpacing.Around = 6
|
||||
Step = 0
|
||||
TabOrder = 8
|
||||
TabOrder = 7
|
||||
end
|
||||
object CancelScanningButton: TBitBtn
|
||||
AnchorSideTop.Control = ProgressBar1
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 478
|
||||
Height = 25
|
||||
Top = 460
|
||||
Width = 114
|
||||
Left = 474
|
||||
Height = 26
|
||||
Top = 458
|
||||
Width = 118
|
||||
Anchors = [akTop, akRight]
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Cancel Scanning'
|
||||
Enabled = False
|
||||
OnClick = CancelScanningButtonClick
|
||||
TabOrder = 9
|
||||
end
|
||||
object dlgSave: TSaveDialog
|
||||
DefaultExt = '.diff'
|
||||
Filter = 'diff|*.diff|any file|*.*'
|
||||
FilterIndex = 0
|
||||
left = 272
|
||||
top = 48
|
||||
TabOrder = 8
|
||||
end
|
||||
object dlgOpen: TOpenDialog
|
||||
DefaultExt = '.pas'
|
||||
|
@ -28,7 +28,7 @@
|
||||
Author: Mattias Gaertner
|
||||
|
||||
Abstract:
|
||||
The TDiffDlg is the dialog for showing the differences between two files.
|
||||
The TDiffDlg is a dialog for showing differences between two files.
|
||||
|
||||
}
|
||||
|
||||
@ -81,11 +81,9 @@ type
|
||||
DiffSynEdit: TSynEdit;
|
||||
OpenInEditorButton: TBitBtn;
|
||||
ProgressBar1: TProgressBar;
|
||||
SaveDiffButton: TBitBtn;
|
||||
SynDiffSyn1: TSynDiffSyn;
|
||||
Text1FileOpenButton: TButton;
|
||||
CancelScanningButton: TBitBtn;
|
||||
dlgSave: TSaveDialog;
|
||||
dlgOpen: TOpenDialog;
|
||||
|
||||
Text2FileOpenButton: TButton;
|
||||
@ -107,7 +105,6 @@ type
|
||||
procedure FileOpenClick(Sender: TObject);
|
||||
procedure HelpButtonClick(Sender: TObject);
|
||||
procedure OnChangeFlag(Sender: TObject);
|
||||
procedure SaveDiffButtonClick(Sender: TObject);
|
||||
procedure Text1ComboboxChange(Sender: TObject);
|
||||
procedure Text2ComboboxChange(Sender: TObject);
|
||||
private
|
||||
@ -135,8 +132,7 @@ type
|
||||
property IdleConnected: boolean read fIdleConnected write SetIdleConnected;
|
||||
end;
|
||||
|
||||
function ShowDiffDialog(Text1Index: integer;
|
||||
var OpenDiffInEditor: boolean; var Diff: string): TModalResult;
|
||||
function ShowDiffDialog(Text1Index: integer; out Diff: string): TModalResult;
|
||||
|
||||
const
|
||||
IgnoreCaseCheckBox = 0;
|
||||
@ -151,36 +147,33 @@ implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
function ShowDiffDialog(Text1Index: integer;
|
||||
var OpenDiffInEditor: boolean; var Diff: string): TModalResult;
|
||||
function ShowDiffDialog(Text1Index: integer; out Diff: string): TModalResult;
|
||||
var
|
||||
DiffDlg: TDiffDlg;
|
||||
Files: TDiffFiles;
|
||||
i: Integer;
|
||||
SrcEdit: TSourceEditor;
|
||||
begin
|
||||
DiffDlg := TDiffDlg.Create(nil);
|
||||
Files := TDiffFiles.Create;
|
||||
for i:=0 to SourceEditorManager.SourceEditorCount - 1 do begin
|
||||
SrcEdit := SourceEditorManager.SourceEditors[i]; // FindSourceEditorWithPageIndex(i);
|
||||
Files.Add(TDiffFile.Create(SrcEdit.PageName, SrcEdit, SrcEdit.SelectionAvailable));
|
||||
try
|
||||
// Get available files
|
||||
for i:=0 to SourceEditorManager.SourceEditorCount - 1 do begin
|
||||
SrcEdit := SourceEditorManager.SourceEditors[i]; // FindSourceEditorWithPageIndex(i);
|
||||
Files.Add(TDiffFile.Create(SrcEdit.PageName, SrcEdit, SrcEdit.SelectionAvailable));
|
||||
end;
|
||||
DiffDlg.Files := Files;
|
||||
DiffDlg.SetText1Index(Text1Index);
|
||||
DiffDlg.Init;
|
||||
Result := DiffDlg.ShowModal;
|
||||
DiffDlg.SaveSettings;
|
||||
// "Open in editor" button returns mrYes.
|
||||
if Result=mrYes then
|
||||
Diff := DiffDlg.DiffSynEdit.Text;
|
||||
finally
|
||||
Files.Free;
|
||||
DiffDlg.Free;
|
||||
end;
|
||||
|
||||
OpenDiffInEditor:=false;
|
||||
DiffDlg:=TDiffDlg.Create(nil);
|
||||
DiffDlg.Files:=Files;
|
||||
DiffDlg.SetText1Index(Text1Index);
|
||||
DiffDlg.Init;
|
||||
Result:=DiffDlg.ShowModal;
|
||||
DiffDlg.SaveSettings;
|
||||
|
||||
if Result=mrYes then begin
|
||||
OpenDiffInEditor:=true;
|
||||
Diff:=DiffDlg.DiffSynEdit.Text;
|
||||
Result:=mrOk;
|
||||
end;
|
||||
|
||||
Files.Free;
|
||||
DiffDlg.Free;
|
||||
end;
|
||||
|
||||
{ TDiffDlg }
|
||||
@ -228,16 +221,6 @@ begin
|
||||
LazarusHelp.ShowHelpForIDEControl(Self);
|
||||
end;
|
||||
|
||||
procedure TDiffDlg.SaveDiffButtonClick(Sender: TObject);
|
||||
begin
|
||||
if dlgSave.Execute then begin
|
||||
try
|
||||
SaveStringsToFileUTF8(DiffSynEdit.Lines,dlgSave.FileName);
|
||||
except
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TDiffDlg.Text1ComboboxChange(Sender: TObject);
|
||||
begin
|
||||
SetText1Index(Text1Combobox.Items.IndexOf(Text1Combobox.Text));
|
||||
@ -251,12 +234,12 @@ end;
|
||||
procedure TDiffDlg.SetupComponents;
|
||||
begin
|
||||
// text 1
|
||||
Text1GroupBox.Caption:=lisDiffDlgText1;
|
||||
Text1GroupBox.Caption:=lisDiffDlgFile1;
|
||||
Text1OnlySelectionCheckBox.Caption:=lisDiffDlgOnlySelection;
|
||||
Text1FileOpenButton.Caption:='...';
|
||||
|
||||
// text 2
|
||||
Text2GroupBox.Caption:=lisDiffDlgText2;
|
||||
Text2GroupBox.Caption:=lisDiffDlgFile2;
|
||||
Text2OnlySelectionCheckBox.Caption:=lisDiffDlgOnlySelection;
|
||||
Text2FileOpenButton.Caption:='...';
|
||||
|
||||
@ -277,17 +260,12 @@ begin
|
||||
CancelScanningButton.LoadGlyphFromResourceName(hInstance, 'btn_cancel');
|
||||
CloseButton.Caption:=lisClose;
|
||||
OpenInEditorButton.Caption:=lisDiffDlgOpenDiffInEditor;
|
||||
SaveDiffButton.Caption:=lisDlgSave;
|
||||
HelpButton.Caption:=lisMenuHelp;
|
||||
|
||||
OpenInEditorButton.LoadGlyphFromStock(idButtonOpen);
|
||||
if OpenInEditorButton.Glyph.Empty then
|
||||
OpenInEditorButton.LoadGlyphFromResourceName(HInstance, 'laz_open');
|
||||
|
||||
SaveDiffButton.LoadGlyphFromStock(idButtonSave);
|
||||
if SaveDiffButton.Glyph.Empty then
|
||||
SaveDiffButton.LoadGlyphFromResourceName(HInstance, 'laz_save');
|
||||
|
||||
// dialogs
|
||||
dlgOpen.Title:=lisOpenExistingFile;
|
||||
dlgOpen.Filter:=dlgAllFiles+' ('+GetAllFilesMask+')|'+GetAllFilesMask
|
||||
@ -296,8 +274,6 @@ begin
|
||||
+'|'+lisLazarusForm+' (*.lfm;*.dfm)|*.lfm;*.dfm'
|
||||
+'|'+lisLazarusPackage+' (*.lpk)|*.lpk'
|
||||
+'|'+lisLazarusProjectSource+' (*.lpr)|*.lpr';
|
||||
dlgSave.Title:=lisSaveFileAs;
|
||||
dlgSave.Filter:=dlgAllFiles+' ('+GetAllFilesMask+')|'+GetAllFilesMask;
|
||||
|
||||
// diff
|
||||
EditorOpts.GetSynEditSettings(DiffSynEdit);
|
||||
@ -360,7 +336,6 @@ begin
|
||||
Text1GroupBox.Enabled := False;
|
||||
Text2GroupBox.Enabled := False;
|
||||
OpenInEditorButton.Enabled := False;
|
||||
SaveDiffButton.Enabled := False;
|
||||
//CancelScanningButton.Enabled := True;
|
||||
|
||||
DiffOutput:=TDiffOutput.Create(Text1Src, Text2Src, GetDiffOptions, ProgressBar1);
|
||||
@ -371,7 +346,6 @@ begin
|
||||
end;
|
||||
|
||||
//CancelScanningButton.Enabled := False;
|
||||
SaveDiffButton.Enabled := True;
|
||||
OpenInEditorButton.Enabled := True;
|
||||
Text2GroupBox.Enabled := True;
|
||||
Text1GroupBox.Enabled := True;
|
||||
@ -384,7 +358,7 @@ begin
|
||||
inherited Create(TheOwner);
|
||||
fUpdating := False;
|
||||
fCancelled := False;
|
||||
Caption := lisCaptionDiff;
|
||||
Caption := lisCaptionCompareFiles;
|
||||
IDEDialogLayoutList.ApplyLayout(Self,600,500);
|
||||
SetupComponents;
|
||||
end;
|
||||
|
@ -511,8 +511,8 @@ resourcestring
|
||||
lisMenuGuessUnclosedBlock = 'Guess Unclosed Block';
|
||||
lisMenuGuessMisplacedIFDEF = 'Guess Misplaced IFDEF/ENDIF';
|
||||
lisMenuMakeResourceString = 'Make Resource String ...';
|
||||
lisCaptionDiff = 'Diff';
|
||||
lisMenuDiff = 'Diff ...';
|
||||
lisCaptionCompareFiles = 'Compare files (not for creating patches)';
|
||||
lisMenuCompareFiles = 'Compare files ...';
|
||||
lisMenuConvertDFMtoLFM = 'Convert Binary DFM to Text LFM + Check Syntax ...';
|
||||
lisMenuCheckLFM = 'Check LFM File in Editor';
|
||||
lisMenuDelphiConversion = 'Delphi Conversion';
|
||||
@ -3398,9 +3398,9 @@ resourcestring
|
||||
lisTheApplicationBundleWasCreatedFor = 'The Application Bundle was created for "%s"';
|
||||
|
||||
// diff dialog
|
||||
lisDiffDlgText1 = 'Text1';
|
||||
lisDiffDlgFile1 = 'File1';
|
||||
lisDiffDlgOnlySelection = 'Only selection';
|
||||
lisDiffDlgText2 = 'Text2';
|
||||
lisDiffDlgFile2 = 'File2';
|
||||
lisDiffDlgCaseInsensitive = 'Case Insensitive';
|
||||
lisDiffDlgIgnoreIfEmptyLinesWereAdd = 'Ignore if empty lines were added or removed';
|
||||
lisDiffDlgIgnoreSpacesAtStartOfLine = 'Ignore spaces at start of line';
|
||||
@ -3409,7 +3409,7 @@ resourcestring
|
||||
+'g. #10 = #13#10)';
|
||||
lisDiffDlgIgnoreIfSpaceCharsWereAdd = 'Ignore amount of space chars';
|
||||
lisDiffDlgIgnoreSpaces = 'Ignore spaces (newline chars not included)';
|
||||
lisDiffDlgOpenDiffInEditor = 'Open Diff in editor';
|
||||
lisDiffDlgOpenDiffInEditor = 'Open difference in editor';
|
||||
|
||||
// packages
|
||||
lisPkgFileTypeUnit = 'Unit';
|
||||
|
@ -9928,7 +9928,6 @@ function TMainIDE.DoDiff: TModalResult;
|
||||
var
|
||||
ActiveSrcEdit: TSourceEditor;
|
||||
ActiveUnitInfo: TUnitInfo;
|
||||
OpenDiffInEditor: boolean;
|
||||
DiffText: string;
|
||||
NewDiffFilename: String;
|
||||
begin
|
||||
@ -9936,10 +9935,9 @@ begin
|
||||
GetCurrentUnit(ActiveSrcEdit,ActiveUnitInfo);
|
||||
if ActiveSrcEdit=nil then exit;
|
||||
|
||||
Result:=ShowDiffDialog(ActiveSrcEdit.PageIndex,
|
||||
OpenDiffInEditor,DiffText);
|
||||
if OpenDiffInEditor then begin
|
||||
NewDiffFilename:=CreateSrcEditPageName('','diff.txt', nil);
|
||||
Result:=ShowDiffDialog(ActiveSrcEdit.PageIndex, DiffText);
|
||||
if Result = mrYes then begin
|
||||
NewDiffFilename:=CreateSrcEditPageName('','FileDifference.diff', nil);
|
||||
Result:=DoNewEditorFile(FileDescriptorText,NewDiffFilename,DiffText,
|
||||
[nfOpenInEditor]);
|
||||
GetCurrentUnit(ActiveSrcEdit,ActiveUnitInfo);
|
||||
|
@ -997,7 +997,7 @@ begin
|
||||
CreateMenuSeparatorSection(mnuTools,itmSecondaryTools,'itmSecondaryTools');
|
||||
ParentMI:=itmSecondaryTools;
|
||||
CreateMenuItem(ParentMI,itmToolManageExamples,'itmToolManageExamples',lisMenuExampleProjects, 'camera');
|
||||
CreateMenuItem(ParentMI,itmToolDiff,'itmToolDiff',lisMenuDiff, 'menu_tool_diff');
|
||||
CreateMenuItem(ParentMI,itmToolDiff,'itmToolDiff',lisMenuCompareFiles, 'menu_tool_diff');
|
||||
|
||||
CreateMenuSubSection(mnuTools,itmDelphiConversion,'itmDelphiConversion',lisMenuDelphiConversion,'menu_tool_dfm_to_lfm');
|
||||
ParentMI:=itmDelphiConversion;
|
||||
|
Loading…
Reference in New Issue
Block a user