1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Back, by popular demand, an empty trash button in the accounts context menu

This commit is contained in:
Jesse Vincent 2013-06-30 16:52:45 -04:00
parent 4baaafcd88
commit 0a029561d1
2 changed files with 10 additions and 0 deletions

View File

@ -4,6 +4,8 @@
android:title="@string/manage_accounts_move_up_action" /> android:title="@string/manage_accounts_move_up_action" />
<item android:id="@+id/move_down" <item android:id="@+id/move_down"
android:title="@string/manage_accounts_move_down_action" /> android:title="@string/manage_accounts_move_down_action" />
<item android:id="@+id/empty_trash"
android:title="@string/empty_trash_action" />
<item android:id="@+id/account_settings" <item android:id="@+id/account_settings"
android:title="@string/account_settings_action" /> android:title="@string/account_settings_action" />
<item android:id="@+id/delete_account" <item android:id="@+id/delete_account"

View File

@ -630,6 +630,11 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
MessagingController.getInstance(getApplication()).clearAllPending(account); MessagingController.getInstance(getApplication()).clearAllPending(account);
} }
private void onEmptyTrash(Account account) {
MessagingController.getInstance(getApplication()).emptyTrash(account, null);
}
private void onCompose() { private void onCompose() {
Account defaultAccount = Preferences.getPreferences(this).getDefaultAccount(); Account defaultAccount = Preferences.getPreferences(this).getDefaultAccount();
if (defaultAccount != null) { if (defaultAccount != null) {
@ -1149,6 +1154,9 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
case R.id.clear_pending: case R.id.clear_pending:
onClearCommands(realAccount); onClearCommands(realAccount);
break; break;
case R.id.empty_trash:
onEmptyTrash(realAccount);
break;
case R.id.clear: case R.id.clear:
onClear(realAccount); onClear(realAccount);
break; break;