@@ -670,13 +670,13 @@ private void SaveSettingsOnExit()
670
670
671
671
void UpdateUnityInstallationsList ( )
672
672
{
673
- // reset preferred string, if user changed it
673
+ // Reset preferred string, if user changed it
674
674
//preferredVersion = "none";
675
675
676
676
unityInstallationsSource = GetUnityInstallations . Scan ( ) ;
677
677
dataGridUnitys . ItemsSource = unityInstallationsSource ;
678
678
679
- // also make dictionary of installed unitys, to search faster
679
+ // Also make dictionary of installed unitys, to search faster
680
680
unityInstalledVersions . Clear ( ) ;
681
681
682
682
for ( int i = 0 , len = unityInstallationsSource . Count ; i < len ; i ++ )
@@ -725,6 +725,7 @@ void AddUnityInstallationRootFolder()
725
725
lstRootFolders . Items . Refresh ( ) ;
726
726
Properties . Settings . Default . Save ( ) ;
727
727
UpdateUnityInstallationsList ( ) ;
728
+ RefreshRecentProjects ( ) ;
728
729
}
729
730
}
730
731
@@ -1526,12 +1527,16 @@ private void BtnOpenWebsite_Click(object sender, RoutedEventArgs e)
1526
1527
1527
1528
private void ChkMinimizeToTaskbar_CheckedChanged ( object sender , RoutedEventArgs e )
1528
1529
{
1530
+ if ( this . IsActive == false ) return ; // dont run code on window init
1531
+
1529
1532
Settings . Default . minimizeToTaskbar = ( bool ) chkMinimizeToTaskbar . IsChecked ;
1530
1533
Settings . Default . Save ( ) ;
1531
1534
}
1532
1535
1533
1536
private void ChkRegisterExplorerMenu_CheckedChanged ( object sender , RoutedEventArgs e )
1534
1537
{
1538
+ if ( this . IsActive == false ) return ; // dont run code on window init
1539
+
1535
1540
if ( ( bool ) chkRegisterExplorerMenu . IsChecked )
1536
1541
{
1537
1542
Tools . AddContextMenuRegistry ( contextRegRoot ) ;
@@ -1548,6 +1553,7 @@ private void ChkRegisterExplorerMenu_CheckedChanged(object sender, RoutedEventAr
1548
1553
private void ChkShowLauncherArgumentsColumn_CheckedChanged ( object sender , RoutedEventArgs e )
1549
1554
{
1550
1555
if ( this . IsActive == false ) return ; // dont run code on window init
1556
+
1551
1557
Settings . Default . showArgumentsColumn = ( bool ) chkShowLauncherArgumentsColumn . IsChecked ;
1552
1558
Settings . Default . Save ( ) ;
1553
1559
gridRecent . Columns [ 4 ] . Visibility = ( bool ) chkShowLauncherArgumentsColumn . IsChecked ? Visibility . Visible : Visibility . Collapsed ;
@@ -1557,6 +1563,7 @@ private void ChkShowLauncherArgumentsColumn_CheckedChanged(object sender, Routed
1557
1563
private void ChkShowGitBranchColumn_CheckedChanged ( object sender , RoutedEventArgs e )
1558
1564
{
1559
1565
if ( this . IsActive == false ) return ; // dont run code on window init
1566
+
1560
1567
Settings . Default . showGitBranchColumn = ( bool ) chkShowGitBranchColumn . IsChecked ;
1561
1568
Settings . Default . Save ( ) ;
1562
1569
gridRecent . Columns [ 5 ] . Visibility = ( bool ) chkShowGitBranchColumn . IsChecked ? Visibility . Visible : Visibility . Collapsed ;
@@ -1565,12 +1572,16 @@ private void ChkShowGitBranchColumn_CheckedChanged(object sender, RoutedEventArg
1565
1572
1566
1573
private void ChkQuitAfterOpen_CheckedChanged ( object sender , RoutedEventArgs e )
1567
1574
{
1575
+ if ( this . IsActive == false ) return ; // dont run code on window init
1576
+
1568
1577
Settings . Default . closeAfterProject = ( bool ) chkQuitAfterOpen . IsChecked ;
1569
1578
Settings . Default . Save ( ) ;
1570
1579
}
1571
1580
1572
1581
private void ChkQuitAfterCommandline_CheckedChanged ( object sender , RoutedEventArgs e )
1573
1582
{
1583
+ if ( this . IsActive == false ) return ; // dont run code on window init
1584
+
1574
1585
Settings . Default . closeAfterExplorer = ( bool ) chkQuitAfterCommandline . IsChecked ;
1575
1586
Settings . Default . Save ( ) ;
1576
1587
}
@@ -1793,12 +1804,16 @@ private void DataGridUpdates_PreviewMouseDoubleClick(object sender, MouseButtonE
1793
1804
1794
1805
private void ChkShowMissingFolderProjects_CheckedChanged ( object sender , RoutedEventArgs e )
1795
1806
{
1807
+ if ( this . IsActive == false ) return ; // dont run code on window init
1808
+
1796
1809
Settings . Default . showProjectsMissingFolder = ( bool ) chkShowMissingFolderProjects . IsChecked ;
1797
1810
Settings . Default . Save ( ) ;
1798
1811
}
1799
1812
1800
1813
private void ChkAllowSingleInstanceOnly_CheckedChanged ( object sender , RoutedEventArgs e )
1801
1814
{
1815
+ if ( this . IsActive == false ) return ; // dont run code on window init
1816
+
1802
1817
Settings . Default . AllowSingleInstanceOnly = ( bool ) chkAllowSingleInstanceOnly . IsChecked ;
1803
1818
Settings . Default . Save ( ) ;
1804
1819
}
@@ -1966,17 +1981,21 @@ void CreateNewEmptyProject(string targetFolder = null)
1966
1981
1967
1982
private void ChkAskNameForQuickProject_Checked ( object sender , RoutedEventArgs e )
1968
1983
{
1969
- Properties . Settings . Default . askNameForQuickProject = ( bool ) chkAskNameForQuickProject . IsChecked ;
1970
- Properties . Settings . Default . Save ( ) ;
1984
+ if ( this . IsActive == false ) return ; // dont run code on window init
1985
+
1986
+ Settings . Default . askNameForQuickProject = ( bool ) chkAskNameForQuickProject . IsChecked ;
1987
+ Settings . Default . Save ( ) ;
1971
1988
}
1972
1989
1973
1990
bool isInitializing = true ; // used to avoid doing things while still starting up
1974
1991
private void ChkStreamerMode_Checked ( object sender , RoutedEventArgs e )
1975
1992
{
1993
+ if ( this . IsActive == false ) return ; // dont run code on window init
1994
+
1976
1995
var isChecked = ( bool ) ( ( CheckBox ) sender ) . IsChecked ;
1977
1996
1978
- Properties . Settings . Default . streamerMode = isChecked ;
1979
- Properties . Settings . Default . Save ( ) ;
1997
+ Settings . Default . streamerMode = isChecked ;
1998
+ Settings . Default . Save ( ) ;
1980
1999
1981
2000
// Create cellstyle and assign if streamermode is enabled
1982
2001
Style cellStyle = new Style ( typeof ( DataGridCell ) ) ;
@@ -1999,6 +2018,8 @@ private void ChkStreamerMode_Checked(object sender, RoutedEventArgs e)
1999
2018
2000
2019
private void ChkShowPlatform_Checked ( object sender , RoutedEventArgs e )
2001
2020
{
2021
+ if ( this . IsActive == false ) return ; // dont run code on window init
2022
+
2002
2023
var isChecked = ( bool ) ( ( CheckBox ) sender ) . IsChecked ;
2003
2024
2004
2025
Settings . Default . showTargetPlatform = isChecked ;
@@ -2072,6 +2093,8 @@ public void MoveRecentGridItem(int to)
2072
2093
2073
2094
private void ChkEnableProjectRename_Checked ( object sender , RoutedEventArgs e )
2074
2095
{
2096
+ if ( this . IsActive == false ) return ; // dont run code on window init
2097
+
2075
2098
Properties . Settings . Default . enableProjectRename = ( bool ) chkEnableProjectRename . IsChecked ;
2076
2099
Properties . Settings . Default . Save ( ) ;
2077
2100
}
@@ -2565,8 +2588,8 @@ private void ChkUseCustomTheme_Checked(object sender, RoutedEventArgs e)
2565
2588
if ( this . IsActive == false ) return ; // dont run code on window init
2566
2589
2567
2590
var isChecked = ( bool ) ( ( CheckBox ) sender ) . IsChecked ;
2568
- Properties . Settings . Default . useCustomTheme = isChecked ;
2569
- Properties . Settings . Default . Save ( ) ;
2591
+ Settings . Default . useCustomTheme = isChecked ;
2592
+ Settings . Default . Save ( ) ;
2570
2593
2571
2594
btnReloadTheme . IsEnabled = isChecked ;
2572
2595
@@ -2616,9 +2639,11 @@ private void BtnExploreFolder_Click(object sender, RoutedEventArgs e)
2616
2639
2617
2640
private void ChkEnablePlatformSelection_Checked ( object sender , RoutedEventArgs e )
2618
2641
{
2642
+ if ( this . IsActive == false ) return ; // dont run code on window init
2643
+
2619
2644
var isChecked = ( bool ) ( ( CheckBox ) sender ) . IsChecked ;
2620
- Properties . Settings . Default . enablePlatformSelection = isChecked ;
2621
- Properties . Settings . Default . Save ( ) ;
2645
+ Settings . Default . enablePlatformSelection = isChecked ;
2646
+ Settings . Default . Save ( ) ;
2622
2647
chkEnablePlatformSelection . IsChecked = isChecked ;
2623
2648
}
2624
2649
@@ -2642,9 +2667,10 @@ private void CmbPlatformSelection_DropDownClosed(object sender, EventArgs e)
2642
2667
private void ChkRunAutomatically_Checked ( object sender , RoutedEventArgs e )
2643
2668
{
2644
2669
if ( this . IsActive == false ) return ; // dont run code on window init
2670
+
2645
2671
var isChecked = ( bool ) ( ( CheckBox ) sender ) . IsChecked ;
2646
- Properties . Settings . Default . runAutomatically = isChecked ;
2647
- Properties . Settings . Default . Save ( ) ;
2672
+ Settings . Default . runAutomatically = isChecked ;
2673
+ Settings . Default . Save ( ) ;
2648
2674
chkRunAutomatically . IsChecked = isChecked ;
2649
2675
// set or unset registry, NOTE should not do this on debug build.. (otherwise 2 builds try to run?)
2650
2676
Tools . SetStartupRegistry ( isChecked ) ;
@@ -2741,6 +2767,7 @@ bool ValidateIntRange(TextBox textBox, int min, int max)
2741
2767
private void ChkHumanFriendlyDateTime_Checked ( object sender , RoutedEventArgs e )
2742
2768
{
2743
2769
if ( this . IsActive == false ) return ; // dont run code on window init
2770
+
2744
2771
var isChecked = ( bool ) ( ( CheckBox ) sender ) . IsChecked ;
2745
2772
2746
2773
// cannot have both date formats
@@ -2796,6 +2823,7 @@ void OpenSelectedBuildReportFile()
2796
2823
private void ChkRunAutomaticallyMinimized_Checked ( object sender , RoutedEventArgs e )
2797
2824
{
2798
2825
if ( this . IsActive == false ) return ; // dont run code on window init
2826
+
2799
2827
var isChecked = ( bool ) ( ( CheckBox ) sender ) . IsChecked ;
2800
2828
2801
2829
Settings . Default . runAutomaticallyMinimized = isChecked ;
@@ -2974,6 +3002,7 @@ private void Window_SourceInitialized(object sender, EventArgs e)
2974
3002
private void ChkSearchProjectPath_Checked ( object sender , RoutedEventArgs e )
2975
3003
{
2976
3004
if ( this . IsActive == false ) return ; // dont run code on window init
3005
+
2977
3006
var isChecked = ( bool ) ( ( CheckBox ) sender ) . IsChecked ;
2978
3007
2979
3008
searchProjectPathAlso = isChecked ;
@@ -3011,6 +3040,7 @@ private void MenuBatchBuildIOS_Click(object sender, RoutedEventArgs e)
3011
3040
private void ChkCheckPlasticBranch_Checked ( object sender , RoutedEventArgs e )
3012
3041
{
3013
3042
if ( this . IsActive == false ) return ; // dont run code on window init
3043
+
3014
3044
Settings . Default . checkPlasticBranch = ( bool ) chkCheckPlasticBranch . IsChecked ;
3015
3045
Settings . Default . Save ( ) ;
3016
3046
RefreshRecentProjects ( ) ;
@@ -3087,7 +3117,6 @@ void SortHandlerUpdates(object sender, DataGridSortingEventArgs e)
3087
3117
{
3088
3118
DataGridColumn column = e . Column ;
3089
3119
3090
-
3091
3120
IComparer comparer = null ;
3092
3121
3093
3122
// prevent the built-in sort from sorting
@@ -3179,6 +3208,14 @@ void SortHandlerRecentProjects(object sender, DataGridSortingEventArgs e)
3179
3208
3180
3209
//apply the sort
3181
3210
lcv . CustomSort = comparer ;
3211
+
3212
+ if ( gridRecent . SelectedItem != null )
3213
+ {
3214
+ // scroll view to selected, after sort
3215
+ gridRecent . ScrollIntoView ( gridRecent . SelectedItem ) ;
3216
+ // needed for keyboard to work in grid
3217
+ gridRecent . Focus ( ) ;
3218
+ }
3182
3219
}
3183
3220
3184
3221
public class CustomProjectSort : IComparer
@@ -3308,7 +3345,7 @@ private void btnPatchHubConfig_Click(object sender, RoutedEventArgs e)
3308
3345
// replace the manual:true with manual:false using regex
3309
3346
json = json . Replace ( "\" manual\" :true" , "\" manual\" :false" ) ;
3310
3347
3311
- Console . WriteLine ( json ) ;
3348
+ // Console.WriteLine(json);
3312
3349
3313
3350
// write the config file
3314
3351
File . WriteAllText ( configFile , json ) ;
@@ -3556,6 +3593,12 @@ private void btnHubLogs_Click(object sender, RoutedEventArgs e)
3556
3593
Tools . OpenAppdataSpecialFolder ( "../Roaming/UnityHub/logs/" ) ;
3557
3594
}
3558
3595
3596
+ //private void menuProjectProperties_Click(object sender, RoutedEventArgs e)
3597
+ //{
3598
+ // var proj = GetSelectedProject();
3599
+ // if (proj == null) return;
3600
+ // Tools.DisplayProjectProperties(proj, this);
3601
+ //}
3559
3602
} // class
3560
3603
} //namespace
3561
3604
0 commit comments