Restore Bao-long's original design for "widgets on the left" being a

global config option rather than a per-account one. (But with a new
implementation.) - As we now have views that show messages across
accounts, this needed to become a global)
This commit is contained in:
Jesse Vincent 2010-01-09 23:02:40 +00:00
parent d48449c7e7
commit 9db97e214d
6 changed files with 35 additions and 17 deletions

View file

@ -42,11 +42,6 @@
android:dialogTitle="@string/account_settings_mail_display_count_label" />
</PreferenceCategory>
<CheckBoxPreference
android:key="left_handed"
android:title="@string/account_settings_left_handed_label" />
<PreferenceCategory android:title="@string/account_settings_message_view">
<ListPreference

View file

@ -38,7 +38,13 @@
android:summary="@string/animations_summary"
/>
</PreferenceCategory>
<PreferenceCategory android:title="@string/messagelist_preferences" android:key="messagelist_preferences">
<CheckBoxPreference
android:key="messagelist_lefthanded_widgets"
android:title="@string/account_settings_left_handed_label"/>
</PreferenceCategory>
<PreferenceCategory android:title="@string/operational_preferences" android:key="operational_preferences">
<ListPreference
android:key="background_ops"

View file

@ -62,8 +62,13 @@ public class K9 extends Application
public static boolean ENABLE_ERROR_FOLDER = true;
public static String ERROR_FOLDER_NAME = "K9mail-errors";
private static boolean mAnimations = true;
private static boolean mMessageListLefthandedWidgets = false;
/**
* The MIME type(s) of attachments we're willing to send. At the moment it is not possible
* to open a chooser with a list of filter types, so the chooser is only opened with the first
@ -498,6 +503,7 @@ public class K9 extends Application
editor.putBoolean("enableSensitiveLogging", K9.DEBUG_SENSITIVE);
editor.putString("backgroundOperations", K9.backgroundOps.toString());
editor.putBoolean("animations", mAnimations);
editor.putBoolean("messageListLefthandedWidgets",mMessageListLefthandedWidgets);
editor.putInt("theme", theme);
}
@ -511,6 +517,9 @@ public class K9 extends Application
DEBUG = sprefs.getBoolean("enableDebugLogging", false);
DEBUG_SENSITIVE = sprefs.getBoolean("enableSensitiveLogging", false);
mAnimations = sprefs.getBoolean("animations", true);
mMessageListLefthandedWidgets = sprefs.getBoolean("messageListLefthandedWidgets",false);
try
{
setBackgroundOps(BACKGROUND_OPS.valueOf(sprefs.getString("backgroundOperations", "WHEN_CHECKED")));
@ -628,6 +637,16 @@ public class K9 extends Application
{
mAnimations = animations;
}
public static boolean messageListLefthandedWidgets()
{
return mMessageListLefthandedWidgets;
}
public static void setMessageListLefthandedWidgets(boolean lefty)
{
mMessageListLefthandedWidgets = lefty;
}
}

View file

@ -383,11 +383,6 @@ public class MessageList
mSelectedCount = savedInstanceState.getInt(STATE_KEY_SELECTED_COUNT);
}
if (mAccount != null)
{
mLeftHanded = mAccount.getLeftHanded();
}
mAdapter = new MessageListAdapter();
final Object previousData = getLastNonConfigurationInstance();
@ -452,6 +447,7 @@ public class MessageList
{
super.onResume();
mLeftHanded = K9.messageListLefthandedWidgets();
sortType = mController.getSortType();
sortAscending = mController.isSortAscending(sortType);

View file

@ -46,7 +46,6 @@ public class AccountSettings extends K9PreferenceActivity
private static final String PREFERENCE_DELETE_POLICY = "delete_policy";
private static final String PREFERENCE_EXPUNGE_POLICY = "expunge_policy";
private static final String PREFERENCE_AUTO_EXPAND_FOLDER = "account_setup_auto_expand_folder";
private static final String PREFERENCE_LEFT_HANDED = "left_handed";
private Account mAccount;
@ -71,8 +70,6 @@ public class AccountSettings extends K9PreferenceActivity
private ListPreference mExpungePolicy;
private Preference mAutoExpandFolder;
private CheckBoxPreference mLeftHanded;
public static void actionSettings(Context context, Account account)
{
@ -266,9 +263,6 @@ public class AccountSettings extends K9PreferenceActivity
mAccount.equals(Preferences.getPreferences(this).getDefaultAccount()));
mLeftHanded = (CheckBoxPreference) findPreference(PREFERENCE_LEFT_HANDED);
mLeftHanded.setChecked(mAccount.getLeftHanded());
mAccountHideButtons = (ListPreference) findPreference(PREFERENCE_HIDE_BUTTONS);
mAccountHideButtons.setValue("" + mAccount.getHideMessageViewButtons());
mAccountHideButtons.setSummary(mAccountHideButtons.getEntry());
@ -394,7 +388,6 @@ public class AccountSettings extends K9PreferenceActivity
mAccount.setRingtone(prefs.getString(PREFERENCE_RINGTONE, null));
mAccount.setHideMessageViewButtons(Account.HideButtons.valueOf(mAccountHideButtons.getValue()));
mAccount.setAutoExpandFolderName(reverseTranslateFolder(mAutoExpandFolder.getSummary().toString()));
mAccount.setLeftHanded(mLeftHanded.isChecked());
mAccount.save(Preferences.getPreferences(this));
K9.setServicesEnabled(this);
// TODO: refresh folder list here

View file

@ -27,6 +27,7 @@ public class Prefs extends K9PreferenceActivity
private static final String PREFERENCE_SENSITIVE_LOGGING = "sensitive_logging";
private static final String PREFERENCE_ANIMATIONS = "animations";
private static final String PREFERENCE_MESSAGELIST_LEFTHANDED_WIDGETS = "messagelist_lefthanded_widgets";
private ListPreference mTheme;
private ListPreference mDateFormat;
@ -34,6 +35,8 @@ public class Prefs extends K9PreferenceActivity
private CheckBoxPreference mDebugLogging;
private CheckBoxPreference mSensitiveLogging;
private CheckBoxPreference mAnimations;
private CheckBoxPreference mLefthandedWidgets;
private String initBackgroundOps;
@ -118,6 +121,9 @@ public class Prefs extends K9PreferenceActivity
mAnimations = (CheckBoxPreference)findPreference(PREFERENCE_ANIMATIONS);
mAnimations.setChecked(K9.isAnimations());
mLefthandedWidgets = (CheckBoxPreference)findPreference(PREFERENCE_MESSAGELIST_LEFTHANDED_WIDGETS);
mLefthandedWidgets.setChecked(K9.messageListLefthandedWidgets());
}
@Override
@ -134,7 +140,10 @@ public class Prefs extends K9PreferenceActivity
K9.DEBUG_SENSITIVE = mSensitiveLogging.isChecked();
String newBackgroundOps = mBackgroundOps.getValue();
K9.setBackgroundOps(newBackgroundOps);
K9.setAnimations(mAnimations.isChecked());
K9.setMessageListLefthandedWidgets(mLefthandedWidgets.isChecked());
Editor editor = preferences.edit();
K9.save(editor);
DateFormatter.setDateFormat(editor, mDateFormat.getValue());