Merge branch 'master' into muted-notification

This commit is contained in:
Craftplacer
2019-10-03 12:51:22 +02:00
committed by GitHub
2 changed files with 28 additions and 22 deletions

View File

@ -239,6 +239,18 @@ namespace osu.Game.Tests.Visual.SongSelect
AddAssert("Selection is non-null", () => currentSelection != null); AddAssert("Selection is non-null", () => currentSelection != null);
setSelected(1, 3); setSelected(1, 3);
}
[Test]
public void TestFilterRange()
{
loadBeatmaps();
// buffer the selection
setSelected(3, 2);
setSelected(1, 3);
AddStep("Apply a range filter", () => carousel.Filter(new FilterCriteria AddStep("Apply a range filter", () => carousel.Filter(new FilterCriteria
{ {
SearchText = "#3", SearchText = "#3",
@ -249,9 +261,9 @@ namespace osu.Game.Tests.Visual.SongSelect
IsLowerInclusive = true IsLowerInclusive = true
} }
}, false)); }, false));
waitForSelection(3, 2);
AddStep("Un-filter", () => carousel.Filter(new FilterCriteria(), false)); // should reselect the buffered selection.
waitForSelection(3, 2);
} }
/// <summary> /// <summary>

View File

@ -400,20 +400,17 @@ namespace osu.Game.Database
int i = 0; int i = 0;
using (ContextFactory.GetForWrite()) foreach (var b in items)
{ {
foreach (var b in items) if (notification.State == ProgressNotificationState.Cancelled)
{ // user requested abort
if (notification.State == ProgressNotificationState.Cancelled) return;
// user requested abort
return;
notification.Text = $"Deleting {HumanisedModelName}s ({++i} of {items.Count})"; notification.Text = $"Deleting {HumanisedModelName}s ({++i} of {items.Count})";
Delete(b); Delete(b);
notification.Progress = (float)i / items.Count; notification.Progress = (float)i / items.Count;
}
} }
notification.State = ProgressNotificationState.Completed; notification.State = ProgressNotificationState.Completed;
@ -439,20 +436,17 @@ namespace osu.Game.Database
int i = 0; int i = 0;
using (ContextFactory.GetForWrite()) foreach (var item in items)
{ {
foreach (var item in items) if (notification.State == ProgressNotificationState.Cancelled)
{ // user requested abort
if (notification.State == ProgressNotificationState.Cancelled) return;
// user requested abort
return;
notification.Text = $"Restoring ({++i} of {items.Count})"; notification.Text = $"Restoring ({++i} of {items.Count})";
Undelete(item); Undelete(item);
notification.Progress = (float)i / items.Count; notification.Progress = (float)i / items.Count;
}
} }
notification.State = ProgressNotificationState.Completed; notification.State = ProgressNotificationState.Completed;