Skip to content
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
Binary file modified docs/OrthoStreamXP-UserGuide.pdf
Binary file not shown.
13 changes: 13 additions & 0 deletions release-notes/v1.3.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## What's new

- **Esri first, if you prefer it.** In **Settings › Pictures and download**, **Where the pictures come from** has a new choice: **Esri (ArcGIS), then Bing where Esri has no picture**. In some regions Esri's photos are newer or clearer than Bing's; Bing then fills the gaps. Bing first stays the recommended choice.
- **Check for updates.** A new **Check for updates** button at the top of the **Home** page looks for a new version straight away, without waiting for the regular check. When one is found, it is downloaded and offered as usual; otherwise OrthoStreamXP tells you that you already have the newest version, or why it could not look.

## Fixes

- A new version ready to install is now shown at the top of the **Home** page, above the status card, instead of further down where it was easy to miss.
- Sliders on the **Settings** page, and the values next to them, now look greyed out when they cannot be changed (while the scenery is streaming, or when their setting is off), like the switches already did.

## Good to know

- Your choice of where the pictures come from is not changed by the update. Like every setting, it can be changed only while OrthoStreamXP is stopped, and applies from the next start.
3 changes: 3 additions & 0 deletions src/OrthoStreamXP/Gui/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public MainWindow(MainViewModel main)
{
if (new UpdateDialog(offer) { Owner = this }.ShowDialog() == true) _main.Home.InstallConfirmedUpdate();
};
// The Home page's Check for updates button found nothing to install.
_main.Home.UpdateCheckReported += (_, message) =>
MessageBox.Show(this, message, "OrthoStreamXP", MessageBoxButton.OK, MessageBoxImage.Information);
var tray = new TrayIcon(this);
_main.Home.XPlaneStarted += async (_, _) => await HandOverToXPlaneAsync(tray).ConfigureAwait(true);
// The flight is over: back on the Home page, with Stop and (once stopped) the flight's report.
Expand Down
46 changes: 38 additions & 8 deletions src/OrthoStreamXP/Gui/ViewModels/HomeViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ public HomeViewModel(MainViewModel main)
_updateTimer.Tick += async (_, _) =>
{
_updateTimer.Interval = TimeSpan.FromHours(6);
if (await _updates.CheckAsync().ConfigureAwait(true)) Notices = BuildNotices();
if (await _updates.CheckAsync().ConfigureAwait(true) == UpdateCheck.Downloaded) Notices = BuildNotices();
};
CheckForUpdates = new RelayCommand(() => _ = CheckForUpdatesAsync(), () => !_updates.IsChecking);
_updateTimer.Start();
Mount.PropertyChanged += (_, e) =>
{
Expand Down Expand Up @@ -115,6 +116,34 @@ private void OfferUpdate()
UpdateOffered?.Invoke(this, new UpdateOffer(version, _updates.CurrentVersion, ReleaseNotes.Parse(_updates.ReadyNotes), AppUpdates.ReleasePage(version)));
}

/// <summary>Looks for a new version now: one found is shown as the update notice, otherwise the window says why there is none.</summary>
public ICommand CheckForUpdates { get; }

/// <summary>A look asked for by the person found no update to show (up to date, failed, not installed): the window tells them.</summary>
public event EventHandler<string>? UpdateCheckReported;

public string CheckForUpdatesText => _updates.IsChecking ? "Checking…" : "Check for updates";

private async Task CheckForUpdatesAsync()
{
Task<UpdateCheck> check = _updates.CheckAsync();
Raise(nameof(CheckForUpdatesText));
CommandManager.InvalidateRequerySuggested();
UpdateCheck result = await check.ConfigureAwait(true);
Raise(nameof(CheckForUpdatesText));
CommandManager.InvalidateRequerySuggested();
Notices = BuildNotices();
string? message = result switch
{
UpdateCheck.UpToDate => $"No updates are available. You have the newest version of OrthoStreamXP ({_updates.CurrentVersion}).",
UpdateCheck.InProgress => "OrthoStreamXP is already looking for a new version. Try again in a moment.",
UpdateCheck.Failed => "OrthoStreamXP could not look for a new version. Check your internet connection and try again; the details are in the log.",
UpdateCheck.NotInstalled => "No updates are available: this copy of OrthoStreamXP was not installed, so it does not update itself.",
_ => null, // Downloaded or already ready: the update notice shows it.
};
if (message is not null) UpdateCheckReported?.Invoke(this, message);
}

