1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-16 22:45:04 -05:00

Merge commit '4586ba560e3498ead43fc4eacb7a92a3ce62de75'

Merged branch issue-3060 to master: Option to hide special accounts
This commit is contained in:
baolongnt 2011-03-06 16:53:21 -08:00
commit 06ecc11ee7
19 changed files with 88 additions and 11 deletions

View File

@ -920,6 +920,9 @@ Benvingut a la configuració del K-9. El K-9 és un client de codi obert per An
<string name="count_search_title">Compta resultats cerca</string>
<string name="count_search_summary">Apaga-ho perquè es mostri més ràpid</string>
<!-- NEW: <string name="hide_special_accounts_title">Hide special accounts</string>-->
<!-- NEW: <string name="hide_special_accounts_summary">Hide the unified inbox and all messages accounts</string>-->
<string name="search_title"><xliff:g id="search_name">%s</xliff:g> <xliff:g id="modifier">%s</xliff:g></string>
<string name="flagged_modifier">- Senyalat</string>
<string name="unread_modifier">- No llegit</string>

View File

@ -926,6 +926,9 @@ Vítejte v nastavení pošty K-9 Mail. K-9 je open source poštovní klient pro
<string name="count_search_title">Počet výsledků hledání</string>
<string name="count_search_summary">Vypněte pro rychlejší zobrazování</string>
<!-- NEW: <string name="hide_special_accounts_title">Hide special accounts</string>-->
<!-- NEW: <string name="hide_special_accounts_summary">Hide the unified inbox and all messages accounts</string>-->
<string name="search_title"><xliff:g id="search_name">%s</xliff:g> <xliff:g id="modifier">%s</xliff:g></string>
<string name="flagged_modifier"> - S \u2605</string>
<string name="unread_modifier"> - Nepřečtené</string>

View File

@ -917,6 +917,9 @@ Willkommen zum \"K-9 Mail\"-Setup. K-9 ist eine quelloffene E-Mail-Anwendung fü
<string name="count_search_title">Suchergebnisse zählen</string>
<string name="count_search_summary">Deaktivieren für schnellere Anzeige</string>
<!-- NEW: <string name="hide_special_accounts_title">Hide special accounts</string>-->
<!-- NEW: <string name="hide_special_accounts_summary">Hide the unified inbox and all messages accounts</string>-->
<string name="search_title"><xliff:g id="search_name">%s</xliff:g> <xliff:g id="modifier">%s</xliff:g></string>
<string name="flagged_modifier"> - Wichtig</string>
<string name="unread_modifier"> - Ungelesen</string>

View File

@ -917,6 +917,9 @@ Bienvenido a la Configuración de K-9. K-9 es un cliente de correo OpenSource pa
<string name="count_search_title">Mostrar contador de búsqueda</string>
<string name="count_search_summary">Desactivar para mejorar rendimiento</string>
<!-- NEW: <string name="hide_special_accounts_title">Hide special accounts</string>-->
<!-- NEW: <string name="hide_special_accounts_summary">Hide the unified inbox and all messages accounts</string>-->
<string name="search_title"><xliff:g id="search_name">%s</xliff:g> <xliff:g id="modifier">%s</xliff:g></string>
<string name="flagged_modifier"> - Estrellas</string>
<string name="unread_modifier"> - Sin leer</string>

View File

@ -914,6 +914,9 @@ Tervetuloa K-9 Mail asennukseen.  K-9 on avoimen lähdekoodin sähköpostiasiak
<string name="count_search_title">Laske haun tulokset</string>
<string name="count_search_summary">Jos pois päältä, näyttö tulee nopeammin</string>
<!-- NEW: <string name="hide_special_accounts_title">Hide special accounts</string>-->
<!-- NEW: <string name="hide_special_accounts_summary">Hide the unified inbox and all messages accounts</string>-->
<string name="search_title"><xliff:g id="search_name">%s</xliff:g> <xliff:g id="modifier">%s</xliff:g></string>
<string name="flagged_modifier"> - Tähdet</string>
<string name="unread_modifier"> - Lukemattomat</string>

