Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "download editor in browser" button to the upgrade window. #162

Merged
merged 1 commit into from
Aug 24, 2024
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
15 changes: 9 additions & 6 deletions UnityLauncherPro/UpgradeWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:UnityLauncherPro"
mc:Ignorable="d"
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">
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">

<Grid>
<StackPanel Orientation="Horizontal">
Expand All @@ -15,19 +15,22 @@
<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" />
</StackPanel>
<Label x:Name="lblAvailableVersions" Content="Available Unity Versions" HorizontalAlignment="Left" Margin="9,94,0,0" VerticalAlignment="Top" Foreground="{DynamicResource ThemeButtonForeground}"/>

<StackPanel Orientation="Horizontal" Margin="9,47,9,0">
<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" >
<Label Foreground="{DynamicResource ThemeButtonForeground}" Content="_Open Release Notes"/>
<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" >
<Label Foreground="{DynamicResource ThemeButtonForeground}" Content="_Release Notes"/>
</Button>
<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" >
<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" >
<Label Foreground="{DynamicResource ThemeButtonForeground}" Content="Download in _Browser"/>
</Button>
<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" >
<Label Foreground="{DynamicResource ThemeButtonForeground}" Content="Download Editor in _Browser"/>
</Button>
<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)" >
<Label Foreground="{DynamicResource ThemeButtonForeground}" Content="_Download &amp; Install"/>
</Button>
</StackPanel>

<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" >
<Label Foreground="{DynamicResource ThemeButtonForeground}" Content="_Cancel"/>
</Button>
Expand Down
14 changes: 14 additions & 0 deletions UnityLauncherPro/UpgradeWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,20 @@ private void BtnOpenReleasePage_Click(object sender, RoutedEventArgs e)
Tools.OpenReleaseNotes(txtCurrentVersion.Text);
}


private void BtnDownloadEditor_Click(object sender, RoutedEventArgs e)
{
string url = Tools.GetUnityReleaseURL(txtCurrentVersion.Text);
if (string.IsNullOrEmpty(url) == false)
{
Tools.DownloadInBrowser(url, txtCurrentVersion.Text, true);
}
else
{
Console.WriteLine("Failed getting Unity Installer URL for " + txtCurrentVersion.Text);
}
}

private void BtnDownload_Click(object sender, RoutedEventArgs e)
{
string url = Tools.GetUnityReleaseURL(txtCurrentVersion.Text);
Expand Down
Loading