@@ -53,7 +53,7 @@ public partial class MainWindow : Window
53
53
54
54
Dictionary < string , SolidColorBrush > origResourceColors = new Dictionary < string , SolidColorBrush > ( ) ;
55
55
56
- string latestBuildReportProjectPath = null ;
56
+ string currentBuildReportProjectPath = null ;
57
57
List < List < string > > buildReports = new List < List < string > > ( ) ;
58
58
int currentBuildReport = 0 ;
59
59
@@ -791,12 +791,11 @@ private void OnWindowKeyDown(object sender, KeyEventArgs e)
791
791
switch ( e . Key )
792
792
{
793
793
case Key . F5 : // refresh unitys
794
- UpdateUnityInstallationsList ( ) ; break ;
794
+ UpdateUnityInstallationsList ( ) ;
795
+ break ;
795
796
case Key . Escape : // clear project search
796
797
txtSearchBoxUnity . Text = "" ;
797
798
break ;
798
- default : // any key
799
- break ;
800
799
}
801
800
break ;
802
801
@@ -810,8 +809,6 @@ private void OnWindowKeyDown(object sender, KeyEventArgs e)
810
809
case Key . Escape : // clear project search
811
810
txtSearchBoxUpdates . Text = "" ;
812
811
break ;
813
- default : // any key
814
- break ;
815
812
}
816
813
break ;
817
814
@@ -822,8 +819,6 @@ private void OnWindowKeyDown(object sender, KeyEventArgs e)
822
819
case Key . Escape : // clear search
823
820
txtSearchBoxBuildReport . Text = "" ;
824
821
break ;
825
- default : // any key
826
- break ;
827
822
}
828
823
break ;
829
824
default :
@@ -1739,6 +1734,7 @@ private void ChkShowPlatform_Checked(object sender, RoutedEventArgs e)
1739
1734
public void CopyRowFolderToClipBoard ( object sender , ExecutedRoutedEventArgs e )
1740
1735
{
1741
1736
string path = null ;
1737
+
1742
1738
if ( tabControl . SelectedIndex == 0 ) // projects
1743
1739
{
1744
1740
path = GetSelectedProject ( ) ? . Path ;
@@ -1751,9 +1747,18 @@ public void CopyRowFolderToClipBoard(object sender, ExecutedRoutedEventArgs e)
1751
1747
{
1752
1748
path = GetSelectedUpdate ( ) ? . Version ; // TODO copy url instead
1753
1749
}
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
+ }
1755
1755
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
+ }
1757
1762
}
1758
1763
1759
1764
public void CanExecute_Copy ( object sender , CanExecuteRoutedEventArgs e )
@@ -1832,6 +1837,11 @@ private void GridRecent_ContextMenuOpening(object sender, ContextMenuEventArgs e
1832
1837
} ) ) ;
1833
1838
1834
1839
private void BtnRefreshBuildReport_Click ( object sender , RoutedEventArgs e )
1840
+ {
1841
+ RefreshBuildReports ( ) ;
1842
+ }
1843
+
1844
+ void RefreshBuildReports ( )
1835
1845
{
1836
1846
currentBuildReport = 0 ;
1837
1847
buildReports . Clear ( ) ;
@@ -1852,10 +1862,21 @@ private void BtnRefreshBuildReport_Click(object sender, RoutedEventArgs e)
1852
1862
using ( StreamReader sr = new StreamReader ( fs ) )
1853
1863
{
1854
1864
bool collect = false ;
1855
- // now we collect all lines, but could collect only those needed below
1865
+ bool gotProjectPath = false ;
1866
+
1856
1867
while ( ! sr . EndOfStream )
1857
1868
{
1858
1869
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
+
1859
1880
// build report starts, TODO collect report header also
1860
1881
if ( collect == false && line . IndexOf ( "Used Assets and files from the Resources folder, sorted by uncompressed size:" ) == 0 )
1861
1882
{
@@ -1882,12 +1903,16 @@ private void BtnRefreshBuildReport_Click(object sender, RoutedEventArgs e)
1882
1903
}
1883
1904
catch ( Exception )
1884
1905
{
1906
+ gridBuildReport . ItemsSource = null ;
1907
+ gridBuildReport . Items . Clear ( ) ;
1885
1908
Console . WriteLine ( "Failed to open editor log: " + logFile ) ;
1886
1909
return ;
1887
1910
}
1888
1911
1889
1912
if ( buildReports . Count < 1 || buildReports [ 0 ] . Count < 1 )
1890
1913
{
1914
+ gridBuildReport . ItemsSource = null ;
1915
+ gridBuildReport . Items . Clear ( ) ;
1891
1916
Console . WriteLine ( "Failed to parse Editor.Log (probably no build reports there)" ) ;
1892
1917
return ;
1893
1918
}
@@ -2260,11 +2285,9 @@ void OpenSelectedBuildReportFile()
2260
2285
{
2261
2286
var item = GetSelectedBuildItem ( ) ;
2262
2287
2263
- Console . WriteLine ( item . Path ) ;
2264
-
2265
2288
if ( item != null )
2266
2289
{
2267
- string filePath = Path . Combine ( latestBuildReportProjectPath , item . Path ) ;
2290
+ string filePath = Path . Combine ( currentBuildReportProjectPath , item . Path ) ;
2268
2291
Tools . LaunchExplorerSelectFile ( filePath ) ;
2269
2292
}
2270
2293
}
@@ -2517,6 +2540,29 @@ private void BtnBrowseBatchFileFolder_Click(object sender, RoutedEventArgs e)
2517
2540
}
2518
2541
}
2519
2542
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
+
2520
2566
//private void BtnBrowseTemplateUnityPackagesFolder_Click(object sender, RoutedEventArgs e)
2521
2567
//{
2522
2568
// var folder = Tools.BrowseForOutputFolder("Select unitypackage Templates folder");
0 commit comments