@@ -458,13 +458,9 @@ internal void RefreshSnapshotsListView(ListView listView, EngineSnapshotStatus s
458
458
459
459
listView . Items . Clear ( ) ;
460
460
461
- foreach ( var snapshot in _luaManager . ActiveEngine . Snapshots )
461
+ foreach ( var snapshot in _luaManager . ActiveEngine . Snapshots . Where ( snapshot =>
462
+ category == null || category . Id == 0 || snapshot . CategoryId == category . Id ) )
462
463
{
463
- if ( category != null && category . Id != 0 && snapshot . CategoryId != category . Id )
464
- {
465
- continue ;
466
- }
467
-
468
464
var listViewItem = new ListViewItem ( ) ;
469
465
bool first = true ;
470
466
@@ -1214,7 +1210,6 @@ private void CleanSnapshots()
1214
1210
}
1215
1211
1216
1212
SetProgressBarVisibility ( true ) ;
1217
- Thread . Sleep ( 100 ) ;
1218
1213
1219
1214
// Oldest first
1220
1215
var comparer = GetSnapshotComparer ( "SavedAt" , SortOrder . Ascending ) ;
@@ -1234,9 +1229,6 @@ private void CleanSnapshots()
1234
1229
EngineSnapshotStatus . Nuked ) ;
1235
1230
1236
1231
SetProgressBarVisibility ( false ) ;
1237
- Thread . Sleep ( 100 ) ;
1238
-
1239
- SortSnapshots ( ) ;
1240
1232
}
1241
1233
1242
1234
private void CleanupSnapshotsCore ( SettingsAutoCleanupBackup settings , EngineSnapshotStatus statusLookup ,
@@ -1508,6 +1500,11 @@ private void closeProfileToolStripMenuItem_Click(object sender, EventArgs e)
1508
1500
1509
1501
private void comboBoxCategories_SelectionChangeCommitted ( object sender , EventArgs e )
1510
1502
{
1503
+ if ( comboBoxCategories . SelectedItem is EngineSnapshotCategory selection )
1504
+ {
1505
+ _activeProfileFile . LastSelectedCategory = selection . Id ;
1506
+ }
1507
+
1511
1508
RefreshSnapshotLists ( ) ;
1512
1509
}
1513
1510
@@ -2674,6 +2671,10 @@ private void RefreshCategories()
2674
2671
id = selection . Id ;
2675
2672
selection = null ;
2676
2673
}
2674
+ else if ( _activeProfileFile . LastSelectedCategory != - 1 )
2675
+ {
2676
+ id = _activeProfileFile . LastSelectedCategory ;
2677
+ }
2677
2678
2678
2679
comboBoxCategories . Items . Clear ( ) ;
2679
2680
foreach ( var category in _luaManager . ActiveEngine . Categories )
@@ -2706,6 +2707,7 @@ private void RefreshCategories()
2706
2707
if ( category != null && comboBoxCategories . Items . Contains ( category ) )
2707
2708
{
2708
2709
comboBoxCategories . SelectedItem = category ;
2710
+ _activeProfileFile . LastSelectedCategory = category . Id ;
2709
2711
}
2710
2712
}
2711
2713
@@ -2828,7 +2830,7 @@ private void RefreshSnapshotLists()
2828
2830
int archived = 0 ;
2829
2831
int deleted = 0 ;
2830
2832
2831
- foreach ( var snapshot in _activeProfileFile . Snapshots . Where ( snapshot =>
2833
+ foreach ( var snapshot in _luaManager . ActiveEngine . Snapshots . Where ( snapshot =>
2832
2834
category == null || category . Id == 0 || snapshot . CategoryId == category . Id ) )
2833
2835
{
2834
2836
switch ( snapshot . Status )
@@ -2992,8 +2994,8 @@ private void SetProgressBarVisibility(bool visible)
2992
2994
{
2993
2995
Invoke ( new Action ( ( ) => { SetProgressBarVisibility ( visible ) ; } ) ) ;
2994
2996
}
2995
-
2996
- toolStripProgressBar . Visible = visible ;
2997
+ else
2998
+ toolStripProgressBar . Visible = visible ;
2997
2999
}
2998
3000
2999
3001
private void SetSnapshotInfo ( EngineSnapshot snapshot )
0 commit comments