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

Added preference to go to Integrated Inbox on application startup.

Fixes issue 1797
This commit is contained in:
cketti 2010-07-03 00:26:35 +00:00
parent c15c3dc225
commit 45339457f8
5 changed files with 31 additions and 1 deletions

View File

@ -765,6 +765,8 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin
<string name="manage_back_title">Manage \"Back\" button</string>
<string name="manage_back_summary">Make \"Back\" always go up a level</string>
<string name="start_integrated_inbox_title">Integrated Inbox on start</string>
<string name="start_integrated_inbox_summary">Show the Integrated Inbox after startup</string>
<string name="measure_accounts_title">Show account size</string>
<string name="measure_accounts_summary">Turn off for faster display</string>

View File

@ -53,6 +53,10 @@
android:title="@string/manage_back_title"
android:summary="@string/manage_back_summary" />
<CheckBoxPreference
android:key="start_integrated_inbox"
android:title="@string/start_integrated_inbox_title"
android:summary="@string/start_integrated_inbox_summary" />
</PreferenceCategory>

View File

@ -83,6 +83,7 @@ public class K9 extends Application
private static boolean mGesturesEnabled = true;
private static boolean mManageBack = false;
private static boolean mStartIntegratedInbox = false;
private static boolean mMeasureAccounts = true;
private static boolean mCountSearchMessages = true;
@ -302,6 +303,7 @@ public class K9 extends Application
editor.putBoolean("animations", mAnimations);
editor.putBoolean("gesturesEnabled", mGesturesEnabled);
editor.putBoolean("manageBack", mManageBack);
editor.putBoolean("startIntegratedInbox", mStartIntegratedInbox);
editor.putBoolean("measureAccounts", mMeasureAccounts);
editor.putBoolean("countSearchMessages", mCountSearchMessages);
editor.putBoolean("messageListStars",mMessageListStars);
@ -332,6 +334,7 @@ public class K9 extends Application
mAnimations = sprefs.getBoolean("animations", true);
mGesturesEnabled = sprefs.getBoolean("gesturesEnabled", true);
mManageBack = sprefs.getBoolean("manageBack", false);
mStartIntegratedInbox = sprefs.getBoolean("startIntegratedInbox", false);
mMeasureAccounts = sprefs.getBoolean("measureAccounts", true);
mCountSearchMessages = sprefs.getBoolean("countSearchMessages", true);
mMessageListStars = sprefs.getBoolean("messageListStars",true);
@ -476,6 +479,16 @@ public class K9 extends Application
mManageBack = manageBack;
}
public static boolean startIntegratedInbox()
{
return mStartIntegratedInbox;
}
public static void setStartIntegratedInbox(boolean startIntegratedInbox)
{
mStartIntegratedInbox = startIntegratedInbox;
}
public static boolean isAnimations()
{
return mAnimations;

View File

@ -325,7 +325,12 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
Account[] accounts = Preferences.getPreferences(this).getAccounts();
Intent intent = getIntent();
boolean startup = (boolean)intent.getBooleanExtra(EXTRA_STARTUP, true);
if (startup && accounts.length == 1)
if (startup && K9.startIntegratedInbox())
{
onOpenAccount(integratedInboxAccount);
finish();
}
else if (startup && accounts.length == 1)
{
onOpenAccount(accounts[0]);
finish();

View File

@ -29,6 +29,7 @@ public class Prefs extends K9PreferenceActivity
private static final String PREFERENCE_ANIMATIONS = "animations";
private static final String PREFERENCE_GESTURES = "gestures";
private static final String PREFERENCE_MANAGE_BACK = "manage_back";
private static final String PREFERENCE_START_INTEGRATED_INBOX = "start_integrated_inbox";
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";
@ -46,6 +47,7 @@ public class Prefs extends K9PreferenceActivity
private CheckBoxPreference mSensitiveLogging;
private CheckBoxPreference mGestures;
private CheckBoxPreference mManageBack;
private CheckBoxPreference mStartIntegratedInbox;
private CheckBoxPreference mAnimations;
private CheckBoxPreference mStars;
private CheckBoxPreference mCheckboxes;
@ -158,6 +160,9 @@ public class Prefs extends K9PreferenceActivity
mManageBack = (CheckBoxPreference)findPreference(PREFERENCE_MANAGE_BACK);
mManageBack.setChecked(K9.manageBack());
mStartIntegratedInbox = (CheckBoxPreference)findPreference(PREFERENCE_START_INTEGRATED_INBOX);
mStartIntegratedInbox.setChecked(K9.startIntegratedInbox());
mStars = (CheckBoxPreference)findPreference(PREFERENCE_MESSAGELIST_STARS);
mStars.setChecked(K9.messageListStars());
@ -201,6 +206,7 @@ public class Prefs extends K9PreferenceActivity
K9.setAnimations(mAnimations.isChecked());
K9.setGesturesEnabled(mGestures.isChecked());
K9.setManageBack(mManageBack.isChecked());
K9.setStartIntegratedInbox(mStartIntegratedInbox.isChecked());
K9.setMessageListStars(mStars.isChecked());
K9.setMessageListCheckboxes(mCheckboxes.isChecked());
K9.setMessageListTouchable(mTouchable.isChecked());