@@ -1094,6 +1094,22 @@ private void GridRecent_Loaded(object sender, RoutedEventArgs e)
1094
1094
Tools . SetFocusToGrid ( gridRecent ) ;
1095
1095
// if coming from explorer launch, and missing unity version, projectsource is still null?
1096
1096
if ( projectsSource != null ) SetStatus ( "Ready (" + projectsSource . Count + " projects)" ) ;
1097
+
1098
+ // use saved sort columns
1099
+ if ( string . IsNullOrEmpty ( Settings . Default . currentSortColumn ) == false )
1100
+ {
1101
+ // check if that column exists in headers
1102
+ foreach ( DataGridColumn column in gridRecent . Columns )
1103
+ {
1104
+ if ( column . Header . ToString ( ) == Settings . Default . currentSortColumn )
1105
+ {
1106
+ // TODO Project binding is to Title, not project
1107
+ Settings . Default . currentSortColumn = Settings . Default . currentSortColumn . Replace ( "Project" , "Title" ) ;
1108
+ gridRecent . Items . SortDescriptions . Add ( new SortDescription ( Settings . Default . currentSortColumn , Settings . Default . currentSortDirectionAscending ? ListSortDirection . Ascending : ListSortDirection . Descending ) ) ;
1109
+ break ;
1110
+ }
1111
+ }
1112
+ }
1097
1113
}
1098
1114
1099
1115
private void BtnExploreUnity_Click ( object sender , RoutedEventArgs e )
@@ -1885,7 +1901,7 @@ private void ChkStreamerMode_Checked(object sender, RoutedEventArgs e)
1885
1901
Style cellStyle = new Style ( typeof ( DataGridCell ) ) ;
1886
1902
cellStyle . Setters . Add ( new Setter ( FontSizeProperty , 1.0 ) ) ;
1887
1903
txtColumnTitle . CellStyle = isChecked ? cellStyle : null ;
1888
- txtColumnName . CellStyle = isChecked ? cellStyle : null ;
1904
+ txtColumnPath . CellStyle = isChecked ? cellStyle : null ;
1889
1905
txtColumnGitBranch . CellStyle = isChecked ? cellStyle : null ;
1890
1906
1891
1907
Style txtBoxStyle = new Style ( typeof ( TextBox ) ) ;
@@ -2915,7 +2931,6 @@ void SortHandlerUpdates(object sender, DataGridSortingEventArgs e)
2915
2931
{
2916
2932
DataGridColumn column = e . Column ;
2917
2933
2918
- //Console.WriteLine("Sorted by " + column.Header);
2919
2934
2920
2935
IComparer comparer = null ;
2921
2936
@@ -2981,13 +2996,22 @@ void SortHandlerRecentProjects(object sender, DataGridSortingEventArgs e)
2981
2996
2982
2997
//Console.WriteLine("Sorted by " + column.Header);
2983
2998
2999
+ // save current sort to prefs
3000
+ Settings . Default . currentSortColumn = column . Header . ToString ( ) ;
3001
+
2984
3002
IComparer comparer = null ;
2985
3003
2986
3004
// prevent the built-in sort from sorting
2987
3005
e . Handled = true ;
2988
3006
3007
+ // load sort dir
3008
+ column . SortDirection = Settings . Default . currentSortDirectionAscending ? ListSortDirection . Ascending : ListSortDirection . Descending ;
3009
+
2989
3010
ListSortDirection direction = ( column . SortDirection != ListSortDirection . Ascending ) ? ListSortDirection . Ascending : ListSortDirection . Descending ;
2990
3011
3012
+ // save
3013
+ Settings . Default . currentSortDirectionAscending = direction == ListSortDirection . Ascending ;
3014
+
2991
3015
//set the sort order on the column
2992
3016
column . SortDirection = direction ;
2993
3017
0 commit comments