mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 14:18:17 +02:00
IDE: packages: added option Enable i18n for lfm similar to the project option
git-svn-id: trunk@34752 -
This commit is contained in:
parent
e54cc77c3c
commit
4899a6c2e2
@ -6,8 +6,8 @@ object AnchorDockOptionsFrame: TAnchorDockOptionsFrame
|
||||
ClientHeight = 346
|
||||
ClientWidth = 352
|
||||
TabOrder = 0
|
||||
DesignLeft = 456
|
||||
DesignTop = 222
|
||||
DesignLeft = 471
|
||||
DesignTop = 220
|
||||
object DragThresholdLabel: TLabel
|
||||
Left = 10
|
||||
Height = 15
|
||||
|
@ -2123,6 +2123,8 @@ resourcestring
|
||||
+'po files';
|
||||
lisCreateUpdatePoFileWhenSavingALfmFile = 'Create/update .po file when '
|
||||
+'saving a lfm file';
|
||||
lisYouCanDisableThisForIndividualFormsViaThePackageEd = 'You can disable '
|
||||
+'this for individual forms via the package editor';
|
||||
lisYouCanDisableThisForIndividualFormsViaThePopupMenu = 'You can disable '
|
||||
+'this for individual forms via the popup menu in the project inspector';
|
||||
rsIncludeVersionInfoInExecutable = 'Include version info in executable';
|
||||
@ -4076,6 +4078,11 @@ resourcestring
|
||||
lisPkgMangAddUnitToUsesClauseOfPackageDisableThisOnlyForUnit = 'Add unit to '
|
||||
+'uses clause of package. Disable this only for units, that should not be '
|
||||
+'compiled in all cases.';
|
||||
lisPckDisableI18NOfLfm = 'Disable I18N of lfm';
|
||||
lisPckWhenTheFormIsSavedTheIDECanStoreAllTTranslateString = 'When the form is'
|
||||
+' saved, the IDE can store all TTranslateString properties to the package '
|
||||
+'po file. For this you must enable I18N for this package, provide a po '
|
||||
+'output directory and leave this option unchecked.';
|
||||
lisPkgMangUseUnit = 'Use unit';
|
||||
lisPckEditMinimumVersion = 'Minimum Version:';
|
||||
lisPckEditMaximumVersion = 'Maximum Version:';
|
||||
|
45
ide/main.pp
45
ide/main.pp
@ -5647,6 +5647,37 @@ end;
|
||||
|
||||
function TMainIDE.DoSaveUnitComponent(AnUnitInfo: TUnitInfo;
|
||||
ResourceCode, LFMCode: TCodeBuffer; Flags: TSaveFlags): TModalResult;
|
||||
|
||||
function IsI18NEnabled(UnitOwners: TFPList): boolean;
|
||||
var
|
||||
i: Integer;
|
||||
APackage: TLazPackage;
|
||||
PkgFile: TPkgFile;
|
||||
begin
|
||||
if AnUnitInfo.IsPartOfProject then begin
|
||||
// a project unit
|
||||
Result:=AnUnitInfo.Project.EnableI18N and AnUnitInfo.Project.EnableI18NForLFM
|
||||
and (not AnUnitInfo.DisableI18NForLFM);
|
||||
exit;
|
||||
end;
|
||||
if (UnitOwners<>nil) then begin
|
||||
for i:=0 to UnitOwners.Count-1 do begin
|
||||
if TObject(UnitOwners[i]) is TLazPackage then begin
|
||||
// a package unit
|
||||
APackage:=TLazPackage(UnitOwners[i]);
|
||||
Result:=false;
|
||||
if APackage.EnableI18N and APackage.EnableI18NForLFM then begin
|
||||
PkgFile:=APackage.FindPkgFile(AnUnitInfo.Filename,true,true);
|
||||
Result:=(PkgFile<>nil) and (not PkgFile.DisableI18NForLFM);
|
||||
end;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
// a rogue unit
|
||||
Result:=false;
|
||||
end;
|
||||
|
||||
var
|
||||
ComponentSavingOk: boolean;
|
||||
MemStream, BinCompStream, TxtCompStream: TExtMemoryStream;
|
||||
@ -5661,8 +5692,6 @@ var
|
||||
Ancestor: TComponent;
|
||||
HasI18N: Boolean;
|
||||
UnitOwners: TFPList;
|
||||
APackage: TLazPackage;
|
||||
i: Integer;
|
||||
LRSFilename: String;
|
||||
PropPath: String;
|
||||
ResType: TResourceType;
|
||||
@ -5719,17 +5748,7 @@ begin
|
||||
BinCompStream.Position:=0;
|
||||
Writer:=CreateLRSWriter(BinCompStream,DestroyDriver);
|
||||
// used to save lrt files
|
||||
HasI18N:=AnUnitInfo.IsPartOfProject and (not AnUnitInfo.DisableI18NForLFM)
|
||||
and AnUnitInfo.Project.EnableI18N and AnUnitInfo.Project.EnableI18NForLFM;
|
||||
if (not HasI18N) and (UnitOwners<>nil) then begin
|
||||
for i:=0 to UnitOwners.Count-1 do begin
|
||||
if TObject(UnitOwners[i]) is TLazPackage then begin
|
||||
APackage:=TLazPackage(UnitOwners[i]);
|
||||
if APackage.EnableI18N then
|
||||
HasI18N:=true;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
HasI18N:=IsI18NEnabled(UnitOwners);
|
||||
if HasI18N then
|
||||
Grubber:=TLRTGrubber.Create(Writer);
|
||||
Writer.OnWriteMethodProperty:=@FormEditor1.WriteMethodPropertyEvent;
|
||||
|
@ -67,12 +67,14 @@ type
|
||||
|
||||
TLazPackageFile = class
|
||||
private
|
||||
FDisableI18NForLFM: boolean;
|
||||
FFilename: string;
|
||||
FRemoved: boolean;
|
||||
protected
|
||||
procedure SetFilename(const AValue: string); virtual;
|
||||
function GetIDEPackage: TIDEPackage; virtual; abstract;
|
||||
procedure SetRemoved(const AValue: boolean); virtual;
|
||||
procedure SetDisableI18NForLFM(AValue: boolean); virtual;
|
||||
public
|
||||
function GetFullFilename: string; virtual; abstract;
|
||||
function GetShortFilename(UseUp: boolean): string; virtual; abstract;
|
||||
@ -80,6 +82,7 @@ type
|
||||
property Filename: string read FFilename write SetFilename; // can contain macros if package was auto created
|
||||
property LazPackage: TIDEPackage read GetIDEPackage;
|
||||
property Removed: boolean read FRemoved write SetRemoved;
|
||||
property DisableI18NForLFM: boolean read FDisableI18NForLFM write SetDisableI18NForLFM;
|
||||
end;
|
||||
|
||||
{ TLazPackageID }
|
||||
@ -746,6 +749,11 @@ end;
|
||||
|
||||
{ TLazPackageFile }
|
||||
|
||||
procedure TLazPackageFile.SetDisableI18NForLFM(AValue: boolean);
|
||||
begin
|
||||
FDisableI18NForLFM:=AValue;
|
||||
end;
|
||||
|
||||
procedure TLazPackageFile.SetFilename(const AValue: string);
|
||||
begin
|
||||
FFilename:=AValue;
|
||||
|
@ -4,8 +4,8 @@ inherited PackageI18NOptionsFrame: TPackageI18NOptionsFrame
|
||||
ClientHeight = 322
|
||||
ClientWidth = 551
|
||||
TabOrder = 0
|
||||
DesignLeft = 245
|
||||
DesignTop = 173
|
||||
DesignLeft = 851
|
||||
DesignTop = 207
|
||||
object I18NGroupBox: TGroupBox[0]
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = EnableI18NCheckBox
|
||||
@ -13,23 +13,23 @@ inherited PackageI18NOptionsFrame: TPackageI18NOptionsFrame
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 75
|
||||
Top = 25
|
||||
Height = 97
|
||||
Top = 30
|
||||
Width = 551
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoSize = True
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'i18n Options'
|
||||
ClientHeight = 57
|
||||
ClientHeight = 81
|
||||
ClientWidth = 547
|
||||
TabOrder = 0
|
||||
object PoOutDirLabel: TLabel
|
||||
AnchorSideLeft.Control = I18NGroupBox
|
||||
AnchorSideTop.Control = I18NGroupBox
|
||||
Left = 6
|
||||
Height = 16
|
||||
Height = 15
|
||||
Top = 6
|
||||
Width = 112
|
||||
Width = 113
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'PO Output Directory:'
|
||||
ParentColor = False
|
||||
@ -40,9 +40,9 @@ inherited PackageI18NOptionsFrame: TPackageI18NOptionsFrame
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = POOutDirButton
|
||||
Left = 6
|
||||
Height = 23
|
||||
Top = 28
|
||||
Width = 494
|
||||
Height = 24
|
||||
Top = 27
|
||||
Width = 508
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Around = 6
|
||||
TabOrder = 0
|
||||
@ -53,10 +53,10 @@ inherited PackageI18NOptionsFrame: TPackageI18NOptionsFrame
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = POOutDirEdit
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 506
|
||||
Height = 23
|
||||
Top = 28
|
||||
Width = 35
|
||||
Left = 520
|
||||
Height = 24
|
||||
Top = 27
|
||||
Width = 21
|
||||
Anchors = [akTop, akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Right = 6
|
||||
@ -64,14 +64,27 @@ inherited PackageI18NOptionsFrame: TPackageI18NOptionsFrame
|
||||
OnClick = POOutDirButtonClick
|
||||
TabOrder = 1
|
||||
end
|
||||
object PoForFormsCheckBox: TCheckBox
|
||||
AnchorSideLeft.Control = PoOutDirLabel
|
||||
AnchorSideTop.Control = POOutDirEdit
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 24
|
||||
Top = 57
|
||||
Width = 145
|
||||
Caption = 'PoForFormsCheckBox'
|
||||
ParentShowHint = False
|
||||
ShowHint = True
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
||||
object EnableI18NCheckBox: TCheckBox[1]
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = Owner
|
||||
Left = 0
|
||||
Height = 19
|
||||
Height = 24
|
||||
Top = 0
|
||||
Width = 80
|
||||
Width = 91
|
||||
Caption = 'Enable i18n'
|
||||
OnChange = EnableI18NCheckBoxChange
|
||||
TabOrder = 1
|
||||
|
@ -18,6 +18,7 @@ type
|
||||
POOutDirButton: TButton;
|
||||
POOutDirEdit: TEdit;
|
||||
PoOutDirLabel: TLabel;
|
||||
PoForFormsCheckBox: TCheckBox;
|
||||
procedure EnableI18NCheckBoxChange(Sender: TObject);
|
||||
procedure POOutDirButtonClick(Sender: TObject);
|
||||
private
|
||||
@ -63,6 +64,9 @@ begin
|
||||
EnableI18NCheckBox.Caption := rsEnableI18n;
|
||||
I18NGroupBox.Caption := rsI18nOptions;
|
||||
PoOutDirlabel.Caption := rsPOOutputDirectory;
|
||||
PoForFormsCheckBox.Caption:=lisCreateUpdatePoFileWhenSavingALfmFile;
|
||||
PoForFormsCheckBox.Hint:=
|
||||
lisYouCanDisableThisForIndividualFormsViaThePackageEd;
|
||||
end;
|
||||
|
||||
procedure TPackageI18NOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||
@ -73,6 +77,7 @@ begin
|
||||
EnableI18NCheckBox.Checked := LazPackage.EnableI18N;
|
||||
I18NGroupBox.Enabled := LazPackage.EnableI18N;
|
||||
POOutDirEdit.Text := LazPackage.POOutputDirectory;
|
||||
PoForFormsCheckBox.Checked:=LazPackage.EnableI18NForLFM;
|
||||
end;
|
||||
|
||||
procedure TPackageI18NOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);
|
||||
@ -81,6 +86,7 @@ var
|
||||
begin
|
||||
LazPackage.EnableI18N := EnableI18NCheckBox.Checked;
|
||||
LazPackage.POOutputDirectory := POOutDirEdit.Text;
|
||||
LazPackage.EnableI18NForLFM := PoForFormsCheckBox.Checked;
|
||||
end;
|
||||
|
||||
class function TPackageI18NOptionsFrame.SupportedOptionsClass: TAbstractIDEOptionsClass;
|
||||
|
@ -171,6 +171,7 @@ type
|
||||
function GetIDEPackage: TIDEPackage; override;
|
||||
procedure SetFilename(const AValue: string); override;
|
||||
procedure SetRemoved(const AValue: boolean); override;
|
||||
procedure SetDisableI18NForLFM(AValue: boolean); override;
|
||||
public
|
||||
constructor Create(ThePackage: TLazPackage);
|
||||
destructor Destroy; override;
|
||||
@ -575,6 +576,7 @@ type
|
||||
FDirectoryExpanded: string;
|
||||
FDirectoryExpandedChangeStamp: integer;
|
||||
FEnableI18N: boolean;
|
||||
FEnableI18NForLFM: boolean;
|
||||
FFileReadOnly: boolean;
|
||||
FFiles: TFPList; // TFPList of TPkgFile
|
||||
FFirstRemovedDependency: TPkgDependency;
|
||||
@ -622,6 +624,7 @@ type
|
||||
procedure SetAutoInstall(const AValue: TPackageInstallType);
|
||||
procedure SetAutoUpdate(const AValue: TPackageUpdatePolicy);
|
||||
procedure SetDescription(const AValue: string);
|
||||
procedure SetEnableI18NForLFM(AValue: boolean);
|
||||
procedure SetFileReadOnly(const AValue: boolean);
|
||||
procedure SetFlags(const AValue: TLazPackageFlags);
|
||||
procedure SetIconFile(const AValue: string);
|
||||
@ -792,6 +795,7 @@ type
|
||||
property Editor: TBasePackageEditor read FPackageEditor
|
||||
write SetPackageEditor;
|
||||
property EnableI18N: Boolean read FEnableI18N write SetEnableI18N;
|
||||
property EnableI18NForLFM: boolean read FEnableI18NForLFM write SetEnableI18NForLFM;
|
||||
property FileReadOnly: boolean read FFileReadOnly write SetFileReadOnly;
|
||||
property Files[Index: integer]: TPkgFile read GetFiles;
|
||||
property FirstRemovedDependency: TPkgDependency
|
||||
@ -1537,6 +1541,13 @@ begin
|
||||
UpdateSourceDirectoryReference;
|
||||
end;
|
||||
|
||||
procedure TPkgFile.SetDisableI18NForLFM(AValue: boolean);
|
||||
begin
|
||||
if DisableI18NForLFM=AValue then exit;
|
||||
inherited SetDisableI18NForLFM(AValue);
|
||||
LazPackage.Modified:=true;
|
||||
end;
|
||||
|
||||
function TPkgFile.GetComponents(Index: integer): TPkgComponent;
|
||||
begin
|
||||
Result:=TPkgComponent(FComponents[Index]);
|
||||
@ -1686,6 +1697,7 @@ begin
|
||||
HasRegisterProc:=XMLConfig.GetValue(Path+'HasRegisterProc/Value',false);
|
||||
AddToUsesPkgSection:=XMLConfig.GetValue(Path+'AddToUsesPkgSection/Value',
|
||||
FileType in PkgFileUnitTypes);
|
||||
DisableI18NForLFM:=XMLConfig.GetValue(Path+'DisableI18NForLFM/Value',false);
|
||||
fUnitName:=XMLConfig.GetValue(Path+'UnitName/Value','');
|
||||
if FileType in PkgFileUnitTypes then begin
|
||||
// make sure the unitname makes sense
|
||||
@ -1710,6 +1722,7 @@ begin
|
||||
false);
|
||||
XMLConfig.SetDeleteValue(Path+'AddToUsesPkgSection/Value',AddToUsesPkgSection,
|
||||
FileType in PkgFileUnitTypes);
|
||||
XMLConfig.SetDeleteValue(Path+'DisableI18NForLFM/Value',DisableI18NForLFM,false);
|
||||
XMLConfig.SetDeleteValue(Path+'Type/Value',PkgFileTypeIdents[FileType],
|
||||
PkgFileTypeIdents[pftUnit]);
|
||||
XMLConfig.SetDeleteValue(Path+'UnitName/Value',FUnitName,'');
|
||||
@ -2283,6 +2296,7 @@ begin
|
||||
IconFile:=aSource.IconFile;
|
||||
UsageOptions.AssignOptions(aSource.UsageOptions);
|
||||
EnableI18N:=aSource.EnableI18N;
|
||||
EnableI18NForLFM:=aSource.EnableI18NForLFM;
|
||||
Description:=aSource.Description;
|
||||
AutoUpdate:=aSource.AutoUpdate;
|
||||
AutoIncrementVersionOnBuild:=aSource.AutoIncrementVersionOnBuild;
|
||||
@ -2369,6 +2383,13 @@ begin
|
||||
Modified:=true;
|
||||
end;
|
||||
|
||||
procedure TLazPackage.SetEnableI18NForLFM(AValue: boolean);
|
||||
begin
|
||||
if FEnableI18NForLFM=AValue then Exit;
|
||||
FEnableI18NForLFM:=AValue;
|
||||
Modified:=true;
|
||||
end;
|
||||
|
||||
procedure TLazPackage.SetFileReadOnly(const AValue: boolean);
|
||||
begin
|
||||
if FFileReadOnly=AValue then exit;
|
||||
@ -2650,6 +2671,9 @@ begin
|
||||
FDescription:='';
|
||||
FDirectory:='';
|
||||
FDirectoryExpandedChangeStamp:=InvalidParseStamp;
|
||||
FEnableI18N:=false;
|
||||
FEnableI18NForLFM:=false;
|
||||
FPOOutputDirectory:='';
|
||||
FHasDirectory:=false;
|
||||
FHasStaticDirectory:=false;
|
||||
FVersion.Clear;
|
||||
@ -2813,6 +2837,7 @@ begin
|
||||
FPOOutputDirectory := SwitchPathDelims(
|
||||
xmlconfig.GetValue(Path+'i18n/OutDir/Value', ''),PathDelimChanged);
|
||||
end;
|
||||
EnableI18NForLFM:=xmlconfig.GetValue(Path+'i18n/EnableI18NForLFM/Value', false);
|
||||
|
||||
LoadFiles(Path+'Files/',FFiles);
|
||||
UpdateSourceDirectories;
|
||||
@ -2892,6 +2917,7 @@ begin
|
||||
|
||||
XMLConfig.SetDeleteValue(Path+'i18n/EnableI18N/Value', EnableI18N, false);
|
||||
XMLConfig.SetDeleteValue(Path+'i18n/OutDir/Value',f(FPOOutputDirectory), '');
|
||||
XMLConfig.SetDeleteValue(Path+'i18n/EnableI18NForLFM/Value', EnableI18NForLFM, false);
|
||||
|
||||
XMLConfig.SetDeleteValue(Path+'Type/Value',LazPackageTypeIdents[FPackageType],
|
||||
LazPackageTypeIdents[lptRunTime]);
|
||||
|
@ -1,7 +1,7 @@
|
||||
inherited PackageEditorForm: TPackageEditorForm
|
||||
Left = 344
|
||||
Left = 383
|
||||
Height = 455
|
||||
Top = 119
|
||||
Top = 201
|
||||
Width = 577
|
||||
Caption = 'PackageEditorForm'
|
||||
ClientHeight = 455
|
||||
@ -25,18 +25,18 @@ inherited PackageEditorForm: TPackageEditorForm
|
||||
object FilePropsGroupBox: TGroupBox[1]
|
||||
Left = 0
|
||||
Height = 118
|
||||
Top = 318
|
||||
Top = 317
|
||||
Width = 577
|
||||
Align = alBottom
|
||||
Caption = 'FilePropsGroupBox'
|
||||
ClientHeight = 101
|
||||
ClientHeight = 102
|
||||
ClientWidth = 573
|
||||
TabOrder = 2
|
||||
object CallRegisterProcCheckBox: TCheckBox
|
||||
Left = 0
|
||||
Height = 26
|
||||
Height = 24
|
||||
Top = 0
|
||||
Width = 189
|
||||
Width = 171
|
||||
Caption = 'CallRegisterProcCheckBox'
|
||||
OnChange = CallRegisterProcCheckBoxChange
|
||||
ParentShowHint = False
|
||||
@ -46,10 +46,10 @@ inherited PackageEditorForm: TPackageEditorForm
|
||||
object AddToUsesPkgSectionCheckBox: TCheckBox
|
||||
AnchorSideLeft.Control = CallRegisterProcCheckBox
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
Left = 199
|
||||
Height = 26
|
||||
Left = 181
|
||||
Height = 24
|
||||
Top = 0
|
||||
Width = 226
|
||||
Width = 201
|
||||
BorderSpacing.Left = 10
|
||||
Caption = 'AddToUsesPkgSectionCheckBox'
|
||||
OnChange = AddToUsesPkgSectionCheckBoxChange
|
||||
@ -62,9 +62,9 @@ inherited PackageEditorForm: TPackageEditorForm
|
||||
AnchorSideTop.Control = MinVersionEdit
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 0
|
||||
Height = 26
|
||||
Top = -2
|
||||
Width = 179
|
||||
Height = 24
|
||||
Top = 0
|
||||
Width = 160
|
||||
Caption = 'UseMinVersionCheckBox'
|
||||
OnChange = UseMinVersionCheckBoxChange
|
||||
TabOrder = 2
|
||||
@ -73,8 +73,8 @@ inherited PackageEditorForm: TPackageEditorForm
|
||||
AnchorSideLeft.Control = UseMinVersionCheckBox
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = FilePropsGroupBox
|
||||
Left = 189
|
||||
Height = 23
|
||||
Left = 170
|
||||
Height = 24
|
||||
Top = 0
|
||||
Width = 100
|
||||
BorderSpacing.Left = 10
|
||||
@ -87,9 +87,9 @@ inherited PackageEditorForm: TPackageEditorForm
|
||||
AnchorSideTop.Control = MaxVersionEdit
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 0
|
||||
Height = 26
|
||||
Top = 23
|
||||
Width = 182
|
||||
Height = 24
|
||||
Top = 26
|
||||
Width = 163
|
||||
Caption = 'UseMaxVersionCheckBox'
|
||||
OnChange = UseMaxVersionCheckBoxChange
|
||||
TabOrder = 4
|
||||
@ -99,9 +99,9 @@ inherited PackageEditorForm: TPackageEditorForm
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = MinVersionEdit
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 192
|
||||
Height = 23
|
||||
Top = 25
|
||||
Left = 173
|
||||
Height = 24
|
||||
Top = 26
|
||||
Width = 100
|
||||
BorderSpacing.Left = 10
|
||||
BorderSpacing.Top = 2
|
||||
@ -114,9 +114,9 @@ inherited PackageEditorForm: TPackageEditorForm
|
||||
AnchorSideTop.Control = MaxVersionEdit
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 25
|
||||
Top = 54
|
||||
Width = 163
|
||||
Height = 26
|
||||
Top = 56
|
||||
Width = 147
|
||||
AutoSize = True
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'ApplyDependencyButton'
|
||||
@ -127,33 +127,50 @@ inherited PackageEditorForm: TPackageEditorForm
|
||||
AnchorSideTop.Control = CallRegisterProcCheckBox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 69
|
||||
Top = 32
|
||||
Height = 72
|
||||
Top = 30
|
||||
Width = 573
|
||||
Align = alBottom
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'RegisteredPluginsGroupBox'
|
||||
ClientHeight = 52
|
||||
ClientHeight = 56
|
||||
ClientWidth = 569
|
||||
TabOrder = 7
|
||||
object RegisteredListBox: TListBox
|
||||
Left = 0
|
||||
Height = 52
|
||||
Height = 56
|
||||
Top = 0
|
||||
Width = 569
|
||||
Align = alClient
|
||||
ItemHeight = 0
|
||||
OnDrawItem = RegisteredListBoxDrawItem
|
||||
ScrollWidth = 567
|
||||
Style = lbOwnerDrawFixed
|
||||
TabOrder = 0
|
||||
TopIndex = -1
|
||||
end
|
||||
end
|
||||
object DisableI18NForLFMCheckBox: TCheckBox
|
||||
AnchorSideLeft.Control = AddToUsesPkgSectionCheckBox
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = AddToUsesPkgSectionCheckBox
|
||||
Left = 388
|
||||
Height = 24
|
||||
Top = 0
|
||||
Width = 184
|
||||
BorderSpacing.Left = 6
|
||||
Caption = 'DisableI18NForLFMCheckBox'
|
||||
OnChange = DisableI18NForLFMCheckBoxChange
|
||||
ParentShowHint = False
|
||||
ShowHint = True
|
||||
TabOrder = 8
|
||||
end
|
||||
end
|
||||
object StatusBar: TStatusBar[2]
|
||||
Left = 0
|
||||
Height = 19
|
||||
Top = 436
|
||||
Height = 20
|
||||
Top = 435
|
||||
Width = 577
|
||||
Panels = <>
|
||||
end
|
||||
@ -161,32 +178,32 @@ inherited PackageEditorForm: TPackageEditorForm
|
||||
Cursor = crVSplit
|
||||
Left = 0
|
||||
Height = 5
|
||||
Top = 313
|
||||
Top = 312
|
||||
Width = 577
|
||||
Align = alBottom
|
||||
ResizeAnchor = akBottom
|
||||
end
|
||||
object ItemsPanel: TPanel[4]
|
||||
Left = 0
|
||||
Height = 265
|
||||
Height = 264
|
||||
Top = 48
|
||||
Width = 577
|
||||
Align = alClient
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 265
|
||||
ClientHeight = 264
|
||||
ClientWidth = 577
|
||||
TabOrder = 1
|
||||
object FilesTreeView: TTreeView
|
||||
AnchorSideTop.Control = FilterEdit
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 239
|
||||
Top = 26
|
||||
Height = 237
|
||||
Top = 27
|
||||
Width = 577
|
||||
Align = alBottom
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Top = 3
|
||||
DefaultItemHeight = 18
|
||||
DefaultItemHeight = 16
|
||||
PopupMenu = FilesPopupMenu
|
||||
ReadOnly = True
|
||||
RightClickSelect = True
|
||||
@ -200,9 +217,9 @@ inherited PackageEditorForm: TPackageEditorForm
|
||||
AnchorSideLeft.Control = ItemsPanel
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 23
|
||||
Height = 4
|
||||
Top = 0
|
||||
Width = 23
|
||||
Width = 4
|
||||
AllowAllUp = True
|
||||
AutoSize = True
|
||||
GroupIndex = 1
|
||||
@ -215,10 +232,10 @@ inherited PackageEditorForm: TPackageEditorForm
|
||||
AnchorSideLeft.Control = DirectoryHierarchySpeedButton
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 23
|
||||
Height = 23
|
||||
Left = 4
|
||||
Height = 4
|
||||
Top = 0
|
||||
Width = 23
|
||||
Width = 4
|
||||
AllowAllUp = True
|
||||
AutoSize = True
|
||||
GroupIndex = 2
|
||||
@ -232,10 +249,10 @@ inherited PackageEditorForm: TPackageEditorForm
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = ItemsPanel
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 46
|
||||
Height = 23
|
||||
Left = 8
|
||||
Height = 24
|
||||
Top = 0
|
||||
Width = 508
|
||||
Width = 546
|
||||
ButtonWidth = 23
|
||||
NumGlyphs = 0
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
|
@ -141,6 +141,7 @@ type
|
||||
|
||||
TPackageEditorForm = class(TBasePackageEditor)
|
||||
DirectoryHierarchySpeedButton: TSpeedButton;
|
||||
DisableI18NForLFMCheckBox: TCheckBox;
|
||||
FilterEdit: TTreeFilterEdit;
|
||||
ItemsPanel: TPanel;
|
||||
SortAlphabeticallySpeedButton: TSpeedButton;
|
||||
@ -189,6 +190,7 @@ type
|
||||
procedure CompileCleanClick(Sender: TObject);
|
||||
procedure CreateMakefileClick(Sender: TObject);
|
||||
procedure DirectoryHierarchySpeedButtonClick(Sender: TObject);
|
||||
procedure DisableI18NForLFMCheckBoxChange(Sender: TObject);
|
||||
procedure EditVirtualUnitMenuItemClick(Sender: TObject);
|
||||
procedure ExpandDirectoryMenuItemClick(Sender: TObject);
|
||||
procedure FilesPopupMenuPopup(Sender: TObject);
|
||||
@ -1418,6 +1420,20 @@ begin
|
||||
ShowDirectoryHierarchy:=DirectoryHierarchySpeedButton.Down;
|
||||
end;
|
||||
|
||||
procedure TPackageEditorForm.DisableI18NForLFMCheckBoxChange(Sender: TObject);
|
||||
var
|
||||
CurFile: TPkgFile;
|
||||
Removed: boolean;
|
||||
begin
|
||||
if LazPackage=nil then exit;
|
||||
CurFile:=GetCurrentFile(Removed);
|
||||
if (CurFile=nil) then exit;
|
||||
if CurFile.DisableI18NForLFM=DisableI18NForLFMCheckBox.Checked then exit;
|
||||
CurFile.DisableI18NForLFM:=DisableI18NForLFMCheckBox.Checked;
|
||||
if not Removed then
|
||||
LazPackage.Modified:=true;
|
||||
end;
|
||||
|
||||
procedure TPackageEditorForm.SetLazPackage(const AValue: TLazPackage);
|
||||
begin
|
||||
if FLazPackage=AValue then exit;
|
||||
@ -1431,8 +1447,6 @@ begin
|
||||
FLazPackage.Editor:=Self;
|
||||
// update components
|
||||
UpdateAll(true);
|
||||
// show files
|
||||
// FFilesNode.Expanded:=true;
|
||||
end;
|
||||
|
||||
procedure TPackageEditorForm.SetupComponents;
|
||||
@ -1514,6 +1528,9 @@ begin
|
||||
AddToUsesPkgSectionCheckBox.Caption:=lisPkgMangUseUnit;
|
||||
AddToUsesPkgSectionCheckBox.Hint:=lisPkgMangAddUnitToUsesClauseOfPackageDisableThisOnlyForUnit;
|
||||
|
||||
DisableI18NForLFMCheckBox.Caption:=lisPckDisableI18NOfLfm;
|
||||
DisableI18NForLFMCheckBox.Hint:=lisPckWhenTheFormIsSavedTheIDECanStoreAllTTranslateString;
|
||||
|
||||
UseMinVersionCheckBox.Caption:=lisPckEditMinimumVersion;
|
||||
UseMaxVersionCheckBox.Caption:=lisPckEditMaximumVersion;
|
||||
ApplyDependencyButton.Caption:=lisPckEditApplyChanges;
|
||||
@ -1748,6 +1765,8 @@ var
|
||||
FileCount: integer;
|
||||
HasRegisterProcCount: integer;
|
||||
AddToUsesPkgSectionCount: integer;
|
||||
HasLFM: Boolean;
|
||||
CurFilename: String;
|
||||
begin
|
||||
if LazPackage=nil then exit;
|
||||
FPlugins.Clear;
|
||||
@ -1757,6 +1776,13 @@ begin
|
||||
Dependency:=GetCurrentDependency(Removed);
|
||||
CurNode:=FilesTreeView.Selected;
|
||||
IsDir:=IsDirectoryNode(CurNode) or (CurNode=FFilesNode);
|
||||
CurFilename:='';
|
||||
HasLFM:=false;
|
||||
if (CurFile<>nil) and (CurFile.FileType in PkgFileRealUnitTypes) then begin
|
||||
CurFilename:=CurFile.GetFullFilename;
|
||||
HasLFM:=FilenameIsAbsolute(CurFilename)
|
||||
and FileExistsCached(ChangeFileExt(CurFilename,'.lfm'));
|
||||
end;
|
||||
|
||||
// make components visible
|
||||
UseMinVersionCheckBox.Visible:=Dependency<>nil;
|
||||
@ -1768,6 +1794,8 @@ begin
|
||||
CallRegisterProcCheckBox.Visible:=CurFile<>nil;
|
||||
AddToUsesPkgSectionCheckBox.Visible:=CurFile<>nil;
|
||||
RegisteredPluginsGroupBox.Visible:=CurFile<>nil;
|
||||
DisableI18NForLFMCheckBox.Visible:=HasLFM and LazPackage.EnableI18N
|
||||
and LazPackage.EnableI18NForLFM;
|
||||
|
||||
FDirSummaryLabel.Visible:=IsDir;
|
||||
|
||||
@ -1782,6 +1810,8 @@ begin
|
||||
or (CurFile.FileType=pftMainUnit);
|
||||
AddToUsesPkgSectionCheckBox.Enabled:=(not LazPackage.ReadOnly)
|
||||
and (CurFile.FileType in [pftUnit,pftVirtualUnit]);
|
||||
DisableI18NForLFMCheckBox.Checked:=CurFile.DisableI18NForLFM;
|
||||
DisableI18NForLFMCheckBox.Enabled:=not LazPackage.ReadOnly;
|
||||
// fetch all registered plugins
|
||||
CurListIndex:=0;
|
||||
RegCompCnt:=CurFile.ComponentCount;
|
||||
|
Loading…
Reference in New Issue
Block a user