mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Merge branch 'undelete-button-add' of https://github.com/freezylemon/osu into undelete-button-add
This commit is contained in:
@ -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));
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user