mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-20 13:59:26 +01:00
Converter: Show missing units in a CheckListBox and let user select them.
git-svn-id: trunk@24304 -
This commit is contained in:
parent
77991a4720
commit
f9cad14768
@ -776,7 +776,7 @@ end;
|
||||
constructor TConvertDelphiPBase.Create(const AFilename, ADescription: string);
|
||||
begin
|
||||
fOrigPFilename:=AFilename;
|
||||
fCachedUnitNames:=TStringToStringTree.Create(true);
|
||||
fCachedUnitNames:=TStringToStringTree.Create(false);
|
||||
fCachedRealUnitNames:=TStringToStringTree.Create(true);
|
||||
fSettings:=TConvertSettings.Create('Convert Delphi '+ADescription);
|
||||
fSettings.MainFilename:=fOrigPFilename;
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
object ConvertSettingsForm: TConvertSettingsForm
|
||||
Left = 286
|
||||
Left = 280
|
||||
Height = 400
|
||||
Top = 122
|
||||
Width = 607
|
||||
Top = 292
|
||||
Width = 611
|
||||
ActiveControl = MainPathEdit
|
||||
Caption = 'Convert Delphi unit, project or package '
|
||||
ClientHeight = 400
|
||||
ClientWidth = 607
|
||||
ClientWidth = 611
|
||||
Constraints.MinHeight = 400
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
@ -17,12 +17,12 @@ object ConvertSettingsForm: TConvertSettingsForm
|
||||
Left = 0
|
||||
Height = 133
|
||||
Top = 219
|
||||
Width = 607
|
||||
Width = 611
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Top = 3
|
||||
Caption = 'Missing Properties and Types'
|
||||
ClientHeight = 111
|
||||
ClientWidth = 597
|
||||
ClientHeight = 113
|
||||
ClientWidth = 601
|
||||
TabOrder = 0
|
||||
object MissingTypesCheckBox: TCheckBox
|
||||
Left = 11
|
||||
@ -67,10 +67,10 @@ object ConvertSettingsForm: TConvertSettingsForm
|
||||
Left = 0
|
||||
Height = 136
|
||||
Top = 80
|
||||
Width = 607
|
||||
Width = 611
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
ClientHeight = 126
|
||||
ClientWidth = 597
|
||||
ClientWidth = 601
|
||||
TabOrder = 1
|
||||
object TargetRadioGroup: TRadioGroup
|
||||
Left = 11
|
||||
@ -87,7 +87,7 @@ object ConvertSettingsForm: TConvertSettingsForm
|
||||
ChildSizing.ShrinkVertical = crsScaleChilds
|
||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||
ChildSizing.ControlsPerLine = 1
|
||||
ClientHeight = 90
|
||||
ClientHeight = 92
|
||||
ClientWidth = 262
|
||||
ItemIndex = 0
|
||||
Items.Strings = (
|
||||
@ -115,12 +115,12 @@ object ConvertSettingsForm: TConvertSettingsForm
|
||||
Left = 0
|
||||
Height = 48
|
||||
Top = 352
|
||||
Width = 607
|
||||
Width = 611
|
||||
Align = alBottom
|
||||
AutoSize = True
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 48
|
||||
ClientWidth = 607
|
||||
ClientWidth = 611
|
||||
TabOrder = 2
|
||||
object HelpButton: TBitBtn
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
@ -139,7 +139,7 @@ object ConvertSettingsForm: TConvertSettingsForm
|
||||
end
|
||||
object btnOK: TBitBtn
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 439
|
||||
Left = 443
|
||||
Height = 36
|
||||
Top = 6
|
||||
Width = 75
|
||||
@ -157,7 +157,7 @@ object ConvertSettingsForm: TConvertSettingsForm
|
||||
object btnCancel: TBitBtn
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 520
|
||||
Left = 524
|
||||
Height = 36
|
||||
Top = 6
|
||||
Width = 81
|
||||
@ -178,7 +178,7 @@ object ConvertSettingsForm: TConvertSettingsForm
|
||||
Left = 80
|
||||
Height = 17
|
||||
Top = 15
|
||||
Width = 499
|
||||
Width = 503
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderStyle = bsNone
|
||||
Color = clBtnFace
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
object FixLFMDialog: TFixLFMDialog
|
||||
Left = 251
|
||||
Left = 280
|
||||
Height = 536
|
||||
Top = 356
|
||||
Top = 233
|
||||
Width = 756
|
||||
ActiveControl = LFMSynEdit
|
||||
Caption = 'Repair LFM file'
|
||||
Caption = 'Fix LFM file'
|
||||
ClientHeight = 536
|
||||
ClientWidth = 756
|
||||
OnCreate = CheckLFMDialogCreate
|
||||
@ -26,14 +26,14 @@ object FixLFMDialog: TFixLFMDialog
|
||||
Width = 408
|
||||
Align = alLeft
|
||||
Caption = 'LFM file'
|
||||
ClientHeight = 346
|
||||
ClientWidth = 398
|
||||
ClientHeight = 349
|
||||
ClientWidth = 404
|
||||
TabOrder = 0
|
||||
inline LFMSynEdit: TSynEdit
|
||||
Left = 0
|
||||
Height = 346
|
||||
Height = 349
|
||||
Top = 0
|
||||
Width = 398
|
||||
Width = 404
|
||||
Align = alClient
|
||||
Font.Height = -15
|
||||
Font.Name = 'courier'
|
||||
@ -633,14 +633,14 @@ object FixLFMDialog: TFixLFMDialog
|
||||
Width = 756
|
||||
Align = alBottom
|
||||
Caption = 'Errors'
|
||||
ClientHeight = 82
|
||||
ClientWidth = 746
|
||||
ClientHeight = 85
|
||||
ClientWidth = 752
|
||||
TabOrder = 1
|
||||
object ErrorsListBox: TListBox
|
||||
Left = 0
|
||||
Height = 82
|
||||
Height = 85
|
||||
Top = 0
|
||||
Width = 746
|
||||
Width = 752
|
||||
Align = alClient
|
||||
ItemHeight = 0
|
||||
OnClick = ErrorsListBoxClick
|
||||
@ -693,33 +693,33 @@ object FixLFMDialog: TFixLFMDialog
|
||||
Width = 343
|
||||
Align = alClient
|
||||
Caption = 'Properties and Types to replace'
|
||||
ClientHeight = 346
|
||||
ClientWidth = 333
|
||||
ClientHeight = 349
|
||||
ClientWidth = 339
|
||||
TabOrder = 3
|
||||
object PropertyReplaceGrid: TStringGrid
|
||||
Left = 0
|
||||
Height = 346
|
||||
Height = 349
|
||||
Top = 0
|
||||
Width = 333
|
||||
Width = 339
|
||||
Align = alClient
|
||||
AutoFillColumns = True
|
||||
ColCount = 2
|
||||
Columns = <
|
||||
item
|
||||
Title.Caption = 'Delphi name'
|
||||
Width = 163
|
||||
Width = 167
|
||||
end
|
||||
item
|
||||
Title.Caption = 'New name'
|
||||
Width = 164
|
||||
Width = 168
|
||||
end>
|
||||
FixedCols = 0
|
||||
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goSmoothScroll]
|
||||
RowCount = 2
|
||||
TabOrder = 0
|
||||
ColWidths = (
|
||||
163
|
||||
164
|
||||
167
|
||||
168
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
@ -340,7 +340,17 @@ end;
|
||||
|
||||
function TLFMFixer.Repair: TModalResult;
|
||||
begin
|
||||
Result:=inherited Repair;
|
||||
Result:=mrCancel;
|
||||
if CodeToolBoss.CheckLFM(fPascalBuffer,fLFMBuffer,fLFMTree,
|
||||
fRootMustBeClassInIntf,fObjectsMustExists)
|
||||
then begin
|
||||
Result:=mrOk;
|
||||
exit;
|
||||
end;
|
||||
Result:=FixMissingComponentClasses;
|
||||
if Result in [mrAbort,mrOk] then exit;
|
||||
WriteLFMErrors;
|
||||
Result:=ShowRepairLFMWizard;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
@ -1,27 +1,26 @@
|
||||
object MissingUnitsDialog: TMissingUnitsDialog
|
||||
Left = 283
|
||||
Height = 219
|
||||
Top = 127
|
||||
Width = 562
|
||||
Left = 280
|
||||
Height = 323
|
||||
Top = 149
|
||||
Width = 641
|
||||
HorzScrollBar.Page = 411
|
||||
VertScrollBar.Page = 342
|
||||
Caption = 'Units not Found'
|
||||
ClientHeight = 219
|
||||
ClientWidth = 562
|
||||
ClientHeight = 323
|
||||
ClientWidth = 641
|
||||
LCLVersion = '0.9.29'
|
||||
object MissingUnitsInfoLabel: TLabel
|
||||
Left = 16
|
||||
Height = 16
|
||||
Top = 16
|
||||
Width = 538
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
Width = 99
|
||||
Caption = 'Missing Units Info'
|
||||
ParentColor = False
|
||||
end
|
||||
object CommentButton: TBitBtn
|
||||
Left = 16
|
||||
Height = 30
|
||||
Top = 170
|
||||
Top = 274
|
||||
Width = 152
|
||||
Anchors = [akLeft, akBottom]
|
||||
Caption = 'Comment'
|
||||
@ -31,9 +30,9 @@ object MissingUnitsDialog: TMissingUnitsDialog
|
||||
TabOrder = 0
|
||||
end
|
||||
object SearchButton: TBitBtn
|
||||
Left = 209
|
||||
Left = 249
|
||||
Height = 30
|
||||
Top = 170
|
||||
Top = 274
|
||||
Width = 152
|
||||
Anchors = [akBottom]
|
||||
Caption = 'Search'
|
||||
@ -42,9 +41,9 @@ object MissingUnitsDialog: TMissingUnitsDialog
|
||||
TabOrder = 1
|
||||
end
|
||||
object AbortButton: TBitBtn
|
||||
Left = 402
|
||||
Left = 481
|
||||
Height = 30
|
||||
Top = 170
|
||||
Top = 274
|
||||
Width = 152
|
||||
Anchors = [akRight, akBottom]
|
||||
Caption = 'Abort'
|
||||
@ -54,60 +53,51 @@ object MissingUnitsDialog: TMissingUnitsDialog
|
||||
TabOrder = 2
|
||||
end
|
||||
object ChoicesLabel: TLabel
|
||||
AnchorSideTop.Control = UnitNamesLabel
|
||||
Left = 16
|
||||
Left = 224
|
||||
Height = 16
|
||||
Top = 62
|
||||
Width = 538
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
Top = 40
|
||||
Width = 50
|
||||
BorderSpacing.Top = 23
|
||||
Caption = 'Choices:'
|
||||
ParentColor = False
|
||||
end
|
||||
object Info1Label: TLabel
|
||||
AnchorSideTop.Control = ChoicesLabel
|
||||
Left = 16
|
||||
Left = 224
|
||||
Height = 16
|
||||
Top = 85
|
||||
Width = 538
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
Top = 63
|
||||
Width = 28
|
||||
BorderSpacing.Top = 23
|
||||
Caption = 'Info1'
|
||||
ParentColor = False
|
||||
end
|
||||
object Info2Label: TLabel
|
||||
AnchorSideTop.Control = Info1Label
|
||||
Left = 16
|
||||
Left = 224
|
||||
Height = 16
|
||||
Top = 108
|
||||
Width = 538
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
Top = 86
|
||||
Width = 28
|
||||
BorderSpacing.Top = 23
|
||||
Caption = 'Info2'
|
||||
ParentColor = False
|
||||
end
|
||||
object Info3Label: TLabel
|
||||
AnchorSideTop.Control = Info2Label
|
||||
Left = 16
|
||||
Left = 224
|
||||
Height = 16
|
||||
Top = 131
|
||||
Width = 538
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
Top = 109
|
||||
Width = 28
|
||||
BorderSpacing.Top = 23
|
||||
Caption = 'Info3'
|
||||
ParentColor = False
|
||||
end
|
||||
object UnitNamesLabel: TLabel
|
||||
AnchorSideTop.Control = MissingUnitsInfoLabel
|
||||
Left = 24
|
||||
Height = 16
|
||||
Top = 39
|
||||
Width = 530
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Top = 23
|
||||
Caption = 'UnitNames'
|
||||
Font.Style = [fsBold]
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
object MissingUnitsCheckListBox: TCheckListBox
|
||||
Left = 16
|
||||
Height = 222
|
||||
Top = 40
|
||||
Width = 192
|
||||
Anchors = [akTop, akLeft, akBottom]
|
||||
ItemHeight = 0
|
||||
TabOrder = 3
|
||||
end
|
||||
end
|
||||
|
||||
@ -33,7 +33,7 @@ interface
|
||||
uses
|
||||
// FCL+LCL
|
||||
Classes, SysUtils, LCLProc, LResources, Forms, Controls, Graphics,
|
||||
Dialogs, Buttons, StdCtrls, FileUtil,
|
||||
Dialogs, Buttons, StdCtrls, FileUtil, CheckLst,
|
||||
// Components
|
||||
SynEdit, CodeAtom, CodeCache, CodeToolManager, DefineTemplates,
|
||||
// IDEIntf
|
||||
@ -47,9 +47,9 @@ type
|
||||
{ TMissingUnitsDialog }
|
||||
|
||||
TMissingUnitsDialog = class(TForm)
|
||||
MissingUnitsCheckListBox: TCheckListBox;
|
||||
CommentButton: TBitBtn;
|
||||
ChoicesLabel: TLabel;
|
||||
UnitNamesLabel: TLabel;
|
||||
Info1Label: TLabel;
|
||||
Info2Label: TLabel;
|
||||
Info3Label: TLabel;
|
||||
@ -80,7 +80,7 @@ function AskMissingUnits(AMissingUnits: TStrings; AMainUnitName: string;
|
||||
ATargetDelphi: boolean): TModalResult;
|
||||
var
|
||||
UNFDialog: TMissingUnitsDialog;
|
||||
UnitsTitle, UnitsCommaList: string;
|
||||
UnitsTitle: string;
|
||||
i: Integer;
|
||||
begin
|
||||
Result:=mrCancel;
|
||||
@ -91,20 +91,11 @@ begin
|
||||
else
|
||||
UnitsTitle:=lisUnitsNotFound2+' '+AMainUnitName;
|
||||
|
||||
// A comma separated list of missing units.
|
||||
UnitsCommaList:='';
|
||||
for i:=0 to AMissingUnits.Count-1 do begin
|
||||
if UnitsCommaList<>'' then
|
||||
UnitsCommaList:=UnitsCommaList+', ';
|
||||
UnitsCommaList:=UnitsCommaList+AMissingUnits[i];
|
||||
end;
|
||||
|
||||
UNFDialog:=TMissingUnitsDialog.Create(nil);
|
||||
with UNFDialog do begin
|
||||
Caption:=UnitsTitle;
|
||||
SearchButton.Caption:=lisMissingUnitsSearch;
|
||||
MissingUnitsInfoLabel.Caption:=lisTheseUnitsWereNotFound;
|
||||
UnitNamesLabel.Caption:=UnitsCommaList;
|
||||
ChoicesLabel.Caption:=lisMissingUnitsChoices;
|
||||
if ATargetDelphi then begin
|
||||
CommentButton.Caption:=lisMissingUnitsForDelphi;
|
||||
@ -116,7 +107,21 @@ begin
|
||||
end;
|
||||
Info2Label.Caption:=lisMissingUnitsInfo2;
|
||||
Info3Label.Caption:=lisMissingUnitsInfo3;
|
||||
// Add missing units to CheckListBox.
|
||||
for i:=0 to AMissingUnits.Count-1 do begin
|
||||
MissingUnitsCheckListBox.Items.Append(AMissingUnits[i]);
|
||||
MissingUnitsCheckListBox.Checked[i]:=true;
|
||||
end;
|
||||
// Show dialog and get user action.
|
||||
Result:=ShowModal;
|
||||
if Result=mrOK then begin
|
||||
AMissingUnits.Clear;
|
||||
for i := 0 to MissingUnitsCheckListBox.Count-1 do begin
|
||||
if MissingUnitsCheckListBox.Checked[i] then begin
|
||||
AMissingUnits.Append(MissingUnitsCheckListBox.Items[i]);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -442,10 +442,10 @@ resourcestring
|
||||
lisMissingUnitsSearch = 'Search Unit Path';
|
||||
lisTheseUnitsWereNotFound = 'These units were not found:';
|
||||
lisMissingUnitsChoices = 'Your choices are:';
|
||||
lisMissingUnitsInfo1 = '1) Comment out the missing units (ignore them).';
|
||||
lisMissingUnitsInfo1 = '1) Comment out the selected units.';
|
||||
lisMissingUnitsInfo1b = '1) Use the units only for Delphi.';
|
||||
lisMissingUnitsInfo2 = '2) Select a unit path which will be added to project settings.';
|
||||
lisMissingUnitsInfo3 = '3) Abort now, fix the unit path or install packages and try again.';
|
||||
lisMissingUnitsInfo2 = '2) Search for units. Found paths are added to project settings.';
|
||||
lisMissingUnitsInfo3 = '3) Abort now, install packages or fix paths and try again.';
|
||||
lisUnitNotFound = 'A unit not found in';
|
||||
lisUnitsNotFound2 = 'Units not found in';
|
||||
lisUnableToConvertLfmToLrsAndWriteLrsFile = 'Unable to convert lfm to lrs '
|
||||
|
||||
Loading…
Reference in New Issue
Block a user