mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 12:30:36 +02:00
IDE: pckage editor: compile: warn if designtime only
git-svn-id: trunk@61462 -
This commit is contained in:
parent
e56694f585
commit
6acb809a60
@ -365,13 +365,14 @@ type
|
|||||||
procedure FileOptionsChange(Sender: TObject);
|
procedure FileOptionsChange(Sender: TObject);
|
||||||
protected
|
protected
|
||||||
fFlags: TPEFlags;
|
fFlags: TPEFlags;
|
||||||
|
FCompileDesignTimePkg: boolean;
|
||||||
procedure SetLazPackage(const AValue: TLazPackage); override;
|
procedure SetLazPackage(const AValue: TLazPackage); override;
|
||||||
property IdleConnected: boolean read FIdleConnected write SetIdleConnected;
|
property IdleConnected: boolean read FIdleConnected write SetIdleConnected;
|
||||||
public
|
public
|
||||||
constructor Create(TheOwner: TComponent); override;
|
constructor Create(TheOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function CanCloseEditor: TModalResult; override;
|
function CanCloseEditor: TModalResult; override;
|
||||||
procedure DoCompile(CompileClean, CompileRequired: boolean);
|
procedure DoCompile(CompileClean, CompileRequired, WarnIDEPkg: boolean);
|
||||||
procedure DoFindInFiles;
|
procedure DoFindInFiles;
|
||||||
procedure DoFixFilesCase;
|
procedure DoFixFilesCase;
|
||||||
procedure DoShowMissingFiles;
|
procedure DoShowMissingFiles;
|
||||||
@ -1801,12 +1802,12 @@ begin
|
|||||||
if MessageDlg(lisPckEditCompileEverything,
|
if MessageDlg(lisPckEditCompileEverything,
|
||||||
lisPckEditReCompileThisAndAllRequiredPackages,
|
lisPckEditReCompileThisAndAllRequiredPackages,
|
||||||
mtConfirmation,[mbYes,mbNo],0)<>mrYes then exit;
|
mtConfirmation,[mbYes,mbNo],0)<>mrYes then exit;
|
||||||
DoCompile(true,true);
|
DoCompile(true,true,true);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPackageEditorForm.CompileCleanClick(Sender: TObject);
|
procedure TPackageEditorForm.CompileCleanClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
DoCompile(true,false);
|
DoCompile(true,false,true);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPackageEditorForm.CopyMoveToDirMenuItemClick(Sender: TObject);
|
procedure TPackageEditorForm.CopyMoveToDirMenuItemClick(Sender: TObject);
|
||||||
@ -1816,7 +1817,7 @@ end;
|
|||||||
|
|
||||||
procedure TPackageEditorForm.CompileBitBtnClick(Sender: TObject);
|
procedure TPackageEditorForm.CompileBitBtnClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
DoCompile(false,false);
|
DoCompile(false,false,true);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPackageEditorForm.CreateMakefileClick(Sender: TObject);
|
procedure TPackageEditorForm.CreateMakefileClick(Sender: TObject);
|
||||||
@ -3174,8 +3175,27 @@ begin
|
|||||||
UpdateStatusBar;
|
UpdateStatusBar;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPackageEditorForm.DoCompile(CompileClean, CompileRequired: boolean);
|
procedure TPackageEditorForm.DoCompile(CompileClean, CompileRequired,
|
||||||
|
WarnIDEPkg: boolean);
|
||||||
|
var
|
||||||
|
MsgResult: Integer;
|
||||||
begin
|
begin
|
||||||
|
if WarnIDEPkg and not FCompileDesignTimePkg
|
||||||
|
and (LazPackage.PackageType=lptDesignTime) then
|
||||||
|
begin
|
||||||
|
MsgResult:=IDEQuestionDialog('Warning',
|
||||||
|
'Package "'+LazPackage.Name+'" is designtime only, so it should only be compiled into the IDE, and not with the project settings.'#13
|
||||||
|
+'Please use "Install" or "Tools / Build Lazarus" to build the IDE packages.',
|
||||||
|
mtWarning,[mrYes,'Compile with project settings',
|
||||||
|
mrYesToAll,'Compile and do not ask again',mrCancel]);
|
||||||
|
case MsgResult of
|
||||||
|
mrYes: ;
|
||||||
|
mrYesToAll:
|
||||||
|
FCompileDesignTimePkg:=true; // store setting only while running the IDE
|
||||||
|
// when IDE restarts, ask again
|
||||||
|
else exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
CompileBitBtn.Enabled:=False;
|
CompileBitBtn.Enabled:=False;
|
||||||
PackageEditors.CompilePackage(LazPackage,CompileClean,CompileRequired);
|
PackageEditors.CompilePackage(LazPackage,CompileClean,CompileRequired);
|
||||||
UpdateTitle;
|
UpdateTitle;
|
||||||
|
Loading…
Reference in New Issue
Block a user