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

Added the ability for users to change their accounts' return addresses

rspier++ for the idea
This commit is contained in:
Jesse Vincent 2008-10-29 07:09:16 +00:00
parent 1548b024aa
commit 9de986ce04
5 changed files with 50 additions and 23 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.fsck.k9" package="com.fsck.k9"
android:versionCode="6" android:versionCode="7"
android:versionName="0.6"> android:versionName="0.7">
> >
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/> <uses-permission android:name="android.permission.READ_CONTACTS"/>

View File

@ -204,6 +204,7 @@
<string name="account_settings_default_label">Default account</string> <string name="account_settings_default_label">Default account</string>
<string name="account_settings_default_summary">Send email from this account by default</string> <string name="account_settings_default_summary">Send email from this account by default</string>
<string name="account_settings_notify_label">Email notifications</string> <string name="account_settings_notify_label">Email notifications</string>
<string name="account_settings_email_label">Email address</string>
<string name="account_settings_notify_summary">Notify in status bar when email arrives</string> <string name="account_settings_notify_summary">Notify in status bar when email arrives</string>
<string name="account_settings_show_combined_label">Show combined Inbox</string> <string name="account_settings_show_combined_label">Show combined Inbox</string>
<string name="account_settings_mail_check_frequency_label">Email check frequency</string> <string name="account_settings_mail_check_frequency_label">Email check frequency</string>

View File

@ -31,6 +31,12 @@
android:summary="" android:summary=""
android:dialogTitle="@string/account_settings_name_label" /> android:dialogTitle="@string/account_settings_name_label" />
<EditTextPreference
android:key="account_email"
android:title="@string/account_settings_email_label"
android:summary=""
android:dialogTitle="@string/account_settings_email_label" />
<ListPreference <ListPreference
android:key="account_check_frequency" android:key="account_check_frequency"
android:title="@string/account_settings_mail_check_frequency_label" android:title="@string/account_settings_mail_check_frequency_label"

View File

