@@ -53,7 +53,7 @@ public partial class MainWindow : Window
5353
5454 Dictionary < string , SolidColorBrush > origResourceColors = new Dictionary < string , SolidColorBrush > ( ) ;
5555
56- string latestBuildReportProjectPath = null ;
56+ string currentBuildReportProjectPath = null ;
5757 List < List < string > > buildReports = new List < List < string > > ( ) ;
5858 int currentBuildReport = 0 ;
5959
@@ -791,12 +791,11 @@ private void OnWindowKeyDown(object sender, KeyEventArgs e)
791791 switch ( e . Key )
792792 {
793793 case Key . F5 : // refresh unitys
794- UpdateUnityInstallationsList ( ) ; break ;
794+ UpdateUnityInstallationsList ( ) ;
795+ break ;
795796 case Key . Escape : // clear project search
796797 txtSearchBoxUnity . Text = "" ;
797798 break ;
798- default : // any key
799- break ;
800799 }
801800 break ;
802801
@@ -810,8 +809,6 @@ private void OnWindowKeyDown(object sender, KeyEventArgs e)
810809 case Key . Escape : // clear project search
811810 txtSearchBoxUpdates . Text = "" ;
812811 break ;
813- default : // any key
814- break ;
815812 }
816813 break ;
817814
@@ -822,8 +819,6 @@ private void OnWindowKeyDown(object sender, KeyEventArgs e)
822819 case Key . Escape : // clear search
823820 txtSearchBoxBuildReport . Text = "" ;
824821 break ;
825- default : // any key
826- break ;
827822 }
828823 break ;
829824 default :
@@ -1739,6 +1734,7 @@ private void ChkShowPlatform_Checked(object sender, RoutedEventArgs e)
17391734 public void CopyRowFolderToClipBoard ( object sender , ExecutedRoutedEventArgs e )
17401735 {
17411736 string path = null ;
1737+
17421738 if ( tabControl . SelectedIndex == 0 ) // projects
17431739 {
17441740 path = GetSelectedProject ( ) ? . Path ;
@@ -1751,9 +1747,18 @@ public void CopyRowFolderToClipBoard(object sender, ExecutedRoutedEventArgs e)
17511747 {
17521748 path = GetSelectedUpdate ( ) ? . Version ; // TODO copy url instead
17531749 }
1754- Console . WriteLine ( "CopyRowFolderToClipBoard=" + path ) ;
1750+ else if ( tabControl . SelectedIndex == 3 ) // tools
1751+ {
1752+ path = GetSelectedBuildItem ( ) . Path ;
1753+ if ( path != null ) path = Path . Combine ( currentBuildReportProjectPath , path ) ;
1754+ }
17551755
1756- if ( string . IsNullOrEmpty ( path ) == false ) Clipboard . SetText ( path ) ;
1756+ if ( string . IsNullOrEmpty ( path ) == false )
1757+ {
1758+ // fix backslashes
1759+ path = path . Replace ( '\\ ' , '/' ) ;
1760+ Clipboard . SetText ( path ) ;
1761+ }
17571762 }
17581763
17591764 public void CanExecute_Copy ( object sender , CanExecuteRoutedEventArgs e )
@@ -1832,6 +1837,11 @@ private void GridRecent_ContextMenuOpening(object sender, ContextMenuEventArgs e
18321837 } ) ) ;
18331838
18341839 private void BtnRefreshBuildReport_Click ( object sender , RoutedEventArgs e )
1840+ {
1841+ RefreshBuildReports ( ) ;
1842+ }
1843+
1844+ void RefreshBuildReports ( )
18351845 {
18361846 currentBuildReport = 0 ;
18371847 buildReports . Clear ( ) ;
@@ -1852,10 +1862,21 @@ private void BtnRefreshBuildReport_Click(object sender, RoutedEventArgs e)
18521862 using ( StreamReader sr = new StreamReader ( fs ) )
18531863 {
18541864 bool collect = false ;
1855- // now we collect all lines, but could collect only those needed below
1865+ bool gotProjectPath = false ;
1866+
18561867 while ( ! sr . EndOfStream )
18571868 {
18581869 var line = sr . ReadLine ( ) ;
1870+
1871+ // get current projectpath
1872+ if ( gotProjectPath == true )
1873+ {
1874+ currentBuildReportProjectPath = line ;
1875+ gotProjectPath = false ;
1876+ }
1877+ if ( line == "-projectPath" ) gotProjectPath = true ;
1878+
1879+
18591880 // build report starts, TODO collect report header also
18601881 if ( collect == false && line . IndexOf ( "Used Assets and files from the Resources folder, sorted by uncompressed size:" ) == 0 )
18611882 {
@@ -1882,12 +1903,16 @@ private void BtnRefreshBuildReport_Click(object sender, RoutedEventArgs e)
18821903 }
18831904 catch ( Exception )
18841905 {
1906+ gridBuildReport . ItemsSource = null ;
1907+ gridBuildReport . Items . Clear ( ) ;
18851908 Console . WriteLine ( "Failed to open editor log: " + logFile ) ;
18861909 return ;
18871910 }
18881911
18891912 if ( buildReports . Count < 1 || buildReports [ 0 ] . Count < 1 )
18901913 {
1914+ gridBuildReport . ItemsSource = null ;
1915+ gridBuildReport . Items . Clear ( ) ;
18911916 Console . WriteLine ( "Failed to parse Editor.Log (probably no build reports there)" ) ;
18921917 return ;
18931918 }
@@ -2260,11 +2285,9 @@ void OpenSelectedBuildReportFile()
22602285 {
22612286 var item = GetSelectedBuildItem ( ) ;
22622287
2263- Console . WriteLine ( item . Path ) ;
2264-
22652288 if ( item != null )
22662289 {
2267- string filePath = Path . Combine ( latestBuildReportProjectPath , item . Path ) ;
2290+ string filePath = Path . Combine ( currentBuildReportProjectPath , item . Path ) ;
22682291 Tools . LaunchExplorerSelectFile ( filePath ) ;
22692292 }
22702293 }
@@ -2517,6 +2540,29 @@ private void BtnBrowseBatchFileFolder_Click(object sender, RoutedEventArgs e)
25172540 }
25182541 }
25192542
2543+ private void Grid_PreviewKeyDown ( object sender , KeyEventArgs e )
2544+ {
2545+ switch ( e . Key )
2546+ {
2547+ case Key . F5 : // update build reports
2548+ e . Handled = true ;
2549+ RefreshBuildReports ( ) ;
2550+ break ;
2551+ case Key . Return : // open build report
2552+ e . Handled = true ;
2553+ OpenSelectedBuildReportFile ( ) ;
2554+ break ;
2555+ }
2556+ }
2557+
2558+ private void menuItemCopyPathToClipboard_Click ( object sender , RoutedEventArgs e )
2559+ {
2560+ var path = GetSelectedBuildItem ( ) . Path ;
2561+ if ( path != null ) path = Path . Combine ( currentBuildReportProjectPath , path ) ;
2562+ path = path . Replace ( '\\ ' , '/' ) ;
2563+ Clipboard . SetText ( path ) ;
2564+ }
2565+
25202566 //private void BtnBrowseTemplateUnityPackagesFolder_Click(object sender, RoutedEventArgs e)
25212567 //{
25222568 // var folder = Tools.BrowseForOutputFolder("Select unitypackage Templates folder");
0 commit comments