From 8a44ce4aa183a0b2a11d3c22113a5d7f9f4abf40 Mon Sep 17 00:00:00 2001 From: Nikolay Pultsin Date: Fri, 30 Sep 2011 11:27:01 +0100 Subject: [PATCH] resources cleanup (searchResults=>found) and synchronization --- assets/resources/application/cs.xml | 4 ++-- assets/resources/application/de.xml | 4 ++-- assets/resources/application/en.xml | 4 ++-- assets/resources/application/es.xml | 22 ++++++++++--------- assets/resources/application/fr.xml | 20 ++++++++--------- assets/resources/application/gl.xml | 12 ++++------ assets/resources/application/hu.xml | 12 ++++------ assets/resources/application/it.xml | 12 ++++------ assets/resources/application/nl.xml | 6 ++--- assets/resources/application/pl.xml | 6 ++--- assets/resources/application/ro.xml | 22 ++++++++++++------- assets/resources/application/ru.xml | 4 ++-- assets/resources/application/th.xml | 6 ++--- assets/resources/application/uk.xml | 20 ++++++++--------- assets/resources/application/vi.xml | 6 ++--- assets/resources/application/zh.xml | 22 ++++++++++--------- assets/resources/application/zh_TW.xml | 16 +++++--------- .../android/fbreader/BookmarksActivity.java | 4 ++-- .../fbreader/library/LibraryActivity.java | 2 +- .../fbreader/library/LibraryTreeAdapter.java | 2 +- .../fbreader/library/Library.java | 16 +++++++------- 21 files changed, 108 insertions(+), 114 deletions(-) diff --git a/assets/resources/application/cs.xml b/assets/resources/application/cs.xml index e7426111c..ef634ea41 100644 --- a/assets/resources/application/cs.xml +++ b/assets/resources/application/cs.xml @@ -23,7 +23,7 @@ - + @@ -178,7 +178,7 @@ - + diff --git a/assets/resources/application/de.xml b/assets/resources/application/de.xml index 611bcecf1..10b90bbfe 100644 --- a/assets/resources/application/de.xml +++ b/assets/resources/application/de.xml @@ -26,7 +26,7 @@ - + @@ -181,7 +181,7 @@ - + diff --git a/assets/resources/application/en.xml b/assets/resources/application/en.xml index 4cf778d14..82e33a815 100644 --- a/assets/resources/application/en.xml +++ b/assets/resources/application/en.xml @@ -23,7 +23,7 @@ - + @@ -178,7 +178,7 @@ - + diff --git a/assets/resources/application/es.xml b/assets/resources/application/es.xml index 23b72d588..b6a3e5937 100644 --- a/assets/resources/application/es.xml +++ b/assets/resources/application/es.xml @@ -28,7 +28,7 @@ - + @@ -65,7 +65,16 @@ + + + + + + + + + @@ -96,9 +105,6 @@ - - - @@ -177,7 +183,7 @@ - + @@ -638,10 +644,6 @@ - - - - @@ -693,7 +695,7 @@ - + diff --git a/assets/resources/application/fr.xml b/assets/resources/application/fr.xml index 22da486ea..90b2fec9f 100644 --- a/assets/resources/application/fr.xml +++ b/assets/resources/application/fr.xml @@ -23,7 +23,7 @@ - + @@ -60,7 +60,14 @@ + + + + + + + @@ -91,9 +98,6 @@ - - - @@ -172,7 +176,7 @@ - + @@ -633,10 +637,6 @@ - - - - @@ -682,7 +682,7 @@ - + diff --git a/assets/resources/application/gl.xml b/assets/resources/application/gl.xml index bfaa8fa25..a4c2c07fd 100644 --- a/assets/resources/application/gl.xml +++ b/assets/resources/application/gl.xml @@ -23,7 +23,7 @@ - + @@ -93,7 +93,7 @@ - + @@ -172,7 +172,7 @@ - + @@ -633,10 +633,6 @@ - - - - @@ -682,7 +678,7 @@ - + diff --git a/assets/resources/application/hu.xml b/assets/resources/application/hu.xml index f265ca023..c25c45f8f 100644 --- a/assets/resources/application/hu.xml +++ b/assets/resources/application/hu.xml @@ -23,7 +23,7 @@ - + @@ -93,7 +93,7 @@ - + @@ -172,7 +172,7 @@ - + @@ -633,10 +633,6 @@ - - - - @@ -682,7 +678,7 @@ - + diff --git a/assets/resources/application/it.xml b/assets/resources/application/it.xml index b5a4a1f3a..894aab8ed 100644 --- a/assets/resources/application/it.xml +++ b/assets/resources/application/it.xml @@ -24,7 +24,7 @@ - + @@ -94,7 +94,7 @@ - + @@ -173,7 +173,7 @@ - + @@ -634,10 +634,6 @@ - - - - @@ -683,7 +679,7 @@ - + diff --git a/assets/resources/application/nl.xml b/assets/resources/application/nl.xml index 9482a06d8..1f5c21081 100644 --- a/assets/resources/application/nl.xml +++ b/assets/resources/application/nl.xml @@ -23,7 +23,7 @@ - + @@ -93,7 +93,7 @@ - + @@ -172,7 +172,7 @@ - + diff --git a/assets/resources/application/pl.xml b/assets/resources/application/pl.xml index 1caeda5e9..0fd95f24f 100644 --- a/assets/resources/application/pl.xml +++ b/assets/resources/application/pl.xml @@ -23,7 +23,7 @@ - + @@ -93,7 +93,7 @@ - + @@ -172,7 +172,7 @@ - + diff --git a/assets/resources/application/ro.xml b/assets/resources/application/ro.xml index 0424f4320..11d531180 100644 --- a/assets/resources/application/ro.xml +++ b/assets/resources/application/ro.xml @@ -23,8 +23,8 @@ - - + + @@ -60,7 +60,16 @@ + + + + + + + + + @@ -79,10 +88,10 @@ - + - + @@ -91,9 +100,6 @@ - - - @@ -172,7 +178,7 @@ - + diff --git a/assets/resources/application/ru.xml b/assets/resources/application/ru.xml index d8cf0e239..13fa0801f 100644 --- a/assets/resources/application/ru.xml +++ b/assets/resources/application/ru.xml @@ -23,7 +23,7 @@ - + @@ -178,7 +178,7 @@ - + diff --git a/assets/resources/application/th.xml b/assets/resources/application/th.xml index 9b53fec92..7d06d48e2 100644 --- a/assets/resources/application/th.xml +++ b/assets/resources/application/th.xml @@ -23,7 +23,7 @@ - + @@ -93,7 +93,7 @@ - + @@ -172,7 +172,7 @@ - + diff --git a/assets/resources/application/uk.xml b/assets/resources/application/uk.xml index 7c1a64fef..4328b3068 100644 --- a/assets/resources/application/uk.xml +++ b/assets/resources/application/uk.xml @@ -23,7 +23,7 @@ - + @@ -60,7 +60,14 @@ + + + + + + + @@ -91,9 +98,6 @@ - - - @@ -172,7 +176,7 @@ - + @@ -633,10 +637,6 @@ - - - - @@ -682,7 +682,7 @@ - + diff --git a/assets/resources/application/vi.xml b/assets/resources/application/vi.xml index fcfe074db..a6b1ef3ab 100644 --- a/assets/resources/application/vi.xml +++ b/assets/resources/application/vi.xml @@ -23,7 +23,7 @@ - + @@ -93,7 +93,7 @@ - + @@ -172,7 +172,7 @@ - + diff --git a/assets/resources/application/zh.xml b/assets/resources/application/zh.xml index 7a98f7c17..5dd67a0e5 100644 --- a/assets/resources/application/zh.xml +++ b/assets/resources/application/zh.xml @@ -23,7 +23,7 @@ - + @@ -60,7 +60,16 @@ + + + + + + + + + @@ -91,9 +100,6 @@ - - - @@ -172,7 +178,7 @@ - + @@ -633,10 +639,6 @@ - - - - @@ -688,7 +690,7 @@ - + diff --git a/assets/resources/application/zh_TW.xml b/assets/resources/application/zh_TW.xml index bcd54c80c..d03d59e9b 100644 --- a/assets/resources/application/zh_TW.xml +++ b/assets/resources/application/zh_TW.xml @@ -23,7 +23,7 @@ - + @@ -93,7 +93,7 @@ - + @@ -172,7 +172,7 @@ - + @@ -490,8 +490,8 @@ - @@ -638,10 +638,6 @@ - - - - @@ -693,7 +689,7 @@ - + diff --git a/src/org/geometerplus/android/fbreader/BookmarksActivity.java b/src/org/geometerplus/android/fbreader/BookmarksActivity.java index 29e6f6dbf..ac25f6791 100644 --- a/src/org/geometerplus/android/fbreader/BookmarksActivity.java +++ b/src/org/geometerplus/android/fbreader/BookmarksActivity.java @@ -151,7 +151,7 @@ public class BookmarksActivity extends TabActivity implements MenuItem.OnMenuIte void showSearchResultsTab(LinkedList results) { if (mySearchResultsView == null) { - mySearchResultsView = createTab("searchResults", R.id.search_results); + mySearchResultsView = createTab("found", R.id.search_results); new BookmarksAdapter(mySearchResultsView, mySearchResults, false); } else { mySearchResults.clear(); @@ -159,7 +159,7 @@ public class BookmarksActivity extends TabActivity implements MenuItem.OnMenuIte mySearchResults.addAll(results); mySearchResultsView.invalidateViews(); mySearchResultsView.requestLayout(); - getTabHost().setCurrentTabByTag("searchResults"); + getTabHost().setCurrentTabByTag("found"); } public boolean onMenuItemClick(MenuItem item) { diff --git a/src/org/geometerplus/android/fbreader/library/LibraryActivity.java b/src/org/geometerplus/android/fbreader/library/LibraryActivity.java index 3bcf55a60..614a0f273 100644 --- a/src/org/geometerplus/android/fbreader/library/LibraryActivity.java +++ b/src/org/geometerplus/android/fbreader/library/LibraryActivity.java @@ -140,7 +140,7 @@ public class LibraryActivity extends TreeActivity implements MenuItem.OnMenuItem new ZLStringOption("BookSearch", "Pattern", ""); private void openSearchResults() { - final FBTree tree = myLibrary.getRootTree().getSubTree(Library.ROOT_SEARCH_RESULTS); + final FBTree tree = myLibrary.getRootTree().getSubTree(Library.ROOT_FOUND); if (tree != null) { openTree(tree); } diff --git a/src/org/geometerplus/android/fbreader/library/LibraryTreeAdapter.java b/src/org/geometerplus/android/fbreader/library/LibraryTreeAdapter.java index 630e81513..0427b5d0d 100644 --- a/src/org/geometerplus/android/fbreader/library/LibraryTreeAdapter.java +++ b/src/org/geometerplus/android/fbreader/library/LibraryTreeAdapter.java @@ -130,7 +130,7 @@ class LibraryTreeAdapter extends TreeAdapter { return R.drawable.ic_list_library_tags; } else if (Library.ROOT_FILE_TREE.equals(id)) { return R.drawable.ic_list_library_folder; - } else if (Library.ROOT_SEARCH_RESULTS.equals(id)) { + } else if (Library.ROOT_FOUND.equals(id)) { return R.drawable.ic_list_library_search; } } else if (tree instanceof FileTree) { diff --git a/src/org/geometerplus/fbreader/library/Library.java b/src/org/geometerplus/fbreader/library/Library.java index 2c70b333d..506c2420f 100644 --- a/src/org/geometerplus/fbreader/library/Library.java +++ b/src/org/geometerplus/fbreader/library/Library.java @@ -45,7 +45,7 @@ public final class Library { void onLibraryChanged(Code code); } - public static final String ROOT_SEARCH_RESULTS = "searchResults"; + public static final String ROOT_FOUND = "found"; public static final String ROOT_FAVORITES = "favorites"; public static final String ROOT_RECENT = "recent"; public static final String ROOT_BY_AUTHOR = "byAuthor"; @@ -255,10 +255,10 @@ public final class Library { getTagTree(t).getBookSubTree(book, true); } - final SearchResultsTree searchResults = - (SearchResultsTree)getFirstLevelTree(ROOT_SEARCH_RESULTS); - if (searchResults != null && book.matches(searchResults.getPattern())) { - searchResults.getBookSubTree(book, true); + final SearchResultsTree found = + (SearchResultsTree)getFirstLevelTree(ROOT_FOUND); + if (found != null && book.matches(found.getPattern())) { + found.getBookSubTree(book, true); } fireModelChangedEvent(ChangeListener.Code.BookAdded); @@ -298,7 +298,7 @@ public final class Library { myBooks.remove(book); refreshInTree(ROOT_FAVORITES, book); refreshInTree(ROOT_RECENT, book); - removeFromTree(ROOT_SEARCH_RESULTS, book); + removeFromTree(ROOT_FOUND, book); removeFromTree(ROOT_BY_TITLE, book); removeFromTree(ROOT_BY_SERIES, book); removeFromTree(ROOT_BY_AUTHOR, book); @@ -488,7 +488,7 @@ public final class Library { pattern = pattern.toLowerCase(); - final SearchResultsTree oldSearchResults = (SearchResultsTree)getFirstLevelTree(ROOT_SEARCH_RESULTS); + final SearchResultsTree oldSearchResults = (SearchResultsTree)getFirstLevelTree(ROOT_FOUND); if (oldSearchResults != null && pattern.equals(oldSearchResults.getPattern())) { fireModelChangedEvent(ChangeListener.Code.Found); return; @@ -502,7 +502,7 @@ public final class Library { if (oldSearchResults != null) { oldSearchResults.removeSelf(); } - newSearchResults = new SearchResultsTree(myRootTree, ROOT_SEARCH_RESULTS, pattern); + newSearchResults = new SearchResultsTree(myRootTree, ROOT_FOUND, pattern); fireModelChangedEvent(ChangeListener.Code.Found); } newSearchResults.getBookSubTree(book, true);