mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-13 13:29:34 +02:00
Move 2 functions from DialogProcs to SourceFileManager.
This commit is contained in:
parent
f3d1f63432
commit
9297d3f760
ide
@ -43,10 +43,8 @@ uses
|
||||
FileUtil, LazFileUtils, LazFileCache, Laz2_XMLCfg, LazLoggerBase,
|
||||
// CodeTools
|
||||
CodeToolsConfig, CodeCache, CodeToolManager,
|
||||
// IdeIntf
|
||||
LazIDEIntf, IDEDialogs,
|
||||
// IDE
|
||||
IdeUtilsPkgStrConsts;
|
||||
// IdeUtils
|
||||
IDEDialogs, IdeUtilsPkgStrConsts;
|
||||
|
||||
type
|
||||
// load buffer flags
|
||||
@ -116,9 +114,6 @@ function SaveLazStringToFile(const Filename, Content: string;
|
||||
): TModalResult;
|
||||
function ConvertLFMToLRSFileInteractive(const LFMFilename,
|
||||
LRSFilename: string; ShowAbort: boolean): TModalResult;
|
||||
function IfNotOkJumpToCodetoolErrorAndAskToAbort(Ok: boolean;
|
||||
Ask: boolean; out NewResult: TModalResult): boolean;
|
||||
function JumpToCodetoolErrorAndAskToAbort(Ask: boolean): TModalResult;
|
||||
procedure NotImplementedDialog(const Feature: string);
|
||||
|
||||
function SimpleDirectoryCheck(const OldDir, NewDir,
|
||||
@ -692,36 +687,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function IfNotOkJumpToCodetoolErrorAndAskToAbort(Ok: boolean;
|
||||
Ask: boolean; out NewResult: TModalResult): boolean;
|
||||
begin
|
||||
if Ok then begin
|
||||
NewResult:=mrOk;
|
||||
Result:=true;
|
||||
end else begin
|
||||
NewResult:=JumpToCodetoolErrorAndAskToAbort(Ask);
|
||||
Result:=NewResult<>mrAbort;
|
||||
end;
|
||||
end;
|
||||
|
||||
function JumpToCodetoolErrorAndAskToAbort(Ask: boolean): TModalResult;
|
||||
// returns mrCancel or mrAbort
|
||||
var
|
||||
ErrMsg: String;
|
||||
begin
|
||||
ErrMsg:=CodeToolBoss.ErrorMessage;
|
||||
LazarusIDE.DoJumpToCodeToolBossError;
|
||||
if Ask then begin
|
||||
Result:=IDEQuestionDialog(lisCCOErrorCaption,
|
||||
Format(lisTheCodetoolsFoundAnError, [LineEnding, ErrMsg]),
|
||||
mtWarning, [mrIgnore, lisIgnoreAndContinue,
|
||||
mrAbort]);
|
||||
if Result=mrIgnore then Result:=mrCancel;
|
||||
end else begin
|
||||
Result:=mrCancel;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure NotImplementedDialog(const Feature: string);
|
||||
begin
|
||||
IDEMessageDialog(lisNotImplemented,
|
||||
|
@ -220,6 +220,9 @@ function SaveEditorFile(const Filename: string; Flags: TSaveFlags): TModalResult
|
||||
function CloseEditorFile(AEditor: TSourceEditorInterface; Flags: TCloseFlags):TModalResult;
|
||||
function CloseEditorFile(const Filename: string; Flags: TCloseFlags): TModalResult;
|
||||
// interactive unit selection
|
||||
//function IfNotOkJumpToCodetoolErrorAndAskToAbort(Ok: boolean;
|
||||
// Ask: boolean; out NewResult: TModalResult): boolean;
|
||||
function JumpToCodetoolErrorAndAskToAbort(Ask: boolean): TModalResult;
|
||||
function SelectProjectItems(ItemList: TViewUnitEntries; ItemType: TIDEProjectItem): TModalResult;
|
||||
function SelectUnitComponents(DlgCaption: string; ItemType: TIDEProjectItem;
|
||||
Files: TStringList): TModalResult;
|
||||
@ -3410,6 +3413,36 @@ begin
|
||||
Files.Free;
|
||||
end;
|
||||
end;
|
||||
{
|
||||
function IfNotOkJumpToCodetoolErrorAndAskToAbort(Ok: boolean;
|
||||
Ask: boolean; out NewResult: TModalResult): boolean;
|
||||
begin
|
||||
if Ok then begin
|
||||
NewResult:=mrOk;
|
||||
Result:=true;
|
||||
end else begin
|
||||
NewResult:=JumpToCodetoolErrorAndAskToAbort(Ask);
|
||||
Result:=NewResult<>mrAbort;
|
||||
end;
|
||||
end;
|
||||
}
|
||||
function JumpToCodetoolErrorAndAskToAbort(Ask: boolean): TModalResult;
|
||||
// returns mrCancel or mrAbort
|
||||
var
|
||||
ErrMsg: String;
|
||||
begin
|
||||
ErrMsg:=CodeToolBoss.ErrorMessage;
|
||||
LazarusIDE.DoJumpToCodeToolBossError;
|
||||
if Ask then begin
|
||||
Result:=IDEQuestionDialog(lisCCOErrorCaption,
|
||||
Format(lisTheCodetoolsFoundAnError, [LineEnding, ErrMsg]),
|
||||
mtWarning, [mrIgnore, lisIgnoreAndContinue,
|
||||
mrAbort]);
|
||||
if Result=mrIgnore then Result:=mrCancel;
|
||||
end else begin
|
||||
Result:=mrCancel;
|
||||
end;
|
||||
end;
|
||||
|
||||
function SelectProjectItems(ItemList: TViewUnitEntries; ItemType: TIDEProjectItem): TModalResult;
|
||||
var
|
||||
|
Loading…
Reference in New Issue
Block a user