Added debug option to disable expunge

This commit is contained in:
M66B
2021-02-09 16:49:51 +01:00
parent 5c8f4c0cbc
commit 89ee7d79ee
5 changed files with 58 additions and 14 deletions

View File

@@ -109,6 +109,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private SwitchCompat swProtocol;
private SwitchCompat swDebug;
private SwitchCompat swExpunge;
private SwitchCompat swAuthPlain;
private SwitchCompat swAuthLogin;
private SwitchCompat swAuthNtlm;
@@ -133,7 +134,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
"classification", "class_min_probability", "class_min_difference",
"language", "watchdog", "updates",
"experiments", "query_threads", "crash_reports", "cleanup_attachments",
"protocol", "debug", "auth_plain", "auth_login", "auth_ntlm", "auth_sasl"
"protocol", "debug", "perform_expunge", "auth_plain", "auth_login", "auth_ntlm", "auth_sasl"
};
private final static String[] RESET_QUESTIONS = new String[]{
@@ -200,6 +201,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swProtocol = view.findViewById(R.id.swProtocol);
swDebug = view.findViewById(R.id.swDebug);
swExpunge = view.findViewById(R.id.swExpunge);
swAuthPlain = view.findViewById(R.id.swAuthPlain);
swAuthLogin = view.findViewById(R.id.swAuthLogin);
swAuthNtlm = view.findViewById(R.id.swAuthNtlm);
@@ -469,6 +471,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
swExpunge.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("perform_expunge", checked).apply();
}
});
swAuthPlain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -845,6 +854,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swProtocol.setChecked(prefs.getBoolean("protocol", false));
swDebug.setChecked(prefs.getBoolean("debug", false));
swExpunge.setChecked(prefs.getBoolean("perform_expunge", true));
swAuthPlain.setChecked(prefs.getBoolean("auth_plain", true));
swAuthLogin.setChecked(prefs.getBoolean("auth_login", true));
swAuthNtlm.setChecked(prefs.getBoolean("auth_ntlm", true));