Added option to download plain text only part by default

This commit is contained in:
M66B
2022-02-14 20:18:03 +01:00
parent 632a3912bf
commit 82ac131e39
8 changed files with 57 additions and 15 deletions

View File

@@ -62,6 +62,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
private SwitchCompat swRlah;
private SwitchCompat swDownloadHeaders;
private SwitchCompat swDownloadEml;
private SwitchCompat swDownloadPlain;
private SwitchCompat swValidated;
private SwitchCompat swVpnOnly;
private EditText etTimeout;
@@ -82,7 +83,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
private final static String[] RESET_OPTIONS = new String[]{
"metered", "download", "roaming", "rlah",
"download_headers", "download_eml",
"download_headers", "download_eml", "download_plain",
"require_validated", "vpn_only",
"timeout", "prefer_ip4", "bind_socket", "standalone_vpn", "tcp_keep_alive",
"ssl_harden", "cert_strict"
@@ -104,6 +105,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
swRlah = view.findViewById(R.id.swRlah);
swDownloadHeaders = view.findViewById(R.id.swDownloadHeaders);
swDownloadEml = view.findViewById(R.id.swDownloadEml);
swDownloadPlain = view.findViewById(R.id.swDownloadPlain);
swValidated = view.findViewById(R.id.swValidated);
swVpnOnly = view.findViewById(R.id.swVpnOnly);
etTimeout = view.findViewById(R.id.etTimeout);
@@ -179,6 +181,13 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
}
});
swDownloadPlain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean checked) {
prefs.edit().putBoolean("download_plain", checked).apply();
}
});
grpValidated.setVisibility(Build.VERSION.SDK_INT < Build.VERSION_CODES.M ? View.GONE : View.VISIBLE);
swValidated.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
@@ -371,6 +380,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
swDownloadHeaders.setChecked(prefs.getBoolean("download_headers", false));
swDownloadEml.setChecked(prefs.getBoolean("download_eml", false));
swDownloadPlain.setChecked(prefs.getBoolean("download_plain", false));
swValidated.setChecked(prefs.getBoolean("require_validated", false));
swVpnOnly.setChecked(prefs.getBoolean("vpn_only", false));