IDE: compiler options: when warn about paths give hint where to find the inherited paths

git-svn-id: trunk@51758 -
This commit is contained in:
mattias 2016-02-29 17:17:56 +00:00
parent 53d48e17bf
commit aa1dbeba55
2 changed files with 9 additions and 5 deletions

View File

@ -76,7 +76,7 @@ implementation
const
cBrowseBtnSize = 50;
function CheckSearchPath(const Context, ExpandedPath: string; Level: TCheckCompileOptionsMsgLvl): boolean;
function CheckSearchPath(const Context, ExpandedPath: string; Level: TCheckCompileOptionsMsgLvl; Hint: string = ''): boolean;
var
CurPath: string;
p: integer;
@ -85,13 +85,15 @@ var
begin
Result := False;
if Hint<>'' then Hint:=#13#13+Hint;
// check for *
if Ord(Level) <= Ord(ccomlHints) then
begin
if System.Pos('*', ExpandedPath) > 0 then
begin
if IDEMessageDialog(lisHint, Format(
lisTheContainsAStarCharacterLazarusUsesThisAsNormalCh, [Context, LineEnding]),
lisTheContainsAStarCharacterLazarusUsesThisAsNormalCh, [Context, LineEnding])+Hint,
mtWarning, [mbOK, mbCancel]) <> mrOk then
exit;
end;
@ -110,7 +112,7 @@ begin
if not DirPathExistsCached(CurPath) then
begin
if IDEMessageDialog(lisCCOWarningCaption, Format(
lisTheContainsANotExistingDirectory, [Context, LineEnding, CurPath]),
lisTheContainsANotExistingDirectory, [Context, LineEnding, CurPath])+Hint,
mtWarning, [mbIgnore, mbCancel]) <> mrIgnore then
Exit;
end;
@ -130,7 +132,7 @@ begin
ErrorMsg := SpecialCharsToStr(HasChars);
if ErrorMsg <> '' then
begin
if IDEMessageDialog(lisCCOWarningCaption, Context + LineEnding + ErrorMsg,
if IDEMessageDialog(lisCCOWarningCaption, Context + LineEnding + ErrorMsg+Hint,
mtWarning, [mbOK, mbCancel]) <> mrOk then
exit;
end;
@ -162,7 +164,7 @@ var
if NewParsedOutputDir<>'' then
p:=RemoveSearchPaths(p,NewParsedOutputDir);
Result := CheckSearchPath(Context, p, Level);
Result := CheckSearchPath(Context, p, Level, lisHintClickOnShowOptionsToFindOutWhereInheritedPaths);
end;
var

View File

@ -2396,6 +2396,8 @@ resourcestring
lisSAMUnableToShowAbstractMethodsOfTheCurrentClassBecaus = 'Unable to show '
+'abstract methods of the current class, because';
lisCCOWarningCaption = 'Warning';
lisHintClickOnShowOptionsToFindOutWhereInheritedPaths = 'Hint: Click on "'
+'Show Options" to find out where inherited paths are coming from.';
lisFileNotFound5 = 'File not found:%s%s';
lisMovingTheseUnitsWillBreakTheirUsesSectionsSeeMessa = 'Moving these units '
+'will break their uses sections. See Messages window for details.';