View File

@ -917,6 +917,9 @@ Benvido á Configuración de K-9. K-9 é un cliente de correo OpenSource para An
<string name="count_search_title">Amosar contador de búsqueda</string>
<string name="count_search_summary">Desactivar para mellorar rendimento</string>
<!-- NEW: <string name="hide_special_accounts_title">Hide special accounts</string>-->
<!-- NEW: <string name="hide_special_accounts_summary">Hide the unified inbox and all messages accounts</string>-->
<string name="search_title"><xliff:g id="search_name">%s</xliff:g> <xliff:g id="modifier">%s</xliff:g></string>
<string name="flagged_modifier"> - Estrelas</string>
<string name="unread_modifier"> - Sin ler</string>

View File

@ -921,6 +921,9 @@ Benvenuto nella configurazione della posta di K-9. K-9 è un client di posta ope
<string name="count_search_title">Conta i risultati della ricerca</string>
<string name="count_search_summary">Disattiva per una visualizzazione più veloce</string>
<!-- NEW: <string name="hide_special_accounts_title">Hide special accounts</string>-->
<!-- NEW: <string name="hide_special_accounts_summary">Hide the unified inbox and all messages accounts</string>-->
<string name="search_title"><xliff:g id="search_name">%s</xliff:g> <xliff:g id="modifier">%s</xliff:g></string>
<string name="flagged_modifier"> - Con stella</string>
<string name="unread_modifier"> - Non letto</string>

View File

@ -913,6 +913,9 @@ K-9 Mail セットアップにようこそ。\nK-9 は標準のAndroidメール
<string name="count_search_title">検索結果の件数表示</string>
<string name="count_search_summary">表示を早くしたい場合はチェックをはずしてください</string>
<!-- NEW: <string name="hide_special_accounts_title">Hide special accounts</string>-->
<!-- NEW: <string name="hide_special_accounts_summary">Hide the unified inbox and all messages accounts</string>-->
<string name="search_title"><xliff:g id="search_name">%s</xliff:g> <xliff:g id="modifier">%s</xliff:g></string>
<string name="flagged_modifier"> - スター</string>
<string name="unread_modifier"> - 未読</string>

View File

@ -917,6 +917,9 @@ Welkom bij K-9 Mail setup. K-9 is een open source mail cliënt voor Android, ge
<string name="count_search_title">Tel zoek resultaten</string>
<string name="count_search_summary">Zet uit voor sneller beeldscherm</string>
<!-- NEW: <string name="hide_special_accounts_title">Hide special accounts</string>-->
<!-- NEW: <string name="hide_special_accounts_summary">Hide the unified inbox and all messages accounts</string>-->
<string name="search_title"><xliff:g id="search_name">%s</xliff:g> <xliff:g id="modifier">%s</xliff:g></string>
<string name="flagged_modifier"> - Starred</string>
<string name="unread_modifier"> - Ongelezen</string>

View File

@ -928,6 +928,9 @@ Witaj w K-9 Mail, darmowym programie pocztowym dla systemu Android. Najistotniej
<string name="count_search_title">Zliczaj wyniki szukania</string>
<string name="count_search_summary">Wyłącz by przyspieszyć wyświetlanie</string>
<!-- NEW: <string name="hide_special_accounts_title">Hide special accounts</string>-->
<!-- NEW: <string name="hide_special_accounts_summary">Hide the unified inbox and all messages accounts</string>-->
<string name="search_title"><xliff:g id="search_name">%s</xliff:g> <xliff:g id="modifier">%s</xliff:g></string>
<string name="flagged_modifier"> - Z gwiazdka</string>
<string name="unread_modifier"> - Nieprzeczytane</string>

View File

