From fce2fc12d0522ee09b5da4a709bf476710d87ca2 Mon Sep 17 00:00:00 2001 From: baolongnt Date: Fri, 25 Feb 2011 12:36:47 -0800 Subject: [PATCH 1/3] Implemented option to hide special accounts (issue 3060) --- res/values/strings.xml | 3 +++ res/xml/global_preferences.xml | 10 ++++++++- src/com/fsck/k9/K9.java | 13 +++++++++++- src/com/fsck/k9/activity/Accounts.java | 25 +++++++++++++++-------- src/com/fsck/k9/activity/setup/Prefs.java | 8 +++++++- 5 files changed, 47 insertions(+), 12 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 4fd6b3938..550849c82 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -921,6 +921,9 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin Count search results Turn off for faster display + Hide special accounts + Hide the unified inbox and all messages accounts + %s %s - Starred - Unread diff --git a/res/xml/global_preferences.xml b/res/xml/global_preferences.xml index b58487e67..aee7235e2 100644 --- a/res/xml/global_preferences.xml +++ b/res/xml/global_preferences.xml @@ -92,6 +92,13 @@ android:title="@string/count_search_title" android:summary="@string/count_search_summary" /> + + + android:summary="@string/start_integrated_inbox_summary" + android:dependency="hide_special_accounts" /> newAccounts = new ArrayList(accounts.length + 4); - if (accounts.length > 0) { + List newAccounts; + if (!K9.isHideSpecialAccounts() + && accounts.length > 0) { + newAccounts = new ArrayList(accounts.length + 2); newAccounts.add(integratedInboxAccount); newAccounts.add(unreadAccount); } + else { + newAccounts = new ArrayList(accounts.length); + } newAccounts.addAll(Arrays.asList(accounts)); diff --git a/src/com/fsck/k9/activity/setup/Prefs.java b/src/com/fsck/k9/activity/setup/Prefs.java index fdd190b54..1e5096321 100644 --- a/src/com/fsck/k9/activity/setup/Prefs.java +++ b/src/com/fsck/k9/activity/setup/Prefs.java @@ -52,6 +52,7 @@ public class Prefs extends K9PreferenceActivity { private static final String PREFERENCE_PRIVACY_MODE = "privacy_mode"; private static final String PREFERENCE_MEASURE_ACCOUNTS = "measure_accounts"; private static final String PREFERENCE_COUNT_SEARCH = "count_search"; + private static final String PREFERENCE_HIDE_SPECIAL_ACCOUNTS = "hide_special_accounts"; private static final String PREFERENCE_MESSAGELIST_TOUCHABLE = "messagelist_touchable"; private static final String PREFERENCE_MESSAGELIST_PREVIEW_LINES = "messagelist_preview_lines"; private static final String PREFERENCE_MESSAGELIST_STARS = "messagelist_stars"; @@ -88,6 +89,7 @@ public class Prefs extends K9PreferenceActivity { private CheckBoxPreference mPrivacyMode; private CheckBoxPreference mMeasureAccounts; private CheckBoxPreference mCountSearch; + private CheckBoxPreference mHideSpecialAccounts; private CheckBoxPreference mTouchable; private ListPreference mPreviewLines; private CheckBoxPreference mStars; @@ -191,6 +193,9 @@ public class Prefs extends K9PreferenceActivity { mCountSearch = (CheckBoxPreference)findPreference(PREFERENCE_COUNT_SEARCH); mCountSearch.setChecked(K9.countSearchMessages()); + mHideSpecialAccounts = (CheckBoxPreference)findPreference(PREFERENCE_HIDE_SPECIAL_ACCOUNTS); + mHideSpecialAccounts.setChecked(K9.isHideSpecialAccounts()); + mTouchable = (CheckBoxPreference)findPreference(PREFERENCE_MESSAGELIST_TOUCHABLE); mTouchable.setChecked(K9.messageListTouchable()); @@ -298,11 +303,12 @@ public class Prefs extends K9PreferenceActivity { K9.setUseVolumeKeysForNavigation(mVolumeNavigation.getCheckedItems()[0]); K9.setUseVolumeKeysForListNavigation(mVolumeNavigation.getCheckedItems()[1]); K9.setManageBack(mManageBack.isChecked()); - K9.setStartIntegratedInbox(mStartIntegratedInbox.isChecked()); + K9.setStartIntegratedInbox(!mHideSpecialAccounts.isChecked() && mStartIntegratedInbox.isChecked()); K9.setConfirmDelete(mConfirmActions.getCheckedItems()[0]); K9.setKeyguardPrivacy(mPrivacyMode.isChecked()); K9.setMeasureAccounts(mMeasureAccounts.isChecked()); K9.setCountSearchMessages(mCountSearch.isChecked()); + K9.setHideSpecialAccounts(mHideSpecialAccounts.isChecked()); K9.setMessageListTouchable(mTouchable.isChecked()); K9.setMessageListPreviewLines(Integer.parseInt(mPreviewLines.getValue())); K9.setMessageListStars(mStars.isChecked()); From 457479cd431e0c35f9aff50d679085e17d9f57b7 Mon Sep 17 00:00:00 2001 From: baolongnt Date: Fri, 25 Feb 2011 14:49:39 -0800 Subject: [PATCH 2/3] Removed dup check (keeping the more explicit one) per cketti recommendation --- src/com/fsck/k9/K9.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/fsck/k9/K9.java b/src/com/fsck/k9/K9.java index 63162476a..9322012c9 100644 --- a/src/com/fsck/k9/K9.java +++ b/src/com/fsck/k9/K9.java @@ -776,7 +776,7 @@ public class K9 extends Application { public static boolean startIntegratedInbox() { - return !mHideSpecialAccounts && mStartIntegratedInbox; + return mStartIntegratedInbox; } public static void setStartIntegratedInbox(boolean startIntegratedInbox) { From 4586ba560e3498ead43fc4eacb7a92a3ce62de75 Mon Sep 17 00:00:00 2001 From: cketti Date: Sat, 26 Feb 2011 15:11:30 +0100 Subject: [PATCH 3/3] Added new hide_special_accounts_* strings to translations --- res/values-ca/strings.xml | 3 +++ res/values-cs/strings.xml | 3 +++ res/values-de/strings.xml | 3 +++ res/values-es/strings.xml | 3 +++ res/values-fi/strings.xml | 3 +++ res/values-gl/strings.xml | 3 +++ res/values-it/strings.xml | 3 +++ res/values-ja/strings.xml | 3 +++ res/values-nl/strings.xml | 3 +++ res/values-pl/strings.xml | 3 +++ res/values-pt-rBR/strings.xml | 3 +++ res/values-ru/strings.xml | 3 +++ res/values-sv/strings.xml | 3 +++ res/values-zh-rCN/strings.xml | 3 +++ 14 files changed, 42 insertions(+) diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml index afbac3f94..acecdd829 100644 --- a/res/values-ca/strings.xml +++ b/res/values-ca/strings.xml @@ -920,6 +920,9 @@ Benvingut a la configuració del K-9. El K-9 és un client de codi obert per An Compta resultats cerca Apaga-ho perquè es mostri més ràpid + + + %s %s - Senyalat - No llegit diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml index 1a64e4bf5..166985d49 100644 --- a/res/values-cs/strings.xml +++ b/res/values-cs/strings.xml @@ -926,6 +926,9 @@ Vítejte v nastavení pošty K-9 Mail. K-9 je open source poštovní klient pro Počet výsledků hledání Vypněte pro rychlejší zobrazování + + + %s %s - S \u2605 - Nepřečtené diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml index 3c94180db..f54508f63 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -917,6 +917,9 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü Suchergebnisse zählen Deaktivieren für schnellere Anzeige + + + %s %s - Wichtig - Ungelesen diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml index 6545dceb3..36361ad0d 100644 --- a/res/values-es/strings.xml +++ b/res/values-es/strings.xml @@ -917,6 +917,9 @@ Bienvenido a la Configuración de K-9. K-9 es un cliente de correo OpenSource pa Mostrar contador de búsqueda Desactivar para mejorar rendimiento + + + %s %s - Entrellas - Sin leer diff --git a/res/values-fi/strings.xml b/res/values-fi/strings.xml index ab8e1d010..d4c204cae 100644 --- a/res/values-fi/strings.xml +++ b/res/values-fi/strings.xml @@ -914,6 +914,9 @@ Tervetuloa K-9 Mail asennukseen.  K-9 on avoimen lähdekoodin sähköpostiasiak Laske haun tulokset Jos pois päältä, näyttö tulee nopeammin + + + %s %s - Tähdet - Lukemattomat diff --git a/res/values-gl/strings.xml b/res/values-gl/strings.xml index f0baab411..733525bb2 100644 --- a/res/values-gl/strings.xml +++ b/res/values-gl/strings.xml @@ -917,6 +917,9 @@ Benvido á Configuración de K-9. K-9 é un cliente de correo OpenSource para An Amosar contador de búsqueda Desactivar para mellorar rendimento + + + %s %s - Estrelas - Sin ler diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml index 8cccd0f1e..7392812e8 100644 --- a/res/values-it/strings.xml +++ b/res/values-it/strings.xml @@ -921,6 +921,9 @@ Benvenuto nella configurazione della posta di K-9. K-9 è un client di posta ope Conta i risultati della ricerca Disattiva per una visualizzazione più veloce + + + %s %s - Con stella - Non letto diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml index a18a7b234..4c0da394a 100644 --- a/res/values-ja/strings.xml +++ b/res/values-ja/strings.xml @@ -913,6 +913,9 @@ K-9 Mail セットアップにようこそ。\nK-9 は標準のAndroidメール 検索結果の件数表示 表示を早くしたい場合はチェックをはずしてください + + + %s %s - スター - 未読 diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml index 6820477c0..7d62dec92 100644 --- a/res/values-nl/strings.xml +++ b/res/values-nl/strings.xml @@ -917,6 +917,9 @@ Welkom bij K-9 Mail setup. K-9 is een open source mail cliënt voor Android, ge Tel zoek resultaten Zet uit voor sneller beeldscherm + + + %s %s - Starred - Ongelezen diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml index 9a76e0739..50d8ae2d1 100644 --- a/res/values-pl/strings.xml +++ b/res/values-pl/strings.xml @@ -928,6 +928,9 @@ Witaj w K-9 Mail, darmowym programie pocztowym dla systemu Android. Najistotniej Zliczaj wyniki szukania Wyłącz by przyspieszyć wyświetlanie + + + %s %s - Z gwiazdka - Nieprzeczytane diff --git a/res/values-pt-rBR/strings.xml b/res/values-pt-rBR/strings.xml index 6885e3ae5..1c763a680 100644 --- a/res/values-pt-rBR/strings.xml +++ b/res/values-pt-rBR/strings.xml @@ -914,6 +914,9 @@ Bem-vindo à configuração do K-9 Mail. K-9 é um cliente de e-mail com código Contador para resultados de pesquisa Desligar visualização rápida + + + %s %s - Favoritado - Não lido diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml index 2a65dc34c..921391fb3 100644 --- a/res/values-ru/strings.xml +++ b/res/values-ru/strings.xml @@ -911,6 +911,9 @@ + + + diff --git a/res/values-sv/strings.xml b/res/values-sv/strings.xml index 707335946..ff5344ced 100644 --- a/res/values-sv/strings.xml +++ b/res/values-sv/strings.xml @@ -920,6 +920,9 @@ Välkommen till installationen av K-9 E-post. K-9 är en e-postklient med öppen Räkna sökresultat Avaktivera för snabbare visning + + + %s %s - Stjärnmärkta - Olästa diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index 35ef97e45..3fb90088e 100644 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -901,6 +901,9 @@ 计算搜索结果的数量 关闭该功能以便加快显示速度 + + + %s %s - 星标 - 未读