mirror of https://gitlab.com/basile.b/dexed.git
patch old widgets names, finish and close #374
This commit is contained in:
parent
2102a15437
commit
9ae72f8feb
|
@ -1893,50 +1893,66 @@ end;
|
||||||
|
|
||||||
function TMainForm.LoadDocking: boolean;
|
function TMainForm.LoadDocking: boolean;
|
||||||
var
|
var
|
||||||
xcfg: TXMLConfigStorage;
|
x: TXMLConfigStorage;
|
||||||
str: TMemoryStream;
|
s: TMemoryStream;
|
||||||
|
f: string;
|
||||||
|
t: string;
|
||||||
|
i: integer;
|
||||||
begin
|
begin
|
||||||
result := false;
|
result := false;
|
||||||
if fileExists(getDocPath + 'docking.xml') then
|
f := getDocPath + 'docking.xml';
|
||||||
|
if fileExists(f) then
|
||||||
begin
|
begin
|
||||||
xcfg := TXMLConfigStorage.Create(getDocPath + 'docking.xml', true);
|
|
||||||
|
// TODO-cmaintenance: remove this from 3.8.0
|
||||||
|
with TStringList.Create do
|
||||||
|
try
|
||||||
|
LoadFromFile(f);
|
||||||
|
for i := 0 to Count-1 do
|
||||||
|
strings[i] := ReplaceText(strings[i], 'Name="CE', 'Name="');
|
||||||
|
finally
|
||||||
|
SaveToFile(f);
|
||||||
|
free;
|
||||||
|
end;
|
||||||
|
|
||||||
|
x := TXMLConfigStorage.Create(f, true);
|
||||||
try
|
try
|
||||||
try
|
try
|
||||||
DockMaster.CloseAll;
|
DockMaster.CloseAll;
|
||||||
self.Visible:=true;
|
self.Visible:=true;
|
||||||
DockMaster.LoadLayoutFromConfig(xcfg, false);
|
DockMaster.LoadLayoutFromConfig(x, false);
|
||||||
except
|
except
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
str := TMemoryStream.Create;
|
s := TMemoryStream.Create;
|
||||||
try
|
try
|
||||||
xcfg.SaveToStream(str);
|
x.SaveToStream(s);
|
||||||
str.saveToFile(getDocPath + 'docking.bak')
|
s.saveToFile(f)
|
||||||
finally
|
finally
|
||||||
str.Free;
|
s.Free;
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
xcfg.Free;
|
x.Free;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if fileExists(getDocPath + 'dockingopts.xml') then
|
if fileExists(getDocPath + 'dockingopts.xml') then
|
||||||
begin
|
begin
|
||||||
xcfg := TXMLConfigStorage.Create(getDocPath + 'dockingopts.xml', true);
|
x := TXMLConfigStorage.Create(getDocPath + 'dockingopts.xml', true);
|
||||||
try
|
try
|
||||||
try
|
try
|
||||||
DockMaster.LoadSettingsFromConfig(xcfg);
|
DockMaster.LoadSettingsFromConfig(x);
|
||||||
except
|
except
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
str := TMemoryStream.Create;
|
s := TMemoryStream.Create;
|
||||||
try
|
try
|
||||||
xcfg.SaveToStream(str);
|
x.SaveToStream(s);
|
||||||
str.saveToFile(getDocPath + 'dockingopts.bak')
|
s.saveToFile(getDocPath + 'dockingopts.bak')
|
||||||
finally
|
finally
|
||||||
str.Free;
|
s.Free;
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
xcfg.Free;
|
x.Free;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
result := true;
|
result := true;
|
||||||
|
|
Loading…
Reference in New Issue