mirror of
https://github.com/moparisthebest/k-9
synced 2025-01-12 06:08:25 -05:00
Show "check mail" action when displaying Unified Inbox etc.
This commit is contained in:
parent
0c5bdf2c97
commit
c5dc626bbc
@ -1045,21 +1045,15 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
|
||||
|
||||
if (!mMessageListFragment.isSingleAccountMode()) {
|
||||
menu.findItem(R.id.expunge).setVisible(false);
|
||||
menu.findItem(R.id.check_mail).setVisible(false);
|
||||
menu.findItem(R.id.send_messages).setVisible(false);
|
||||
} else {
|
||||
menu.findItem(R.id.send_messages).setVisible(mMessageListFragment.isOutbox());
|
||||
|
||||
if (mMessageListFragment.isRemoteFolder()) {
|
||||
menu.findItem(R.id.check_mail).setVisible(true);
|
||||
menu.findItem(R.id.expunge).setVisible(
|
||||
menu.findItem(R.id.expunge).setVisible(mMessageListFragment.isRemoteFolder() &&
|
||||
mMessageListFragment.isAccountExpungeCapable());
|
||||
} else {
|
||||
menu.findItem(R.id.check_mail).setVisible(false);
|
||||
menu.findItem(R.id.expunge).setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
menu.findItem(R.id.check_mail).setVisible(mMessageListFragment.isCheckMailSupported());
|
||||
|
||||
// If this is an explicit local search, show the option to search on the server
|
||||
if (!mMessageListFragment.isRemoteSearch() &&
|
||||
mMessageListFragment.isRemoteSearchAllowed()) {
|
||||
|
@ -384,6 +384,7 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick
|
||||
private LocalSearch mSearch = null;
|
||||
private boolean mSingleAccountMode;
|
||||
private boolean mSingleFolderMode;
|
||||
private boolean mAllAccounts;
|
||||
|
||||
private MessageListHandler mHandler = new MessageListHandler();
|
||||
|
||||
@ -901,11 +902,13 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick
|
||||
mCurrentFolder = getFolder(mFolderName, mAccount);
|
||||
}
|
||||
|
||||
mAllAccounts = false;
|
||||
if (mSingleAccountMode) {
|
||||
mAccountUuids = new String[] { mAccount.getUuid() };
|
||||
} else {
|
||||
if (accountUuids.length == 1 &&
|
||||
accountUuids[0].equals(SearchSpecification.ALL_ACCOUNTS)) {
|
||||
mAllAccounts = true;
|
||||
|
||||
Account[] accounts = mPreferences.getAccounts();
|
||||
|
||||
@ -2829,8 +2832,17 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick
|
||||
}
|
||||
|
||||
public void checkMail() {
|
||||
if (isSingleAccountMode() && isSingleFolderMode()) {
|
||||
mController.synchronizeMailbox(mAccount, mFolderName, mListener, null);
|
||||
mController.sendPendingMessages(mAccount, mListener);
|
||||
} else if (mAllAccounts) {
|
||||
mController.checkMail(mContext, null, true, true, mListener);
|
||||
} else {
|
||||
for (String accountUuid : mAccountUuids) {
|
||||
Account account = mPreferences.getAccount(accountUuid);
|
||||
mController.checkMail(mContext, account, true, true, mListener);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3452,4 +3464,9 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick
|
||||
mController.markAllMessagesRead(mAccount, mFolderName);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isCheckMailSupported() {
|
||||
return (mAllAccounts || !isSingleAccountMode() || !isSingleFolderMode() ||
|
||||
isRemoteFolder());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user