Skip to content

Commit

Permalink
Merge pull request #9956 from keymanapp/chore/developer/9948-hide-rem…
Browse files Browse the repository at this point in the history
…ove-project

chore(developer): hide 'Remove From Project' for v2.0 projects 🦕
  • Loading branch information
mcdurdin authored Nov 15, 2023
2 parents c060666 + 96e78c6 commit 26900f7
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ procedure TfrmProject.WebCommandProject(Command: WideString; Params: TStringList
if Command = 'fileaddnew' then
begin
{ create a new file, add it to the project }
Assert(FGlobalProject.Options.Version = pv10);
with TfrmNewFileDetails.Create(Self) do
try
BaseFileName := FGlobalProject.FileName;
Expand All @@ -421,6 +422,7 @@ procedure TfrmProject.WebCommandProject(Command: WideString; Params: TStringList
else if Command = 'fileaddexisting' then
begin
{ locate an existing file, add it to the project }
Assert(FGlobalProject.Options.Version = pv10);
FFileType := FileTypeFromParamType;

dlgOpenFile.Filter := GetFileTypeFilter(FFileType, FDefaultExtension);
Expand Down Expand Up @@ -479,6 +481,7 @@ procedure TfrmProject.WebCommandProject(Command: WideString; Params: TStringList
end
else if Command = 'removefile' then
begin
Assert(FGlobalProject.Options.Version = pv10);
pf := SelectedProjectFile;
if Assigned(pf) then
begin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ function TryUpgradeProject(Project: TProject): TUpgradeResult;
Exit;
end;

case MessageDlg('The current project can be upgraded to Keyman Developer 17.0 format. Do you wish to upgrade it (recommended)?',
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;
mrCancel: Exit(urCancelled);
Expand Down
10 changes: 6 additions & 4 deletions developer/src/tike/xml/project/distribution.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,12 @@
<xsl:with-param name="caption">Open Containing Folder</xsl:with-param>
<xsl:with-param name="command">keyman:opencontainingfolder?id=<xsl:value-of select="ID" /></xsl:with-param>
</xsl:call-template>
<xsl:call-template name="menuitem">
<xsl:with-param name="caption">Remove from Project</xsl:with-param>
<xsl:with-param name="command">keyman:removefile?id=<xsl:value-of select="ID" /></xsl:with-param>
</xsl:call-template>
<xsl:if test="/KeymanDeveloperProject/Options/Version != '2.0' or not(/KeymanDeveloperProject/Options/Version)">
<xsl:call-template name="menuitem">
<xsl:with-param name="caption">Remove from Project</xsl:with-param>
<xsl:with-param name="command">keyman:removefile?id=<xsl:value-of select="ID" /></xsl:with-param>
</xsl:call-template>
</xsl:if>
</div>
</xsl:template>

Expand Down
12 changes: 7 additions & 5 deletions developer/src/tike/xml/project/keyboards.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,13 @@
<xsl:with-param name="command">keyman:openbuildfolder?id=<xsl:value-of select="ID" />
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="menuitem">
<xsl:with-param name="caption">Remove from Project</xsl:with-param>
<xsl:with-param name="command">keyman:removefile?id=<xsl:value-of select="ID" />
</xsl:with-param>
</xsl:call-template>
<xsl:if test="/KeymanDeveloperProject/Options/Version != '2.0' or not(/KeymanDeveloperProject/Options/Version)">
<xsl:call-template name="menuitem">
<xsl:with-param name="caption">Remove from Project</xsl:with-param>
<xsl:with-param name="command">keyman:removefile?id=<xsl:value-of select="ID" />
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</div>
</xsl:template>

Expand Down
24 changes: 14 additions & 10 deletions developer/src/tike/xml/project/models.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,13 @@
<xsl:with-param name="command">keyman:openbuildfolder?id=<xsl:value-of select="ID" />
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="menuitem">
<xsl:with-param name="caption">Remove from Project</xsl:with-param>
<xsl:with-param name="command">keyman:removefile?id=<xsl:value-of select="ID" />
</xsl:with-param>
</xsl:call-template>
<xsl:if test="KeymanDeveloperProject/Options/Version != '2.0' or not(KeymanDeveloperProject/Options/Version)">
<xsl:call-template name="menuitem">
<xsl:with-param name="caption">Remove from Project</xsl:with-param>
<xsl:with-param name="command">keyman:removefile?id=<xsl:value-of select="ID" />
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</div>
</xsl:template>

Expand All @@ -193,11 +195,13 @@
<xsl:with-param name="command">keyman:opencontainingfolder?id=<xsl:value-of select="ID" />
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="menuitem">
<xsl:with-param name="caption">Remove from Project</xsl:with-param>
<xsl:with-param name="command">keyman:removefile?id=<xsl:value-of select="ID" />
</xsl:with-param>
</xsl:call-template>
<xsl:if test="/KeymanDeveloperProject/Options/Version != '2.0' or not(/KeymanDeveloperProject/Options/Version)">
<xsl:call-template name="menuitem">
<xsl:with-param name="caption">Remove from Project</xsl:with-param>
<xsl:with-param name="command">keyman:removefile?id=<xsl:value-of select="ID" />
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</div>
</xsl:template>
</xsl:stylesheet>
10 changes: 6 additions & 4 deletions developer/src/tike/xml/project/packages.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,12 @@
<xsl:with-param name="command">keyman:openbuildfolder?id=<xsl:value-of select="ID" />
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="menuitem">
<xsl:with-param name="caption">Remove from Project</xsl:with-param>
<xsl:with-param name="command">keyman:removefile?id=<xsl:value-of select="ID" /></xsl:with-param>
</xsl:call-template>
<xsl:if test="/KeymanDeveloperProject/Options/Version != '2.0' or not(/KeymanDeveloperProject/Options/Version)">
<xsl:call-template name="menuitem">
<xsl:with-param name="caption">Remove from Project</xsl:with-param>
<xsl:with-param name="command">keyman:removefile?id=<xsl:value-of select="ID" /></xsl:with-param>
</xsl:call-template>
</xsl:if>
</div>
</xsl:template>

Expand Down

0 comments on commit 26900f7

Please sign in to comment.