menu, add source to project, emit hint when proj kind is dub

This commit is contained in:
Basile Burg 2015-09-18 00:01:47 +02:00
parent 4c23566a61
commit e1e86c258f
1 changed files with 10 additions and 6 deletions

View File

@ -1425,14 +1425,18 @@ end;
procedure TCEMainForm.actFileAddToProjExecute(Sender: TObject); procedure TCEMainForm.actFileAddToProjExecute(Sender: TObject);
begin begin
//TODO-cDUB: update 'add file to project' for a DUB project
if fDoc = nil then exit; if fDoc = nil then exit;
if fDoc.isProjectSource then exit; if fDoc.isProjectSource then exit; // TODO: rename this abiguous property name to 'isProjectFile'
if fNativeProject = nil then exit; if fProjectInterface = nil then exit;
// //
if fProjectInterface.getFormat = pfNative then
begin
if fileExists(fDoc.fileName) and (not fDoc.isTemporary) then if fileExists(fDoc.fileName) and (not fDoc.isTemporary) then
fNativeProject.addSource(fDoc.fileName) fNativeProject.addSource(fDoc.fileName)
else dlgOkInfo('the file has not been added to the project because it does not exist'); else dlgOkInfo('the file has not been added to the project because it does not exist');
end else
getMessageDisplay.message('use the DUB project editor to add a source to a DUB project',
nil, amcApp, amkHint);
end; end;
procedure TCEMainForm.actFileCloseExecute(Sender: TObject); procedure TCEMainForm.actFileCloseExecute(Sender: TObject);