diff --git a/res/values/strings.xml b/res/values/strings.xml index 127fecbd7..756637e44 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -314,6 +314,8 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin Message previews Roomier list items with message previews + Show names from Contacts + Show recipient names from Contacts if available Colorize contacts Don\'t colorize names in your contact list Colorize names in your contact list @@ -660,8 +662,8 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin New mail ringtone Blink LED Blink LED when mail arrives - - + + Server settings Message composition options diff --git a/res/xml/global_preferences.xml b/res/xml/global_preferences.xml index fcb4351c8..179e443e0 100644 --- a/res/xml/global_preferences.xml +++ b/res/xml/global_preferences.xml @@ -121,10 +121,16 @@ android:title="@string/global_settings_checkbox_label" android:summary="@string/global_settings_checkbox_summary" /> + + + android:summary="@string/global_settings_registered_name_color_default" + android:dependency="messagelist_show_contact_name" /> diff --git a/src/com/fsck/k9/K9.java b/src/com/fsck/k9/K9.java index fd510f55e..9021d70ea 100644 --- a/src/com/fsck/k9/K9.java +++ b/src/com/fsck/k9/K9.java @@ -141,6 +141,7 @@ public class K9 extends Application private static boolean mMessageListCheckboxes = false; private static boolean mMessageListTouchable = false; + private static boolean mShowContactName = false; private static boolean mChangeRegisteredNameColor = false; private static int mRegisteredNameColor = 0xff00008f; private static boolean mMessageViewFixedWidthFont = false; @@ -380,7 +381,7 @@ public class K9 extends Application editor.putBoolean("messageListCheckboxes",mMessageListCheckboxes); editor.putBoolean("messageListTouchable",mMessageListTouchable); - + editor.putBoolean("showContactName",mShowContactName); editor.putBoolean("changeRegisteredNameColor",mChangeRegisteredNameColor); editor.putInt("registeredNameColor",mRegisteredNameColor); editor.putBoolean("messageViewFixedWidthFont",mMessageViewFixedWidthFont); @@ -421,6 +422,7 @@ public class K9 extends Application mMessageListCheckboxes = sprefs.getBoolean("messageListCheckboxes",false); mMessageListTouchable = sprefs.getBoolean("messageListTouchable",false); + mShowContactName = sprefs.getBoolean("showContactName", false); mChangeRegisteredNameColor = sprefs.getBoolean("changeRegisteredNameColor", false); mRegisteredNameColor = sprefs.getInt("registeredNameColor", 0xff00008f); mMessageViewFixedWidthFont = sprefs.getBoolean("messageViewFixedWidthFont", false); @@ -689,6 +691,16 @@ public class K9 extends Application mMessageListCheckboxes = checkboxes; } + public static boolean showContactName() + { + return mShowContactName; + } + + public static void setShowContactName(boolean showContactName) + { + mShowContactName = showContactName; + } + public static boolean changeRegisteredNameColor() { return mChangeRegisteredNameColor; diff --git a/src/com/fsck/k9/activity/setup/Prefs.java b/src/com/fsck/k9/activity/setup/Prefs.java index 72ebd62d3..0e827c39d 100644 --- a/src/com/fsck/k9/activity/setup/Prefs.java +++ b/src/com/fsck/k9/activity/setup/Prefs.java @@ -49,7 +49,7 @@ public class Prefs extends K9PreferenceActivity private static final String PREFERENCE_MESSAGELIST_STARS = "messagelist_stars"; private static final String PREFERENCE_MESSAGELIST_CHECKBOXES = "messagelist_checkboxes"; private static final String PREFERENCE_MESSAGELIST_TOUCHABLE = "messagelist_touchable"; - + private static final String PREFERENCE_MESSAGELIST_SHOW_CONTACT_NAME = "messagelist_show_contact_name"; private static final String PREFERENCE_CHANGE_REGISTERED_NAME_COLOR = "change_registered_name_color"; private static final String PREFERENCE_MESSAGEVIEW_FIXEDWIDTH = "messageview_fixedwidth_font"; private static final String PREFERENCE_MESSAGEVIEW_RETURN_TO_LIST = "messageview_return_to_list"; @@ -76,7 +76,7 @@ public class Prefs extends K9PreferenceActivity private CheckBoxPreference mStars; private CheckBoxPreference mCheckboxes; private CheckBoxPreference mTouchable; - + private CheckBoxPreference mShowContactName; private CheckBoxPreference mChangeRegisteredNameColor; private CheckBoxPreference mFixedWidth; private CheckBoxPreference mReturnToList; @@ -233,6 +233,9 @@ public class Prefs extends K9PreferenceActivity mTouchable = (CheckBoxPreference)findPreference(PREFERENCE_MESSAGELIST_TOUCHABLE); mTouchable.setChecked(K9.messageListTouchable()); + mShowContactName = (CheckBoxPreference)findPreference(PREFERENCE_MESSAGELIST_SHOW_CONTACT_NAME); + mShowContactName.setChecked(K9.showContactName()); + mChangeRegisteredNameColor = (CheckBoxPreference)findPreference(PREFERENCE_CHANGE_REGISTERED_NAME_COLOR); mChangeRegisteredNameColor.setChecked(K9.changeRegisteredNameColor()); if (K9.changeRegisteredNameColor())