OPK: Use the new Version to read RemoteRepository also from old configuration.

git-svn-id: trunk@53455 -
This commit is contained in:
juha 2016-11-25 13:18:43 +00:00
parent 45004c171a
commit ee23326382
2 changed files with 9 additions and 4 deletions

View File

@ -30,7 +30,7 @@ uses
Classes, SysUtils, LazIDEIntf, Laz2_XMLCfg, LazFileUtils; Classes, SysUtils, LazIDEIntf, Laz2_XMLCfg, LazFileUtils;
const const
Version = 1; OpkVersion = 1;
type type
{ TOptions } { TOptions }
@ -46,6 +46,7 @@ type
private private
FProxySettings: TProxySettings; FProxySettings: TProxySettings;
FXML: TXMLConfig; FXML: TXMLConfig;
FVersion: Integer;
FRemoteRepository: String; FRemoteRepository: String;
FForceDownloadAndExtract: Boolean; FForceDownloadAndExtract: Boolean;
FDeleteZipAfterInstall: Boolean; FDeleteZipAfterInstall: Boolean;
@ -113,7 +114,11 @@ end;
procedure TOptions.Load; procedure TOptions.Load;
begin begin
FRemoteRepository := FXML.GetValue('General/RemoteRepository/Value', ''); FVersion := FXML.GetValue('Version/Value', 0);
if FVersion = 0 then
FRemoteRepository := FXML.GetValue('RemoteRepository/Value', '')
else
FRemoteRepository := FXML.GetValue('General/RemoteRepository/Value', '');
FForceDownloadAndExtract := FXML.GetValue('General/ForceDownloadAndExtract/Value', True); FForceDownloadAndExtract := FXML.GetValue('General/ForceDownloadAndExtract/Value', True);
FDeleteZipAfterInstall := FXML.GetValue('General/DeleteZipAfterInstall/Value', True); FDeleteZipAfterInstall := FXML.GetValue('General/DeleteZipAfterInstall/Value', True);
FLastDownloadDir := FXML.GetValue('General/LastDownloadDir/Value', ''); FLastDownloadDir := FXML.GetValue('General/LastDownloadDir/Value', '');
@ -133,7 +138,7 @@ end;
procedure TOptions.Save; procedure TOptions.Save;
begin begin
FXML.SetDeleteValue('Version/Value', Version, 0); FXML.SetDeleteValue('Version/Value', OpkVersion, 0);
FXML.SetDeleteValue('General/RemoteRepository/Value', FRemoteRepository, ''); FXML.SetDeleteValue('General/RemoteRepository/Value', FRemoteRepository, '');
FXML.SetDeleteValue('General/ForceDownloadAndExtract/Value', FForceDownloadAndExtract, True); FXML.SetDeleteValue('General/ForceDownloadAndExtract/Value', FForceDownloadAndExtract, True);
FXML.SetDeleteValue('General/DeleteZipAfterInstall/Value', FDeleteZipAfterInstall, True); FXML.SetDeleteValue('General/DeleteZipAfterInstall/Value', FDeleteZipAfterInstall, True);

View File

@ -47,7 +47,7 @@ object OptionsFrm: TOptionsFrm
Left = 8 Left = 8
Height = 25 Height = 25
Top = 8 Top = 8
Width = 100 Width = 162
Caption = 'Restore defaults' Caption = 'Restore defaults'
OnClick = bRestoreClick OnClick = bRestoreClick
TabOrder = 2 TabOrder = 2