Added option to disable auto plain text only reply

pull/210/head
M66B 2 years ago
parent b2fa1c596a
commit 53e6b8625b

@ -4630,6 +4630,7 @@ public class FragmentCompose extends FragmentBase {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean plain_only = prefs.getBoolean("plain_only", false);
boolean plain_only_reply = prefs.getBoolean("plain_only_reply", true);
boolean resize_reply = prefs.getBoolean("resize_reply", true);
boolean sign_default = prefs.getBoolean("sign_default", false);
boolean encrypt_default = prefs.getBoolean("encrypt_default", false);
@ -5074,7 +5075,7 @@ public class FragmentCompose extends FragmentBase {
data.draft.sensitivity = ref.sensitivity;
// Plain-only
if (ref.isPlainOnly())
if (plain_only_reply && ref.isPlainOnly())
data.draft.plain_only = 1;
// Encryption

@ -103,6 +103,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
private SwitchCompat swAttachNew;
private SwitchCompat swAutoLink;
private SwitchCompat swPlainOnly;
private SwitchCompat swPlainOnlyReply;
private SwitchCompat swFormatFlowed;
private SwitchCompat swUsenetSignature;
private SwitchCompat swRemoveSignatures;
@ -126,7 +127,8 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
"prefix_once", "prefix_count", "alt_re", "alt_fwd",
"separate_reply", "extended_reply", "write_below", "quote_reply", "quote_limit", "resize_reply",
"signature_location", "signature_new", "signature_reply", "signature_reply_once", "signature_forward",
"attach_new", "auto_link", "plain_only", "format_flowed", "usenet_signature", "remove_signatures",
"attach_new", "auto_link", "plain_only", "plain_only_reply",
"format_flowed", "usenet_signature", "remove_signatures",
"receipt_default", "receipt_type", "receipt_legacy",
"forward_new",
"lookup_mx", "reply_move", "reply_move_inbox"
@ -183,6 +185,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
swAttachNew = view.findViewById(R.id.swAttachNew);
swAutoLink = view.findViewById(R.id.swAutoLink);
swPlainOnly = view.findViewById(R.id.swPlainOnly);
swPlainOnlyReply = view.findViewById(R.id.swPlainOnlyReply);
swFormatFlowed = view.findViewById(R.id.swFormatFlowed);
swUsenetSignature = view.findViewById(R.id.swUsenetSignature);
swRemoveSignatures = view.findViewById(R.id.swRemoveSignatures);
@ -558,6 +561,13 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
}
});
swPlainOnlyReply.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("plain_only_reply", checked).apply();
}
});
swFormatFlowed.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -762,6 +772,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
swAttachNew.setChecked(prefs.getBoolean("attach_new", true));
swAutoLink.setChecked(prefs.getBoolean("auto_link", false));
swPlainOnly.setChecked(prefs.getBoolean("plain_only", false));
swPlainOnlyReply.setChecked(prefs.getBoolean("plain_only_reply", true));
swFormatFlowed.setChecked(prefs.getBoolean("format_flowed", false));
swUsenetSignature.setChecked(prefs.getBoolean("usenet_signature", false));
swRemoveSignatures.setChecked(prefs.getBoolean("remove_signatures", false));

@ -738,6 +738,18 @@
app:layout_constraintTop_toBottomOf="@id/swAutoLink"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swPlainOnlyReply"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_plain_only_reply"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swPlainOnly"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swFormatFlowed"
android:layout_width="0dp"
@ -746,7 +758,7 @@
android:text="@string/title_advanced_flow"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swPlainOnly"
app:layout_constraintTop_toBottomOf="@id/swPlainOnlyReply"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat

@ -461,6 +461,7 @@
<string name="title_advanced_auto_link">Automatically create links</string>
<string name="title_advanced_plain_only">Send plain text only by default</string>
<string name="title_advanced_plain_only_reply">Automatically plain text only when replying to a plain text only message</string>
<string name="title_advanced_flow">\'format flowed\' for plain text</string>
<string name="title_advanced_usenet_signature">Follow Usenet signature convention</string>
<string name="title_advanced_remove_signatures">Remove recognized signatures</string>

Loading…
Cancel
Save