Issue 274, for consideration
authorsrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Thu, 26 Nov 2009 02:47:44 +0000 (02:47 +0000)
committersrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Thu, 26 Nov 2009 02:47:44 +0000 (02:47 +0000)
git-svn-id: http://zxing.googlecode.com/svn/trunk@1129 59b500cc-1b3d-0410-9834-0bbf25fbcc57

13 files changed:
android/res/values-de/strings.xml
android/res/values-es/strings.xml
android/res/values-fr/strings.xml
android/res/values-it/strings.xml
android/res/values-ja-rJP/strings.xml
android/res/values-ru/strings.xml
android/res/values-zh-rCN/strings.xml
android/res/values-zh-rTW/strings.xml
android/res/values/strings.xml
android/src/com/google/zxing/client/android/PreferencesActivity.java
android/src/com/google/zxing/client/android/result/ISBNResultHandler.java
android/src/com/google/zxing/client/android/result/ProductResultHandler.java
android/src/com/google/zxing/client/android/result/ResultHandler.java

index fea0533..3355789 100644 (file)
@@ -66,6 +66,7 @@
   <string name="msg_encode_in_progress">Erzeuge Barcode\u2026</string>\r
   <string name="msg_intent_failed">Die gewünschte Applikation kann nicht geöffnet werden. Der Barcode könnte ungültig sein.</string>\r
   <string name="msg_loading_apps">Laden einer Liste von Anwendungen</string>\r
+  <string name="msg_not_our_results">Sie verlassen diese Anwendung. Die Suchergebnisse, die Sie sind nicht auf diese Anwendung in Zusammenhang stehen.</string>\r
   <string name="msg_sbc_book_not_searchable">Das Buch kann nicht durchsucht werden.</string>\r
   <string name="msg_sbc_failed">Bei der Suche ist ein Fehler aufgetreten.</string>\r
   <string name="msg_sbc_no_page_returned">Keine Seite zurückgeliefert.</string>\r
index 789c126..872bf63 100644 (file)
@@ -66,6 +66,7 @@
   <string name="msg_encode_in_progress">Generando un código de barras\u2026</string>
   <string name="msg_intent_failed">Lo sentimos, la aplicación solicitada no pudo ser lanzada. El contenido de código de barras puede ser inválida.</string>
   <string name="msg_loading_apps">Cargando una lista de aplicaciones</string>
+  <string name="msg_not_our_results">Usted está saliendo de esta aplicación. Los resultados de búsqueda que se ver, no están relacionados con esta aplicación.</string>  
   <string name="msg_sbc_book_not_searchable">Lo sentimos, no se puede buscar en este libro.</string>
   <string name="msg_sbc_failed">Lo sentimos, la búsqueda ha detectado un problema.</string>
   <string name="msg_sbc_no_page_returned">Página no encontrada</string>
index 737092f..6e8248c 100644 (file)
@@ -66,6 +66,7 @@
   <string name="msg_encode_in_progress">Génération du code barre\u2026</string>
   <string name="msg_intent_failed">Désolé, l\'application demandée n\'a pas pu être lancé. Le contenu du code barre peut être invalide.</string>
   <string name="msg_loading_apps">Chargement d'une liste d'applications</string>
+  <string name="msg_not_our_results">Vous quittez cette application. Les résultats de recherche qui vous voir ne sont pas liées à cette application.</string>
   <string name="msg_sbc_book_not_searchable">Désolé, ce livre n\'est pas trouvable.</string>
   <string name="msg_sbc_failed">Désolé, la recherche a rencontrée un problème.</string>
   <string name="msg_sbc_no_page_returned">Page non trouvée</string>
index f1438e2..d7b855e 100644 (file)
@@ -66,6 +66,7 @@
   <string name="msg_encode_in_progress">Generazione codice a barre\u2026</string>
   <string name="msg_intent_failed">Spiacenti, l\'applicazione richiesta non può essere avviata. Il contenuto del codice a barre può essere non valido.</string>
   <string name="msg_loading_apps">Carico della lista delle applicazioni</string>
+  <string name="msg_not_our_results">Si sta lasciando questa applicazione. I risultati della ricerca che verrà vedi non sono collegati a questa domanda.</string>
   <string name="msg_sbc_book_not_searchable">Spiacenti, questo libro non è ricercabile.</string>
   <string name="msg_sbc_failed">Spiacenti, la ricerca ha avuto un problema.</string>
   <string name="msg_sbc_no_page_returned">Nessuna pagina restitiuta</string>
index a3df5ba..c90eb3e 100644 (file)
@@ -66,6 +66,7 @@
   <string name="msg_encode_in_progress">バーコード作成中\u2026</string>
   <string name="msg_intent_failed">指定されたアプリケーションを起動できませんでした。バーコードの内容が無効である可能性があります。</string>
   <string name="msg_loading_apps">適用のリストの負荷</string>
