diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml index 200388c7c..ce597541b 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -79,6 +79,7 @@ Delete Key Create Key Edit Key + Search Sign diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml index 200388c7c..ce597541b 100644 --- a/res/values-ko/strings.xml +++ b/res/values-ko/strings.xml @@ -79,6 +79,7 @@ Delete Key Create Key Edit Key + Search Sign diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml index 200388c7c..ce597541b 100644 --- a/res/values-ru/strings.xml +++ b/res/values-ru/strings.xml @@ -79,6 +79,7 @@ Delete Key Create Key Edit Key + Search Sign diff --git a/res/values-sl/strings.xml b/res/values-sl/strings.xml index d838c6073..d44a606c7 100644 --- a/res/values-sl/strings.xml +++ b/res/values-sl/strings.xml @@ -79,6 +79,7 @@ Izbriši ključ Ustvari ključ Uredi ključ + Search Podpiši diff --git a/res/values/strings.xml b/res/values/strings.xml index 1eac3292f..e7e5b36b0 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -79,6 +79,7 @@ Delete Key Create Key Edit Key + Search Sign diff --git a/src/org/thialfihar/android/apg/BaseActivity.java b/src/org/thialfihar/android/apg/BaseActivity.java index 210e09409..e25a268da 100644 --- a/src/org/thialfihar/android/apg/BaseActivity.java +++ b/src/org/thialfihar/android/apg/BaseActivity.java @@ -103,6 +103,11 @@ public class BaseActivity extends Activity return true; } + case Id.menu.option.search: { + startSearch("", false, null, false); + return true; + } + default: { break; } diff --git a/src/org/thialfihar/android/apg/Id.java b/src/org/thialfihar/android/apg/Id.java index 73d4ddc85..72942d2ba 100644 --- a/src/org/thialfihar/android/apg/Id.java +++ b/src/org/thialfihar/android/apg/Id.java @@ -33,6 +33,7 @@ public final class Id { public static final int import_keys = 0x21070006; public static final int export_keys = 0x21070007; public static final int preferences = 0x21070008; + public static final int search = 0x21070009; } } diff --git a/src/org/thialfihar/android/apg/KeyListActivity.java b/src/org/thialfihar/android/apg/KeyListActivity.java index f09a74384..4bb2c091d 100644 --- a/src/org/thialfihar/android/apg/KeyListActivity.java +++ b/src/org/thialfihar/android/apg/KeyListActivity.java @@ -72,6 +72,8 @@ public class KeyListActivity extends BaseActivity { super.onCreate(savedInstanceState); setContentView(R.layout.key_list); + setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL); + mList = (ExpandableListView) findViewById(R.id.list); registerForContextMenu(mList); diff --git a/src/org/thialfihar/android/apg/PublicKeyListActivity.java b/src/org/thialfihar/android/apg/PublicKeyListActivity.java index 4997f60b7..74e964ec8 100644 --- a/src/org/thialfihar/android/apg/PublicKeyListActivity.java +++ b/src/org/thialfihar/android/apg/PublicKeyListActivity.java @@ -37,9 +37,11 @@ public class PublicKeyListActivity extends KeyListActivity { .setIcon(android.R.drawable.ic_menu_add); menu.add(0, Id.menu.option.export_keys, 1, R.string.menu_exportKeys) .setIcon(android.R.drawable.ic_menu_save); - menu.add(1, Id.menu.option.preferences, 2, R.string.menu_preferences) + menu.add(1, Id.menu.option.search, 2, R.string.menu_search) + .setIcon(android.R.drawable.ic_menu_search); + menu.add(1, Id.menu.option.preferences, 3, R.string.menu_preferences) .setIcon(android.R.drawable.ic_menu_preferences); - menu.add(1, Id.menu.option.about, 3, R.string.menu_about) + menu.add(1, Id.menu.option.about, 4, R.string.menu_about) .setIcon(android.R.drawable.ic_menu_info_details); return true; } diff --git a/src/org/thialfihar/android/apg/SecretKeyListActivity.java b/src/org/thialfihar/android/apg/SecretKeyListActivity.java index 0252c46d2..fb8ad92c6 100644 --- a/src/org/thialfihar/android/apg/SecretKeyListActivity.java +++ b/src/org/thialfihar/android/apg/SecretKeyListActivity.java @@ -45,9 +45,11 @@ public class SecretKeyListActivity extends KeyListActivity implements OnChildCli .setIcon(android.R.drawable.ic_menu_save); menu.add(1, Id.menu.option.create, 2, R.string.menu_createKey) .setIcon(android.R.drawable.ic_menu_add); - menu.add(2, Id.menu.option.preferences, 3, R.string.menu_preferences) + menu.add(3, Id.menu.option.search, 3, R.string.menu_search) + .setIcon(android.R.drawable.ic_menu_search); + menu.add(3, Id.menu.option.preferences, 4, R.string.menu_preferences) .setIcon(android.R.drawable.ic_menu_preferences); - menu.add(2, Id.menu.option.about, 4, R.string.menu_about) + menu.add(3, Id.menu.option.about, 5, R.string.menu_about) .setIcon(android.R.drawable.ic_menu_info_details); return true; } diff --git a/src/org/thialfihar/android/apg/SelectPublicKeyListActivity.java b/src/org/thialfihar/android/apg/SelectPublicKeyListActivity.java index d9d9864c4..a487bc1ff 100644 --- a/src/org/thialfihar/android/apg/SelectPublicKeyListActivity.java +++ b/src/org/thialfihar/android/apg/SelectPublicKeyListActivity.java @@ -21,6 +21,7 @@ import java.util.Vector; import android.app.SearchManager; import android.content.Intent; import android.os.Bundle; +import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; @@ -39,6 +40,8 @@ public class SelectPublicKeyListActivity extends BaseActivity { super.onCreate(savedInstanceState); setContentView(R.layout.select_public_key); + setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL); + mList = (ListView) findViewById(R.id.list); // needed in Android 1.5, where the XML attribute gets ignored mList.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); @@ -154,4 +157,11 @@ public class SelectPublicKeyListActivity extends BaseActivity { setResult(RESULT_OK, data); finish(); } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + menu.add(0, Id.menu.option.search, 0, R.string.menu_search) + .setIcon(android.R.drawable.ic_menu_search); + return true; + } } diff --git a/src/org/thialfihar/android/apg/SelectSecretKeyListActivity.java b/src/org/thialfihar/android/apg/SelectSecretKeyListActivity.java index be00e18f4..c0ab57710 100644 --- a/src/org/thialfihar/android/apg/SelectSecretKeyListActivity.java +++ b/src/org/thialfihar/android/apg/SelectSecretKeyListActivity.java @@ -19,6 +19,7 @@ package org.thialfihar.android.apg; import android.app.SearchManager; import android.content.Intent; import android.os.Bundle; +import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; @@ -40,6 +41,8 @@ public class SelectSecretKeyListActivity extends BaseActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL); + setContentView(R.layout.select_secret_key); mList = (ListView) findViewById(R.id.list); @@ -97,4 +100,11 @@ public class SelectSecretKeyListActivity extends BaseActivity { mListAdapter = new SelectSecretKeyListAdapter(this, mList, searchString); mList.setAdapter(mListAdapter); } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + menu.add(0, Id.menu.option.search, 0, R.string.menu_search) + .setIcon(android.R.drawable.ic_menu_search); + return true; + } }