Skip to content

Commit 60bf073

Browse files
committed
adjust Project Upgrade window, fix null ref on explorer project launch (if missing unity version)
1 parent 20a1747 commit 60bf073

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

Diff for: UnityLauncherPro/MainWindow.xaml.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,8 @@ private void BtnUpgradeProject_Click(object sender, RoutedEventArgs e)
990990
private void GridRecent_Loaded(object sender, RoutedEventArgs e)
991991
{
992992
Tools.SetFocusToGrid(gridRecent);
993-
SetStatus("Ready (" + projectsSource.Count + " projects)");
993+
// if coming from explorer launch, and missing unity version, projectsource is still null?
994+
if (projectsSource != null) SetStatus("Ready (" + projectsSource.Count + " projects)");
994995
}
995996

996997
private void BtnExploreUnity_Click(object sender, RoutedEventArgs e)

Diff for: UnityLauncherPro/UpgradeWindow.xaml

+19-18
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,31 @@
66
xmlns:local="clr-namespace:UnityLauncherPro"
77
mc:Ignorable="d"
88
Title="Upgrade Project Version" Height="533.165" Width="418.684" Background="{DynamicResource ThemeDarkestBackground}" MinWidth="319" MinHeight="555" ResizeMode="NoResize" WindowStartupLocation="CenterOwner" HorizontalAlignment="Left" VerticalAlignment="Top" PreviewKeyDown="Window_PreviewKeyDown" ShowInTaskbar="False">
9-
10-
<Grid>
11-
<Label x:Name="lblCurrentVersion" Content="Project Current Version" HorizontalAlignment="Left" Margin="9,11,0,0" VerticalAlignment="Top" Foreground="{DynamicResource ThemeButtonForeground}" Width="139"/>
12-
<TextBox MinWidth="100" CaretBrush="#FFE2E2E2" x:Name="txtCurrentVersion" Background="{DynamicResource ThemeDarkMenuBar}" BorderBrush="{x:Null}" Foreground="#FFC7C7C7" SelectionBrush="#FF003966" BorderThickness="0" Margin="173,16,37,0" UndoLimit="64" Text="Version" IsReadOnly="True" VerticalAlignment="Top" />
139

