mirror of https://gitlab.com/basile.b/dexed.git
allow to reload the project from proj inspect widget
This commit is contained in:
parent
637ab5802e
commit
077baa2d3a
|
@ -13,14 +13,14 @@ inherited CEDubProjectEditorWidget: TCEDubProjectEditorWidget
|
||||||
ClientHeight = 424
|
ClientHeight = 424
|
||||||
ClientWidth = 407
|
ClientWidth = 407
|
||||||
inherited Content: TPanel
|
inherited Content: TPanel
|
||||||
Height = 390
|
Height = 388
|
||||||
Top = 34
|
Top = 36
|
||||||
Width = 407
|
Width = 407
|
||||||
ClientHeight = 390
|
ClientHeight = 388
|
||||||
ClientWidth = 407
|
ClientWidth = 407
|
||||||
object propTree: TTreeView[0]
|
object propTree: TTreeView[0]
|
||||||
Left = 4
|
Left = 4
|
||||||
Height = 353
|
Height = 351
|
||||||
Top = 4
|
Top = 4
|
||||||
Width = 399
|
Width = 399
|
||||||
Align = alClient
|
Align = alClient
|
||||||
|
@ -37,7 +37,7 @@ inherited CEDubProjectEditorWidget: TCEDubProjectEditorWidget
|
||||||
object Panel1: TPanel[1]
|
object Panel1: TPanel[1]
|
||||||
Left = 2
|
Left = 2
|
||||||
Height = 27
|
Height = 27
|
||||||
Top = 361
|
Top = 359
|
||||||
Width = 403
|
Width = 403
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
|
@ -70,14 +70,13 @@ inherited CEDubProjectEditorWidget: TCEDubProjectEditorWidget
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
inherited toolbar: TCEToolBar
|
inherited toolbar: TCEToolBar
|
||||||
Height = 28
|
|
||||||
Width = 399
|
Width = 399
|
||||||
object btnUpdate: TCEToolButton[0]
|
object btnReload: TCEToolButton[0]
|
||||||
Left = 85
|
Left = 85
|
||||||
Hint = 'reload project'
|
Hint = 'reload the project, useful to fetch new dependencies or detect new source files'
|
||||||
Top = 0
|
Top = 0
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = 'btnUpdate'
|
Caption = 'btnReload'
|
||||||
OnClick = btnRefreshClick
|
OnClick = btnRefreshClick
|
||||||
resourceName = 'ARROW_UPDATE'
|
resourceName = 'ARROW_UPDATE'
|
||||||
scaledSeparator = False
|
scaledSeparator = False
|
||||||
|
@ -104,7 +103,7 @@ inherited CEDubProjectEditorWidget: TCEDubProjectEditorWidget
|
||||||
end
|
end
|
||||||
object fltEdit: TTreeFilterEdit[3]
|
object fltEdit: TTreeFilterEdit[3]
|
||||||
Left = 128
|
Left = 128
|
||||||
Height = 24
|
Height = 26
|
||||||
Hint = 'filter properties'
|
Hint = 'filter properties'
|
||||||
Top = 2
|
Top = 2
|
||||||
Width = 269
|
Width = 269
|
||||||
|
|
|
@ -42,7 +42,7 @@ type
|
||||||
btnAddProp: TCEToolButton;
|
btnAddProp: TCEToolButton;
|
||||||
btnCloneObject: TCEToolButton;
|
btnCloneObject: TCEToolButton;
|
||||||
btnDelProp: TCEToolButton;
|
btnDelProp: TCEToolButton;
|
||||||
btnUpdate: TCEToolButton;
|
btnReload: TCEToolButton;
|
||||||
edProp: TEdit;
|
edProp: TEdit;
|
||||||
fltEdit: TTreeFilterEdit;
|
fltEdit: TTreeFilterEdit;
|
||||||
MenuItem1: TMenuItem;
|
MenuItem1: TMenuItem;
|
||||||
|
@ -476,10 +476,19 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEDubProjectEditorWidget.btnRefreshClick(Sender: TObject);
|
procedure TCEDubProjectEditorWidget.btnRefreshClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
f: string;
|
||||||
begin
|
begin
|
||||||
if fProj.isNil or not fProj.filename.fileExists then
|
if assigned(fProj) then
|
||||||
|
begin
|
||||||
|
f := fProj.filename;
|
||||||
|
if not f.fileExists then
|
||||||
exit;
|
exit;
|
||||||
fProj.loadFromFile(fProj.filename);
|
if fProj.modified and
|
||||||
|
(dlgYesNo('The project seems to be modified, save before reloading') = mrYes) then
|
||||||
|
fProj.saveToFile(f);
|
||||||
|
fProj.loadFromFile(f);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEDubProjectEditorWidget.btnCloneObjectClick(Sender: TObject);
|
procedure TCEDubProjectEditorWidget.btnCloneObjectClick(Sender: TObject);
|
||||||
|
|
|
@ -53,9 +53,9 @@ inherited CEProjectInspectWidget: TCEProjectInspectWidget
|
||||||
inherited toolbar: TCEToolBar
|
inherited toolbar: TCEToolBar
|
||||||
Width = 368
|
Width = 368
|
||||||
object btnRemFold: TCEToolButton[0]
|
object btnRemFold: TCEToolButton[0]
|
||||||
Left = 113
|
Left = 1
|
||||||
Hint = 'remove the selected source parent folder from the project'
|
Hint = 'remove the selected source parent folder from the project'
|
||||||
Top = 0
|
Top = 28
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = 'btnRemFold'
|
Caption = 'btnRemFold'
|
||||||
OnClick = btnRemFoldClick
|
OnClick = btnRemFoldClick
|
||||||
|
@ -63,7 +63,7 @@ inherited CEProjectInspectWidget: TCEProjectInspectWidget
|
||||||
scaledSeparator = False
|
scaledSeparator = False
|
||||||
end
|
end
|
||||||
object btnAddFold: TCEToolButton[1]
|
object btnAddFold: TCEToolButton[1]
|
||||||
Left = 85
|
Left = 113
|
||||||
Hint = 'add a folder of sources to the project'
|
Hint = 'add a folder of sources to the project'
|
||||||
Top = 0
|
Top = 0
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
|
@ -73,7 +73,7 @@ inherited CEProjectInspectWidget: TCEProjectInspectWidget
|
||||||
scaledSeparator = False
|
scaledSeparator = False
|
||||||
end
|
end
|
||||||
object btnRemFile: TCEToolButton[2]
|
object btnRemFile: TCEToolButton[2]
|
||||||
Left = 57
|
Left = 85
|
||||||
Hint = 'remove selected source from the project'
|
Hint = 'remove selected source from the project'
|
||||||
Top = 0
|
Top = 0
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
|
@ -83,7 +83,7 @@ inherited CEProjectInspectWidget: TCEProjectInspectWidget
|
||||||
scaledSeparator = False
|
scaledSeparator = False
|
||||||
end
|
end
|
||||||
object btnAddFile: TCEToolButton[3]
|
object btnAddFile: TCEToolButton[3]
|
||||||
Left = 29
|
Left = 57
|
||||||
Hint = 'add a source to the project'
|
Hint = 'add a source to the project'
|
||||||
Top = 0
|
Top = 0
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
|
@ -110,7 +110,7 @@ inherited CEProjectInspectWidget: TCEProjectInspectWidget
|
||||||
ExpandAllInitially = True
|
ExpandAllInitially = True
|
||||||
end
|
end
|
||||||
object btnTree: TCEToolButton[5]
|
object btnTree: TCEToolButton[5]
|
||||||
Left = 1
|
Left = 29
|
||||||
Hint = 'display the file list as a tree'
|
Hint = 'display the file list as a tree'
|
||||||
Top = 0
|
Top = 0
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
|
@ -120,6 +120,16 @@ inherited CEProjectInspectWidget: TCEProjectInspectWidget
|
||||||
resourceName = 'FOLDERS_EXPLORER'
|
resourceName = 'FOLDERS_EXPLORER'
|
||||||
scaledSeparator = False
|
scaledSeparator = False
|
||||||
end
|
end
|
||||||
|
object btnReload: TCEToolButton[6]
|
||||||
|
Left = 1
|
||||||
|
Hint = 'reload the project, useful to fetch new dependencies or detect new source files'
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = 'btnReload'
|
||||||
|
OnClick = btnReloadClick
|
||||||
|
resourceName = 'ARROW_UPDATE'
|
||||||
|
scaledSeparator = False
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
inherited contextMenu: TPopupMenu
|
inherited contextMenu: TPopupMenu
|
||||||
|
|
|
@ -24,6 +24,7 @@ type
|
||||||
TCEProjectInspectWidget = class(TCEWidget, ICEProjectObserver, ICEDocumentObserver)
|
TCEProjectInspectWidget = class(TCEWidget, ICEProjectObserver, ICEDocumentObserver)
|
||||||
btnAddFile: TCEToolButton;
|
btnAddFile: TCEToolButton;
|
||||||
btnAddFold: TCEToolButton;
|
btnAddFold: TCEToolButton;
|
||||||
|
btnReload: TCEToolButton;
|
||||||
btnRemFile: TCEToolButton;
|
btnRemFile: TCEToolButton;
|
||||||
btnRemFold: TCEToolButton;
|
btnRemFold: TCEToolButton;
|
||||||
btnTree: TCEToolButton;
|
btnTree: TCEToolButton;
|
||||||
|
@ -34,6 +35,7 @@ type
|
||||||
procedure btnRemFileClick(Sender: TObject);
|
procedure btnRemFileClick(Sender: TObject);
|
||||||
procedure btnRemFoldClick(Sender: TObject);
|
procedure btnRemFoldClick(Sender: TObject);
|
||||||
procedure btnTreeClick(Sender: TObject);
|
procedure btnTreeClick(Sender: TObject);
|
||||||
|
procedure btnReloadClick(Sender: TObject);
|
||||||
procedure FormDropFiles(Sender: TObject; const fnames: array of String);
|
procedure FormDropFiles(Sender: TObject; const fnames: array of String);
|
||||||
procedure TreeClick(Sender: TObject);
|
procedure TreeClick(Sender: TObject);
|
||||||
procedure TreeDeletion(Sender: TObject; Node: TTreeNode);
|
procedure TreeDeletion(Sender: TObject; Node: TTreeNode);
|
||||||
|
@ -87,7 +89,7 @@ implementation
|
||||||
{$R *.lfm}
|
{$R *.lfm}
|
||||||
|
|
||||||
const optFname = 'projinspect.txt';
|
const optFname = 'projinspect.txt';
|
||||||
const filterAlign: array[boolean] of integer = (34, 142);
|
const filterAlign: array[boolean] of integer = (66, 174);
|
||||||
|
|
||||||
{$REGION Standard Comp/Obj------------------------------------------------------}
|
{$REGION Standard Comp/Obj------------------------------------------------------}
|
||||||
constructor TCEProjectInspectWidget.create(aOwner: TComponent);
|
constructor TCEProjectInspectWidget.create(aOwner: TComponent);
|
||||||
|
@ -525,6 +527,22 @@ begin
|
||||||
setFileListAsTree(btnTree.Down);
|
setFileListAsTree(btnTree.Down);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCEProjectInspectWidget.btnReloadClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
f: string;
|
||||||
|
begin
|
||||||
|
if assigned(fProject) then
|
||||||
|
begin
|
||||||
|
f := fProject.filename;
|
||||||
|
if not f.fileExists then
|
||||||
|
exit;
|
||||||
|
if fProject.modified and
|
||||||
|
(dlgYesNo('The project seems to be modified, save before reloading') = mrYes) then
|
||||||
|
fProject.saveToFile(f);
|
||||||
|
fProject.loadFromFile(f);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCEProjectInspectWidget.btnRemFileClick(Sender: TObject);
|
procedure TCEProjectInspectWidget.btnRemFileClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
fname: string;
|
fname: string;
|
||||||
|
|
Loading…
Reference in New Issue