Skip to content

Commit

Permalink
Fix LT-21999: Disable Save Report on comparison reports (#232)
Browse files Browse the repository at this point in the history
Co-authored-by: Jason Naylor <[email protected]>
  • Loading branch information
jtmaxwell3 and jasonleenaylor authored Dec 10, 2024
1 parent 39e21d1 commit 8de3f0d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions Src/LexText/ParserCore/ParserReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ public ParserReport DiffParserReports(ParserReport other)
diff.ProjectName = DiffNames(ProjectName, other.ProjectName);
diff.SourceText = DiffNames(SourceText, other.SourceText);
diff.MachineName = DiffNames(MachineName, other.MachineName);
diff.Comment = DiffNames(Comment, other.Comment);
diff.Timestamp = Timestamp;
diff.DiffTimestamp = other.Timestamp;
diff.NumWords = NumWords - other.NumWords;
Expand Down
1 change: 1 addition & 0 deletions Src/LexText/ParserUI/ParserReportDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Left" Height="40">
<Button Content="{x:Static local:ParserUIStrings.ksSaveReport}"
ToolTip="{x:Static local:ParserUIStrings.ksSaveReportToolTip}"
IsEnabled="{Binding CanSaveReport}"
Click="SaveParserReport" Width="100" Margin="5"/>
<Label x:Name="commentLabel" Height="27"/>
<Label Content="{Binding DisplayComment, Mode=OneWay}" Height="27"/>
Expand Down
5 changes: 4 additions & 1 deletion Src/LexText/ParserUI/ParserReportViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public string DisplayComment
{
get
{
if (ParserReport.Filename == null)
if (ParserReport.Filename == null && !ParserReport.IsDiff)
{
return ParserUIStrings.ksUnsavedParserReport;
}
Expand Down Expand Up @@ -60,6 +60,9 @@ public bool IsSelected
}
}

public bool CanSaveReport => !ParserReport.IsDiff;


public ParserReportViewModel()
{
ParserReport = new ParserReport();
Expand Down

0 comments on commit 8de3f0d

Please sign in to comment.