1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 19:52:17 -05:00

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" /> android:dialogTitle="@string/account_settings_mail_display_count_label" />
</PreferenceCategory> </PreferenceCategory>
<CheckBoxPreference
android:key="left_handed"
android:title="@string/account_settings_left_handed_label" />
<PreferenceCategory android:title="@string/account_settings_message_view"> <PreferenceCategory android:title="@string/account_settings_message_view">
<ListPreference <ListPreference

View File

@ -38,7 +38,13 @@
android:summary="@string/animations_summary" android:summary="@string/animations_summary"
/> />
</PreferenceCategory> </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"> <PreferenceCategory android:title="@string/operational_preferences" android:key="operational_preferences">
<ListPreference <ListPreference
android:key="background_ops" android:key="background_ops"

View File

@ -62,8 +62,13 @@ public class K9 extends Application
public static boolean ENABLE_ERROR_FOLDER = true; public static boolean ENABLE_ERROR_FOLDER = true;
public static String ERROR_FOLDER_NAME = "K9mail-errors"; public static String ERROR_FOLDER_NAME = "K9mail-errors";
private static boolean mAnimations = true; 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 * 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 * 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.putBoolean("enableSensitiveLogging", K9.DEBUG_SENSITIVE);
editor.putString("backgroundOperations", K9.backgroundOps.toString()); editor.putString("backgroundOperations", K9.backgroundOps.toString());
editor.putBoolean("animations", mAnimations); editor.putBoolean("animations", mAnimations);
editor.putBoolean("messageListLefthandedWidgets",mMessageListLefthandedWidgets);
editor.putInt("theme", theme); editor.putInt("theme", theme);
} }
@ -511,6 +517,9 @@ public class K9 extends Application
DEBUG = sprefs.getBoolean("enableDebugLogging", false); DEBUG = sprefs.getBoolean("enableDebugLogging", false);
DEBUG_SENSITIVE = sprefs.getBoolean("enableSensitiveLogging", false); DEBUG_SENSITIVE = sprefs.getBoolean("enableSensitiveLogging", false);
mAnimations = sprefs.getBoolean("animations", true); mAnimations = sprefs.getBoolean("animations", true);
mMessageListLefthandedWidgets = sprefs.getBoolean("messageListLefthandedWidgets",false);
try try
{ {
setBackgroundOps(BACKGROUND_OPS.valueOf(sprefs.getString("backgroundOperations", "WHEN_CHECKED"))); setBackgroundOps(BACKGROUND_OPS.valueOf(sprefs.getString("backgroundOperations", "WHEN_CHECKED")));
@ -628,6 +637,16 @@ public class K9 extends Application
{ {
mAnimations = animations; 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); mSelectedCount = savedInstanceState.getInt(STATE_KEY_SELECTED_COUNT);
} }
if (mAccount != null)
{
mLeftHanded = mAccount.getLeftHanded();
}
mAdapter = new MessageListAdapter(); mAdapter = new MessageListAdapter();
final Object previousData = getLastNonConfigurationInstance(); final Object previousData = getLastNonConfigurationInstance();
@ -452,6 +447,7 @@ public class MessageList
{ {
super.onResume(); super.onResume();
mLeftHanded = K9.messageListLefthandedWidgets();
sortType = mController.getSortType(); sortType = mController.getSortType();
sortAscending = mController.isSortAscending(sortType); 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_DELETE_POLICY = "delete_policy";
private static final String PREFERENCE_EXPUNGE_POLICY = "expunge_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_AUTO_EXPAND_FOLDER = "account_setup_auto_expand_folder";
private static final String PREFERENCE_LEFT_HANDED = "left_handed";
private Account mAccount; private Account mAccount;
@ -71,8 +70,6 @@ public class AccountSettings extends K9PreferenceActivity
private ListPreference mExpungePolicy; private ListPreference mExpungePolicy;
private Preference mAutoExpandFolder; private Preference mAutoExpandFolder;
private CheckBoxPreference mLeftHanded;
public static void actionSettings(Context context, Account account) public static void actionSettings(Context context, Account account)
{ {
@ -266,9 +263,6 @@ public class AccountSettings extends K9PreferenceActivity
mAccount.equals(Preferences.getPreferences(this).getDefaultAccount())); mAccount.equals(Preferences.getPreferences(this).getDefaultAccount()));
mLeftHanded = (CheckBoxPreference) findPreference(PREFERENCE_LEFT_HANDED);
mLeftHanded.setChecked(mAccount.getLeftHanded());
mAccountHideButtons = (ListPreference) findPreference(PREFERENCE_HIDE_BUTTONS); mAccountHideButtons = (ListPreference) findPreference(PREFERENCE_HIDE_BUTTONS);
mAccountHideButtons.setValue("" + mAccount.getHideMessageViewButtons()); mAccountHideButtons.setValue("" + mAccount.getHideMessageViewButtons());
mAccountHideButtons.setSummary(mAccountHideButtons.getEntry()); mAccountHideButtons.setSummary(mAccountHideButtons.getEntry());
@ -394,7 +388,6 @@ public class AccountSettings extends K9PreferenceActivity
mAccount.setRingtone(prefs.getString(PREFERENCE_RINGTONE, null)); mAccount.setRingtone(prefs.getString(PREFERENCE_RINGTONE, null));
mAccount.setHideMessageViewButtons(Account.HideButtons.valueOf(mAccountHideButtons.getValue())); mAccount.setHideMessageViewButtons(Account.HideButtons.valueOf(mAccountHideButtons.getValue()));
mAccount.setAutoExpandFolderName(reverseTranslateFolder(mAutoExpandFolder.getSummary().toString())); mAccount.setAutoExpandFolderName(reverseTranslateFolder(mAutoExpandFolder.getSummary().toString()));
mAccount.setLeftHanded(mLeftHanded.isChecked());
mAccount.save(Preferences.getPreferences(this)); mAccount.save(Preferences.getPreferences(this));
K9.setServicesEnabled(this); K9.setServicesEnabled(this);
// TODO: refresh folder list here // 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_SENSITIVE_LOGGING = "sensitive_logging";
private static final String PREFERENCE_ANIMATIONS = "animations"; private static final String PREFERENCE_ANIMATIONS = "animations";
private static final String PREFERENCE_MESSAGELIST_LEFTHANDED_WIDGETS = "messagelist_lefthanded_widgets";
private ListPreference mTheme; private ListPreference mTheme;
private ListPreference mDateFormat; private ListPreference mDateFormat;
@ -34,6 +35,8 @@ public class Prefs extends K9PreferenceActivity
private CheckBoxPreference mDebugLogging; private CheckBoxPreference mDebugLogging;
private CheckBoxPreference mSensitiveLogging; private CheckBoxPreference mSensitiveLogging;
private CheckBoxPreference mAnimations; private CheckBoxPreference mAnimations;
private CheckBoxPreference mLefthandedWidgets;
private String initBackgroundOps; private String initBackgroundOps;
@ -118,6 +121,9 @@ public class Prefs extends K9PreferenceActivity
mAnimations = (CheckBoxPreference)findPreference(PREFERENCE_ANIMATIONS); mAnimations = (CheckBoxPreference)findPreference(PREFERENCE_ANIMATIONS);
mAnimations.setChecked(K9.isAnimations()); mAnimations.setChecked(K9.isAnimations());
mLefthandedWidgets = (CheckBoxPreference)findPreference(PREFERENCE_MESSAGELIST_LEFTHANDED_WIDGETS);
mLefthandedWidgets.setChecked(K9.messageListLefthandedWidgets());
} }
@Override @Override
@ -134,7 +140,10 @@ public class Prefs extends K9PreferenceActivity
K9.DEBUG_SENSITIVE = mSensitiveLogging.isChecked(); K9.DEBUG_SENSITIVE = mSensitiveLogging.isChecked();
String newBackgroundOps = mBackgroundOps.getValue(); String newBackgroundOps = mBackgroundOps.getValue();
K9.setBackgroundOps(newBackgroundOps); K9.setBackgroundOps(newBackgroundOps);
K9.setAnimations(mAnimations.isChecked()); K9.setAnimations(mAnimations.isChecked());
K9.setMessageListLefthandedWidgets(mLefthandedWidgets.isChecked());
Editor editor = preferences.edit(); Editor editor = preferences.edit();
K9.save(editor); K9.save(editor);
DateFormatter.setDateFormat(editor, mDateFormat.getValue()); DateFormatter.setDateFormat(editor, mDateFormat.getValue());