Skip to content

Commit

Permalink
chore(developer): hide 'Remove From Project' for v2.0 projects
Browse files Browse the repository at this point in the history
Relates to #9948.
  • Loading branch information
mcdurdin committed Nov 7, 2023
1 parent 0285993 commit eb97eb9
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 23 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
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 eb97eb9

Please sign in to comment.