Skip to content

Commit

Permalink
editor logs button: quick open current log with right mouse button
Browse files Browse the repository at this point in the history
  • Loading branch information
unitycoder committed Mar 21, 2024
1 parent b8e1e3f commit 9ba11c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion UnityLauncherPro/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@
<!-- folders -->
<StackPanel Orientation="Horizontal" Margin="0,4,10,4" VerticalAlignment="Top">
<Label Content="Folders" Foreground="{DynamicResource ThemeButtonForeground}" />
<Button Style="{StaticResource CustomButton}" x:Name="btnOpenEditorLogsFolder" Margin="0" BorderBrush="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Top" Click="BtnOpenEditorLogsFolder_Click" ToolTip="Browse Editor logs folder">
<Button Style="{StaticResource CustomButton}" x:Name="btnOpenEditorLogsFolder" Margin="0" BorderBrush="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Top" Click="BtnOpenEditorLogsFolder_Click" ToolTip="Browse Editor logs folder or Right click to open editor.log" MouseRightButtonUp="btnOpenEditorLogsFolder_MouseRightButtonUp">
<Label Content="_Editor Logs" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Control}}}" />
</Button>
<Button Style="{StaticResource CustomButton}" x:Name="btnOpenPlayerLogs" Margin="10,0,0,0" BorderBrush="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Top" Click="BtnOpenPlayerLogs_Click" ToolTip="Browse Player logs folder">
Expand Down
7 changes: 7 additions & 0 deletions UnityLauncherPro/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3597,6 +3597,13 @@ private void btnHubLogs_Click(object sender, RoutedEventArgs e)
Tools.OpenAppdataSpecialFolder("../Roaming/UnityHub/logs/");
}

private void btnOpenEditorLogsFolder_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
{
var logfolder = Tools.GetEditorLogsFolder();
var logFile = Path.Combine(logfolder, "Editor.log");
if (File.Exists(logFile) == true) Tools.LaunchExe(logFile);
}

//private void menuProjectProperties_Click(object sender, RoutedEventArgs e)
//{
// var proj = GetSelectedProject();
Expand Down

0 comments on commit 9ba11c3

Please sign in to comment.