@ -914,6 +914,9 @@ Bem-vindo à configuração do K-9 Mail. K-9 é um cliente de e-mail com código
<string name="count_search_title">Contador para resultados de pesquisa</string>
<string name="count_search_summary">Desligar visualização rápida</string>
<!-- NEW: <string name="hide_special_accounts_title">Hide special accounts</string>-->
<!-- NEW: <string name="hide_special_accounts_summary">Hide the unified inbox and all messages accounts</string>-->
<string name="search_title"><xliff:g id="search_name">%s</xliff:g> <xliff:g id="modifier">%s</xliff:g></string>
<string name="flagged_modifier"> - Favoritado</string>
<string name="unread_modifier"> - Não lido</string>

View File

@ -911,6 +911,9 @@
<!-- NEW: <string name="count_search_title">Count search results</string>-->
<!-- NEW: <string name="count_search_summary">Turn off for faster display</string>-->
<!-- NEW: <string name="hide_special_accounts_title">Hide special accounts</string>-->
<!-- NEW: <string name="hide_special_accounts_summary">Hide the unified inbox and all messages accounts</string>-->
<!-- NEW: <string name="search_title"><xliff:g id="search_name">%s</xliff:g> <xliff:g id="modifier">%s</xliff:g></string>-->
<!-- NEW: <string name="flagged_modifier"> - Starred</string>-->
<!-- NEW: <string name="unread_modifier"> - Unread</string>-->

View File

@ -920,6 +920,9 @@ Välkommen till installationen av K-9 E-post. K-9 är en e-postklient med öppen
<string name="count_search_title">Räkna sökresultat</string>
<string name="count_search_summary">Avaktivera för snabbare visning</string>
<!-- NEW: <string name="hide_special_accounts_title">Hide special accounts</string>-->
<!-- NEW: <string name="hide_special_accounts_summary">Hide the unified inbox and all messages accounts</string>-->
<string name="search_title"><xliff:g id="search_name">%s</xliff:g> <xliff:g id="modifier">%s</xliff:g></string>
<string name="flagged_modifier"> - Stjärnmärkta</string>
<string name="unread_modifier"> - Olästa</string>

View File

@ -901,6 +901,9 @@
<string name="count_search_title">计算搜索结果的数量</string>
<string name="count_search_summary">关闭该功能以便加快显示速度</string>
<!-- NEW: <string name="hide_special_accounts_title">Hide special accounts</string>-->
<!-- NEW: <string name="hide_special_accounts_summary">Hide the unified inbox and all messages accounts</string>-->
<string name="search_title"><xliff:g id="search_name">%s</xliff:g> <xliff:g id="modifier">%s</xliff:g></string>
<string name="flagged_modifier"> - 星标</string>
<string name="unread_modifier"> - 未读</string>

View File

@ -921,6 +921,9 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin
<string name="count_search_title">Count search results</string>
<string name="count_search_summary">Turn off for faster display</string>
<string name="hide_special_accounts_title">Hide special accounts</string>
<string name="hide_special_accounts_summary">Hide the unified inbox and all messages accounts</string>
<string name="search_title"><xliff:g id="search_name">%s</xliff:g> <xliff:g id="modifier">%s</xliff:g></string>
<string name="flagged_modifier"> - Starred</string>
<string name="unread_modifier"> - Unread</string>

View File

@ -92,6 +92,13 @@
android:title="@string/count_search_title"
android:summary="@string/count_search_summary" />
<CheckBoxPreference
android:persistent="false"
android:key="hide_special_accounts"
android:title="@string/hide_special_accounts_title"
android:summary="@string/hide_special_accounts_summary"
android:disableDependentsState="true" />
</PreferenceCategory>
<PreferenceCategory
@ -180,7 +187,8 @@
android:persistent="false"
android:key="start_integrated_inbox"
android:title="@string/start_integrated_inbox_title"
android:summary="@string/start_integrated_inbox_summary" />
android:summary="@string/start_integrated_inbox_summary"
android:dependency="hide_special_accounts" />
<CheckBoxPreference
android:persistent="false"

