diff --git a/res/values/strings.xml b/res/values/strings.xml index 4832a6ebc..8710aaca4 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -594,7 +594,14 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin Del (or D) - Delete\u000AR - Reply\u000AA - Reply All\u000AC - Compose\u000AF - Forward\u000aM - Move\u000AY - Copy\u000AG - Star\u000AO - Sort type\u000AI - Sort order\u000AQ - - Return to Accounts\u000AS - Select/deselect + - Return to Folders\u000AS - Select/deselect + + 1 - Display only 1st Class folders\u000A + 2 - Display 1st and 2nd Class folders\u000A + 3 - Display all except 2nd Class folders\u000A + 4 - Display all folders\u000A + Q - Return to Accounts\u000A + S - Edit Account Settings Signature position Before quoted messages diff --git a/src/com/fsck/k9/activity/FolderList.java b/src/com/fsck/k9/activity/FolderList.java index f05918d0f..a921f4576 100644 --- a/src/com/fsck/k9/activity/FolderList.java +++ b/src/com/fsck/k9/activity/FolderList.java @@ -19,12 +19,14 @@ import android.widget.*; import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.AdapterView.OnItemClickListener; import com.fsck.k9.*; +import com.fsck.k9.Account.FolderMode; import com.fsck.k9.activity.setup.AccountSettings; import com.fsck.k9.activity.setup.FolderSettings; import com.fsck.k9.mail.Folder; import com.fsck.k9.mail.Message; import com.fsck.k9.mail.MessagingException; import com.fsck.k9.mail.Store; +import com.fsck.k9.service.MailService; import java.util.ArrayList; import java.util.Collections; @@ -368,16 +370,46 @@ public class FolderList extends K9ListActivity case KeyEvent.KEYCODE_H: { - Toast toast = Toast.makeText(this, R.string.message_list_help_key, Toast.LENGTH_LONG); + Toast toast = Toast.makeText(this, R.string.folder_list_help_key, Toast.LENGTH_LONG); toast.show(); return true; } + + case KeyEvent.KEYCODE_1: + { + setDisplayMode(FolderMode.FIRST_CLASS); + return true; + } + case KeyEvent.KEYCODE_2: + { + setDisplayMode(FolderMode.FIRST_AND_SECOND_CLASS); + return true; + } + case KeyEvent.KEYCODE_3: + { + setDisplayMode(FolderMode.NOT_SECOND_CLASS); + return true; + } + case KeyEvent.KEYCODE_4: + { + setDisplayMode(FolderMode.ALL); + return true; + } }//switch return super.onKeyDown(keyCode, event); }//onKeyDown + private void setDisplayMode(FolderMode newMode) + { + mAccount.setFolderDisplayMode(newMode); + mAccount.save(Preferences.getPreferences(this)); + MailService.actionReschedule(this, null); // TODO: really should just refresh pushers + onRefresh(false); + } + + private void onRefresh(final boolean forceRemote) {