+  <string name="msg_not_our_results">このアプリケーションを残している。検索結果が必要になります。このアプリケーションに関連していないことがわかります。</string>
   <string name="msg_sbc_book_not_searchable">この書籍は検索できません。</string>
   <string name="msg_sbc_failed">検索中に問題が発生しました。</string>
   <string name="msg_sbc_no_page_returned">検索結果はありません</string>
index 5b169c9..0449c9c 100644 (file)
@@ -66,6 +66,7 @@
   <string name="msg_encode_in_progress">Генерация штрих-кода\u2026</string>
   <string name="msg_intent_failed">К сожалению, запрошенное приложение не может быть запущенно. Содержимое штрих-кода может быть повреждено.</string>
   <string name="msg_loading_apps">Нагружать список применений</string>
+  <string name="msg_not_our_results">Вы покидаете это приложение. Результаты поиска, которую вы видите, не связанным с этим приложением.</string>
   <string name="msg_sbc_book_not_searchable">К сожалению, поиск книги не удался.</string>
   <string name="msg_sbc_failed">К сожалению, у поиска возникли проблемы.</string>
   <string name="msg_sbc_no_page_returned">Ни одна страница не возвращена</string>
index eb3e08f..1e2287b 100644 (file)
@@ -66,6 +66,7 @@
   <string name="msg_encode_in_progress">正在生成条码\u2026</string>\r
   <string name="msg_intent_failed">抱歉,无法打开所需软件。 条码内容可能无效。</string>\r
   <string name="msg_loading_apps">装载应用名单</string>\r
+  <string name="msg_not_our_results">你离开此应用程序。搜索结果,您会看到的都没有涉及这个应用程序</string>\r
   <string name="msg_sbc_book_not_searchable">抱歉,无法找到此图书。</string>\r
   <string name="msg_sbc_failed">抱歉,搜索时遇到错误。</string>\r
   <string name="msg_sbc_no_page_returned">没有返回页面</string>\r
index cee5713..8bdf4b7 100644 (file)
@@ -66,6 +66,7 @@
   <string name="msg_encode_in_progress">正在生成條碼\u2026</string>\r
   <string name="msg_intent_failed">抱歉,無法打開所需軟件。 條碼內容可能無效。</string>\r
   <string name="msg_loading_apps">裝載應用名單</string>\r
+  <string name="msg_not_our_results">你離開此應用程序。搜索結果,您會看到的都沒有涉及這個應用程序。</string>\r
   <string name="msg_sbc_book_not_searchable">抱歉,無法找到此圖書。</string>\r
   <string name="msg_sbc_failed">抱歉,搜索時遇到錯誤。</string>\r
   <string name="msg_sbc_no_page_returned">沒有返回頁面</string>\r
index e129c82..026db2e 100755 (executable)
@@ -66,6 +66,7 @@
   <string name="msg_encode_in_progress">Generating a barcode\u2026</string>
   <string name="msg_intent_failed">Sorry, the requested application could not be launched. The barcode contents may be invalid.</string>
   <string name="msg_loading_apps">Loading list of applications</string>
+  <string name="msg_not_our_results">You are leaving this application. The search results you will see are not related to this application.</string>
   <string name="msg_sbc_book_not_searchable">Sorry, this book is not searchable.</string>
   <string name="msg_sbc_failed">Sorry, the search encountered a problem.</string>
   <string name="msg_sbc_no_page_returned">No page returned</string>
index b6ee0c7..8054d90 100755 (executable)
@@ -40,6 +40,7 @@ public final class PreferencesActivity extends PreferenceActivity
   static final String KEY_COPY_TO_CLIPBOARD = "preferences_copy_to_clipboard";
 
   static final String KEY_HELP_VERSION_SHOWN = "preferences_help_version_shown";
+  public static final String KEY_NOT_OUR_RESULTS_SHOWN = "preferences_not_out_results_shown";
 
   private CheckBoxPreference decode1D;
   private CheckBoxPreference decodeQR;
index 9b05842..bd80a26 100644 (file)
 
 package com.google.zxing.client.android.result;
 
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+import android.content.SharedPreferences;
+import android.preference.PreferenceManager;
 import com.google.zxing.client.android.PreferencesActivity;
 import com.google.zxing.client.android.R;
 import com.google.zxing.client.result.ISBNParsedResult;
 import com.google.zxing.client.result.ParsedResult;
 
