Skip to content

Commit

Permalink
Merge pull request #108 from opensky-to/small-fixes
Browse files Browse the repository at this point in the history
Small fixed release
  • Loading branch information
sushiat authored Dec 26, 2023
2 parents ad95990 + e33d671 commit 5f4c9d5
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 5 deletions.
1 change: 1 addition & 0 deletions OpenSky.Client.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ OpenSky project 2021-${CurrentDate.Year}
<s:Boolean x:Key="/Default/UserDictionary/Words/=Headered/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ICAO/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=INSTALLFOLDER/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Kunstler/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=magdecl/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=manualrmk/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=mapviewer/@EntryIndexedValue">True</s:Boolean>
Expand Down
2 changes: 1 addition & 1 deletion OpenSky.Client/Controls/MapView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
xmlns:ui="http://schemas.modernwpf.com/2019"
xmlns:converters="clr-namespace:OpenSky.Client.Converters"
xmlns:controls="clr-namespace:OpenSky.Client.Controls"
Loaded="MapViewOnLoaded" Unloaded="MapViewOnUnloaded"
Loaded="MapViewOnLoaded" Unloaded="MapViewOnUnloaded" SizeChanged="MapViewSizeChanged"
d:DesignHeight="450" d:DesignWidth="800" MouseWheel="MapViewOnMouseWheel">
<UserControl.DataContext>
<models:MapViewViewModel />
Expand Down
20 changes: 20 additions & 0 deletions OpenSky.Client/Controls/MapView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,26 @@ private void MapViewOnUnloaded(object sender, RoutedEventArgs e)
}
}

/// -------------------------------------------------------------------------------------------------
/// <summary>
/// Map view size changed.
/// </summary>
/// <remarks>
/// sushi.at, 26/12/2023.
/// </remarks>
/// <param name="sender">
/// Source of the event.
/// </param>
/// <param name="e">
/// Size changed event information.
/// </param>
/// -------------------------------------------------------------------------------------------------
private void MapViewSizeChanged(object sender, SizeChangedEventArgs e)
{
this.WpfMapView.ZoomLevel += 1;
this.WpfMapView.ZoomLevel -= 1;
}

/// -------------------------------------------------------------------------------------------------
/// <summary>
/// simBrief waypoint markers collection changed.
Expand Down
10 changes: 8 additions & 2 deletions OpenSky.Client/Controls/Models/AircraftTypeDetailsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ private void GetAircraftImage()
this.AircraftImage = image;
lock (ImageCache)
{
ImageCache.Add(typeCopy.Id, image);
if (!ImageCache.ContainsKey(typeCopy.Id))
{
ImageCache.Add(typeCopy.Id, image);
}
}
}
catch (Exception ex)
Expand All @@ -287,7 +290,10 @@ private void GetAircraftImage()
this.AircraftImagePlaceholderText = "No image available";
lock (ImageCache)
{
ImageCache.Add(typeCopy.Id, null);
if (!ImageCache.ContainsKey(typeCopy.Id))
{
ImageCache.Add(typeCopy.Id, null);
}
}
});
}
Expand Down
5 changes: 5 additions & 0 deletions OpenSky.Client/Converters/NullItemToVisibilityConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public class NullItemToVisibilityConverter : IValueConverter
/// -------------------------------------------------------------------------------------------------
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (parameter is string and "invert")
{
return value != null ? Visibility.Collapsed : Visibility.Visible;
}

return value == null ? Visibility.Collapsed : Visibility.Visible;
}

Expand Down
3 changes: 3 additions & 0 deletions OpenSky.Client/Pages/NewAircraft.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -268,5 +268,8 @@
</Grid>
</GroupBox>
</Grid>
<Border Background="Black" Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" Opacity=".8" CornerRadius="5" Visibility="{Binding SelectedAircraftType, Converter={StaticResource NullItemToVisibilityConverter}, ConverterParameter=invert}">
<TextBlock Foreground="{StaticResource OpenSkyTealLightBrush}" FontSize="30" HorizontalAlignment="Center" VerticalAlignment="Center">No aircraft type selected</TextBlock>
</Border>
</Grid>
</controls:OpenSkyPage>
4 changes: 2 additions & 2 deletions OpenSky.Client/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
[assembly: AssemblyVersion("0.5.10")]
[assembly: AssemblyFileVersion("0.5.10")]
[assembly: AssemblyVersion("0.5.11")]
[assembly: AssemblyFileVersion("0.5.11")]

// This allows us to detect debug mode in XAML
#if DEBUG
Expand Down
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
OpenSky Client Changelog
======================================================================================

--------------------------------------------------------------------------------------
Version 0.5.11 (ALPHA5)
--------------------------------------------------------------------------------------
- Propper fix for aircraft type image caching bug
- Map view resize will now re-render tiles
- New aircraft dialog disabled right side of view when no type is selected yet

--------------------------------------------------------------------------------------
Version 0.5.10 (ALPHA5)
--------------------------------------------------------------------------------------
Expand Down

0 comments on commit 5f4c9d5

Please sign in to comment.