-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from skowront/issue26
Issue26
- Loading branch information
Showing
24 changed files
with
437 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/Soloplan.WhatsON.GUI.Common/BuildServer/ProgressBarControl .xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<UserControl x:Class="Soloplan.WhatsON.GUI.Common.BuildServer.ProgressBarControl" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:Soloplan.WhatsON.GUI.Common.BuildServer" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
d:DataContext="{d:DesignInstance local:BuildStatusViewModel}" | ||
d:DesignHeight="450" | ||
d:DesignWidth="800" | ||
mc:Ignorable="d"> | ||
<UserControl.Resources> | ||
<BooleanToVisibilityConverter x:Key="BoolToVisibility" /> | ||
</UserControl.Resources> | ||
<StackPanel Orientation="{Binding ControlOrientation, RelativeSource={RelativeSource AncestorType=local:ProgressBarTooltipControl}}"> | ||
<StackPanel Orientation="{Binding ControlOrientation, RelativeSource={RelativeSource AncestorType=local:ProgressBarTooltipControl}}" Visibility="{Binding BuildingNoLongerThenExpected, Converter={StaticResource BoolToVisibility}}"> | ||
<StackPanel Orientation="Horizontal"> | ||
<TextBlock x:Name="CompletionText" Text="Completion: " /> | ||
<TextBlock Text="{Binding Progress}" /> | ||
<TextBlock x:Name="PercentSignText" Text="% " /> | ||
</StackPanel> | ||
<StackPanel Orientation="Horizontal"> | ||
<TextBlock> | ||
<TextBlock.Text> | ||
<MultiBinding StringFormat="{}{0:00}:{1:00}:{2:00}"> | ||
<Binding Path="EstimatedRemaining.Hours" /> | ||
<Binding Path="EstimatedRemaining.Minutes" /> | ||
<Binding Path="EstimatedRemaining.Seconds" /> | ||
</MultiBinding> | ||
</TextBlock.Text> | ||
</TextBlock> | ||
<TextBlock Name="EstimatedRemainingText" Text=" estimated remaining" /> | ||
</StackPanel> | ||
</StackPanel> | ||
<StackPanel Orientation="Horizontal" Visibility="{Binding BuildingLongerThenExpected, Converter={StaticResource BoolToVisibility}}"> | ||
<TextBlock Text="Taking " /> | ||
<TextBlock> | ||
<TextBlock.Text> | ||
<MultiBinding StringFormat="{}{0:00}:{1:00}:{2:00}"> | ||
<Binding Path="BuildTimeExcedingEstimation.Hours" /> | ||
<Binding Path="BuildTimeExcedingEstimation.Minutes" /> | ||
<Binding Path="BuildTimeExcedingEstimation.Seconds" /> | ||
</MultiBinding> | ||
</TextBlock.Text> | ||
</TextBlock> | ||
<TextBlock Text=" longer than estimated." /> | ||
</StackPanel> | ||
</StackPanel> | ||
</UserControl> |
66 changes: 66 additions & 0 deletions
66
src/Soloplan.WhatsON.GUI.Common/BuildServer/ProgressBarControl .xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="ProgressBarTooltipControl.xaml.cs" company="Soloplan GmbH"> | ||
// Copyright (c) Soloplan GmbH. All rights reserved. | ||
// Licensed under the MIT License. See License-file in the project root for license information. | ||
// </copyright> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
|
||
namespace Soloplan.WhatsON.GUI.Common.BuildServer | ||
{ | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
|
||
/// <summary> | ||
/// Control for project build progress. | ||
/// </summary> | ||
public partial class ProgressBarControl : UserControl | ||
{ | ||
/// <summary> | ||
/// Dependency property for <see cref="CulpritsProp"/>. | ||
/// </summary> | ||
public static readonly DependencyProperty ControlOrientationProperty = DependencyProperty.Register(nameof(ControlOrientation), typeof(Orientation), typeof(ProgressBarControl), new PropertyMetadata(Orientation.Vertical)); | ||
|
||
public static readonly DependencyProperty CompactDisplayProperty = DependencyProperty.Register(nameof(CompactDisplay), typeof(bool), typeof(ProgressBarControl), new PropertyMetadata(false, new PropertyChangedCallback(OnCurrentReadingChanged))); | ||
|
||
public ProgressBarControl() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
private static void OnCurrentReadingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) | ||
{ | ||
if (d is ProgressBarTooltipControl control) | ||
{ | ||
control.UpdateTexts(); | ||
} | ||
} | ||
|
||
public Orientation ControlOrientation | ||
{ | ||
get => (Orientation)this.GetValue(ControlOrientationProperty); | ||
set => this.SetValue(ControlOrientationProperty, value); | ||
} | ||
|
||
public bool CompactDisplay | ||
{ | ||
get => (bool)this.GetValue(CompactDisplayProperty); | ||
set => this.SetValue(CompactDisplayProperty, value); | ||
} | ||
|
||
public void UpdateTexts() | ||
{ | ||
if (this.CompactDisplay) | ||
{ | ||
this.CompletionText.Text = string.Empty; | ||
this.EstimatedRemainingText.Text = " ETA"; | ||
this.PercentSignText.Text = "%/"; | ||
} | ||
else | ||
{ | ||
this.CompletionText.Text = "Completion: "; | ||
this.EstimatedRemainingText.Text = " estimated remaining"; | ||
this.PercentSignText.Text = "% "; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.