mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Minor Check UI improvements (#851)
* Minor Check UI improvements * Move Check warning below status box * Hover text on status message * Full status in tooltip * Add ellipsis to status text * null ref assignment * OneWay * trigger StatusFirstLine property changed * Better status property block * wrong op
This commit is contained in:
@@ -61,6 +61,7 @@
|
||||
- Use null for 0 speed internally
|
||||
- Don't hash bad SS
|
||||
- Add and use status label for Check window
|
||||
- Minor Check UI improvements
|
||||
|
||||
### 3.3.0 (2025-01-03)
|
||||
|
||||
|
||||
@@ -174,10 +174,29 @@ namespace MPF.Frontend.ViewModels
|
||||
{
|
||||
_status = value;
|
||||
TriggerPropertyChanged(nameof(Status));
|
||||
TriggerPropertyChanged(nameof(StatusFirstLine));
|
||||
}
|
||||
}
|
||||
private string _status;
|
||||
|
||||
/// <summary>
|
||||
/// Currently displayed status trimmed to one line
|
||||
/// </summary>
|
||||
public string StatusFirstLine
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrEmpty(Status))
|
||||
return string.Empty;
|
||||
|
||||
var statusLines = Status.Split('\n');
|
||||
if (statusLines.Length > 1)
|
||||
return statusLines[0] + " (...)";
|
||||
|
||||
return statusLines[0];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indicates the status of the check dump button
|
||||
/// </summary>
|
||||
@@ -506,13 +525,7 @@ namespace MPF.Frontend.ViewModels
|
||||
/// </summary>
|
||||
private void ProgressUpdated(object? sender, ResultEventArgs value)
|
||||
{
|
||||
var message = value?.Message;
|
||||
|
||||
// Update the label with only the first line of output
|
||||
if (message != null && message.Contains("\n"))
|
||||
Status = message.Split('\n')[0] + " (...)";
|
||||
else
|
||||
Status = message ?? string.Empty;
|
||||
Status = value?.Message ?? string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -110,6 +110,14 @@
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Margin="5,5,5,5" HorizontalAlignment="Stretch" Header="Status">
|
||||
<UniformGrid Margin="5,5,5,5" Grid.ColumnSpan="2">
|
||||
<TextBlock x:Name="StatusLabel" VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
ToolTipService.ToolTip="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Text="{Binding StatusFirstLine}" />
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Margin="5,5,5,5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<GroupBox.Template>
|
||||
<ControlTemplate TargetType="GroupBox">
|
||||
@@ -128,13 +136,6 @@
|
||||
</Label>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Margin="5,5,5,5" HorizontalAlignment="Stretch" Header="Status">
|
||||
<UniformGrid Margin="5,5,5,5" Grid.ColumnSpan="2">
|
||||
<TextBlock x:Name="StatusLabel" VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
Text="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
|
||||
<!-- Check Dump / Cancel -->
|
||||
<GroupBox Margin="5,5,5,5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<GroupBox.Template>
|
||||
|
||||
@@ -166,6 +166,8 @@ namespace MPF.UI.Windows
|
||||
bool? checkAgain = DisplayUserMessage("Check Complete", "The dump has been processed successfully! Would you like to check another dump?", 2, false);
|
||||
if (checkAgain == false)
|
||||
Close();
|
||||
else
|
||||
CheckDumpViewModel.Status = string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user