From 4f9ed1191e306a39539e3bff669cfc53305f9e90 Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 8 Dec 2022 00:54:27 +0100 Subject: [PATCH] EnvironmentOpts: remove dependency on DialogProcs --- ide/dialogprocs.pas | 27 +++++++++++++++++++++++++++ ide/environmentopts.pp | 29 +---------------------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/ide/dialogprocs.pas b/ide/dialogprocs.pas index bdeead30f8..245fd7f3dd 100644 --- a/ide/dialogprocs.pas +++ b/ide/dialogprocs.pas @@ -121,6 +121,9 @@ function IfNotOkJumpToCodetoolErrorAndAskToAbort(Ok: boolean; function JumpToCodetoolErrorAndAskToAbort(Ask: boolean): TModalResult; procedure NotImplementedDialog(const Feature: string); +function SimpleDirectoryCheck(const OldDir, NewDir, + NotFoundErrMsg: string; out StopChecking: boolean): boolean; + implementation {$IFDEF Unix} @@ -725,5 +728,29 @@ begin Format(lisNotImplementedYet, [LineEnding, Feature]), mtError, [mbCancel]); end; +function SimpleDirectoryCheck(const OldDir, NewDir, + NotFoundErrMsg: string; out StopChecking: boolean): boolean; +var + SubResult: TModalResult; +begin + StopChecking:=true; + if OldDir=NewDir then begin + Result:=true; + exit; + end; + SubResult:=CheckDirPathExists(NewDir,lisEnvOptDlgDirectoryNotFound, + NotFoundErrMsg); + if SubResult=mrIgnore then begin + Result:=true; + exit; + end; + if SubResult=mrCancel then begin + Result:=false; + exit; + end; + StopChecking:=false; + Result:=true; +end; + end. diff --git a/ide/environmentopts.pp b/ide/environmentopts.pp index c521e4c98c..fddbc94b5e 100644 --- a/ide/environmentopts.pp +++ b/ide/environmentopts.pp @@ -51,7 +51,7 @@ uses // DebuggerIntf DbgIntfDebuggerBase, // IDE - IDEProcs, DialogProcs, LazarusIDEStrConsts, IDETranslations, LazConf, + IDEProcs, LazarusIDEStrConsts, IDETranslations, LazConf, IDEOptionDefs, TransferMacros, ModeMatrixOpts, IdeCoolbarData, EditorToolbarStatic, IdeDebuggerOpts; @@ -1072,9 +1072,6 @@ function StrToIDEMultipleInstancesOption(const s: string): TIDEMultipleInstances function BackupTypeToName(b: TBackupType): string; function NameToBackupType(const s: string): TBackupType; -function SimpleDirectoryCheck(const OldDir, NewDir, - NotFoundErrMsg: string; out StopChecking: boolean): boolean; - const DefaultMsgViewFocus = {$IFDEF Windows}true{$ELSE}false{$ENDIF}; MaxComboBoxCount: integer = 20; @@ -1163,30 +1160,6 @@ begin Result:=bakNone; end; -function SimpleDirectoryCheck(const OldDir, NewDir, - NotFoundErrMsg: string; out StopChecking: boolean): boolean; -var - SubResult: TModalResult; -begin - StopChecking:=true; - if OldDir=NewDir then begin - Result:=true; - exit; - end; - SubResult:=CheckDirPathExists(NewDir,lisEnvOptDlgDirectoryNotFound, - NotFoundErrMsg); - if SubResult=mrIgnore then begin - Result:=true; - exit; - end; - if SubResult=mrCancel then begin - Result:=false; - exit; - end; - StopChecking:=false; - Result:=true; -end; - function dbgs(o: TEnvOptParseType): string; begin Result:=EnvOptParseTypeNames[o];