Skip to content

Commit 7168cc9

Browse files
authored
Merge pull request #162 from SixParQuatre/dl-editor-in-upgrade-ui
Add "download editor in browser" button to the upgrade window.
2 parents 1ab96fb + 77cb76e commit 7168cc9

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

Diff for: UnityLauncherPro/UpgradeWindow.xaml

+9-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
66
xmlns:local="clr-namespace:UnityLauncherPro"
77
mc:Ignorable="d"
8-
Title="Upgrade Project Version" Height="533.165" Width="455" Background="{DynamicResource ThemeDarkestBackground}" MinWidth="319" MinHeight="555" ResizeMode="NoResize" WindowStartupLocation="CenterOwner" HorizontalAlignment="Left" VerticalAlignment="Top" PreviewKeyDown="Window_PreviewKeyDown" ShowInTaskbar="False">
8+
Title="Upgrade Project Version" Height="533.165" Width="552" Background="{DynamicResource ThemeDarkestBackground}" MinWidth="319" MinHeight="555" ResizeMode="NoResize" WindowStartupLocation="CenterOwner" HorizontalAlignment="Left" VerticalAlignment="Top" PreviewKeyDown="Window_PreviewKeyDown" ShowInTaskbar="False">
99

1010
<Grid>
1111
<StackPanel Orientation="Horizontal">
@@ -15,19 +15,22 @@
1515
<TextBox MinWidth="100" CaretBrush="#FFE2E2E2" x:Name="txtCurrentPlatform" Background="{DynamicResource ThemeDarkMenuBar}" BorderBrush="{x:Null}" Foreground="#FFC7C7C7" SelectionBrush="#FF003966" BorderThickness="0" Margin="0,16,0,0" UndoLimit="64" Text="Platform" IsReadOnly="True" VerticalAlignment="Top" />
1616
</StackPanel>
1717
<Label x:Name="lblAvailableVersions" Content="Available Unity Versions" HorizontalAlignment="Left" Margin="9,94,0,0" VerticalAlignment="Top" Foreground="{DynamicResource ThemeButtonForeground}"/>
18-
18+
1919
<StackPanel Orientation="Horizontal" Margin="9,47,9,0">
20-
<Button Style="{StaticResource CustomButton}" x:Name="btnOpenReleasePage" ToolTip="Open Release Notes Page in Browser" Background="{DynamicResource ThemeButtonBackground}" Foreground="#FFC1C1C1" BorderBrush="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Top" Height="35" Click="BtnOpenReleasePage_Click" Width="125" >
21-
<Label Foreground="{DynamicResource ThemeButtonForeground}" Content="_Open Release Notes"/>
20+
<Button Style="{StaticResource CustomButton}" x:Name="btnOpenReleasePage" ToolTip="Open Release Notes Page in Browser" Background="{DynamicResource ThemeButtonBackground}" Foreground="#FFC1C1C1" BorderBrush="{x:Null}" VerticalAlignment="Top" Height="35" Click="BtnOpenReleasePage_Click" Width="98" >
21+
<Label Foreground="{DynamicResource ThemeButtonForeground}" Content="_Release Notes"/>
2222
</Button>
23-
<Button Style="{StaticResource CustomButton}" x:Name="btnDownload" Background="{DynamicResource ThemeButtonBackground}" Foreground="#FFC1C1C1" Margin="9,0,9,0" BorderBrush="{x:Null}" HorizontalAlignment="Right" VerticalAlignment="Top" Height="35" Click="BtnDownload_Click" Width="125" >
23+
<Button Style="{StaticResource CustomButton}" x:Name="btnDownload" Background="{DynamicResource ThemeButtonBackground}" Foreground="#FFC1C1C1" Margin="9,0,0,0" BorderBrush="{x:Null}" HorizontalAlignment="Right" VerticalAlignment="Top" Height="35" Click="BtnDownload_Click" Width="125" >
2424
<Label Foreground="{DynamicResource ThemeButtonForeground}" Content="Download in _Browser"/>
2525
</Button>
26+
<Button Style="{StaticResource CustomButton}" x:Name="btnDownloadEditorInBrwwoser" Background="{DynamicResource ThemeButtonBackground}" Foreground="#FFC1C1C1" Margin="9,0,9,0" BorderBrush="{x:Null}" VerticalAlignment="Top" Height="35" Click="BtnDownloadEditor_Click" Width="159" >
27+
<Label Foreground="{DynamicResource ThemeButtonForeground}" Content="Download Editor in _Browser"/>
28+
</Button>
2629
<Button Style="{StaticResource CustomButton}" x:Name="btnInstall" Background="{DynamicResource ThemeButtonBackground}" Foreground="#FFC1C1C1" BorderBrush="{x:Null}" HorizontalAlignment="Right" VerticalAlignment="Top" Height="35" Width="125" Click="btnInstall_Click" ToolTip="Downloads Unity web installer into Temp folder and runs it (Root folder path is copied to clipboard)" >
2730
<Label Foreground="{DynamicResource ThemeButtonForeground}" Content="_Download &amp; Install"/>
2831
</Button>
2932
</StackPanel>
30-
33+
3134
<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" >
3235
<Label Foreground="{DynamicResource ThemeButtonForeground}" Content="_Cancel"/>
3336
</Button>

Diff for: UnityLauncherPro/UpgradeWindow.xaml.cs

+14
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,20 @@ private void BtnOpenReleasePage_Click(object sender, RoutedEventArgs e)
106106
Tools.OpenReleaseNotes(txtCurrentVersion.Text);
107107
}
108108

109+
110+
private void BtnDownloadEditor_Click(object sender, RoutedEventArgs e)
111+
{
112+
string url = Tools.GetUnityReleaseURL(txtCurrentVersion.Text);
113+
if (string.IsNullOrEmpty(url) == false)
114+
{
115+
Tools.DownloadInBrowser(url, txtCurrentVersion.Text, true);
116+
}
117+
else
118+
{
119+
Console.WriteLine("Failed getting Unity Installer URL for " + txtCurrentVersion.Text);
120+
}
121+
}
122+
109123
private void BtnDownload_Click(object sender, RoutedEventArgs e)
110124
{
111125
string url = Tools.GetUnityReleaseURL(txtCurrentVersion.Text);

0 commit comments

Comments
 (0)