@@ -670,13 +670,13 @@ private void SaveSettingsOnExit()
670670
671671 void UpdateUnityInstallationsList ( )
672672 {
673- // reset preferred string, if user changed it
673+ // Reset preferred string, if user changed it
674674 //preferredVersion = "none";
675675
676676 unityInstallationsSource = GetUnityInstallations . Scan ( ) ;
677677 dataGridUnitys . ItemsSource = unityInstallationsSource ;
678678
679- // also make dictionary of installed unitys, to search faster
679+ // Also make dictionary of installed unitys, to search faster
680680 unityInstalledVersions . Clear ( ) ;
681681
682682 for ( int i = 0 , len = unityInstallationsSource . Count ; i < len ; i ++ )
@@ -725,6 +725,7 @@ void AddUnityInstallationRootFolder()
725725 lstRootFolders . Items . Refresh ( ) ;
726726 Properties . Settings . Default . Save ( ) ;
727727 UpdateUnityInstallationsList ( ) ;
728+ RefreshRecentProjects ( ) ;
728729 }
729730 }
730731
@@ -1526,12 +1527,16 @@ private void BtnOpenWebsite_Click(object sender, RoutedEventArgs e)
15261527
15271528 private void ChkMinimizeToTaskbar_CheckedChanged ( object sender , RoutedEventArgs e )
15281529 {
1530+ if ( this . IsActive == false ) return ; // dont run code on window init
1531+
15291532 Settings . Default . minimizeToTaskbar = ( bool ) chkMinimizeToTaskbar . IsChecked ;
15301533 Settings . Default . Save ( ) ;
15311534 }
15321535
15331536 private void ChkRegisterExplorerMenu_CheckedChanged ( object sender , RoutedEventArgs e )
15341537 {
1538+ if ( this . IsActive == false ) return ; // dont run code on window init
1539+
15351540 if ( ( bool ) chkRegisterExplorerMenu . IsChecked )
15361541 {
15371542 Tools . AddContextMenuRegistry ( contextRegRoot ) ;
@@ -1548,6 +1553,7 @@ private void ChkRegisterExplorerMenu_CheckedChanged(object sender, RoutedEventAr
15481553 private void ChkShowLauncherArgumentsColumn_CheckedChanged ( object sender , RoutedEventArgs e )
15491554 {
15501555 if ( this . IsActive == false ) return ; // dont run code on window init
1556+
15511557 Settings . Default . showArgumentsColumn = ( bool ) chkShowLauncherArgumentsColumn . IsChecked ;
15521558 Settings . Default . Save ( ) ;
15531559 gridRecent . Columns [ 4 ] . Visibility = ( bool ) chkShowLauncherArgumentsColumn . IsChecked ? Visibility . Visible : Visibility . Collapsed ;
@@ -1557,6 +1563,7 @@ private void ChkShowLauncherArgumentsColumn_CheckedChanged(object sender, Routed
15571563 private void ChkShowGitBranchColumn_CheckedChanged ( object sender , RoutedEventArgs e )
15581564 {
15591565 if ( this . IsActive == false ) return ; // dont run code on window init
1566+
15601567 Settings . Default . showGitBranchColumn = ( bool ) chkShowGitBranchColumn . IsChecked ;
15611568 Settings . Default . Save ( ) ;
15621569 gridRecent . Columns [ 5 ] . Visibility = ( bool ) chkShowGitBranchColumn . IsChecked ? Visibility . Visible : Visibility . Collapsed ;
@@ -1565,12 +1572,16 @@ private void ChkShowGitBranchColumn_CheckedChanged(object sender, RoutedEventArg
15651572
15661573 private void ChkQuitAfterOpen_CheckedChanged ( object sender , RoutedEventArgs e )
15671574 {
1575+ if ( this . IsActive == false ) return ; // dont run code on window init
1576+
15681577 Settings . Default . closeAfterProject = ( bool ) chkQuitAfterOpen . IsChecked ;
15691578 Settings . Default . Save ( ) ;
15701579 }
15711580
15721581 private void ChkQuitAfterCommandline_CheckedChanged ( object sender , RoutedEventArgs e )
15731582 {
1583+ if ( this . IsActive == false ) return ; // dont run code on window init
1584+
15741585 Settings . Default . closeAfterExplorer = ( bool ) chkQuitAfterCommandline . IsChecked ;
15751586 Settings . Default . Save ( ) ;
15761587 }
@@ -1793,12 +1804,16 @@ private void DataGridUpdates_PreviewMouseDoubleClick(object sender, MouseButtonE
17931804
17941805 private void ChkShowMissingFolderProjects_CheckedChanged ( object sender , RoutedEventArgs e )
17951806 {
1807+ if ( this . IsActive == false ) return ; // dont run code on window init
1808+
17961809 Settings . Default . showProjectsMissingFolder = ( bool ) chkShowMissingFolderProjects . IsChecked ;
17971810 Settings . Default . Save ( ) ;
17981811 }
17991812
18001813 private void ChkAllowSingleInstanceOnly_CheckedChanged ( object sender , RoutedEventArgs e )
18011814 {
1815+ if ( this . IsActive == false ) return ; // dont run code on window init
1816+
18021817 Settings . Default . AllowSingleInstanceOnly = ( bool ) chkAllowSingleInstanceOnly . IsChecked ;
18031818 Settings . Default . Save ( ) ;
18041819 }
@@ -1966,17 +1981,21 @@ void CreateNewEmptyProject(string targetFolder = null)
19661981
19671982 private void ChkAskNameForQuickProject_Checked ( object sender , RoutedEventArgs e )
19681983 {
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 ( ) ;
19711988 }
19721989
19731990 bool isInitializing = true ; // used to avoid doing things while still starting up
19741991 private void ChkStreamerMode_Checked ( object sender , RoutedEventArgs e )
19751992 {
1993+ if ( this . IsActive == false ) return ; // dont run code on window init
1994+
19761995 var isChecked = ( bool ) ( ( CheckBox ) sender ) . IsChecked ;
19771996
1978- Properties . Settings . Default . streamerMode = isChecked ;
1979- Properties . Settings . Default . Save ( ) ;
1997+ Settings . Default . streamerMode = isChecked ;
1998+ Settings . Default . Save ( ) ;
19801999
19812000 // Create cellstyle and assign if streamermode is enabled
19822001 Style cellStyle = new Style ( typeof ( DataGridCell ) ) ;
@@ -1999,6 +2018,8 @@ private void ChkStreamerMode_Checked(object sender, RoutedEventArgs e)
19992018
20002019 private void ChkShowPlatform_Checked ( object sender , RoutedEventArgs e )
20012020 {
2021+ if ( this . IsActive == false ) return ; // dont run code on window init
2022+
20022023 var isChecked = ( bool ) ( ( CheckBox ) sender ) . IsChecked ;
20032024
20042025 Settings . Default . showTargetPlatform = isChecked ;
@@ -2072,6 +2093,8 @@ public void MoveRecentGridItem(int to)
20722093
20732094 private void ChkEnableProjectRename_Checked ( object sender , RoutedEventArgs e )
20742095 {
2096+ if ( this . IsActive == false ) return ; // dont run code on window init
2097+
20752098 Properties . Settings . Default . enableProjectRename = ( bool ) chkEnableProjectRename . IsChecked ;
20762099 Properties . Settings . Default . Save ( ) ;
20772100 }
@@ -2565,8 +2588,8 @@ private void ChkUseCustomTheme_Checked(object sender, RoutedEventArgs e)
25652588 if ( this . IsActive == false ) return ; // dont run code on window init
25662589
25672590 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 ( ) ;
25702593
25712594 btnReloadTheme . IsEnabled = isChecked ;
25722595
@@ -2616,9 +2639,11 @@ private void BtnExploreFolder_Click(object sender, RoutedEventArgs e)
26162639
26172640 private void ChkEnablePlatformSelection_Checked ( object sender , RoutedEventArgs e )
26182641 {
2642+ if ( this . IsActive == false ) return ; // dont run code on window init
2643+
26192644 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 ( ) ;
26222647 chkEnablePlatformSelection . IsChecked = isChecked ;
26232648 }
26242649
@@ -2642,9 +2667,10 @@ private void CmbPlatformSelection_DropDownClosed(object sender, EventArgs e)
26422667 private void ChkRunAutomatically_Checked ( object sender , RoutedEventArgs e )
26432668 {
26442669 if ( this . IsActive == false ) return ; // dont run code on window init
2670+
26452671 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 ( ) ;
26482674 chkRunAutomatically . IsChecked = isChecked ;
26492675 // set or unset registry, NOTE should not do this on debug build.. (otherwise 2 builds try to run?)
26502676 Tools . SetStartupRegistry ( isChecked ) ;
@@ -2741,6 +2767,7 @@ bool ValidateIntRange(TextBox textBox, int min, int max)
27412767 private void ChkHumanFriendlyDateTime_Checked ( object sender , RoutedEventArgs e )
27422768 {
27432769 if ( this . IsActive == false ) return ; // dont run code on window init
2770+
27442771 var isChecked = ( bool ) ( ( CheckBox ) sender ) . IsChecked ;
27452772
27462773 // cannot have both date formats
@@ -2796,6 +2823,7 @@ void OpenSelectedBuildReportFile()
27962823 private void ChkRunAutomaticallyMinimized_Checked ( object sender , RoutedEventArgs e )
27972824 {
27982825 if ( this . IsActive == false ) return ; // dont run code on window init
2826+
27992827 var isChecked = ( bool ) ( ( CheckBox ) sender ) . IsChecked ;
28002828
28012829 Settings . Default . runAutomaticallyMinimized = isChecked ;
@@ -2974,6 +3002,7 @@ private void Window_SourceInitialized(object sender, EventArgs e)
29743002 private void ChkSearchProjectPath_Checked ( object sender , RoutedEventArgs e )
29753003 {
29763004 if ( this . IsActive == false ) return ; // dont run code on window init
3005+
29773006 var isChecked = ( bool ) ( ( CheckBox ) sender ) . IsChecked ;
29783007
29793008 searchProjectPathAlso = isChecked ;
@@ -3011,6 +3040,7 @@ private void MenuBatchBuildIOS_Click(object sender, RoutedEventArgs e)
30113040 private void ChkCheckPlasticBranch_Checked ( object sender , RoutedEventArgs e )
30123041 {
30133042 if ( this . IsActive == false ) return ; // dont run code on window init
3043+
30143044 Settings . Default . checkPlasticBranch = ( bool ) chkCheckPlasticBranch . IsChecked ;
30153045 Settings . Default . Save ( ) ;
30163046 RefreshRecentProjects ( ) ;
@@ -3087,7 +3117,6 @@ void SortHandlerUpdates(object sender, DataGridSortingEventArgs e)
30873117 {
30883118 DataGridColumn column = e . Column ;
30893119
3090-
30913120 IComparer comparer = null ;
30923121
30933122 // prevent the built-in sort from sorting
@@ -3179,6 +3208,14 @@ void SortHandlerRecentProjects(object sender, DataGridSortingEventArgs e)
31793208
31803209 //apply the sort
31813210 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+ }
31823219 }
31833220
31843221 public class CustomProjectSort : IComparer
@@ -3308,7 +3345,7 @@ private void btnPatchHubConfig_Click(object sender, RoutedEventArgs e)
33083345 // replace the manual:true with manual:false using regex
33093346 json = json . Replace ( "\" manual\" :true" , "\" manual\" :false" ) ;
33103347
3311- Console . WriteLine ( json ) ;
3348+ // Console.WriteLine(json);
33123349
33133350 // write the config file
33143351 File . WriteAllText ( configFile , json ) ;
@@ -3556,6 +3593,12 @@ private void btnHubLogs_Click(object sender, RoutedEventArgs e)
35563593 Tools . OpenAppdataSpecialFolder ( "../Roaming/UnityHub/logs/" ) ;
35573594 }
35583595
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+ //}
35593602 } // class
35603603} //namespace
35613604
0 commit comments