mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-06 00:20:13 +02:00
Opkman: Preserve compatibility with older version(TPackageType/TLazPackageType).
git-svn-id: trunk@56503 -
This commit is contained in:
parent
e7e4c0547f
commit
a7bbd145e9
@ -82,6 +82,7 @@ type
|
|||||||
FVSTPackages: TVirtualStringTree;
|
FVSTPackages: TVirtualStringTree;
|
||||||
FVSTDetails: TVirtualStringTree;
|
FVSTDetails: TVirtualStringTree;
|
||||||
FRepository: TRepository;
|
FRepository: TRepository;
|
||||||
|
FSortDirection: TSortDirection;
|
||||||
FSerializablePackages: TSerializablePackages;
|
FSerializablePackages: TSerializablePackages;
|
||||||
procedure EnableDisableButtons(const AEnable: Boolean);
|
procedure EnableDisableButtons(const AEnable: Boolean);
|
||||||
procedure ShowHideControls(const AType: Integer);
|
procedure ShowHideControls(const AType: Integer);
|
||||||
@ -172,6 +173,7 @@ begin
|
|||||||
bCancel.Caption := rsCreateRepositoryFrm_bCancel_Caption;
|
bCancel.Caption := rsCreateRepositoryFrm_bCancel_Caption;
|
||||||
bCancel.Hint := rsCreateRepositoryFrm_bCancel_Hint;
|
bCancel.Hint := rsCreateRepositoryFrm_bCancel_Hint;
|
||||||
miRepDetails.Caption := rsCreateRepositoryFrm_miRepDetails_Caption;
|
miRepDetails.Caption := rsCreateRepositoryFrm_miRepDetails_Caption;
|
||||||
|
FSortDirection := sdAscending;
|
||||||
EnableDisableButtons(True);
|
EnableDisableButtons(True);
|
||||||
ShowHideControls(0);
|
ShowHideControls(0);
|
||||||
|
|
||||||
@ -398,7 +400,7 @@ begin
|
|||||||
if FSerializablePackages.AddPackageFromJSON(JSON) then
|
if FSerializablePackages.AddPackageFromJSON(JSON) then
|
||||||
begin
|
begin
|
||||||
JSON := '';
|
JSON := '';
|
||||||
SerializablePackages.Sort(stName, soAscendent);
|
FSerializablePackages.Sort(stName, soAscendent);
|
||||||
if FSerializablePackages.PackagesToJSON(JSON) then
|
if FSerializablePackages.PackagesToJSON(JSON) then
|
||||||
begin
|
begin
|
||||||
if SaveJSONToFile(ExtractFilePath(FRepository.FPath) + cRemoteJSONFile, JSON) then
|
if SaveJSONToFile(ExtractFilePath(FRepository.FPath) + cRemoteJSONFile, JSON) then
|
||||||
@ -440,7 +442,7 @@ begin
|
|||||||
if FSerializablePackages.AddPackageFromJSON(JSON) then
|
if FSerializablePackages.AddPackageFromJSON(JSON) then
|
||||||
begin
|
begin
|
||||||
JSON := '';
|
JSON := '';
|
||||||
SerializablePackages.Sort(stName, soAscendent);
|
FSerializablePackages.Sort(stName, soAscendent);
|
||||||
if FSerializablePackages.PackagesToJSON(JSON) then
|
if FSerializablePackages.PackagesToJSON(JSON) then
|
||||||
begin
|
begin
|
||||||
if SaveJSONToFile(ExtractFilePath(FRepository.FPath) + cRemoteJSONFile, JSON) then
|
if SaveJSONToFile(ExtractFilePath(FRepository.FPath) + cRemoteJSONFile, JSON) then
|
||||||
@ -472,6 +474,7 @@ begin
|
|||||||
AddNewPackage
|
AddNewPackage
|
||||||
else
|
else
|
||||||
AddExistingPackage(AddRepositoryPackageFrm.JSONFile, AddRepositoryPackageFrm.PackageFile);
|
AddExistingPackage(AddRepositoryPackageFrm.JSONFile, AddRepositoryPackageFrm.PackageFile);
|
||||||
|
FVSTPackages.SortTree(0, FSortDirection);
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
AddRepositoryPackageFrm.Free;
|
AddRepositoryPackageFrm.Free;
|
||||||
@ -822,6 +825,7 @@ begin
|
|||||||
SortDirection := opkman_VirtualTrees.sdAscending;
|
SortDirection := opkman_VirtualTrees.sdAscending;
|
||||||
end;
|
end;
|
||||||
SortTree(SortColumn, SortDirection, False);
|
SortTree(SortColumn, SortDirection, False);
|
||||||
|
FSortDirection := SortDirection;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -876,6 +876,15 @@ begin
|
|||||||
LazarusPkg.FPCCompatibility := LazarusPkgsObj.Get('FPCCompatibility');
|
LazarusPkg.FPCCompatibility := LazarusPkgsObj.Get('FPCCompatibility');
|
||||||
LazarusPkg.SupportedWidgetSet := LazarusPkgsObj.Get('SupportedWidgetSet');
|
LazarusPkg.SupportedWidgetSet := LazarusPkgsObj.Get('SupportedWidgetSet');
|
||||||
LazarusPkg.PackageType := TLazPackageType(LazarusPkgsObj.Get('PackageType'));
|
LazarusPkg.PackageType := TLazPackageType(LazarusPkgsObj.Get('PackageType'));
|
||||||
|
{the package type wasn't changed in the packagelist.json to preserve compatibility with older versions, we need to convert from old to new
|
||||||
|
Old --> TPackageType = (ptRunAndDesignTime, ptDesignTime, ptRunTime, ptRunTimeOnly);
|
||||||
|
New --> TLazPackageType = (lptRunTime, lptDesignTime, lptRunAndDesignTime, lptRunTimeOnly);}
|
||||||
|
case Ord(LazarusPkg.PackageType) of
|
||||||
|
0: LazarusPkg.PackageType := lptRunAndDesignTime;
|
||||||
|
1: LazarusPkg.PackageType := lptDesignTime;
|
||||||
|
2: LazarusPkg.PackageType := lptRunTime;
|
||||||
|
3: LazarusPkg.PackageType := lptRunTimeOnly;
|
||||||
|
end;
|
||||||
LazarusPkg.DependenciesAsString := LazarusPkgsObj.Get('DependenciesAsString');
|
LazarusPkg.DependenciesAsString := LazarusPkgsObj.Get('DependenciesAsString');
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -970,6 +979,15 @@ begin
|
|||||||
LazarusPkgObj.Add('LazCompatibility', LazarusPkg.LazCompatibility);
|
LazarusPkgObj.Add('LazCompatibility', LazarusPkg.LazCompatibility);
|
||||||
LazarusPkgObj.Add('FPCCompatibility', LazarusPkg.FPCCompatibility);
|
LazarusPkgObj.Add('FPCCompatibility', LazarusPkg.FPCCompatibility);
|
||||||
LazarusPkgObj.Add('SupportedWidgetSet', LazarusPkg.SupportedWidgetSet);
|
LazarusPkgObj.Add('SupportedWidgetSet', LazarusPkg.SupportedWidgetSet);
|
||||||
|
{the package type wasn't changed in the packagelist.json to preserve compatibility with older versions, we need to convert from new to old
|
||||||
|
New --> TLazPackageType = (lptRunTime, lptDesignTime, lptRunAndDesignTime, lptRunTimeOnly);
|
||||||
|
Old --> TPackageType = (ptRunAndDesignTime, ptDesignTime, ptRunTime, ptRunTimeOnly);}
|
||||||
|
case Ord(LazarusPkg.PackageType) of
|
||||||
|
0: LazarusPkg.PackageType := lptRunAndDesignTime;
|
||||||
|
1: LazarusPkg.PackageType := lptDesignTime;
|
||||||
|
2: LazarusPkg.PackageType := lptRunTime;
|
||||||
|
3: LazarusPkg.PackageType := lptRunTimeOnly;
|
||||||
|
end;
|
||||||
LazarusPkgObj.Add('PackageType', Ord(LazarusPkg.PackageType));
|
LazarusPkgObj.Add('PackageType', Ord(LazarusPkg.PackageType));
|
||||||
LazarusPkgObj.Add('DependenciesAsString', LazarusPkg.DependenciesAsString);
|
LazarusPkgObj.Add('DependenciesAsString', LazarusPkg.DependenciesAsString);
|
||||||
ALazarusPkgsArr.Add(LazarusPkgObj);
|
ALazarusPkgsArr.Add(LazarusPkgObj);
|
||||||
|
Loading…
Reference in New Issue
Block a user