added docking options persistence

This commit is contained in:
Basile Burg 2014-08-13 22:36:07 +02:00
parent 9866d5fd49
commit e592b047e0
1 changed files with 44 additions and 17 deletions

View File

@ -580,6 +580,14 @@ begin
finally finally
xcfg.Free; xcfg.Free;
end; end;
//
xcfg := TXMLConfigStorage.Create(getDocPath + 'dockingopts.xml',false);
try
DockMaster.SaveSettingsToConfig(xcfg);
xcfg.WriteToDisk;
finally
xcfg.Free;
end;
end; end;
procedure TCEMainForm.LoadDocking; procedure TCEMainForm.LoadDocking;
@ -587,8 +595,8 @@ var
xcfg: TXMLConfigStorage; xcfg: TXMLConfigStorage;
str: TMemoryStream; str: TMemoryStream;
begin begin
if not fileExists(getDocPath + 'docking.xml') then if fileExists(getDocPath + 'docking.xml') then
exit; begin
xcfg := TXMLConfigStorage.Create(getDocPath + 'docking.xml', true); xcfg := TXMLConfigStorage.Create(getDocPath + 'docking.xml', true);
try try
try try
@ -606,6 +614,27 @@ begin
finally finally
xcfg.Free; xcfg.Free;
end; end;
end;
if fileExists(getDocPath + 'dockingopts.xml') then
begin
xcfg := TXMLConfigStorage.Create(getDocPath + 'dockingopts.xml', true);
try
try
DockMaster.LoadSettingsFromConfig(xcfg);
except
exit;
end;
str := TMemoryStream.Create;
try
xcfg.SaveToStream(str);
str.saveToFile(getDocPath + 'dockingopts.bak')
finally
str.Free;
end;
finally
xcfg.Free;
end;
end;
end; end;
procedure TCEMainForm.KillPlugs; procedure TCEMainForm.KillPlugs;
@ -1525,8 +1554,6 @@ begin
win.Show; win.Show;
win.BringToFront; win.BringToFront;
end; end;
{$ENDREGION} {$ENDREGION}
{$REGION project ---------------------------------------------------------------} {$REGION project ---------------------------------------------------------------}