From f18cd9e2881564465b9758ddef076fa3485cf6cf Mon Sep 17 00:00:00 2001 From: Ryan Meredith Date: Sun, 29 Nov 2020 02:37:22 -0500 Subject: [PATCH] Android: Clear Log file --- .../features/settings/ui/SettingsAdapter.java | 21 +++++++++++++++++++ .../ui/SettingsFragmentPresenter.java | 2 ++ .../app/src/main/res/values/strings.xml | 2 ++ 3 files changed, 25 insertions(+) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java index b2091d3d05..c751a7750e 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java @@ -39,8 +39,13 @@ import org.dolphinemu.dolphinemu.features.settings.ui.viewholder.SingleChoiceVie import org.dolphinemu.dolphinemu.features.settings.ui.viewholder.SliderViewHolder; import org.dolphinemu.dolphinemu.features.settings.ui.viewholder.SubmenuViewHolder; import org.dolphinemu.dolphinemu.ui.main.MainPresenter; +import org.dolphinemu.dolphinemu.utils.DirectoryInitialization; import org.dolphinemu.dolphinemu.utils.FileBrowserHelper; +import org.dolphinemu.dolphinemu.utils.Log; +import java.io.File; +import java.io.IOException; +import java.io.RandomAccessFile; import java.security.InvalidParameterException; import java.util.ArrayList; import java.util.HashSet; @@ -339,6 +344,22 @@ public final class SettingsAdapter extends RecyclerView.Adapter mView.getAdapter().setAllLogTypes(true))); sl.add(new RunRunnable(R.string.log_disable_all, 0, R.string.log_disable_all_confirmation, 0, () -> mView.getAdapter().setAllLogTypes(false))); + sl.add(new RunRunnable(R.string.log_clear, 0, R.string.log_clear_confirmation, 0, + SettingsAdapter::clearLog)); sl.add(new HeaderSetting(R.string.log_types, 0)); for (Map.Entry entry : LOG_TYPE_NAMES.entrySet()) diff --git a/Source/Android/app/src/main/res/values/strings.xml b/Source/Android/app/src/main/res/values/strings.xml index e940416ca9..ed88152bc1 100644 --- a/Source/Android/app/src/main/res/values/strings.xml +++ b/Source/Android/app/src/main/res/values/strings.xml @@ -283,6 +283,8 @@ Are you sure you want to enable all log types? Disable all Log Types Are you sure you want to disable all log types? + Clear Log file + Are you sure you want to clear the log file? Log Types