View File

@ -168,6 +168,7 @@ public class K9 extends Application {
private static boolean mStartIntegratedInbox = false;
private static boolean mMeasureAccounts = true;
private static boolean mCountSearchMessages = true;
private static boolean mHideSpecialAccounts = false;
private static boolean mZoomControlsEnabled = false;
private static boolean mMobileOptimizedLayout = false;
private static boolean mQuietTimeEnabled = false;
@ -422,6 +423,7 @@ public class K9 extends Application {
editor.putBoolean("startIntegratedInbox", mStartIntegratedInbox);
editor.putBoolean("measureAccounts", mMeasureAccounts);
editor.putBoolean("countSearchMessages", mCountSearchMessages);
editor.putBoolean("hideSpecialAccounts", mHideSpecialAccounts);
editor.putBoolean("messageListStars", mMessageListStars);
editor.putBoolean("messageListCheckboxes", mMessageListCheckboxes);
editor.putBoolean("messageListTouchable", mMessageListTouchable);
@ -468,6 +470,7 @@ public class K9 extends Application {
mStartIntegratedInbox = sprefs.getBoolean("startIntegratedInbox", false);
mMeasureAccounts = sprefs.getBoolean("measureAccounts", true);
mCountSearchMessages = sprefs.getBoolean("countSearchMessages", true);
mHideSpecialAccounts = sprefs.getBoolean("hideSpecialAccounts", false);
mMessageListStars = sprefs.getBoolean("messageListStars", true);
mMessageListCheckboxes = sprefs.getBoolean("messageListCheckboxes", false);
mMessageListTouchable = sprefs.getBoolean("messageListTouchable", false);
@ -900,6 +903,14 @@ public class K9 extends Application {
mCountSearchMessages = countSearchMessages;
}
public static boolean isHideSpecialAccounts() {
return mHideSpecialAccounts;
}
public static void setHideSpecialAccounts(boolean hideSpecialAccounts) {
mHideSpecialAccounts = hideSpecialAccounts;
}
public static boolean useGalleryBugWorkaround() {
return useGalleryBugWorkaround;
}

View File

@ -232,6 +232,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
if (!K9.isHideSpecialAccounts()) {
unreadAccount = new SearchAccount(this, false, null, null);
unreadAccount.setDescription(getString(R.string.search_all_messages_title));
unreadAccount.setEmail(getString(R.string.search_all_messages_detail));
@ -239,11 +240,12 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
integratedInboxAccount = new SearchAccount(this, true, null, null);
integratedInboxAccount.setDescription(getString(R.string.integrated_inbox_title));
integratedInboxAccount.setEmail(getString(R.string.integrated_inbox_detail));
}
Account[] accounts = Preferences.getPreferences(this).getAccounts();
Intent intent = getIntent();
boolean startup = intent.getBooleanExtra(EXTRA_STARTUP, true);
if (startup && K9.startIntegratedInbox()) {
if (startup && K9.startIntegratedInbox() && !K9.isHideSpecialAccounts()) {
onOpenAccount(integratedInboxAccount);
finish();
} else if (startup && accounts.length == 1 && onOpenAccount(accounts[0])) {
@ -306,11 +308,16 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
private void refresh() {
BaseAccount[] accounts = Preferences.getPreferences(this).getAccounts();
List<BaseAccount> newAccounts = new ArrayList<BaseAccount>(accounts.length + 4);
if (accounts.length > 0) {
List<BaseAccount> newAccounts;
if (!K9.isHideSpecialAccounts()
&& accounts.length > 0) {
newAccounts = new ArrayList<BaseAccount>(accounts.length + 2);
newAccounts.add(integratedInboxAccount);
newAccounts.add(unreadAccount);
}
else {
newAccounts = new ArrayList<BaseAccount>(accounts.length);
}
newAccounts.addAll(Arrays.asList(accounts));

View File

@ -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());