mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-05 01:08:12 +02:00
IDE: in the Treeview Items Editor, add the ability to load a treeview from xml. Resolves issue #40806.
This commit is contained in:
parent
d4168ad2aa
commit
6b2d34231b
@ -157,6 +157,7 @@ begin
|
||||
dlgOpen.Title := sccsTrEdtOpenDialog;
|
||||
dlgSave.Title := sccsTrEdtSaveDialog;
|
||||
dlgSave.Filter := 'xml files|*.xml|All files|'+GetAllFilesMask+'|';
|
||||
dlgOpen.Filter := dlgSave.Filter;
|
||||
|
||||
// button panel
|
||||
ButtonPanel.ShowHint := true;
|
||||
@ -410,6 +411,8 @@ begin
|
||||
end;
|
||||
|
||||
procedure TTreeViewItemsEditorForm.tbOpenClick(Sender: TObject);
|
||||
var
|
||||
Fn: String;
|
||||
|
||||
function ConfirmTreeReplace: boolean;
|
||||
begin
|
||||
@ -426,8 +429,11 @@ begin
|
||||
|
||||
if ConfirmTreeReplace and dlgOpen.Execute then
|
||||
begin
|
||||
treEditor.LoadFromFile(dlgOpen.FileName);
|
||||
|
||||
Fn := dlgOpen.FileName;
|
||||
if (CompareFileExt(Fn, 'xml', False) = 0) then
|
||||
TreeLoadFromXML(treEditor, Fn)
|
||||
else
|
||||
treEditor.LoadFromFile(Fn);
|
||||
treEditor.FullExpand;
|
||||
treEditor.Selected := treEditor.Items.GetFirstNode;
|
||||
treEditor.SetFocus;
|
||||
|
Loading…
Reference in New Issue
Block a user