Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(developer): hide 'Remove From Project' for v2.0 projects 🦕 #9956

Merged
merged 3 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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