mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 16:40:54 +02:00
IDE: Improve exporting and importing desktops. By Ondrej Pokorny.
git-svn-id: trunk@49747 -
This commit is contained in:
parent
886b429940
commit
8546093cee
@ -15,11 +15,12 @@ object DesktopForm: TDesktopForm
|
||||
AnchorSideTop.Control = DesktopListBox
|
||||
AnchorSideRight.Control = DeleteBitBtn
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 234
|
||||
Height = 29
|
||||
Left = 253
|
||||
Height = 25
|
||||
Top = 14
|
||||
Width = 178
|
||||
Width = 159
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoSize = True
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Save current desktop'
|
||||
OnClick = SaveBitBtnClick
|
||||
@ -27,8 +28,8 @@ object DesktopForm: TDesktopForm
|
||||
end
|
||||
object ButtonPanel1: TButtonPanel
|
||||
Left = 6
|
||||
Height = 37
|
||||
Top = 298
|
||||
Height = 34
|
||||
Top = 301
|
||||
Width = 406
|
||||
OKButton.Name = 'OKButton'
|
||||
OKButton.Caption = 'Close and use selected desktop'
|
||||
@ -40,7 +41,7 @@ object DesktopForm: TDesktopForm
|
||||
CancelButton.Name = 'CancelButton'
|
||||
CancelButton.Caption = 'Close'
|
||||
CancelButton.DefaultCaption = False
|
||||
TabOrder = 7
|
||||
TabOrder = 8
|
||||
ShowButtons = [pbOK, pbCancel]
|
||||
end
|
||||
object DesktopListBox: TListBox
|
||||
@ -48,7 +49,7 @@ object DesktopForm: TDesktopForm
|
||||
Left = 11
|
||||
Height = 286
|
||||
Top = 8
|
||||
Width = 213
|
||||
Width = 232
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Right = 10
|
||||
ItemHeight = 0
|
||||
@ -59,7 +60,6 @@ object DesktopForm: TDesktopForm
|
||||
ScrollWidth = 211
|
||||
Style = lbOwnerDrawFixed
|
||||
TabOrder = 0
|
||||
TopIndex = -1
|
||||
end
|
||||
object DeleteBitBtn: TBitBtn
|
||||
AnchorSideLeft.Control = SetDebugDesktopBitBtn
|
||||
@ -67,11 +67,12 @@ object DesktopForm: TDesktopForm
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = SetDebugDesktopBitBtn
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 234
|
||||
Height = 29
|
||||
Top = 144
|
||||
Width = 178
|
||||
Left = 253
|
||||
Height = 25
|
||||
Top = 130
|
||||
Width = 159
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoSize = True
|
||||
BorderSpacing.Top = 4
|
||||
Caption = 'Delete'
|
||||
OnClick = DeleteBitBtnClick
|
||||
@ -81,10 +82,10 @@ object DesktopForm: TDesktopForm
|
||||
AnchorSideTop.Control = SelectedDesktopLabel
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 234
|
||||
Height = 29
|
||||
Top = 76
|
||||
Width = 178
|
||||
Left = 253
|
||||
Height = 25
|
||||
Top = 70
|
||||
Width = 159
|
||||
Anchors = [akTop, akRight]
|
||||
AutoSize = True
|
||||
BorderSpacing.Top = 6
|
||||
@ -96,10 +97,10 @@ object DesktopForm: TDesktopForm
|
||||
AnchorSideLeft.Control = SaveBitBtn
|
||||
AnchorSideTop.Control = SaveBitBtn
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 234
|
||||
Height = 17
|
||||
Top = 53
|
||||
Width = 121
|
||||
Left = 253
|
||||
Height = 15
|
||||
Top = 49
|
||||
Width = 92
|
||||
BorderSpacing.Top = 10
|
||||
Caption = 'Selected desktop:'
|
||||
ParentColor = False
|
||||
@ -110,11 +111,12 @@ object DesktopForm: TDesktopForm
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = SetDebugDesktopBitBtn
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 234
|
||||
Height = 29
|
||||
Top = 111
|
||||
Width = 178
|
||||
Left = 253
|
||||
Height = 25
|
||||
Top = 101
|
||||
Width = 159
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoSize = True
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Rename'
|
||||
OnClick = RenameBitBtnClick
|
||||
@ -124,13 +126,13 @@ object DesktopForm: TDesktopForm
|
||||
AnchorSideLeft.Control = DeleteBitBtn
|
||||
AnchorSideTop.Control = DeleteBitBtn
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = DeleteBitBtn
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 234
|
||||
Height = 29
|
||||
Top = 185
|
||||
Width = 178
|
||||
AnchorSideRight.Control = ExportAllBitBtn
|
||||
Left = 253
|
||||
Height = 25
|
||||
Top = 167
|
||||
Width = 121
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoSize = True
|
||||
BorderSpacing.Top = 12
|
||||
Caption = 'Export'
|
||||
OnClick = ExportBitBtnClick
|
||||
@ -140,16 +142,34 @@ object DesktopForm: TDesktopForm
|
||||
AnchorSideLeft.Control = ExportBitBtn
|
||||
AnchorSideTop.Control = ExportBitBtn
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = ExportBitBtn
|
||||
AnchorSideRight.Control = DeleteBitBtn
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 234
|
||||
Height = 29
|
||||
Top = 218
|
||||
Width = 178
|
||||
Left = 253
|
||||
Height = 25
|
||||
Top = 196
|
||||
Width = 159
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoSize = True
|
||||
BorderSpacing.Top = 4
|
||||
Caption = 'Import'
|
||||
OnClick = ImportBitBtnClick
|
||||
TabOrder = 7
|
||||
end
|
||||
object ExportAllBitBtn: TBitBtn
|
||||
AnchorSideLeft.Control = ExportBitBtn
|
||||
AnchorSideTop.Control = ExportBitBtn
|
||||
AnchorSideRight.Control = DeleteBitBtn
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = ExportBitBtn
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 374
|
||||
Height = 25
|
||||
Top = 167
|
||||
Width = 38
|
||||
Anchors = [akTop, akRight, akBottom]
|
||||
AutoSize = True
|
||||
Caption = 'all'
|
||||
OnClick = ExportAllBitBtnClick
|
||||
TabOrder = 6
|
||||
end
|
||||
end
|
||||
|
@ -18,6 +18,7 @@ type
|
||||
TDesktopForm = class(TForm)
|
||||
ExportBitBtn: TBitBtn;
|
||||
ButtonPanel1: TButtonPanel;
|
||||
ExportAllBitBtn: TBitBtn;
|
||||
ImportBitBtn: TBitBtn;
|
||||
RenameBitBtn: TBitBtn;
|
||||
SelectedDesktopLabel: TLabel;
|
||||
@ -31,6 +32,7 @@ type
|
||||
ARect: TRect; {%H-}State: TOwnerDrawState);
|
||||
procedure DesktopListBoxKeyPress(Sender: TObject; var Key: char);
|
||||
procedure DesktopListBoxSelectionChange(Sender: TObject; {%H-}User: boolean);
|
||||
procedure ExportAllBitBtnClick(Sender: TObject);
|
||||
procedure ExportBitBtnClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure ImportBitBtnClick(Sender: TObject);
|
||||
@ -38,7 +40,8 @@ type
|
||||
procedure SaveBitBtnClick(Sender: TObject);
|
||||
procedure SetDebugDesktopBitBtnClick(Sender: TObject);
|
||||
private
|
||||
procedure RefreshList(const SelectName: string = '');
|
||||
procedure RefreshList(SelectName: string = '');
|
||||
procedure ExportDesktops(const aDesktops: array of TDesktopOpt);
|
||||
end;
|
||||
|
||||
TShowDesktopItem = class(TMenuItem)
|
||||
@ -213,7 +216,7 @@ begin
|
||||
xShowOverwriteDlg := False;
|
||||
end else
|
||||
begin
|
||||
if not InputQuery(dlgSaveCurrentDesktop, dlgDesktopName, xDesktopName)
|
||||
if not InputQuery(dlgDesktopName, dlgSaveCurrentDesktopAs, xDesktopName)
|
||||
or (xDesktopName = '') // xDesktopName MUST NOT BE EMPTY !!!
|
||||
then
|
||||
Exit;
|
||||
@ -240,6 +243,7 @@ begin
|
||||
RenameBitBtn.Caption := lisRename;
|
||||
RenameBitBtn.LoadGlyphFromResourceName(HInstance, 'laz_edit');
|
||||
ExportBitBtn.Caption := lisExport;
|
||||
ExportAllBitBtn.Caption := lisExportAll;
|
||||
ImportBitBtn.Caption := lisImport;
|
||||
SetDebugDesktopBitBtn.Caption := dlgToggleSelectedDebugDesktop;
|
||||
SetDebugDesktopBitBtn.LoadGlyphFromResourceName(HInstance, 'menu_run');
|
||||
@ -247,10 +251,13 @@ begin
|
||||
ButtonPanel1.CancelButton.Caption := lisClose;
|
||||
end;
|
||||
|
||||
procedure TDesktopForm.RefreshList(const SelectName: string);
|
||||
procedure TDesktopForm.RefreshList(SelectName: string);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
if (SelectName='') and (DesktopListBox.ItemIndex>=0) then
|
||||
SelectName:=DesktopListBox.Items[DesktopListBox.ItemIndex];
|
||||
|
||||
DesktopListBox.Clear;
|
||||
// Saved desktops
|
||||
with EnvironmentOptions do
|
||||
@ -332,11 +339,8 @@ end;
|
||||
|
||||
procedure TDesktopForm.ExportBitBtnClick(Sender: TObject);
|
||||
var
|
||||
FXMLCfg: TRttiXMLConfig;
|
||||
FConfigStore: TXMLOptionsStorage;
|
||||
SaveDialog: TSaveDialog;
|
||||
xDesktopName, Filename: string;
|
||||
xDesktopID: Integer;
|
||||
xDesktopName: String;
|
||||
xDesktop: TDesktopOpt;
|
||||
begin
|
||||
if DesktopListBox.ItemIndex < 0 then
|
||||
Exit;
|
||||
@ -345,96 +349,149 @@ begin
|
||||
if xDesktopName = '' then
|
||||
Exit;
|
||||
|
||||
xDesktopID := EnvironmentOptions.Desktops.IndexOf(xDesktopName);
|
||||
if xDesktopID = -1 then
|
||||
xDesktop := EnvironmentOptions.Desktops.Find(xDesktopName);
|
||||
if xDesktop = nil then
|
||||
Exit;
|
||||
|
||||
SaveDialog := TSaveDialog.Create(nil);
|
||||
try
|
||||
try
|
||||
InputHistories.ApplyFileDialogSettings(SaveDialog);
|
||||
SaveDialog.Filter := dlgFilterXML +' (*.xml)|*.xml';
|
||||
SaveDialog.Options := SaveDialog.Options + [ofOverwritePrompt];
|
||||
if SaveDialog.Execute then
|
||||
ExportDesktops([xDesktop]);
|
||||
end;
|
||||
|
||||
procedure TDesktopForm.ExportDesktops(const aDesktops: array of TDesktopOpt);
|
||||
var
|
||||
xXMLCfg: TRttiXMLConfig;
|
||||
xConfigStore: TXMLOptionsStorage;
|
||||
xSaveDialog: TSaveDialog;
|
||||
xFileName: string;
|
||||
xCurPath: String;
|
||||
I: Integer;
|
||||
begin
|
||||
Filename := SaveDialog.Filename;
|
||||
if ExtractFileExt(Filename) = '' then
|
||||
Filename := Filename + '.xml';
|
||||
FXMLCfg := TRttiXMLConfig.CreateClean(Filename);
|
||||
if Length(aDesktops) = 0 then
|
||||
Exit;
|
||||
|
||||
xSaveDialog := TSaveDialog.Create(nil);
|
||||
try
|
||||
FConfigStore := TXMLOptionsStorage.Create(FXMLCfg);
|
||||
try
|
||||
EnvironmentOptions.Desktops.SaveToXML(FXMLCfg, FConfigStore, xDesktopID);
|
||||
FConfigStore.WriteToDisk;
|
||||
ShowMessageFmt(lisSuccessfullyExported, [SaveDialog.Filename]);
|
||||
InputHistories.ApplyFileDialogSettings(xSaveDialog);
|
||||
xSaveDialog.Filter := dlgFilterXML +' (*.xml)|*.xml';
|
||||
xSaveDialog.Options := xSaveDialog.Options + [ofOverwritePrompt];
|
||||
if xSaveDialog.Execute then
|
||||
begin
|
||||
xFileName := xSaveDialog.FileName;
|
||||
if ExtractFileExt(xFileName) = '' then
|
||||
xFileName := xFileName + '.xml';
|
||||
|
||||
xXMLCfg := nil;
|
||||
xConfigStore := nil;
|
||||
try
|
||||
xXMLCfg := TRttiXMLConfig.CreateClean(xFileName);
|
||||
xConfigStore := TXMLOptionsStorage.Create(xXMLCfg);
|
||||
xCurPath := 'Desktops/';
|
||||
xXMLCfg.SetDeleteValue(xCurPath + 'Count', Length(aDesktops), 0);
|
||||
for I := 0 to Length(aDesktops)-1 do
|
||||
begin
|
||||
aDesktops[I].SetConfig(xXMLCfg, xConfigStore);
|
||||
aDesktops[I].Save(xCurPath + 'Desktop'+IntToStr(I+1)+'/');
|
||||
end;
|
||||
xConfigStore.WriteToDisk;
|
||||
ShowMessageFmt(dlgDesktopsExported, [Length(aDesktops), xFileName]);
|
||||
finally
|
||||
FConfigStore.Free;
|
||||
end;
|
||||
finally
|
||||
FreeAndNil(FXMLCfg);
|
||||
xConfigStore.Free;
|
||||
xXMLCfg.Free;
|
||||
end;
|
||||
end;
|
||||
InputHistories.StoreFileDialogSettings(SaveDialog);
|
||||
InputHistories.StoreFileDialogSettings(xSaveDialog);
|
||||
except
|
||||
on E: Exception do
|
||||
begin
|
||||
DebugLn('ERROR: [TDesktopMangerDialog.ExportBitBtnClick] ', E.Message);
|
||||
Raise;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
SaveDialog.Free;
|
||||
xSaveDialog.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TDesktopForm.ImportBitBtnClick(Sender: TObject);
|
||||
var
|
||||
FXMLCfg: TRttiXMLConfig;
|
||||
FConfigStore: TXMLOptionsStorage;
|
||||
OpenDialog: TOpenDialog;
|
||||
xDesktopName, Filename: string;
|
||||
xDesktopID: Integer;
|
||||
xXMLCfg: TRttiXMLConfig;
|
||||
xConfigStore: TXMLOptionsStorage;
|
||||
xOpenDialog: TOpenDialog;
|
||||
xDesktopName, xOldDesktopName, xFileName: string;
|
||||
xCurPath, xDesktopPath: string;
|
||||
I: Integer;
|
||||
xCount, xImportedCount: Integer;
|
||||
xDsk: TDesktopOpt;
|
||||
begin
|
||||
if DesktopListBox.ItemIndex < 0 then
|
||||
Exit;
|
||||
xOpenDialog := TOpenDialog.Create(nil);
|
||||
try
|
||||
try
|
||||
InputHistories.ApplyFileDialogSettings(xOpenDialog);
|
||||
xOpenDialog.Filter := dlgFilterXML +' (*.xml)|*.xml';
|
||||
if xOpenDialog.Execute then
|
||||
begin
|
||||
xFileName := xOpenDialog.FileName;
|
||||
xXMLCfg := nil;
|
||||
xConfigStore := nil;
|
||||
try
|
||||
xXMLCfg := TRttiXMLConfig.Create(xFileName);
|
||||
xConfigStore := TXMLOptionsStorage.Create(xXMLCfg);
|
||||
|
||||
xCurPath := 'Desktops/';
|
||||
xCount := xXMLCfg.GetValue(xCurPath+'Count', 0);
|
||||
xImportedCount := 0;
|
||||
for I := 1 to xCount do
|
||||
begin
|
||||
xDesktopPath := xCurPath+'Desktop'+IntToStr(I)+'/';
|
||||
if not xXMLCfg.HasPath(xDesktopPath, True) then
|
||||
Continue;
|
||||
|
||||
xDesktopName := xXMLCfg.GetValue(xDesktopPath+'Name', '');
|
||||
xOldDesktopName := xDesktopName;
|
||||
//show a dialog to modify desktop name
|
||||
if (EnvironmentOptions.Desktops.IndexOf(xDesktopName) >= 0) and
|
||||
not InputQuery(dlgDesktopName, dlgImportDesktopExists, xDesktopName)
|
||||
then
|
||||
Continue;
|
||||
|
||||
xDesktopName := DesktopListBox.Items[DesktopListBox.ItemIndex];
|
||||
if xDesktopName = '' then
|
||||
Exit;
|
||||
|
||||
xDesktopID := EnvironmentOptions.Desktops.IndexOf(xDesktopName);
|
||||
if xDesktopID = -1 then
|
||||
Exit;
|
||||
|
||||
OpenDialog := TOpenDialog.Create(nil);
|
||||
try
|
||||
try
|
||||
InputHistories.ApplyFileDialogSettings(OpenDialog);
|
||||
OpenDialog.Filter := dlgFilterXML +' (*.xml)|*.xml';
|
||||
if OpenDialog.Execute then
|
||||
Continue;
|
||||
xDsk := EnvironmentOptions.Desktops.Find(xDesktopName);
|
||||
if not Assigned(xDsk) then
|
||||
begin
|
||||
Filename := OpenDialog.Filename;
|
||||
FXMLCfg := TRttiXMLConfig.Create(Filename);
|
||||
try
|
||||
FConfigStore := TXMLOptionsStorage.Create(FXMLCfg);
|
||||
try
|
||||
EnvironmentOptions.Desktops.LoadFromXML(FXMLCfg, FConfigStore, xDesktopID);
|
||||
ShowMessageFmt(lisSuccessfullyImported, [OpenDialog.Filename]);
|
||||
finally
|
||||
FConfigStore.Free;
|
||||
xDsk := TDesktopOpt.Create(xDesktopName, False);
|
||||
EnvironmentOptions.Desktops.Add(xDsk);
|
||||
end else
|
||||
if (xOldDesktopName <> xDesktopName) and
|
||||
(MessageDlg(Format(dlgOverwriteDesktop, [xDesktopName]), mtWarning, mbYesNo, 0) <> mrYes)
|
||||
then
|
||||
Continue;
|
||||
|
||||
xDsk.SetConfig(xXMLCfg, xConfigStore);
|
||||
xDsk.Load(xDesktopPath);
|
||||
Inc(xImportedCount);
|
||||
end;//for
|
||||
|
||||
if xImportedCount>0 then
|
||||
begin
|
||||
ShowMessageFmt(dlgDesktopsImported, [xImportedCount, xFileName]);
|
||||
RefreshList;
|
||||
end;
|
||||
finally
|
||||
FreeAndNil(FXMLCfg);
|
||||
xConfigStore.Free;
|
||||
xXMLCfg.Free;
|
||||
end;
|
||||
end;
|
||||
InputHistories.StoreFileDialogSettings(OpenDialog);
|
||||
InputHistories.StoreFileDialogSettings(xOpenDialog);
|
||||
except
|
||||
on E: Exception do
|
||||
begin
|
||||
DebugLn('ERROR: [TDesktopMangerDialog.ImportBitBtnClick] ', E.Message);
|
||||
Raise;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
OpenDialog.Free;
|
||||
xOpenDialog.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -508,7 +565,18 @@ begin
|
||||
SetDebugDesktopBitBtn.Enabled := DeleteBitBtn.Enabled;
|
||||
ButtonPanel1.OKButton.Enabled := DeleteBitBtn.Enabled;
|
||||
ExportBitBtn.Enabled := DeleteBitBtn.Enabled;
|
||||
ImportBitBtn.Enabled := DeleteBitBtn.Enabled;
|
||||
ExportAllBitBtn.Enabled := DesktopListBox.Items.Count>0;
|
||||
end;
|
||||
|
||||
procedure TDesktopForm.ExportAllBitBtnClick(Sender: TObject);
|
||||
var
|
||||
xDesktops: array of TDesktopOpt;
|
||||
I: Integer;
|
||||
begin
|
||||
SetLength(xDesktops, EnvironmentOptions.Desktops.Count);
|
||||
for I := 0 to Length(xDesktops)-1 do
|
||||
xDesktops[I] := EnvironmentOptions.Desktops[I];
|
||||
ExportDesktops(xDesktops);
|
||||
end;
|
||||
|
||||
procedure TDesktopForm.SaveBitBtnClick(Sender: TObject);
|
||||
@ -521,7 +589,7 @@ begin
|
||||
xDesktopName := '';
|
||||
xOldDesktopName := xDesktopName;
|
||||
|
||||
if not InputQuery(dlgSaveCurrentDesktop, dlgDesktopName, xDesktopName)
|
||||
if not InputQuery(dlgDesktopName, dlgSaveCurrentDesktopAs, xDesktopName)
|
||||
or (xDesktopName = '') // xDesktopName MUST NOT BE EMPTY !!!
|
||||
then
|
||||
Exit;
|
||||
|
@ -283,14 +283,15 @@ type
|
||||
// component palette
|
||||
FComponentPaletteOptions: TCompPaletteOptions;
|
||||
|
||||
procedure SetConfig(aXMLCfg: TRttiXMLConfig; aConfigStore: TXMLOptionsStorage);
|
||||
procedure InitLayoutList;
|
||||
procedure Load(Path: String);
|
||||
procedure Save(Path: String);
|
||||
public
|
||||
constructor Create(aName: String; const aUseIDELayouts: Boolean);
|
||||
destructor Destroy; override;
|
||||
procedure Assign(Source: TDesktopOpt);
|
||||
public
|
||||
procedure SetConfig(aXMLCfg: TRttiXMLConfig; aConfigStore: TXMLOptionsStorage);
|
||||
procedure Load(Path: String);
|
||||
procedure Save(Path: String);
|
||||
|
||||
property Name: String read FName write FName;
|
||||
property IDEWindowCreatorsLayoutList: TSimpleWindowLayoutList read FIDEWindowCreatorsLayoutList write FIDEWindowCreatorsLayoutList;
|
||||
@ -330,10 +331,6 @@ type
|
||||
constructor Create(aEnvOpts: TEnvironmentOptions);
|
||||
destructor Destroy; override;
|
||||
procedure AddFromCfg(Path: String);
|
||||
procedure SaveToXML(aXMLCfg: TRttiXMLConfig; aConfigStore: TXMLOptionsStorage;
|
||||
Index: Integer);
|
||||
procedure LoadFromXML(aXMLCfg: TRttiXMLConfig; aConfigStore: TXMLOptionsStorage;
|
||||
Index: Integer);
|
||||
function IndexOf(aName: string): integer;
|
||||
function Find(aName: string): TDesktopOpt;
|
||||
property Items[Index: Integer]: TDesktopOpt read GetItem; default;
|
||||
@ -918,33 +915,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TDesktopOptList.SaveToXML(aXMLCfg: TRttiXMLConfig;
|
||||
aConfigStore: TXMLOptionsStorage; Index: Integer);
|
||||
var
|
||||
CurPath: String;
|
||||
begin
|
||||
CurPath := 'Desktops/';
|
||||
Items[Index].SetConfig(aXMLCfg, aConfigStore);
|
||||
aXMLCfg.SetDeleteValue(CurPath + 'Count', 1, 0);
|
||||
Items[Index].Save(CurPath + 'Desktop1/');
|
||||
end;
|
||||
|
||||
procedure TDesktopOptList.LoadFromXML(aXMLCfg: TRttiXMLConfig;
|
||||
aConfigStore: TXMLOptionsStorage; Index: Integer);
|
||||
var
|
||||
CurPath: String;
|
||||
xDesktop: TDesktopOpt;
|
||||
begin
|
||||
CurPath := 'Desktops/';
|
||||
if aXMLCfg.HasPath(CurPath, True) then
|
||||
begin
|
||||
xDesktop := TDesktopOpt.Create(Items[Index].Name, False);
|
||||
Items[Index].Assign(xDesktop);
|
||||
Items[Index].SetConfig(aXMLCfg, aConfigStore);
|
||||
Items[Index].Load(CurPath + 'Desktop1/');
|
||||
end;
|
||||
end;
|
||||
|
||||
function TDesktopOptList.IndexOf(aName: string): integer;
|
||||
begin
|
||||
Result:=Count-1;
|
||||
|
@ -1268,9 +1268,13 @@ resourcestring
|
||||
dlgRenameDesktop = 'Rename desktop';
|
||||
dlgNewDesktop = 'New desktop ...';
|
||||
dlgToggleSelectedDebugDesktop = 'Toggle as debug desktop';
|
||||
dlgDesktopName = 'Desktop name:';
|
||||
dlgDesktopName = 'Desktop name';
|
||||
dlgOverwriteDesktop = 'Desktop with the name "%s" was found.'+sLineBreak+'Should the old desktop be overwritten?';
|
||||
dlgDebugDesktop = 'debug desktop';
|
||||
dlgImportDesktopExists = 'A desktop with the same name already exists.'+sLineBreak+'Please confirm the desktop name:';
|
||||
dlgDesktopsImported = '%d desktop(s) successfully imported from "%s"';
|
||||
dlgDesktopsExported = '%d desktop(s) successfully exported to "%s"';
|
||||
lisExportAll = 'all';
|
||||
|
||||
// Window options
|
||||
dlgShowingWindows = 'Showing Windows';
|
||||
|
Loading…
Reference in New Issue
Block a user