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