@ -206,30 +206,31 @@ public final class R {
public static final int message_view_option=0x7f090006; public static final int message_view_option=0x7f090006;
} }
public static final class string { public static final class string {
public static final int account_delete_dlg_instructions_fmt=0x7f0600c1; public static final int account_delete_dlg_instructions_fmt=0x7f0600c2;
public static final int account_delete_dlg_title=0x7f0600c0; public static final int account_delete_dlg_title=0x7f0600c1;
public static final int account_settings_action=0x7f06001b; public static final int account_settings_action=0x7f06001b;
public static final int account_settings_add_account_label=0x7f0600b6; public static final int account_settings_add_account_label=0x7f0600b7;
public static final int account_settings_always_bcc_label=0x7f0600be; public static final int account_settings_always_bcc_label=0x7f0600bf;
public static final int account_settings_always_bcc_summary=0x7f0600bf; public static final int account_settings_always_bcc_summary=0x7f0600c0;
public static final int account_settings_default_label=0x7f0600ac; public static final int account_settings_default_label=0x7f0600ac;
public static final int account_settings_default_summary=0x7f0600ad; public static final int account_settings_default_summary=0x7f0600ad;
public static final int account_settings_description_label=0x7f0600b7; public static final int account_settings_description_label=0x7f0600b8;
public static final int account_settings_incoming_label=0x7f0600b2; public static final int account_settings_email_label=0x7f0600af;
public static final int account_settings_incoming_summary=0x7f0600b3; public static final int account_settings_incoming_label=0x7f0600b3;
public static final int account_settings_mail_check_frequency_label=0x7f0600b1; public static final int account_settings_incoming_summary=0x7f0600b4;
public static final int account_settings_name_label=0x7f0600b8; public static final int account_settings_mail_check_frequency_label=0x7f0600b2;
public static final int account_settings_notifications=0x7f0600b9; public static final int account_settings_name_label=0x7f0600b9;
public static final int account_settings_notifications=0x7f0600ba;
public static final int account_settings_notify_label=0x7f0600ae; public static final int account_settings_notify_label=0x7f0600ae;
public static final int account_settings_notify_summary=0x7f0600af; public static final int account_settings_notify_summary=0x7f0600b0;
public static final int account_settings_outgoing_label=0x7f0600b4; public static final int account_settings_outgoing_label=0x7f0600b5;
public static final int account_settings_outgoing_summary=0x7f0600b5; public static final int account_settings_outgoing_summary=0x7f0600b6;
public static final int account_settings_ringtone=0x7f0600bc; public static final int account_settings_ringtone=0x7f0600bd;
public static final int account_settings_servers=0x7f0600bd; public static final int account_settings_servers=0x7f0600be;
public static final int account_settings_show_combined_label=0x7f0600b0; public static final int account_settings_show_combined_label=0x7f0600b1;
public static final int account_settings_title_fmt=0x7f0600ab; public static final int account_settings_title_fmt=0x7f0600ab;
public static final int account_settings_vibrate_enable=0x7f0600ba; public static final int account_settings_vibrate_enable=0x7f0600bb;
public static final int account_settings_vibrate_summary=0x7f0600bb; public static final int account_settings_vibrate_summary=0x7f0600bc;
public static final int account_setup_account_type_imap_action=0x7f060078; public static final int account_setup_account_type_imap_action=0x7f060078;
public static final int account_setup_account_type_instructions=0x7f060076; public static final int account_setup_account_type_instructions=0x7f060076;
public static final int account_setup_account_type_pop_action=0x7f060077; public static final int account_setup_account_type_pop_action=0x7f060077;
@ -398,8 +399,8 @@ public final class R {
public static final int okay_action=0x7f060008; public static final int okay_action=0x7f060008;
public static final int open_action=0x7f06001a; public static final int open_action=0x7f06001a;
public static final int preferences_action=0x7f060019; public static final int preferences_action=0x7f060019;
public static final int provider_note_live=0x7f0600c3; public static final int provider_note_live=0x7f0600c4;
public static final int provider_note_yahoo=0x7f0600c2; public static final int provider_note_yahoo=0x7f0600c3;
public static final int read_action=0x7f06001e; public static final int read_action=0x7f06001e;
public static final int read_attachment_desc=0x7f060002; public static final int read_attachment_desc=0x7f060002;
public static final int read_attachment_label=0x7f060001; public static final int read_attachment_label=0x7f060001;

View File

@ -24,6 +24,7 @@ public class AccountSettings extends PreferenceActivity {
private static final String PREFERENCE_TOP_CATERGORY = "account_settings"; private static final String PREFERENCE_TOP_CATERGORY = "account_settings";
private static final String PREFERENCE_DESCRIPTION = "account_description"; private static final String PREFERENCE_DESCRIPTION = "account_description";
private static final String PREFERENCE_NAME = "account_name"; private static final String PREFERENCE_NAME = "account_name";
private static final String PREFERENCE_EMAIL = "account_email";
private static final String PREFERENCE_ALWAYS_BCC = "account_always_bcc"; private static final String PREFERENCE_ALWAYS_BCC = "account_always_bcc";
private static final String PREFERENCE_FREQUENCY = "account_check_frequency"; private static final String PREFERENCE_FREQUENCY = "account_check_frequency";
private static final String PREFERENCE_DEFAULT = "account_default"; private static final String PREFERENCE_DEFAULT = "account_default";
@ -38,6 +39,7 @@ public class AccountSettings extends PreferenceActivity {
private EditTextPreference mAccountDescription; private EditTextPreference mAccountDescription;
private EditTextPreference mAccountName; private EditTextPreference mAccountName;
private EditTextPreference mAccountEmail;
private EditTextPreference mAccountAlwaysBcc; private EditTextPreference mAccountAlwaysBcc;
private ListPreference mCheckFrequency; private ListPreference mCheckFrequency;
private CheckBoxPreference mAccountDefault; private CheckBoxPreference mAccountDefault;
@ -86,6 +88,22 @@ public class AccountSettings extends PreferenceActivity {
} }
}); });
mAccountEmail = (EditTextPreference) findPreference(PREFERENCE_EMAIL);
mAccountEmail.setSummary(mAccount.getEmail());
mAccountEmail.setText(mAccount.getEmail());
mAccountEmail.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
public boolean onPreferenceChange(Preference preference, Object newValue) {
final String summary = newValue.toString();
mAccountEmail.setSummary(summary);
mAccountEmail.setText(summary);
return false;
}
});
mAccountAlwaysBcc = (EditTextPreference) findPreference(PREFERENCE_ALWAYS_BCC); mAccountAlwaysBcc = (EditTextPreference) findPreference(PREFERENCE_ALWAYS_BCC);
if (mAccount.getAlwaysBcc() != null && (mAccount.getAlwaysBcc().length() > 0 )) { if (mAccount.getAlwaysBcc() != null && (mAccount.getAlwaysBcc().length() > 0 )) {
mAccountAlwaysBcc.setSummary(mAccount.getAlwaysBcc()); mAccountAlwaysBcc.setSummary(mAccount.getAlwaysBcc());
@ -169,6 +187,7 @@ public class AccountSettings extends PreferenceActivity {
} }
mAccount.setDescription(mAccountDescription.getText()); mAccount.setDescription(mAccountDescription.getText());
mAccount.setName(mAccountName.getText()); mAccount.setName(mAccountName.getText());
mAccount.setEmail(mAccountEmail.getText());
mAccount.setAlwaysBcc(mAccountAlwaysBcc.getText()); mAccount.setAlwaysBcc(mAccountAlwaysBcc.getText());
mAccount.setNotifyNewMail(mAccountNotify.isChecked()); mAccount.setNotifyNewMail(mAccountNotify.isChecked());
mAccount.setAutomaticCheckIntervalMinutes(Integer.parseInt(mCheckFrequency.getValue())); mAccount.setAutomaticCheckIntervalMinutes(Integer.parseInt(mCheckFrequency.getValue()));