2006-01-07 19:56:40 +00:00
|
|
|
{: Encapsulates the settings.
|
|
|
|
|
|
|
|
Last changed: $Date$
|
|
|
|
Revision: $Rev$
|
|
|
|
Author: $Author$
|
|
|
|
}
|
|
|
|
unit UnSwSettings;
|
|
|
|
|
|
|
|
interface
|
|
|
|
uses
|
2006-01-13 20:34:45 +00:00
|
|
|
Classes,
|
2006-01-07 19:56:40 +00:00
|
|
|
Graphics,
|
|
|
|
Registry;
|
|
|
|
|
|
|
|
type
|
|
|
|
TUnSwBaseSettings = class(TObject)
|
|
|
|
protected
|
|
|
|
procedure Load(const ARegistry: TRegistry); virtual; abstract;
|
|
|
|
procedure Save(const ARegistry: TRegistry); virtual; abstract;
|
|
|
|
|
|
|
|
function GetKeyName(const AName: String): String; virtual;
|
|
|
|
|
|
|
|
procedure ReadBoolDef(const ARegistry: TRegistry; var AValue: Boolean; const AName: String);
|
|
|
|
procedure ReadIntegerDef(const ARegistry: TRegistry; var AValue: Integer; const AName: String);
|
|
|
|
procedure ReadColorDef(const ARegistry: TRegistry; var AValue: TColor; const AName: String);
|
|
|
|
|
|
|
|
procedure WriteBool(const ARegistry: TRegistry; const AValue: Boolean; const AName: String);
|
|
|
|
procedure WriteInteger(const ARegistry: TRegistry; const AValue: Integer; const AName: String);
|
|
|
|
procedure WriteColor(const ARegistry: TRegistry; const AValue: TColor; const AName: String);
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-13 20:34:45 +00:00
|
|
|
TUnSwDialogSort = (dsName, dsType);
|
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
TUnSwDialogSettings = class(TUnSwBaseSettings)
|
|
|
|
private
|
|
|
|
FHeight: Integer;
|
|
|
|
FIncludeDataModules: Boolean;
|
|
|
|
FIncludeForms: Boolean;
|
|
|
|
FIncludeProjectSource: Boolean;
|
|
|
|
FIncludeUnits: Boolean;
|
2006-01-13 20:34:45 +00:00
|
|
|
FMRUList: TStrings;
|
2006-01-07 19:56:40 +00:00
|
|
|
FPrefix: String;
|
2006-01-13 20:34:45 +00:00
|
|
|
FSort: TUnSwDialogSort;
|
2006-01-07 19:56:40 +00:00
|
|
|
FWidth: Integer;
|
|
|
|
protected
|
|
|
|
function GetKeyName(const AName: String): String; override;
|
|
|
|
procedure Load(const ARegistry: TRegistry); override;
|
|
|
|
procedure Save(const ARegistry: TRegistry); override;
|
|
|
|
public
|
|
|
|
constructor Create(const APrefix: String);
|
2006-01-13 20:34:45 +00:00
|
|
|
destructor Destroy(); override;
|
2006-01-07 19:56:40 +00:00
|
|
|
|
|
|
|
property Height: Integer read FHeight write FHeight;
|
|
|
|
property IncludeDataModules: Boolean read FIncludeDataModules write FIncludeDataModules;
|
|
|
|
property IncludeForms: Boolean read FIncludeForms write FIncludeForms;
|
|
|
|
property IncludeProjectSource: Boolean read FIncludeProjectSource write FIncludeProjectSource;
|
|
|
|
property IncludeUnits: Boolean read FIncludeUnits write FIncludeUnits;
|
2006-01-13 20:34:45 +00:00
|
|
|
property MRUList: TStrings read FMRUList write FMRUList;
|
|
|
|
property Sort: TUnSwDialogSort read FSort write FSort;
|
2006-01-07 19:56:40 +00:00
|
|
|
property Width: Integer read FWidth write FWidth;
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
TUnSwColorSettings = class(TUnSwBaseSettings)
|
|
|
|
private
|
|
|
|
FDataModules: TColor;
|
|
|
|
FEnabled: Boolean;
|
|
|
|
FForms: TColor;
|
|
|
|
FProjectSource: TColor;
|
|
|
|
FUnits: TColor;
|
|
|
|
protected
|
|
|
|
procedure Load(const ARegistry: TRegistry); override;
|
|
|
|
procedure Save(const ARegistry: TRegistry); override;
|
|
|
|
public
|
|
|
|
property DataModules: TColor read FDataModules write FDataModules;
|
|
|
|
property Enabled: Boolean read FEnabled write FEnabled;
|
|
|
|
property Forms: TColor read FForms write FForms;
|
|
|
|
property ProjectSource: TColor read FProjectSource write FProjectSource;
|
|
|
|
property Units: TColor read FUnits write FUnits;
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
|
|
|
TUnSwFilterSettings = class(TUnSwBaseSettings)
|
|
|
|
private
|
|
|
|
FAllowEmptyResults: Boolean;
|
|
|
|
protected
|
|
|
|
procedure Load(const ARegistry: TRegistry); override;
|
|
|
|
procedure Save(const ARegistry: TRegistry); override;
|
|
|
|
public
|
|
|
|
property AllowEmptyResult: Boolean read FAllowEmptyResults write FAllowEmptyResults;
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
TUnSwSettings = class(TObject)
|
|
|
|
private
|
|
|
|
FColors: TUnSwColorSettings;
|
2007-02-09 13:58:37 +00:00
|
|
|
FFilter: TUnSwFilterSettings;
|
2006-01-07 19:56:40 +00:00
|
|
|
FFormsDialog: TUnSwDialogSettings;
|
|
|
|
FUnitsDialog: TUnSwDialogSettings;
|
|
|
|
|
|
|
|
FRegistryKey: String;
|
|
|
|
protected
|
|
|
|
procedure Load();
|
|
|
|
public
|
|
|
|
constructor Create();
|
|
|
|
destructor Destroy(); override;
|
|
|
|
|
2006-01-15 00:22:09 +00:00
|
|
|
procedure ResetDefaults(const AColorsOnly: Boolean = False);
|
2006-01-07 19:56:40 +00:00
|
|
|
procedure Save();
|
|
|
|
|
|
|
|
property Colors: TUnSwColorSettings read FColors write FColors;
|
2007-02-09 13:58:37 +00:00
|
|
|
property Filter: TUnSwFilterSettings read FFilter write FFilter;
|
2006-01-07 19:56:40 +00:00
|
|
|
property FormsDialog: TUnSwDialogSettings read FFormsDialog write FFormsDialog;
|
|
|
|
property UnitsDialog: TUnSwDialogSettings read FUnitsDialog write FUnitsDialog;
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
function Settings(): TUnSwSettings;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
implementation
|
|
|
|
uses
|
|
|
|
SysUtils,
|
|
|
|
ToolsAPI,
|
|
|
|
Windows;
|
|
|
|
|
|
|
|
var
|
|
|
|
GSettings: TUnSwSettings;
|
|
|
|
|
|
|
|
|
|
|
|
function Settings(): TUnSwSettings;
|
|
|
|
begin
|
|
|
|
if not Assigned(GSettings) then
|
|
|
|
GSettings := TUnSwSettings.Create();
|
|
|
|
|
|
|
|
Result := GSettings;
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
{ TUnSwBaseSettings }
|
|
|
|
function TUnSwBaseSettings.GetKeyName(const AName: String): String;
|
|
|
|
begin
|
|
|
|
Result := AName;
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
procedure TUnSwBaseSettings.ReadBoolDef(const ARegistry: TRegistry;
|
|
|
|
var AValue: Boolean;
|
|
|
|
const AName: String);
|
|
|
|
begin
|
|
|
|
if ARegistry.ValueExists(GetKeyName(AName)) then
|
|
|
|
AValue := ARegistry.ReadBool(GetKeyName(AName));
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
procedure TUnSwBaseSettings.ReadColorDef(const ARegistry: TRegistry;
|
|
|
|
var AValue: TColor;
|
|
|
|
const AName: String);
|
|
|
|
begin
|
|
|
|
if ARegistry.ValueExists(GetKeyName(AName)) then
|
|
|
|
AValue := TColor(ARegistry.ReadInteger(GetKeyName(AName)));
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
procedure TUnSwBaseSettings.ReadIntegerDef(const ARegistry: TRegistry;
|
|
|
|
var AValue: Integer;
|
|
|
|
const AName: String);
|
|
|
|
begin
|
|
|
|
if ARegistry.ValueExists(GetKeyName(AName)) then
|
|
|
|
AValue := ARegistry.ReadInteger(GetKeyName(AName));
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TUnSwBaseSettings.WriteBool(const ARegistry: TRegistry;
|
|
|
|
const AValue: Boolean;
|
|
|
|
const AName: String);
|
|
|
|
begin
|
|
|
|
ARegistry.WriteBool(GetKeyName(AName), AValue);
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
procedure TUnSwBaseSettings.WriteColor(const ARegistry: TRegistry;
|
|
|
|
const AValue: TColor;
|
|
|
|
const AName: String);
|
|
|
|
begin
|
|
|
|
WriteInteger(ARegistry, Integer(AValue), AName);
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
procedure TUnSwBaseSettings.WriteInteger(const ARegistry: TRegistry;
|
|
|
|
const AValue: Integer;
|
|
|
|
const AName: String);
|
|
|
|
begin
|
|
|
|
ARegistry.WriteInteger(GetKeyName(AName), AValue);
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
{ TUnSwDialogSettings }
|
|
|
|
constructor TUnSwDialogSettings.Create(const APrefix: String);
|
|
|
|
begin
|
|
|
|
inherited Create();
|
|
|
|
|
2006-01-13 20:34:45 +00:00
|
|
|
FMRUList := TStringList.Create();
|
|
|
|
FPrefix := APrefix;
|
|
|
|
|
|
|
|
TStringList(FMRUList).CaseSensitive := False
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-13 20:34:45 +00:00
|
|
|
destructor TUnSwDialogSettings.Destroy();
|
|
|
|
begin
|
|
|
|
FreeAndNil(FMRUList);
|
|
|
|
|
|
|
|
inherited;
|
2006-01-07 19:56:40 +00:00
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TUnSwDialogSettings.GetKeyName(const AName: String): String;
|
|
|
|
begin
|
|
|
|
Result := FPrefix + AName;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TUnSwDialogSettings.Load(const ARegistry: TRegistry);
|
2006-01-13 20:34:45 +00:00
|
|
|
var
|
2006-01-15 00:22:09 +00:00
|
|
|
iSort: Integer;
|
2006-01-13 20:34:45 +00:00
|
|
|
sMRU: String;
|
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
begin
|
|
|
|
// Conversion v0.1 -> v0.2
|
|
|
|
if ARegistry.ValueExists('IncludeDataModules') then
|
|
|
|
begin
|
|
|
|
ARegistry.RenameValue('IncludeDataModules', 'UnitsIncludeDataModules');
|
|
|
|
ARegistry.RenameValue('IncludeForms', 'UnitsIncludeForms');
|
|
|
|
ARegistry.RenameValue('IncludeProjectSource', 'UnitsIncludeProjectSource');
|
|
|
|
|
|
|
|
ARegistry.RenameValue('FormsDialogHeight', 'FormsHeight');
|
|
|
|
ARegistry.RenameValue('FormsDialogWidth', 'FormsWidth');
|
|
|
|
|
|
|
|
ARegistry.RenameValue('UnitsDialogHeight', 'UnitsHeight');
|
|
|
|
ARegistry.RenameValue('UnitsDialogWidth', 'UnitsWidth');
|
|
|
|
end;
|
|
|
|
|
|
|
|
ReadBoolDef(ARegistry, FIncludeDataModules, 'IncludeDataModules');
|
|
|
|
ReadBoolDef(ARegistry, FIncludeForms, 'IncludeForms');
|
|
|
|
ReadBoolDef(ARegistry, FIncludeProjectSource, 'IncludeProjectSource');
|
|
|
|
ReadBoolDef(ARegistry, FIncludeUnits, 'IncludeUnits');
|
|
|
|
|
|
|
|
ReadIntegerDef(ARegistry, FWidth, 'Width');
|
|
|
|
ReadIntegerDef(ARegistry, FHeight, 'Height');
|
2006-01-13 20:34:45 +00:00
|
|
|
|
2006-01-15 00:22:09 +00:00
|
|
|
iSort := Integer(FSort);
|
2006-01-13 20:34:45 +00:00
|
|
|
ReadIntegerDef(ARegistry, iSort, 'Sort');
|
2006-01-15 00:22:09 +00:00
|
|
|
FSort := TUnSwDialogSort(iSort);
|
2006-01-13 20:34:45 +00:00
|
|
|
|
2006-01-15 00:22:09 +00:00
|
|
|
if ARegistry.ValueExists(GetKeyName('MRU')) then
|
2006-01-13 20:34:45 +00:00
|
|
|
begin
|
2006-01-15 00:22:09 +00:00
|
|
|
SetLength(sMRU, ARegistry.GetDataSize(GetKeyName('MRU')));
|
2006-01-13 20:34:45 +00:00
|
|
|
if Length(sMRU) > 0 then
|
|
|
|
begin
|
2006-01-15 00:22:09 +00:00
|
|
|
ARegistry.ReadBinaryData(GetKeyName('MRU'), PChar(sMRU)^, Length(sMRU));
|
|
|
|
FMRUList.Text := Trim(sMRU);
|
2006-01-13 20:34:45 +00:00
|
|
|
end;
|
|
|
|
end;
|
2006-01-07 19:56:40 +00:00
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
procedure TUnSwDialogSettings.Save(const ARegistry: TRegistry);
|
2006-01-13 20:34:45 +00:00
|
|
|
var
|
|
|
|
sMRU: String;
|
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
begin
|
|
|
|
WriteBool(ARegistry, FIncludeDataModules, 'IncludeDataModules');
|
|
|
|
WriteBool(ARegistry, FIncludeForms, 'IncludeForms');
|
|
|
|
WriteBool(ARegistry, FIncludeProjectSource, 'IncludeProjectSource');
|
|
|
|
WriteBool(ARegistry, FIncludeUnits, 'IncludeUnits');
|
|
|
|
|
2006-01-13 20:34:45 +00:00
|
|
|
WriteInteger(ARegistry, FWidth, 'Width');
|
|
|
|
WriteInteger(ARegistry, FHeight, 'Height');
|
|
|
|
|
|
|
|
WriteInteger(ARegistry, Integer(FSort), 'Sort');
|
|
|
|
|
|
|
|
if FMRUList.Count > 0 then
|
|
|
|
begin
|
|
|
|
sMRU := FMRUList.Text;
|
2006-01-15 00:22:09 +00:00
|
|
|
ARegistry.WriteBinaryData(GetKeyName('MRU'), PChar(sMRU)^, Length(sMRU));
|
2006-01-13 20:34:45 +00:00
|
|
|
end else
|
2006-01-15 00:22:09 +00:00
|
|
|
ARegistry.DeleteValue(GetKeyName('MRU'));
|
2006-01-07 19:56:40 +00:00
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
{ TUnSwColorSettings }
|
|
|
|
procedure TUnSwColorSettings.Load(const ARegistry: TRegistry);
|
|
|
|
begin
|
|
|
|
ReadBoolDef(ARegistry, FEnabled, 'ColorEnabled');
|
|
|
|
ReadColorDef(ARegistry, FDataModules, 'ColorDataModules');
|
|
|
|
ReadColorDef(ARegistry, FForms, 'ColorForms');
|
|
|
|
ReadColorDef(ARegistry, FProjectSource, 'ColorProjectSource');
|
|
|
|
ReadColorDef(ARegistry, FUnits, 'ColorUnits');
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
procedure TUnSwColorSettings.Save(const ARegistry: TRegistry);
|
|
|
|
begin
|
|
|
|
WriteBool(ARegistry, FEnabled, 'ColorEnabled');
|
|
|
|
WriteColor(ARegistry, FDataModules, 'ColorDataModules');
|
|
|
|
WriteColor(ARegistry, FForms, 'ColorForms');
|
|
|
|
WriteColor(ARegistry, FProjectSource, 'ColorProjectSource');
|
|
|
|
WriteColor(ARegistry, FUnits, 'ColorUnits');
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
{ TUnSwFilterSettings }
|
|
|
|
procedure TUnSwFilterSettings.Load(const ARegistry: TRegistry);
|
|
|
|
begin
|
|
|
|
ReadBoolDef(ARegistry, FAllowEmptyResults, 'AllowEmptyResults');
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TUnSwFilterSettings.Save(const ARegistry: TRegistry);
|
|
|
|
begin
|
|
|
|
WriteBool(ARegistry, FAllowEmptyResults, 'AllowEmptyResults');
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
{ TUnSwSettings }
|
|
|
|
constructor TUnSwSettings.Create();
|
|
|
|
begin
|
|
|
|
inherited Create();
|
|
|
|
|
|
|
|
FRegistryKey := (BorlandIDEServices as IOTAServices).GetBaseRegistryKey() +
|
|
|
|
'\UnitSwitcher';
|
|
|
|
|
|
|
|
FColors := TUnSwColorSettings.Create();
|
2007-02-09 13:58:37 +00:00
|
|
|
FFilter := TUnSwFilterSettings.Create();
|
2006-01-07 19:56:40 +00:00
|
|
|
FFormsDialog := TUnSwDialogSettings.Create('Forms');
|
|
|
|
FUnitsDialog := TUnSwDialogSettings.Create('Units');
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
ResetDefaults();
|
2006-01-15 00:22:09 +00:00
|
|
|
Load();
|
2006-01-07 19:56:40 +00:00
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
destructor TUnSwSettings.Destroy();
|
|
|
|
begin
|
|
|
|
FreeAndNil(FUnitsDialog);
|
|
|
|
FreeAndNil(FFormsDialog);
|
2007-02-09 13:58:37 +00:00
|
|
|
FreeAndNil(FFilter);
|
2006-01-07 19:56:40 +00:00
|
|
|
FreeAndNil(FColors);
|
|
|
|
|
|
|
|
inherited;
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
2006-01-15 00:22:09 +00:00
|
|
|
procedure TUnSwSettings.ResetDefaults(const AColorsOnly: Boolean);
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
procedure ResetDialog(const ADialog: TUnSwDialogSettings);
|
|
|
|
begin
|
|
|
|
ADialog.IncludeDataModules := True;
|
|
|
|
ADialog.IncludeForms := True;
|
|
|
|
ADialog.IncludeProjectSource := True;
|
|
|
|
ADialog.IncludeUnits := True;
|
2006-01-13 20:34:45 +00:00
|
|
|
ADialog.Sort := dsName;
|
2006-01-07 19:56:40 +00:00
|
|
|
ADialog.Width := 300;
|
|
|
|
ADialog.Height := 425;
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
begin
|
2006-01-15 00:22:09 +00:00
|
|
|
if not AColorsOnly then
|
|
|
|
begin
|
|
|
|
ResetDialog(FFormsDialog);
|
|
|
|
ResetDialog(FUnitsDialog);
|
|
|
|
end;
|
2006-01-07 19:56:40 +00:00
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
FColors.Enabled := True;
|
|
|
|
FColors.DataModules := RGB( 35, 120, 35); // Green
|
|
|
|
FColors.Forms := RGB( 50, 70, 120); // Blue
|
|
|
|
FColors.ProjectSource := RGB(120, 120, 35); // Yellow
|
|
|
|
FColors.Units := RGB(150, 35, 35); // Red
|
|
|
|
|
|
|
|
FFilter.AllowEmptyResult := False;
|
2006-01-07 19:56:40 +00:00
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TUnSwSettings.Load();
|
|
|
|
var
|
|
|
|
ideRegistry: TRegistry;
|
|
|
|
|
|
|
|
begin
|
|
|
|
ideRegistry := TRegistry.Create();
|
|
|
|
with ideRegistry do
|
|
|
|
try
|
|
|
|
RootKey := HKEY_CURRENT_USER;
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
if OpenKey(FRegistryKey, False) then
|
|
|
|
begin
|
|
|
|
FColors.Load(ideRegistry);
|
2007-02-09 13:58:37 +00:00
|
|
|
FFilter.Load(ideRegistry);
|
2006-01-07 19:56:40 +00:00
|
|
|
FFormsDialog.Load(ideRegistry);
|
|
|
|
FUnitsDialog.Load(ideRegistry);
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
CloseKey();
|
|
|
|
end;
|
|
|
|
finally
|
|
|
|
Free();
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
procedure TUnSwSettings.Save();
|
|
|
|
var
|
|
|
|
ideRegistry: TRegistry;
|
|
|
|
|
|
|
|
begin
|
|
|
|
ideRegistry := TRegistry.Create();
|
|
|
|
with ideRegistry do
|
|
|
|
try
|
|
|
|
RootKey := HKEY_CURRENT_USER;
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
if OpenKey(FRegistryKey, True) then
|
|
|
|
begin
|
|
|
|
FColors.Save(ideRegistry);
|
2007-02-09 13:58:37 +00:00
|
|
|
FFilter.Save(ideRegistry);
|
2006-01-07 19:56:40 +00:00
|
|
|
FFormsDialog.Save(ideRegistry);
|
|
|
|
FUnitsDialog.Save(ideRegistry);
|
2007-02-09 13:58:37 +00:00
|
|
|
|
2006-01-07 19:56:40 +00:00
|
|
|
CloseKey();
|
|
|
|
end;
|
|
|
|
finally
|
|
|
|
Free();
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
initialization
|
|
|
|
finalization
|
|
|
|
FreeAndNil(GSettings);
|
|
|
|
|
|
|
|
end.
|