-import android.app.Activity;
-import android.content.SharedPreferences;
-import android.preference.PreferenceManager;
-
 /**
  * Handles books encoded by their ISBN values.
  *
@@ -58,23 +59,27 @@ public final class ISBNResultHandler extends ResultHandler {
   }
 
   @Override
-  public void handleButtonPress(int index) {
-    ISBNParsedResult isbnResult = (ISBNParsedResult) getResult();
-    switch (index) {
-      case 0:
-        openProductSearch(isbnResult.getISBN());
-        break;
-      case 1:
-        openBookSearch(isbnResult.getISBN());
-        break;
-      case 2:
-        searchBookContents(isbnResult.getISBN());
-        break;
-      case 3:
-        String url = customProductSearch.replace("%s", isbnResult.getISBN());
-        openURL(url);
-        break;
-    }
+  public void handleButtonPress(final int index) {
+    showNotOurResults(index, new AlertDialog.OnClickListener() {
+      public void onClick(DialogInterface dialogInterface, int i) {
+        ISBNParsedResult isbnResult = (ISBNParsedResult) getResult();
+        switch (index) {
+          case 0:
+            openProductSearch(isbnResult.getISBN());
+            break;
+          case 1:
+            openBookSearch(isbnResult.getISBN());
+            break;
+          case 2:
+            searchBookContents(isbnResult.getISBN());
+            break;
+          case 3:
+            String url = customProductSearch.replace("%s", isbnResult.getISBN());
+            openURL(url);
+            break;
+        }
+      }
+    });
   }
 
   @Override
index 0f1405f..1c58da6 100644 (file)
 
 package com.google.zxing.client.android.result;
 
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+import android.content.SharedPreferences;
+import android.preference.PreferenceManager;
 import com.google.zxing.client.android.PreferencesActivity;
 import com.google.zxing.client.android.R;
 import com.google.zxing.client.result.ParsedResult;
 import com.google.zxing.client.result.ProductParsedResult;
 
-import android.app.Activity;
-import android.content.SharedPreferences;
-import android.preference.PreferenceManager;
-
 /**
  * Handles generic products which are not books.
  *
@@ -56,20 +57,24 @@ public final class ProductResultHandler extends ResultHandler {
   }
 
   @Override
-  public void handleButtonPress(int index) {
-    ProductParsedResult productResult = (ProductParsedResult) getResult();
-    switch (index) {
-      case 0:
-        openProductSearch(productResult.getNormalizedProductID());
-        break;
-      case 1:
-        webSearch(productResult.getNormalizedProductID());
-        break;
-      case 2:
-        String url = customProductSearch.replace("%s", productResult.getNormalizedProductID());
-        openURL(url);
-        break;
-    }
+  public void handleButtonPress(final int index) {
+    showNotOurResults(index, new AlertDialog.OnClickListener() {
+      public void onClick(DialogInterface dialogInterface, int i) {
+        ProductParsedResult productResult = (ProductParsedResult) getResult();
+        switch (index) {
+          case 0:
+            openProductSearch(productResult.getNormalizedProductID());
+            break;
+          case 1:
+            webSearch(productResult.getNormalizedProductID());
+            break;
+          case 2:
+            String url = customProductSearch.replace("%s", productResult.getNormalizedProductID());
+            openURL(url);
+            break;
+        }
+      }
+    });
   }
 
   @Override
index d7bd354..48a22b7 100644 (file)
 
 package com.google.zxing.client.android.result;
 
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.ActivityNotFoundException;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.net.Uri;
+import android.preference.PreferenceManager;
+import android.provider.Contacts;
 import com.google.zxing.client.android.Contents;
 import com.google.zxing.client.android.Intents;
 import com.google.zxing.client.android.LocaleManager;
+import com.google.zxing.client.android.PreferencesActivity;
 import com.google.zxing.client.android.R;
 import com.google.zxing.client.android.book.SearchBookContentsActivity;
 import com.google.zxing.client.result.ParsedResult;
 import com.google.zxing.client.result.ParsedResultType;
 
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.content.ActivityNotFoundException;
-import android.content.Intent;
-import android.net.Uri;
-import android.provider.Contacts;
-
 import java.text.DateFormat;
 import java.text.ParsePosition;
 import java.text.SimpleDateFormat;
@@ -315,4 +317,20 @@ public abstract class ResultHandler {
       intent.putExtra(key, value);
     }
   }
+
+  protected void showNotOurResults(int index, AlertDialog.OnClickListener proceedListener) {
+    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
+    if (prefs.getBoolean(PreferencesActivity.KEY_NOT_OUR_RESULTS_SHOWN, false)) {
+      // already seen it, just proceed
+      proceedListener.onClick(null, index);
+    } else {
+      // note the user has seen it
+      prefs.edit().putBoolean(PreferencesActivity.KEY_NOT_OUR_RESULTS_SHOWN, true);
+      AlertDialog.Builder builder = new AlertDialog.Builder(activity);
+      builder.setMessage(R.string.msg_not_our_results);
+      builder.setPositiveButton(R.string.button_ok, proceedListener);
+      builder.show();
+    }
+  }
+
 }