diff --git a/developer/src/tike/main/UfrmMessages.pas b/developer/src/tike/main/UfrmMessages.pas index 21d11fe6921..ade6b1d1b8b 100644 --- a/developer/src/tike/main/UfrmMessages.pas +++ b/developer/src/tike/main/UfrmMessages.pas @@ -182,6 +182,12 @@ procedure TfrmMessages.memoMessageDblClick(Sender: TObject); mi := FMessageItems[line] as TMessageItem; FFilename := mi.FileName; + if FFileName = FGlobalProject.FileName then + begin + frmKeymanDeveloper.ShowProject; + Exit; + end; + frm := frmKeymanDeveloper.FindEditorByFileName(FFileName); if not Assigned(frm) then begin diff --git a/developer/src/tike/project/Keyman.Developer.System.Project.ProjectFile.pas b/developer/src/tike/project/Keyman.Developer.System.Project.ProjectFile.pas index e556f80a7df..1d13591347e 100644 --- a/developer/src/tike/project/Keyman.Developer.System.Project.ProjectFile.pas +++ b/developer/src/tike/project/Keyman.Developer.System.Project.ProjectFile.pas @@ -984,17 +984,6 @@ procedure TProject.PopulateFolder(const path: string); end; end; -{ -function IsLMDLKeyboardFile(filename: string): Boolean; - if EndsText('.xml', filename) then - begin - Result := Pos('ldmlKeyboard3.dtd', ReadUtf8FileText(ff)) > 0; - end - else - Result := False; -end; -} - function TProject.CanUpgrade: Boolean; var i: Integer; @@ -1015,12 +1004,12 @@ function TProject.CanUpgrade: Boolean; if Options.BuildPath.Contains('$SOURCEPATH') then begin Result := False; - FUpgradeMessages.Add('The BuildPath option contains "$SOURCEPATH"'); + FUpgradeMessages.Add('The BuildPath project setting contains the "$SOURCEPATH" tag, which is no longer supported'); end; if Options.BuildPath.Contains('$VERSION') then begin Result := False; - FUpgradeMessages.Add('The BuildPath option contains "$VERSION"'); + FUpgradeMessages.Add('The BuildPath project setting contains the "$VERSION" tag, which is no longer supported'); end; for i := 0 to Files.Count - 1 do @@ -1037,7 +1026,7 @@ function TProject.CanUpgrade: Boolean; Continue; end; - FUpgradeMessages.Add('File '+Files[i].FileName+' is outside the project folder'); + FUpgradeMessages.Add('File '+Files[i].FileName+' is outside the project folder. All primary source files must be in the same folder as the project file, or in a subfolder.'); Result := False; end; end; diff --git a/developer/src/tike/project/Keyman.Developer.UI.Project.UpgradeProject.pas b/developer/src/tike/project/Keyman.Developer.UI.Project.UpgradeProject.pas index 7e09f2a1ba3..fe4ae171378 100644 --- a/developer/src/tike/project/Keyman.Developer.UI.Project.UpgradeProject.pas +++ b/developer/src/tike/project/Keyman.Developer.UI.Project.UpgradeProject.pas @@ -13,13 +13,18 @@ function TryUpgradeProject(Project: TProject): TUpgradeResult; implementation uses + System.Classes, System.UITypes, Vcl.Controls, Vcl.Dialogs, + UfrmMessages, + Keyman.Developer.System.Project.ProjectLog, KeymanDeveloperOptions; function TryUpgradeProject(Project: TProject): TUpgradeResult; +var + msg: string; begin Result := urNoAction; @@ -29,22 +34,32 @@ function TryUpgradeProject(Project: TProject): TUpgradeResult; Exit; end; -{ if not FKeymanDeveloperOptions.PromptForProjectUpgrade then +{ TODO: + if not FKeymanDeveloperOptions.PromptForProjectUpgrade then begin // User wishes to stick with v1.0 projects Exit; - end;} + end; +} + + frmMessages.Clear; if not Project.CanUpgrade then begin // Project has restrictions, such as files in wrong folders, so // we cannot upgrade. Show a message for the user - ShowMessage('The current project cannot be upgraded to v2.0. The following errors were encountered:'#13#10+ - Project.UpgradeMessages.Text); + for msg in Project.UpgradeMessages do + begin + Project.Log(plsError, Project.FileName, msg, 0, 0); + end; + MessageDlg('Some issues must be addressed before the current project can '+ + 'be upgraded to Keyman Developer 17 format. '+ + 'Details of the issues are listed in the Messages panel.', mtError, [mbOk], 0); Exit; end; - case MessageDlg('The current project can be upgraded to Keyman Developer 17.0 format. Do you wish to upgrade it (recommended)?'#13#10#13#10+ + case MessageDlg('The current project can be upgraded to Keyman Developer 17.0 format. '+ + 'Do you wish to upgrade it (recommended)?'#13#10#13#10+ 'Note: upgraded projects will not be readable by older versions of Keyman Developer.', mtConfirmation, mbYesNoCancel, 0) of mrNo: Exit;