1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Added option to always show the CC/BCC text input fields

This commit is contained in:
cketti 2012-08-10 03:38:10 +02:00
parent 1ff3b6b88f
commit d9f1690741
7 changed files with 45 additions and 2 deletions

View File

@ -552,6 +552,9 @@ http://k9mail.googlecode.com/
<string name="account_settings_message_format_html">HTML (images and formatting are preserved)</string>
<string name="account_settings_message_format_auto">Automatic (plain text unless replying to an HTML message)</string>
<string name="account_settings_always_show_cc_bcc_label">Always show CC/BCC</string>
<string name="account_settings_always_show_cc_bcc_summary">Always show the CC/BCC text input fields</string>
<string name="account_settings_message_read_receipt_label">Read receipt</string>
<string name="account_settings_message_read_receipt_summary">Always request a read receipt</string>

View File

@ -231,6 +231,12 @@
android:entries="@array/account_settings_message_format_entries"
android:entryValues="@array/account_settings_message_format_values" />
<CheckBoxPreference
android:persistent="false"
android:key="always_show_cc_bcc"
android:title="@string/account_settings_always_show_cc_bcc_label"
android:summary="@string/account_settings_always_show_cc_bcc_summary" />
<CheckBoxPreference
android:persistent="false"
android:key="message_read_receipt"

View File

@ -186,6 +186,7 @@ public class Account implements BaseAccount {
private boolean mCryptoAutoSignature;
private boolean mCryptoAutoEncrypt;
private boolean mMarkMessageAsReadOnView;
private boolean mAlwaysShowCcBcc;
private CryptoProvider mCryptoProvider = null;
@ -276,6 +277,7 @@ public class Account implements BaseAccount {
mCryptoAutoEncrypt = false;
mEnabled = true;
mMarkMessageAsReadOnView = true;
mAlwaysShowCcBcc = false;
searchableFolders = Searchable.ALL;
@ -441,6 +443,7 @@ public class Account implements BaseAccount {
mCryptoAutoEncrypt = prefs.getBoolean(mUuid + ".cryptoAutoEncrypt", false);
mEnabled = prefs.getBoolean(mUuid + ".enabled", true);
mMarkMessageAsReadOnView = prefs.getBoolean(mUuid + ".markMessageAsReadOnView", true);
mAlwaysShowCcBcc = prefs.getBoolean(mUuid + ".alwaysShowCcBcc", false);
}
protected synchronized void delete(Preferences preferences) {
@ -525,6 +528,7 @@ public class Account implements BaseAccount {
editor.remove(mUuid + ".enableMoveButtons");
editor.remove(mUuid + ".hideMoveButtonsEnum");
editor.remove(mUuid + ".markMessageAsReadOnView");
editor.remove(mUuid + ".alwaysShowCcBcc");
for (String type : networkTypes) {
editor.remove(mUuid + ".useCompression." + type);
}
@ -688,6 +692,7 @@ public class Account implements BaseAccount {
editor.putBoolean(mUuid + ".cryptoAutoEncrypt", mCryptoAutoEncrypt);
editor.putBoolean(mUuid + ".enabled", mEnabled);
editor.putBoolean(mUuid + ".markMessageAsReadOnView", mMarkMessageAsReadOnView);
editor.putBoolean(mUuid + ".alwaysShowCcBcc", mAlwaysShowCcBcc);
editor.putBoolean(mUuid + ".vibrate", mNotificationSetting.shouldVibrate());
editor.putInt(mUuid + ".vibratePattern", mNotificationSetting.getVibratePattern());
@ -1623,4 +1628,12 @@ public class Account implements BaseAccount {
public synchronized void setMarkMessageAsReadOnView(boolean value) {
mMarkMessageAsReadOnView = value;
}
public synchronized boolean isAlwaysShowCcBcc() {
return mAlwaysShowCcBcc;
}
public synchronized void setAlwaysShowCcBcc(boolean show) {
mAlwaysShowCcBcc = show;
}
}

View File

@ -508,6 +508,10 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
mCcWrapper = (LinearLayout) findViewById(R.id.cc_wrapper);
mBccWrapper = (LinearLayout) findViewById(R.id.bcc_wrapper);
if (mAccount.isAlwaysShowCcBcc()) {
onAddCcBcc();
}
EditText upperSignature = (EditText)findViewById(R.id.upper_signature);
EditText lowerSignature = (EditText)findViewById(R.id.lower_signature);
@ -2017,6 +2021,15 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
} else {
mAccount = account;
}
// Show CC/BCC text input field when switching to an account that always wants them
// displayed.
// Please note that we're not hiding the fields if the user switches back to an account
// that doesn't have this setting checked.
if (mAccount.isAlwaysShowCcBcc()) {
onAddCcBcc();
}
// not sure how to handle mFolder, mSourceMessage?
}

View File

@ -108,7 +108,7 @@ public class AccountSettings extends K9PreferenceActivity {
private static final String PREFERENCE_SENT_FOLDER = "sent_folder";
private static final String PREFERENCE_SPAM_FOLDER = "spam_folder";
private static final String PREFERENCE_TRASH_FOLDER = "trash_folder";
private static final String PREFERENCE_ALWAYS_SHOW_CC_BCC = "always_show_cc_bcc";
private Account mAccount;
@ -169,6 +169,7 @@ public class AccountSettings extends K9PreferenceActivity {
private ListPreference mSentFolder;
private ListPreference mSpamFolder;
private ListPreference mTrashFolder;
private CheckBoxPreference mAlwaysShowCcBcc;
public static void actionSettings(Context context, Account account) {
@ -223,6 +224,9 @@ public class AccountSettings extends K9PreferenceActivity {
}
});
mAlwaysShowCcBcc = (CheckBoxPreference) findPreference(PREFERENCE_ALWAYS_SHOW_CC_BCC);
mAlwaysShowCcBcc.setChecked(mAccount.isAlwaysShowCcBcc());
mMessageReadReceipt = (CheckBoxPreference) findPreference(PREFERENCE_MESSAGE_READ_RECEIPT);
mMessageReadReceipt.setChecked(mAccount.isMessageReadReceiptAlways());
@ -719,6 +723,7 @@ public class AccountSettings extends K9PreferenceActivity {
mAccount.setSaveAllHeaders(mSaveAllHeaders.isChecked());
mAccount.setSearchableFolders(Account.Searchable.valueOf(mSearchableFolders.getValue()));
mAccount.setMessageFormat(Account.MessageFormat.valueOf(mMessageFormat.getValue()));
mAccount.setAlwaysShowCcBcc(mAlwaysShowCcBcc.isChecked());
mAccount.setMessageReadReceipt(mMessageReadReceipt.isChecked());
mAccount.setQuoteStyle(QuoteStyle.valueOf(mQuoteStyle.getValue()));
mAccount.setQuotePrefix(mAccountQuotePrefix.getText());

View File

@ -33,6 +33,9 @@ public class AccountSettings {
s.put("alwaysBcc", Settings.versions(
new V(11, new StringSetting(""))
));
s.put("alwaysShowCcBcc", Settings.versions(
new V(13, new BooleanSetting(false))
));
s.put("archiveFolderName", Settings.versions(
new V(1, new StringSetting("Archive"))
));

View File

@ -35,7 +35,7 @@ public class Settings {
*
* @see SettingsExporter
*/
public static final int VERSION = 12;
public static final int VERSION = 13;
public static Map<String, Object> validate(int version, Map<String,
TreeMap<Integer, SettingsDescription>> settings,