10+
<Grid>
11+
<StackPanel Orientation="Horizontal">
12+
<Label x:Name="lblCurrentVersion" Content="Project version:" HorizontalAlignment="Left" Margin="9,11,0,0" VerticalAlignment="Top" Foreground="{DynamicResource ThemeButtonForeground}"/>
13+
<TextBox MinWidth="100" CaretBrush="#FFE2E2E2" x:Name="txtCurrentVersion" Background="{DynamicResource ThemeDarkMenuBar}" BorderBrush="{x:Null}" Foreground="#FFC7C7C7" SelectionBrush="#FF003966" BorderThickness="0" Margin="0,16,0,0" UndoLimit="64" Text="Version" IsReadOnly="True" VerticalAlignment="Top" />
14+
</StackPanel>
1415
<Label x:Name="lblAvailableVersions" Content="Available Unity Versions" HorizontalAlignment="Left" Margin="9,94,0,0" VerticalAlignment="Top" Foreground="{DynamicResource ThemeButtonForeground}"/>
15-
<Button Style="{StaticResource CustomButton}" x:Name="btnDownload" Background="{DynamicResource ThemeButtonBackground}" Foreground="#FFC1C1C1" Margin="0,47,8,0" BorderBrush="{x:Null}" HorizontalAlignment="Right" VerticalAlignment="Top" Height="35" Click="BtnDownload_Click" >
16+
<Button Style="{StaticResource CustomButton}" x:Name="btnDownload" Background="{DynamicResource ThemeButtonBackground}" Foreground="#FFC1C1C1" Margin="0,47,8,0" BorderBrush="{x:Null}" HorizontalAlignment="Right" VerticalAlignment="Top" Height="35" Click="BtnDownload_Click" Width="150" >
1617
<Label Foreground="{DynamicResource ThemeButtonForeground}" Content="_Download in Browser"/>
17-
</Button>
18-
<Button Style="{StaticResource CustomButton}" x:Name="btnOpenReleasePage" Background="{DynamicResource ThemeButtonBackground}" Foreground="#FFC1C1C1" Margin="9,47,0,0" BorderBrush="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Top" Height="35" Click="BtnOpenReleasePage_Click" >
19-
<Label Foreground="{DynamicResource ThemeButtonForeground}" Content="_Open Release Page"/>
20-
</Button>
18+
</Button>
19+
<Button Style="{StaticResource CustomButton}" x:Name="btnOpenReleasePage" ToolTip="Open Release Notes Page in Browser" Background="{DynamicResource ThemeButtonBackground}" Foreground="#FFC1C1C1" Margin="9,47,0,0" BorderBrush="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Top" Height="35" Click="BtnOpenReleasePage_Click" Width="150" >
20+
<Label Foreground="{DynamicResource ThemeButtonForeground}" Content="_Open Release Notes"/>
21+
</Button>
2122
<Button Style="{StaticResource CustomButton}" x:Name="btnCancelUpgrade" Background="{DynamicResource ThemeButtonBackground}" Foreground="#FFC1C1C1" Margin="9,434,0,0" BorderBrush="{x:Null}" HorizontalAlignment="Left" Width="111" VerticalAlignment="Top" Height="51" Click="BtnCancelUpgrade_Click" >
2223
<Label Foreground="{DynamicResource ThemeButtonForeground}" Content="_Cancel"/>
23-
</Button>
24-
<Button Style="{StaticResource CustomButton}" x:Name="btnUpgradeProject" Background="{DynamicResource ThemeButtonBackground}" Foreground="#FFC1C1C1" Margin="0,434,8,0" BorderBrush="{x:Null}" HorizontalAlignment="Right" Width="159" VerticalAlignment="Top" Height="51" Click="BtnUpgradeProject_Click" >
24+
</Button>
25+
<Button Style="{StaticResource CustomButton}" x:Name="btnUpgradeProject" ToolTip="Launch with selected Unity version" Background="{DynamicResource ThemeButtonBackground}" Foreground="#FFC1C1C1" Margin="0,434,8,0" BorderBrush="{x:Null}" HorizontalAlignment="Right" Width="159" VerticalAlignment="Top" Height="51" Click="BtnUpgradeProject_Click" >
2526
<Label Foreground="{DynamicResource ThemeButtonForeground}" Content="_Upgrade Project"/>
26-
</Button>
27+
</Button>
2728
<DataGrid x:Name="gridAvailableVersions" SelectionMode="Single" HorizontalAlignment="Left" Height="304" Margin="10,121,0,0" VerticalAlignment="Top" Width="393" HeadersVisibility="None" AutoGenerateColumns="False" IsSynchronizedWithCurrentItem="True" Foreground="{DynamicResource ThemeButtonForeground}" Background="{DynamicResource ThemeMainBackgroundColor}" PreviewKeyDown="GridAvailableVersions_PreviewKeyDown" Loaded="GridAvailableVersions_Loaded" PreviewMouseDoubleClick="GridAvailableVersions_PreviewMouseDoubleClick" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled">
28-
<DataGrid.Columns>
29-
<DataGridTextColumn Header="Key" Binding="{Binding Key}" IsReadOnly="True" />
30-
<DataGridTextColumn Header="Value" Binding="{Binding Value}" IsReadOnly="True" />
31-
</DataGrid.Columns>
32-
</DataGrid>
29+
<DataGrid.Columns>
30+
<DataGridTextColumn Header="Key" Binding="{Binding Key}" IsReadOnly="True" />
31+
<DataGridTextColumn Header="Value" Binding="{Binding Value}" IsReadOnly="True" />
32+
</DataGrid.Columns>
33+
</DataGrid>
3334

34-
</Grid>
35+
</Grid>
3536
</Window>

0 commit comments

Comments
 (0)