Added methods to delete songs and song groups.

- OsuGroupList.get().deleteSongGroup() will delete a song group from the list.
- OsuGroupList.get().deleteSong() will delete an individual song from the list (must be expanded), and will delete the song group if there are no remaining songs in the group.
- If possible, deleted beatmap files are moved to system trash (using JNA); otherwise, they are deleted immediately.  This is done through Utils.deleteToTrash().

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-02-12 02:27:33 -05:00
parent 484bb1ba31
commit b69ff68d7c
7 changed files with 211 additions and 7 deletions

View File

@@ -396,6 +396,8 @@ public class SongMenu extends BasicGameState {
// search produced new list: re-initialize it
startNode = focusNode = null;
scoreMap = null;
focusScores = null;
if (OsuGroupList.get().size() > 0) {
OsuGroupList.get().init();
if (search.getText().isEmpty()) { // cleared search
@@ -606,6 +608,8 @@ public class SongMenu extends BasicGameState {
// reset state and node references
MusicController.reset();
startNode = focusNode = null;
scoreMap = null;
focusScores = null;
oldFocusNode = null;
randomStack = new Stack<SongNode>();
songInfo = null;