1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 12:42:54 +08:00

Merge branch 'master' into muted-notification

This commit is contained in:
Craftplacer 2019-10-03 12:51:22 +02:00 committed by GitHub
commit dbcb9e51c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);
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
{
SearchText = "#3",
@ -249,9 +261,9 @@ namespace osu.Game.Tests.Visual.SongSelect
IsLowerInclusive = true
}
}, false));
waitForSelection(3, 2);
AddStep("Un-filter", () => carousel.Filter(new FilterCriteria(), false));
// should reselect the buffered selection.
waitForSelection(3, 2);
}
/// <summary>

View File

@ -400,20 +400,17 @@ namespace osu.Game.Database
int i = 0;
using (ContextFactory.GetForWrite())
foreach (var b in items)
{
foreach (var b in items)
{
if (notification.State == ProgressNotificationState.Cancelled)
// user requested abort
return;
if (notification.State == ProgressNotificationState.Cancelled)
// 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;
@ -439,20 +436,17 @@ namespace osu.Game.Database
int i = 0;
using (ContextFactory.GetForWrite())
foreach (var item in items)
{
foreach (var item in items)
{
if (notification.State == ProgressNotificationState.Cancelled)
// user requested abort
return;
if (notification.State == ProgressNotificationState.Cancelled)
// 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;