Hide move & copy options for mixed messagelists. Also use hide and show the new grouped icon for them correctly.

This commit is contained in:
Sander Bogaert 2012-07-26 10:02:06 -04:00 committed by Andrew Chen
parent f0eafdf143
commit 9f568e3e08

View file

@ -2766,6 +2766,7 @@ public class MessageList extends K9ListActivity implements
menu.findItem(R.id.archive).setVisible(true);
menu.findItem(R.id.spam).setVisible(true);
menu.findItem(R.id.copy).setVisible(true);
menu.findItem(R.id.move_or_copy).setVisible(true);
// hide uncapable
/*
@ -2804,6 +2805,21 @@ public class MessageList extends K9ListActivity implements
}
private void setContextCapabilities(Account mAccount, Menu menu) {
/*
* TODO get rid of this when we finally split the messagelist into
* a folder content display and a search result display
*/
if (mQueryString != null) {
menu.findItem(R.id.move).setVisible(false);
menu.findItem(R.id.copy).setVisible(false);
menu.findItem(R.id.move_or_copy).setVisible(false);
menu.findItem(R.id.archive).setVisible(false);
menu.findItem(R.id.spam).setVisible(false);
return;
}
// hide unsupported
if (!mController.isCopyCapable(mAccount)) {
menu.findItem(R.id.copy).setVisible(false);
@ -2815,6 +2831,11 @@ public class MessageList extends K9ListActivity implements
menu.findItem(R.id.spam).setVisible(false);
}
if (!mController.isMoveCapable(mAccount)
&& !mController.isCopyCapable(mAccount)) {
menu.findItem(R.id.move_or_copy).setVisible(false);
}
if (!mAccount.hasArchiveFolder()) {
menu.findItem(R.id.archive).setVisible(false);
}