mirror of
https://github.com/moparisthebest/k-9
synced 2025-02-17 07:30:16 -05:00
Optional signatures on per identity basis. Original patch by jiri.tyr (thanks!) slightly modified by me.
Fixes issue 461
This commit is contained in:
parent
3b6cccdf7a
commit
033e0d40de
@ -48,6 +48,17 @@
|
|||||||
android:inputType="textEmailAddress"
|
android:inputType="textEmailAddress"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="fill_parent" />
|
android:layout_width="fill_parent" />
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/account_signature_use"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/account_settings_signature_use_label" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/account_signature_layout"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@string/account_settings_signature_label"
|
android:text="@string/account_settings_signature_label"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -82,4 +93,5 @@
|
|||||||
android:text="@string/account_settings_signature__location_after_quoted_text" />
|
android:text="@string/account_settings_signature__location_after_quoted_text" />
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
@ -62,6 +62,16 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="fill_parent" />
|
android:layout_width="fill_parent" />
|
||||||
-->
|
-->
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/signature_use"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/account_settings_signature_use_label" />
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/signature_layout"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@string/edit_identity_signature_label"
|
android:text="@string/edit_identity_signature_label"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -73,7 +83,7 @@
|
|||||||
android:singleLine="false"
|
android:singleLine="false"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:hint="@string/edit_identity_signature_hint"
|
android:hint="@string/edit_identity_signature_hint"/>
|
||||||
/>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
@ -506,6 +506,7 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung f
|
|||||||
<string name="edit_identity_signature_label">Signatur</string>
|
<string name="edit_identity_signature_label">Signatur</string>
|
||||||
<string name="edit_identity_signature_hint">(Optional)</string>
|
<string name="edit_identity_signature_hint">(Optional)</string>
|
||||||
|
|
||||||
|
<string name="account_settings_signature_use_label">Signatur verwenden</string>
|
||||||
<string name="account_settings_signature_label">Signatur</string>
|
<string name="account_settings_signature_label">Signatur</string>
|
||||||
<string name="account_settings_signature_summary">Signatur an jede Nachricht anfügen</string>
|
<string name="account_settings_signature_summary">Signatur an jede Nachricht anfügen</string>
|
||||||
|
|
||||||
|
@ -540,6 +540,7 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin
|
|||||||
<string name="edit_identity_signature_label">Signature</string>
|
<string name="edit_identity_signature_label">Signature</string>
|
||||||
<string name="edit_identity_signature_hint">(Optional)</string>
|
<string name="edit_identity_signature_hint">(Optional)</string>
|
||||||
|
|
||||||
|
<string name="account_settings_signature_use_label">Use Signature</string>
|
||||||
<string name="account_settings_signature_label">Signature</string>
|
<string name="account_settings_signature_label">Signature</string>
|
||||||
<string name="account_settings_signature_summary">Append a signature to every message you send</string>
|
<string name="account_settings_signature_summary">Append a signature to every message you send</string>
|
||||||
|
|
||||||
|
@ -114,6 +114,7 @@ public class Account implements Serializable
|
|||||||
identities = new ArrayList<Identity>();
|
identities = new ArrayList<Identity>();
|
||||||
|
|
||||||
Identity identity = new Identity();
|
Identity identity = new Identity();
|
||||||
|
identity.setSignatureUse(true);
|
||||||
identity.setSignature(context.getString(R.string.default_signature));
|
identity.setSignature(context.getString(R.string.default_signature));
|
||||||
identity.setDescription(context.getString(R.string.default_identity_description));
|
identity.setDescription(context.getString(R.string.default_identity_description));
|
||||||
identities.add(identity);
|
identities.add(identity);
|
||||||
@ -125,6 +126,8 @@ public class Account implements Serializable
|
|||||||
String mName;
|
String mName;
|
||||||
String mEmail;
|
String mEmail;
|
||||||
String mSignature;
|
String mSignature;
|
||||||
|
boolean mSignatureUse;
|
||||||
|
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
return mName;
|
return mName;
|
||||||
@ -141,6 +144,14 @@ public class Account implements Serializable
|
|||||||
{
|
{
|
||||||
mEmail = email;
|
mEmail = email;
|
||||||
}
|
}
|
||||||
|
public boolean getSignatureUse()
|
||||||
|
{
|
||||||
|
return mSignatureUse;
|
||||||
|
}
|
||||||
|
public void setSignatureUse(boolean signatureUse)
|
||||||
|
{
|
||||||
|
mSignatureUse = signatureUse;
|
||||||
|
}
|
||||||
public String getSignature()
|
public String getSignature()
|
||||||
{
|
{
|
||||||
return mSignature;
|
return mSignature;
|
||||||
@ -300,6 +311,7 @@ public class Account implements Serializable
|
|||||||
gotOne = false;
|
gotOne = false;
|
||||||
String name = prefs.getString(mUuid + ".name." + ident, null);
|
String name = prefs.getString(mUuid + ".name." + ident, null);
|
||||||
String email = prefs.getString(mUuid + ".email." + ident, null);
|
String email = prefs.getString(mUuid + ".email." + ident, null);
|
||||||
|
boolean signatureUse = prefs.getBoolean(mUuid + ".signatureUse." + ident, true);
|
||||||
String signature = prefs.getString(mUuid + ".signature." + ident, null);
|
String signature = prefs.getString(mUuid + ".signature." + ident, null);
|
||||||
String description = prefs.getString(mUuid + ".description." + ident, null);
|
String description = prefs.getString(mUuid + ".description." + ident, null);
|
||||||
if (email != null)
|
if (email != null)
|
||||||
@ -307,6 +319,7 @@ public class Account implements Serializable
|
|||||||
Identity identity = new Identity();
|
Identity identity = new Identity();
|
||||||
identity.setName(name);
|
identity.setName(name);
|
||||||
identity.setEmail(email);
|
identity.setEmail(email);
|
||||||
|
identity.setSignatureUse(signatureUse);
|
||||||
identity.setSignature(signature);
|
identity.setSignature(signature);
|
||||||
identity.setDescription(description);
|
identity.setDescription(description);
|
||||||
newIdentities.add(identity);
|
newIdentities.add(identity);
|
||||||
@ -316,14 +329,17 @@ public class Account implements Serializable
|
|||||||
}
|
}
|
||||||
while (gotOne);
|
while (gotOne);
|
||||||
|
|
||||||
|
//FIXME: This can never be true?
|
||||||
if (newIdentities.size() == 0)
|
if (newIdentities.size() == 0)
|
||||||
{
|
{
|
||||||
String name = prefs.getString(mUuid + ".name", null);
|
String name = prefs.getString(mUuid + ".name", null);
|
||||||
String email = prefs.getString(mUuid + ".email", null);
|
String email = prefs.getString(mUuid + ".email", null);
|
||||||
|
boolean signatureUse = prefs.getBoolean(mUuid + ".signatureUse", true);
|
||||||
String signature = prefs.getString(mUuid + ".signature", null);
|
String signature = prefs.getString(mUuid + ".signature", null);
|
||||||
Identity identity = new Identity();
|
Identity identity = new Identity();
|
||||||
identity.setName(name);
|
identity.setName(name);
|
||||||
identity.setEmail(email);
|
identity.setEmail(email);
|
||||||
|
identity.setSignatureUse(signatureUse);
|
||||||
identity.setSignature(signature);
|
identity.setSignature(signature);
|
||||||
identity.setDescription(email);
|
identity.setDescription(email);
|
||||||
newIdentities.add(identity);
|
newIdentities.add(identity);
|
||||||
@ -344,6 +360,7 @@ public class Account implements Serializable
|
|||||||
{
|
{
|
||||||
editor.remove(mUuid + ".name." + ident);
|
editor.remove(mUuid + ".name." + ident);
|
||||||
editor.remove(mUuid + ".email." + ident);
|
editor.remove(mUuid + ".email." + ident);
|
||||||
|
editor.remove(mUuid + ".signatureUse." + ident);
|
||||||
editor.remove(mUuid + ".signature." + ident);
|
editor.remove(mUuid + ".signature." + ident);
|
||||||
editor.remove(mUuid + ".description." + ident);
|
editor.remove(mUuid + ".description." + ident);
|
||||||
gotOne = true;
|
gotOne = true;
|
||||||
@ -362,6 +379,7 @@ public class Account implements Serializable
|
|||||||
{
|
{
|
||||||
editor.putString(mUuid + ".name." + ident, identity.getName());
|
editor.putString(mUuid + ".name." + ident, identity.getName());
|
||||||
editor.putString(mUuid + ".email." + ident, identity.getEmail());
|
editor.putString(mUuid + ".email." + ident, identity.getEmail());
|
||||||
|
editor.putBoolean(mUuid + ".signatureUse." + ident, identity.getSignatureUse());
|
||||||
editor.putString(mUuid + ".signature." + ident, identity.getSignature());
|
editor.putString(mUuid + ".signature." + ident, identity.getSignature());
|
||||||
editor.putString(mUuid + ".description." + ident, identity.getDescription());
|
editor.putString(mUuid + ".description." + ident, identity.getDescription());
|
||||||
ident++;
|
ident++;
|
||||||
@ -423,6 +441,16 @@ public class Account implements Serializable
|
|||||||
identities.get(0).setName(name);
|
identities.get(0).setName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getSignatureUse()
|
||||||
|
{
|
||||||
|
return identities.get(0).getSignatureUse();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSignatureUse(boolean signatureUse)
|
||||||
|
{
|
||||||
|
identities.get(0).setSignatureUse(signatureUse);
|
||||||
|
}
|
||||||
|
|
||||||
public String getSignature()
|
public String getSignature()
|
||||||
{
|
{
|
||||||
return identities.get(0).getSignature();
|
return identities.get(0).getSignature();
|
||||||
|
@ -2,7 +2,12 @@ package com.fsck.k9.activity;
|
|||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.CheckBox;
|
||||||
|
import android.widget.CompoundButton;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
import com.fsck.k9.Account;
|
import com.fsck.k9.Account;
|
||||||
import com.fsck.k9.K9Activity;
|
import com.fsck.k9.K9Activity;
|
||||||
import com.fsck.k9.Preferences;
|
import com.fsck.k9.Preferences;
|
||||||
@ -21,7 +26,9 @@ public class EditIdentity extends K9Activity
|
|||||||
private Account.Identity mIdentity;
|
private Account.Identity mIdentity;
|
||||||
private int mIdentityIndex;
|
private int mIdentityIndex;
|
||||||
private EditText mDescriptionView;
|
private EditText mDescriptionView;
|
||||||
|
private CheckBox mSignatureUse;
|
||||||
private EditText mSignatureView;
|
private EditText mSignatureView;
|
||||||
|
private LinearLayout mSignatureLayout;
|
||||||
private EditText mEmailView;
|
private EditText mEmailView;
|
||||||
// private EditText mAlwaysBccView;
|
// private EditText mAlwaysBccView;
|
||||||
private EditText mNameView;
|
private EditText mNameView;
|
||||||
@ -63,9 +70,34 @@ public class EditIdentity extends K9Activity
|
|||||||
// mAccountAlwaysBcc = (EditText)findViewById(R.id.bcc);
|
// mAccountAlwaysBcc = (EditText)findViewById(R.id.bcc);
|
||||||
// mAccountAlwaysBcc.setText(mIdentity.getAlwaysBcc());
|
// mAccountAlwaysBcc.setText(mIdentity.getAlwaysBcc());
|
||||||
|
|
||||||
|
mSignatureLayout = (LinearLayout)findViewById(R.id.signature_layout);
|
||||||
|
mSignatureUse = (CheckBox)findViewById(R.id.signature_use);
|
||||||
mSignatureView = (EditText)findViewById(R.id.signature);
|
mSignatureView = (EditText)findViewById(R.id.signature);
|
||||||
|
mSignatureUse.setChecked(mIdentity.getSignatureUse());
|
||||||
|
mSignatureUse.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
|
||||||
|
{
|
||||||
|
if (isChecked)
|
||||||
|
{
|
||||||
|
mSignatureLayout.setVisibility(View.VISIBLE);
|
||||||
mSignatureView.setText(mIdentity.getSignature());
|
mSignatureView.setText(mIdentity.getSignature());
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mSignatureLayout.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (mSignatureUse.isChecked())
|
||||||
|
{
|
||||||
|
mSignatureView.setText(mIdentity.getSignature());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mSignatureLayout.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume()
|
public void onResume()
|
||||||
@ -80,6 +112,7 @@ public class EditIdentity extends K9Activity
|
|||||||
mIdentity.setEmail(mEmailView.getText().toString());
|
mIdentity.setEmail(mEmailView.getText().toString());
|
||||||
// mIdentity.setAlwaysBcc(mAccountAlwaysBcc.getText().toString());
|
// mIdentity.setAlwaysBcc(mAccountAlwaysBcc.getText().toString());
|
||||||
mIdentity.setName(mNameView.getText().toString());
|
mIdentity.setName(mNameView.getText().toString());
|
||||||
|
mIdentity.setSignatureUse(mSignatureUse.isChecked());
|
||||||
mIdentity.setSignature(mSignatureView.getText().toString());
|
mIdentity.setSignature(mSignatureView.getText().toString());
|
||||||
|
|
||||||
List<Account.Identity> identities = mAccount.getIdentities();
|
List<Account.Identity> identities = mAccount.getIdentities();
|
||||||
|
@ -494,6 +494,11 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
}
|
}
|
||||||
mSignatureView.addTextChangedListener(sigwatcher);
|
mSignatureView.addTextChangedListener(sigwatcher);
|
||||||
|
|
||||||
|
if (!mIdentity.getSignatureUse())
|
||||||
|
{
|
||||||
|
mSignatureView.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
if (!mSourceMessageProcessed)
|
if (!mSourceMessageProcessed)
|
||||||
{
|
{
|
||||||
updateFrom();
|
updateFrom();
|
||||||
@ -740,12 +745,15 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
|
|
||||||
private String appendSignature(String text)
|
private String appendSignature(String text)
|
||||||
{
|
{
|
||||||
String signature= mSignatureView.getText().toString();
|
if (mIdentity.getSignatureUse())
|
||||||
|
{
|
||||||
|
String signature = mSignatureView.getText().toString();
|
||||||
|
|
||||||
if (signature != null && ! signature.contentEquals(""))
|
if (signature != null && !signature.contentEquals(""))
|
||||||
{
|
{
|
||||||
text += "\n" + signature;
|
text += "\n" + signature;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
@ -1036,8 +1044,16 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateSignature()
|
private void updateSignature()
|
||||||
|
{
|
||||||
|
if (mIdentity.getSignatureUse())
|
||||||
{
|
{
|
||||||
mSignatureView.setText(mIdentity.getSignature());
|
mSignatureView.setText(mIdentity.getSignature());
|
||||||
|
mSignatureView.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mSignatureView.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick(View view)
|
public void onClick(View view)
|
||||||
|
@ -134,6 +134,9 @@ public class AccountSetupBasics extends K9Activity
|
|||||||
boolean valid = Utility.requiredFieldValid(mEmailView)
|
boolean valid = Utility.requiredFieldValid(mEmailView)
|
||||||
&& Utility.requiredFieldValid(mPasswordView)
|
&& Utility.requiredFieldValid(mPasswordView)
|
||||||
&& mEmailValidator.isValid(email);
|
&& mEmailValidator.isValid(email);
|
||||||
|
|
||||||
|
//FIXME: "foo@bar .com" will validate
|
||||||
|
|
||||||
/*&& email.contains("@"); */ // Not sure if this is a good idea or not
|
/*&& email.contains("@"); */ // Not sure if this is a good idea or not
|
||||||
mNextButton.setEnabled(valid);
|
mNextButton.setEnabled(valid);
|
||||||
mManualSetupButton.setEnabled(valid);
|
mManualSetupButton.setEnabled(valid);
|
||||||
|
@ -4,7 +4,12 @@ import android.app.Activity;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.CompoundButton;
|
||||||
|
import android.widget.CheckBox;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
import android.widget.RadioButton;
|
import android.widget.RadioButton;
|
||||||
import com.fsck.k9.Account;
|
import com.fsck.k9.Account;
|
||||||
import com.fsck.k9.K9Activity;
|
import com.fsck.k9.K9Activity;
|
||||||
@ -22,9 +27,10 @@ public class AccountSetupComposition extends K9Activity
|
|||||||
private EditText mAccountEmail;
|
private EditText mAccountEmail;
|
||||||
private EditText mAccountAlwaysBcc;
|
private EditText mAccountAlwaysBcc;
|
||||||
private EditText mAccountName;
|
private EditText mAccountName;
|
||||||
|
private CheckBox mAccountSignatureUse;
|
||||||
private RadioButton mAccountSignatureBeforeLocation;
|
private RadioButton mAccountSignatureBeforeLocation;
|
||||||
private RadioButton mAccountSignatureAfterLocation;
|
private RadioButton mAccountSignatureAfterLocation;
|
||||||
|
private LinearLayout mAccountSignatureLayout;
|
||||||
|
|
||||||
public static void actionEditCompositionSettings(Activity context, Account account)
|
public static void actionEditCompositionSettings(Activity context, Account account)
|
||||||
{
|
{
|
||||||
@ -62,15 +68,47 @@ public class AccountSetupComposition extends K9Activity
|
|||||||
mAccountAlwaysBcc = (EditText)findViewById(R.id.account_always_bcc);
|
mAccountAlwaysBcc = (EditText)findViewById(R.id.account_always_bcc);
|
||||||
mAccountAlwaysBcc.setText(mAccount.getAlwaysBcc());
|
mAccountAlwaysBcc.setText(mAccount.getAlwaysBcc());
|
||||||
|
|
||||||
mAccountSignature = (EditText)findViewById(R.id.account_signature);
|
mAccountSignatureLayout = (LinearLayout)findViewById(R.id.account_signature_layout);
|
||||||
mAccountSignature.setText(mAccount.getSignature());
|
|
||||||
|
|
||||||
mAccountSignatureBeforeLocation = (RadioButton)findViewById(R.id.account_signature_location_before_quoted_text);
|
mAccountSignatureUse = (CheckBox)findViewById(R.id.account_signature_use);
|
||||||
mAccountSignatureAfterLocation = (RadioButton)findViewById(R.id.account_signature_location_after_quoted_text);
|
boolean useSignature = mAccount.getSignatureUse();
|
||||||
|
mAccountSignatureUse.setChecked(useSignature);
|
||||||
|
mAccountSignatureUse.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
|
||||||
|
{
|
||||||
|
if (isChecked)
|
||||||
|
{
|
||||||
|
mAccountSignatureLayout.setVisibility(View.VISIBLE);
|
||||||
|
mAccountSignature.setText(mAccount.getSignature());
|
||||||
boolean isSignatureBeforeQuotedText = mAccount.isSignatureBeforeQuotedText();
|
boolean isSignatureBeforeQuotedText = mAccount.isSignatureBeforeQuotedText();
|
||||||
mAccountSignatureBeforeLocation.setChecked(isSignatureBeforeQuotedText);
|
mAccountSignatureBeforeLocation.setChecked(isSignatureBeforeQuotedText);
|
||||||
mAccountSignatureAfterLocation.setChecked(!isSignatureBeforeQuotedText);
|
mAccountSignatureAfterLocation.setChecked(!isSignatureBeforeQuotedText);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mAccountSignatureLayout.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
mAccountSignature = (EditText)findViewById(R.id.account_signature);
|
||||||
|
|
||||||
|
mAccountSignatureBeforeLocation = (RadioButton)findViewById(R.id.account_signature_location_before_quoted_text);
|
||||||
|
mAccountSignatureAfterLocation = (RadioButton)findViewById(R.id.account_signature_location_after_quoted_text);
|
||||||
|
|
||||||
|
if (useSignature)
|
||||||
|
{
|
||||||
|
mAccountSignature.setText(mAccount.getSignature());
|
||||||
|
|
||||||
|
boolean isSignatureBeforeQuotedText = mAccount.isSignatureBeforeQuotedText();
|
||||||
|
mAccountSignatureBeforeLocation.setChecked(isSignatureBeforeQuotedText);
|
||||||
|
mAccountSignatureAfterLocation.setChecked(!isSignatureBeforeQuotedText);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mAccountSignatureLayout.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume()
|
public void onResume()
|
||||||
@ -84,9 +122,13 @@ public class AccountSetupComposition extends K9Activity
|
|||||||
mAccount.setEmail(mAccountEmail.getText().toString());
|
mAccount.setEmail(mAccountEmail.getText().toString());
|
||||||
mAccount.setAlwaysBcc(mAccountAlwaysBcc.getText().toString());
|
mAccount.setAlwaysBcc(mAccountAlwaysBcc.getText().toString());
|
||||||
mAccount.setName(mAccountName.getText().toString());
|
mAccount.setName(mAccountName.getText().toString());
|
||||||
|
mAccount.setSignatureUse(mAccountSignatureUse.isChecked());
|
||||||
|
if (mAccountSignatureUse.isChecked())
|
||||||
|
{
|
||||||
mAccount.setSignature(mAccountSignature.getText().toString());
|
mAccount.setSignature(mAccountSignature.getText().toString());
|
||||||
boolean isSignatureBeforeQuotedText = mAccountSignatureBeforeLocation.isChecked();
|
boolean isSignatureBeforeQuotedText = mAccountSignatureBeforeLocation.isChecked();
|
||||||
mAccount.setSignatureBeforeQuotedText(isSignatureBeforeQuotedText);
|
mAccount.setSignatureBeforeQuotedText(isSignatureBeforeQuotedText);
|
||||||
|
}
|
||||||
|
|
||||||
mAccount.save(Preferences.getPreferences(this));
|
mAccount.save(Preferences.getPreferences(this));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user