/// <summary>Installs the downloaded version and restarts, once confirmed; not while the scenery streams.</summary>
public void InstallConfirmedUpdate()
{
Expand Down Expand Up @@ -546,6 +575,14 @@ private void MeasureSpeed()
private List<Notice> BuildNotices()
{
var notices = new List<Notice>();
// A new version first: it heads the page.
if (_updates.ReadyVersion is { } version)
notices.Add(Mount.State == MountState.Stopped
? new Notice(Severity.Info, $"OrthoStreamXP {version} is ready to install",
$"A new version was downloaded (you have {_updates.CurrentVersion}). See what's new and install it when you choose; your settings, cache and flight history stay.",
"Update…", InstallUpdate)
: new Notice(Severity.Info, $"OrthoStreamXP {version} is ready to install",
$"A new version was downloaded (you have {_updates.CurrentVersion}). Stop the streaming when you have finished flying, and install it from here."));
if (Mount.State == MountState.Stopped && !ShowReview)
{
if (_tuningNotice is not null) notices.Add(_tuningNotice);
Expand All @@ -556,13 +593,6 @@ private List<Notice> BuildNotices()
notices.Add(new Notice(Severity.Success, $"{PresetName(suited.Level)} suits your PC and connection",
$"OrthoStreamXP watched {suited.MinutesInFlight:0} minutes of flying and found nothing to tune."));
}
if (_updates.ReadyVersion is { } version)
notices.Add(Mount.State == MountState.Stopped
? new Notice(Severity.Info, $"OrthoStreamXP {version} is ready to install",
$"A new version was downloaded (you have {_updates.CurrentVersion}). See what's new and install it when you choose; your settings, cache and flight history stay.",
"Update…", InstallUpdate)
: new Notice(Severity.Info, $"OrthoStreamXP {version} is ready to install",
$"A new version was downloaded (you have {_updates.CurrentVersion}). Stop the streaming when you have finished flying, and install it from here."));
if (_xplaneProblem is not null) notices.Add(_xplaneProblem);
if (Mount.Problem is { } problem)
notices.Add(new Notice(Severity.Error, problem.Title, problem.Message, problem.ActionLabel,
Expand Down
1 change: 1 addition & 0 deletions src/OrthoStreamXP/Gui/ViewModels/SettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public SettingsViewModel(MainViewModel main)
Providers =
[
new Choice("Bing, then Esri where Bing has no picture (recommended)", "bing,esri"),
new Choice("Esri (ArcGIS), then Bing where Esri has no picture", "esri,bing"),
new Choice("Bing only", "bing"),
new Choice("Geoportal in Poland (national orthophoto), Bing and Esri elsewhere", "geoportal,bing,esri"),
];
Expand Down
16 changes: 13 additions & 3 deletions src/OrthoStreamXP/Gui/Views/HomeView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,19 @@

<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<StackPanel Margin="36,28,36,36" MaxWidth="980">
<TextBlock Text="Home" Style="{StaticResource PageTitle}" />
<Grid>
<TextBlock Text="Home" Style="{StaticResource PageTitle}" />
<Button Command="{Binding CheckForUpdates}" HorizontalAlignment="Right" VerticalAlignment="Center" Padding="12,4"
ToolTip="Look for a new version of OrthoStreamXP now" AutomationProperties.Name="{Binding CheckForUpdatesText}">
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource Icon}" Text="&#xE895;" Margin="0,0,8,0" />
<TextBlock Text="{Binding CheckForUpdatesText}" VerticalAlignment="Center" />
</StackPanel>
</Button>
</Grid>

<!-- Notices (a new version first among them) above everything else -->
<ItemsControl ItemsSource="{Binding Notices}" ItemTemplate="{StaticResource NoticeTemplate}" Focusable="False" Margin="0,8,0,0" />

<!-- What is happening, and the one button that matters -->
<Border Style="{StaticResource Card}" Padding="24,20" Margin="0,16,0,0">
Expand Down Expand Up @@ -113,8 +125,6 @@
</Grid>
</Border>

<ItemsControl ItemsSource="{Binding Notices}" ItemTemplate="{StaticResource NoticeTemplate}" Focusable="False" />

<!-- After a flight: what the tuning suggests, to apply or not -->
<Border Style="{StaticResource Card}" Padding="24,20" Margin="0,16,0,0" Visibility="{Binding ShowReview, Converter={StaticResource Visible}}">
<StackPanel>
Expand Down
32 changes: 26 additions & 6 deletions src/OrthoStreamXP/Gui/Views/SettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:ClassModifier="internal">
<UserControl.Resources>
<!-- Fluent's slider does not look disabled when it is (streaming running, or its setting off): dimmed like the switches -->
<Style TargetType="Slider" BasedOn="{StaticResource {x:Type Slider}}">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.4" />
</Trigger>
</Style.Triggers>
</Style>
<!-- A slider's value ("100 %", "Off"), greyed with it -->
<Style x:Key="SliderValue" TargetType="TextBlock">
<Setter Property="Width" Value="80" />
<Setter Property="Margin" Value="12,0,0,0" />
<Setter Property="VerticalAlignment" Value="Center" />
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource TextFillColorDisabledBrush}" />
</Trigger>
</Style.Triggers>
</Style>

<!-- A preset card's content -->
<DataTemplate x:Key="PresetTemplate">
<RadioButton Style="{StaticResource ChoiceCard}"
Expand Down Expand Up @@ -140,7 +160,7 @@
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
<Slider Width="200" Minimum="0" Maximum="100" TickFrequency="10" IsSnapToTickEnabled="True" VerticalAlignment="Center"
Value="{Binding GroundDetail, Delay=400}" AutomationProperties.Name="Ground detail" />
<TextBlock Text="{Binding GroundDetailText}" Width="80" Margin="12,0,0,0" VerticalAlignment="Center" />
<TextBlock Text="{Binding GroundDetailText}" Style="{StaticResource SliderValue}" />
</StackPanel>
</Grid>
</Border>
Expand Down Expand Up @@ -227,7 +247,7 @@
</Grid.ColumnDefinitions>
<StackPanel VerticalAlignment="Center" Margin="0,0,24,0">
<TextBlock Text="Where the pictures come from" />
<TextBlock Style="{StaticResource Caption}" Margin="0,2,0,0" Text="Bing has the sharpest pictures in most places; Esri fills the gaps." />
<TextBlock Style="{StaticResource Caption}" Margin="0,2,0,0" Text="Bing has the sharpest pictures in most places; Esri (ArcGIS) can be newer or clearer in some regions. The second one fills the gaps." />
</StackPanel>
<ComboBox Grid.Column="1" Width="300" VerticalAlignment="Center" ItemsSource="{Binding Providers}" DisplayMemberPath="Label"
SelectedItem="{Binding Provider}" AutomationProperties.Name="Where the pictures come from" />
Expand All @@ -247,7 +267,7 @@
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
<Slider Width="200" Minimum="16" Maximum="256" TickFrequency="16" IsSnapToTickEnabled="True" VerticalAlignment="Center"
Value="{Binding DownloadWorkers, Delay=400}" AutomationProperties.Name="Downloads at once" />
<TextBlock Text="{Binding DownloadWorkersText}" Width="80" Margin="12,0,0,0" VerticalAlignment="Center" />
<TextBlock Text="{Binding DownloadWorkersText}" Style="{StaticResource SliderValue}" />
</StackPanel>
</Grid>
</Border>
Expand Down Expand Up @@ -353,7 +373,7 @@
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
<Slider Width="200" Minimum="0" Maximum="100" TickFrequency="10" IsSnapToTickEnabled="True" VerticalAlignment="Center"
Value="{Binding MatchStrength, Delay=400}" AutomationProperties.Name="Colour matching strength" />
<TextBlock Text="{Binding MatchStrengthText}" Width="80" Margin="12,0,0,0" VerticalAlignment="Center" />
<TextBlock Text="{Binding MatchStrengthText}" Style="{StaticResource SliderValue}" />
</StackPanel>
</Grid>
</Border>
Expand Down Expand Up @@ -404,7 +424,7 @@
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
<Slider Width="200" Minimum="0" Maximum="100" TickFrequency="10" IsSnapToTickEnabled="True" VerticalAlignment="Center"
Value="{Binding SeasonStrength, Delay=400}" AutomationProperties.Name="Season strength" />
<TextBlock Text="{Binding SeasonStrengthText}" Width="80" Margin="12,0,0,0" VerticalAlignment="Center" />
<TextBlock Text="{Binding SeasonStrengthText}" Style="{StaticResource SliderValue}" />
</StackPanel>
</Grid>
</Border>
Expand All @@ -427,7 +447,7 @@
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
<Slider Width="200" Minimum="50" Maximum="100" TickFrequency="5" IsSnapToTickEnabled="True" VerticalAlignment="Center"
Value="{Binding Exposure, Delay=400}" AutomationProperties.Name="Exposure" />
<TextBlock Text="{Binding ExposureText}" Width="80" Margin="12,0,0,0" VerticalAlignment="Center" />
<TextBlock Text="{Binding ExposureText}" Style="{StaticResource SliderValue}" />
</StackPanel>
</Grid>
</Border>
Expand Down
21 changes: 15 additions & 6 deletions src/OrthoStreamXP/Setup/Installation/AppUpdates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,23 @@ public AppUpdates()
/// <summary>The GitHub Release page of a version.</summary>
public static string ReleasePage(string version) => $"{Repository}/releases/tag/v{version}";

/// <summary>Looks for a newer version and downloads it; true when one became ready. Problems (offline, GitHub busy) are only logged.</summary>
public async Task<bool> CheckAsync()
/// <summary>A look for a new version (and its download) is under way.</summary>
public bool IsChecking => _checking;

/// <summary>Looks for a newer version and downloads it. Problems (offline, GitHub busy) are only logged.</summary>
public async Task<UpdateCheck> CheckAsync()
{
if (_manager is null || _checking || Ready is not null) return false;
if (_manager is null) return UpdateCheck.NotInstalled;
if (Ready is not null) return UpdateCheck.AlreadyReady;
if (_checking) return UpdateCheck.InProgress;
_checking = true;
try
{
if (await _manager.CheckForUpdatesAsync().ConfigureAwait(true) is not { } update) return false;
if (await _manager.CheckForUpdatesAsync().ConfigureAwait(true) is not { } update)
{
Log.Info($"OrthoStreamXP {CurrentVersion} is the newest version");
return UpdateCheck.UpToDate;
}
Log.Info($"OrthoStreamXP {update.TargetFullRelease.Version} is available (this is {CurrentVersion}); downloading it");
await _manager.DownloadUpdatesAsync(update).ConfigureAwait(true);
string? notes = update.TargetFullRelease.NotesMarkdown;
Expand All @@ -67,12 +76,12 @@ public async Task<bool> CheckAsync()
: notes;
Ready = update;
Log.Step($"OrthoStreamXP {ReadyVersion} is downloaded and ready to install");
return true;
return UpdateCheck.Downloaded;
}
catch (Exception ex)
{
Log.Info($"Could not look for a new version: {ex.Message}");
return false;
return UpdateCheck.Failed;
}
finally
{
Expand Down
23 changes: 23 additions & 0 deletions src/OrthoStreamXP/Setup/Installation/UpdateCheck.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
namespace OrthoStreamXP.Setup;

/// <summary>What one look for a new version found.</summary>
internal enum UpdateCheck
{
/// <summary>A newer version was found and downloaded: it is ready to install.</summary>
Downloaded,

/// <summary>A newer version was already downloaded before this look.</summary>
AlreadyReady,

/// <summary>This is the newest version.</summary>
UpToDate,

/// <summary>Another look is under way.</summary>
InProgress,

/// <summary>The look failed (offline, GitHub busy); the reason is in the log.</summary>
Failed,

/// <summary>The program was not installed (a build run from the source): it does not look.</summary>
NotInstalled,
}
Loading