Added option to disable signatures for new messages

pull/203/head
M66B 4 years ago
parent 08317ae814
commit 2c3ac2aa30

@ -4185,6 +4185,7 @@ public class FragmentCompose extends FragmentBase {
document.body().append(d.body().html());
}
data.draft.signature = prefs.getBoolean("signature_new", true);
addSignature(context, document, data.draft, selected);
} else {
// Actions:

@ -73,6 +73,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
private SwitchCompat swQuoteLimit;
private SwitchCompat swResizeReply;
private Spinner spSignatureLocation;
private SwitchCompat swSignatureNew;
private SwitchCompat swSignatureReply;
private SwitchCompat swSignatureForward;
private Button btnEditSignature;
@ -94,7 +95,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
"alt_re", "alt_fwd",
"send_reminders", "send_delayed", "send_pending",
"compose_font", "prefix_once", "separate_reply", "extended_reply", "write_below", "quote_reply", "quote_limit", "resize_reply",
"signature_location", "signature_reply", "signature_forward",
"signature_location", "signature_new", "signature_reply", "signature_forward",
"discard_delete", "reply_move",
"auto_link", "plain_only", "format_flowed", "usenet_signature", "remove_signatures",
"receipt_default", "receipt_type", "lookup_mx"
@ -132,6 +133,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
swQuoteLimit = view.findViewById(R.id.swQuoteLimit);
swResizeReply = view.findViewById(R.id.swResizeReply);
spSignatureLocation = view.findViewById(R.id.spSignatureLocation);
swSignatureNew = view.findViewById(R.id.swSignatureNew);
swSignatureReply = view.findViewById(R.id.swSignatureReply);
swSignatureForward = view.findViewById(R.id.swSignatureForward);
btnEditSignature = view.findViewById(R.id.btnEditSignature);
@ -345,6 +347,13 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
}
});
swSignatureNew.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("signature_new", checked).apply();
}
});
swSignatureReply.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -539,6 +548,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
int signature_location = prefs.getInt("signature_location", 1);
spSignatureLocation.setSelection(signature_location);
swSignatureNew.setChecked(prefs.getBoolean("signature_new", true));
swSignatureReply.setChecked(prefs.getBoolean("signature_reply", true));
swSignatureForward.setChecked(prefs.getBoolean("signature_forward", true));
swDiscardDelete.setChecked(prefs.getBoolean("discard_delete", false));

@ -467,6 +467,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSignatureLocation" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swSignatureNew"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_signature_new"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spSignatureLocation"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swSignatureReply"
android:layout_width="0dp"
@ -476,7 +488,7 @@
android:text="@string/title_advanced_signature_reply"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spSignatureLocation"
app:layout_constraintTop_toBottomOf="@id/swSignatureNew"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat

@ -360,6 +360,7 @@
<string name="title_advanced_limit_reply">Limit the number of nested quotes</string>
<string name="title_advanced_resize_reply">Resize images in replied text</string>
<string name="title_advanced_signature_location">Signature position</string>
<string name="title_advanced_signature_new">Use signature for new messages</string>
<string name="title_advanced_signature_reply">Use signature when replying</string>
<string name="title_advanced_signature_forward">Use signature when forwarding</string>
<string name="title_advanced_discard_delete">On discard draft permanently delete draft</string>

Loading…
Cancel
Save