mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-26 23:03:48 +02:00
IDEIntf: TLazPackageFile.CustomOptions
git-svn-id: trunk@59920 -
This commit is contained in:
parent
92e510d650
commit
6f9f36001f
@ -60,6 +60,7 @@ type
|
||||
FDisableI18NForLFM: boolean;
|
||||
FFileType: TPkgFileType;
|
||||
FRemoved: boolean;
|
||||
FCustomOptions: TConfigStorage;
|
||||
protected
|
||||
function GetInUses: boolean; virtual; abstract;
|
||||
procedure SetInUses(AValue: boolean); virtual; abstract;
|
||||
@ -68,6 +69,7 @@ type
|
||||
procedure SetDisableI18NForLFM(AValue: boolean); virtual;
|
||||
procedure SetFileType(const AValue: TPkgFileType); virtual;
|
||||
public
|
||||
constructor Create; virtual;
|
||||
destructor Destroy; override;
|
||||
function GetOptionsInstanceOf(OptionsClass: TAbstractPackageFileIDEOptionsClass): TAbstractPackageFileIDEOptions;
|
||||
property LazPackage: TIDEPackage read GetIDEPackage;
|
||||
@ -75,6 +77,7 @@ type
|
||||
property DisableI18NForLFM: boolean read FDisableI18NForLFM write SetDisableI18NForLFM;
|
||||
property FileType: TPkgFileType read FFileType write SetFileType;
|
||||
property InUses: boolean read GetInUses write SetInUses; // added to uses section of package
|
||||
property CustomOptions: TConfigStorage read FCustomOptions;
|
||||
end;
|
||||
|
||||
{ PkgDependency flags }
|
||||
@ -843,6 +846,7 @@ end;
|
||||
destructor TLazPackageFile.Destroy;
|
||||
begin
|
||||
FIDEOptionsList.Free;
|
||||
FreeAndNil(FCustomOptions);
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
@ -864,6 +868,12 @@ begin
|
||||
FIDEOptionsList.Add(Result);
|
||||
end;
|
||||
|
||||
constructor TLazPackageFile.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
FCustomOptions:=TConfigMemStorage.Create('',false);
|
||||
end;
|
||||
|
||||
initialization
|
||||
PackageEditingInterface:=nil;
|
||||
|
||||
|
@ -1684,6 +1684,7 @@ procedure TPkgFile.LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string;
|
||||
var
|
||||
AFilename: String;
|
||||
CaseInsensitiveUnitName: String;
|
||||
Config: TXMLOptionsStorage;
|
||||
begin
|
||||
if FileVersion=1 then ;
|
||||
Clear;
|
||||
@ -1705,12 +1706,20 @@ begin
|
||||
end;
|
||||
FResourceBaseClass:=StrToComponentBaseClass(
|
||||
XMLConfig.GetValue(Path+'ResourceBaseClass/Value',''));
|
||||
|
||||
Config:=TXMLOptionsStorage.Create(XMLConfig);
|
||||
try
|
||||
TConfigMemStorage(CustomOptions).LoadFromConfig(Config,Path+'CustomOptions/');
|
||||
finally
|
||||
Config.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TPkgFile.SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string;
|
||||
UsePathDelim: TPathDelimSwitch);
|
||||
var
|
||||
TmpFilename: String;
|
||||
Config: TXMLOptionsStorage;
|
||||
begin
|
||||
TmpFilename:=Filename;
|
||||
FPackage.ShortenFilename(TmpFilename,true);
|
||||
@ -1727,6 +1736,13 @@ begin
|
||||
XMLConfig.SetDeleteValue(Path+'ResourceBaseClass/Value',
|
||||
PFComponentBaseClassNames[FResourceBaseClass],
|
||||
PFComponentBaseClassNames[pfcbcNone]);
|
||||
|
||||
Config:=TXMLOptionsStorage.Create(XMLConfig);
|
||||
try
|
||||
TConfigMemStorage(CustomOptions).SaveToConfig(Config,Path+'CustomOptions/');
|
||||
finally
|
||||
Config.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TPkgFile.ConsistencyCheck;
|
||||
|
Loading…
Reference in New Issue
Block a user