Merge branch 'undelete-button-add' of https://github.com/freezylemon/osu into undelete-button-add

This commit is contained in:
FreezyLemon
2017-12-10 11:26:31 +01:00
3 changed files with 45 additions and 3 deletions

View File

@ -15,6 +15,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
private TriangleButton importButton;
private TriangleButton deleteButton;
private TriangleButton restoreButton;
private TriangleButton undeleteButton;
protected override string Header => "General";
@ -55,6 +56,19 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
}).ContinueWith(t => Schedule(() => restoreButton.Enabled.Value = true));
}
},
undeleteButton = new SettingsButton
{
Text = "Restore all recently deleted beatmaps",
Action = () =>
{
undeleteButton.Enabled.Value = false;
Task.Run(() =>
{
foreach (var bs in beatmaps.QueryBeatmapSets(bs => bs.DeletePending).ToList())
beatmaps.Undelete(bs);
}).ContinueWith(t => Schedule(() => undeleteButton.Enabled.Value = true));
}
},
};
}
}