Fixes Issue 784

This commit is contained in:
Daniel Applebaum 2009-11-22 19:42:44 +00:00
parent 0f24c6a28b
commit 3f98e3204b
5 changed files with 22 additions and 0 deletions

View File

@ -382,6 +382,9 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin
<string name="account_settings_notify_sync_summary">Notify in status bar while mail is checked</string>
<string name="account_settings_show_combined_label">Show combined Inbox</string>
<string name="account_settings_notify_self_label">Notify for mail I sent</string>
<string name="account_settings_notify_self_summary">Notify even for mail sent from an account identity</string>
<string name="account_settings_hide_buttons_label">Scroll navigation buttons</string>
<string name="account_settings_hide_buttons_never">Never</string>
<string name="account_settings_hide_buttons_keyboard_avail">When keyboard is available</string>

View File

@ -146,6 +146,13 @@
android:title="@string/account_settings_notify_label"
android:defaultValue="true"
android:summary="@string/account_settings_notify_summary" />
<CheckBoxPreference
android:key="account_notify_self"
android:dependency="account_notify"
android:title="@string/account_settings_notify_self_label"
android:defaultValue="true"
android:summary="@string/account_settings_notify_self_summary" />
<RingtonePreference
android:layout="?android:attr/preferenceLayoutChild"

View File

@ -173,6 +173,8 @@ public class Account implements Serializable {
+ ".lastAutomaticCheckTime", 0);
mNotifyNewMail = preferences.getPreferences().getBoolean(mUuid + ".notifyNewMail",
false);
mNotifySelfNewMail = preferences.getPreferences().getBoolean(mUuid + ".notifySelfNewMail",
true);
mNotifySync = preferences.getPreferences().getBoolean(mUuid + ".notifyMailCheck",
false);
mDeletePolicy = preferences.getPreferences().getInt(mUuid + ".deletePolicy", 0);
@ -465,6 +467,7 @@ public class Account implements Serializable {
editor.remove(mUuid + ".automaticCheckIntervalMinutes");
editor.remove(mUuid + ".lastAutomaticCheckTime");
editor.remove(mUuid + ".notifyNewMail");
editor.remove(mUuid + ".notifySelfNewMail");
editor.remove(mUuid + ".deletePolicy");
editor.remove(mUuid + ".draftsFolderName");
editor.remove(mUuid + ".sentFolderName");
@ -528,6 +531,7 @@ public class Account implements Serializable {
editor.putInt(mUuid + ".displayCount", mDisplayCount);
editor.putLong(mUuid + ".lastAutomaticCheckTime", mLastAutomaticCheckTime);
editor.putBoolean(mUuid + ".notifyNewMail", mNotifyNewMail);
editor.putBoolean(mUuid + ".notifySelfNewMail", mNotifySelfNewMail);
editor.putBoolean(mUuid + ".notifyMailCheck", mNotifySync);
editor.putInt(mUuid + ".deletePolicy", mDeletePolicy);
editor.putString(mUuid + ".draftsFolderName", mDraftsFolderName);

View File

@ -393,6 +393,7 @@ public class Email extends Application {
public static final String EXTRA_CC = "com.android.email.intent.extra.CC";
public static final String EXTRA_BCC = "com.android.email.intent.extra.BCC";
public static final String EXTRA_SUBJECT = "com.android.email.intent.extra.SUBJECT";
public static final String EXTRA_FROM_SELF = "com.android.email.intent.extra.FROM_SELF";
}
}
@ -512,6 +513,7 @@ public class Email extends Application {
intent.putExtra(Email.Intents.EmailReceived.EXTRA_CC, Address.toString(message.getRecipients(Message.RecipientType.CC)));
intent.putExtra(Email.Intents.EmailReceived.EXTRA_BCC, Address.toString(message.getRecipients(Message.RecipientType.BCC)));
intent.putExtra(Email.Intents.EmailReceived.EXTRA_SUBJECT, message.getSubject());
intent.putExtra(Email.Intents.EmailReceived.EXTRA_FROM_SELF, account.isAnIdentity(message.getFrom()));
Email.this.sendBroadcast(intent);
Log.d(Email.LOG_TAG, "Broadcasted intent: " + message.getSubject());
}

View File

@ -44,6 +44,7 @@ public class AccountSettings extends K9PreferenceActivity {
private static final String PREFERENCE_DEFAULT = "account_default";
private static final String PREFERENCE_HIDE_BUTTONS = "hide_buttons_enum";
private static final String PREFERENCE_NOTIFY = "account_notify";
private static final String PREFERENCE_NOTIFY_SELF = "account_notify_self";
private static final String PREFERENCE_NOTIFY_SYNC = "account_notify_sync";
private static final String PREFERENCE_VIBRATE = "account_vibrate";
private static final String PREFERENCE_RINGTONE = "account_ringtone";
@ -63,6 +64,7 @@ public class AccountSettings extends K9PreferenceActivity {
private ListPreference mDisplayCount;
private CheckBoxPreference mAccountDefault;
private CheckBoxPreference mAccountNotify;
private CheckBoxPreference mAccountNotifySelf;
private ListPreference mAccountHideButtons;
private CheckBoxPreference mAccountNotifySync;
private CheckBoxPreference mAccountVibrate;
@ -224,6 +226,9 @@ public class AccountSettings extends K9PreferenceActivity {
mAccountNotify = (CheckBoxPreference) findPreference(PREFERENCE_NOTIFY);
mAccountNotify.setChecked(mAccount.isNotifyNewMail());
mAccountNotifySelf = (CheckBoxPreference) findPreference(PREFERENCE_NOTIFY_SELF);
mAccountNotifySelf.setChecked(mAccount.isNotifySelfNewMail());
mAccountNotifySync = (CheckBoxPreference) findPreference(PREFERENCE_NOTIFY_SYNC);
mAccountNotifySync.setChecked(mAccount.isShowOngoing());
@ -295,6 +300,7 @@ public class AccountSettings extends K9PreferenceActivity {
}
mAccount.setDescription(mAccountDescription.getText());
mAccount.setNotifyNewMail(mAccountNotify.isChecked());
mAccount.setNotifySelfNewMail(mAccountNotifySelf.isChecked());
mAccount.setShowOngoing(mAccountNotifySync.isChecked());
mAccount.setAutomaticCheckIntervalMinutes(Integer.parseInt(mCheckFrequency.getValue()));
mAccount.setDisplayCount(Integer.parseInt(mDisplayCount.getValue()));