diff options
Diffstat (limited to 'src/org/theb')
-rw-r--r-- | src/org/theb/ssh/HostsList.java | 15 | ||||
-rw-r--r-- | src/org/theb/ssh/Pubkey.java (renamed from src/org/theb/ssh/Preferences.java) | 6 |
2 files changed, 13 insertions, 8 deletions
diff --git a/src/org/theb/ssh/HostsList.java b/src/org/theb/ssh/HostsList.java index 5ac7ed9..2634eba 100644 --- a/src/org/theb/ssh/HostsList.java +++ b/src/org/theb/ssh/HostsList.java @@ -31,6 +31,7 @@ import android.net.ContentURI; import android.os.Bundle; import android.view.KeyEvent; import android.view.Menu; +import android.view.SubMenu; import android.view.View; import android.view.WindowManager; import android.view.View.MeasureSpec; @@ -45,6 +46,9 @@ public class HostsList extends ListActivity { public static final int PREFERENCES_ID = Menu.FIRST + 2; public static final int ABOUT_ID = Menu.FIRST + 3; + // Preferences submenu + public static final int PUBKEY_ID = SubMenu.FIRST + 4; + private static final String[] PROJECTION = new String[] { HostDb.Hosts._ID, HostDb.Hosts.HOSTNAME, @@ -144,7 +148,8 @@ public class HostsList extends ListActivity { KeyEvent.KEYCODE_3, 0, KeyEvent.KEYCODE_A); // The preferences link allows users to e.g. set the pubkey - menu.add(0, PREFERENCES_ID, R.string.menu_preferences).setShortcut( + SubMenu prefs = menu.addSubMenu(0, 0, R.string.menu_preferences); + prefs.add(0, PUBKEY_ID, R.string.menu_pubkey).setShortcut( KeyEvent.KEYCODE_4, 0, KeyEvent.KEYCODE_P); // This links to the about dialog for the program. @@ -216,8 +221,8 @@ public class HostsList extends ListActivity { case INSERT_ID: insertItem(); return true; - case PREFERENCES_ID: - showPreferences(); + case PUBKEY_ID: + showPubkey(); return true; case ABOUT_ID: showAbout(); @@ -226,8 +231,8 @@ public class HostsList extends ListActivity { return super.onOptionsItemSelected(item); } - private void showPreferences() { - Intent intent = new Intent(this, Preferences.class); + private void showPubkey() { + Intent intent = new Intent(this, Pubkey.class); this.startActivity(intent); } diff --git a/src/org/theb/ssh/Preferences.java b/src/org/theb/ssh/Pubkey.java index cfc0156..cf3bd0d 100644 --- a/src/org/theb/ssh/Preferences.java +++ b/src/org/theb/ssh/Pubkey.java @@ -35,9 +35,9 @@ import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; -public class Preferences extends Activity { +public class Pubkey extends Activity { private static SecureRandom mSecRand = null; - private static KeyStore mKeyStore = null; + //private static KeyStore mKeyStore = null; private Thread kgThread = null; private static final int GATHER_ENTROPY = 0; @@ -52,7 +52,7 @@ public class Preferences extends Activity { public void onCreate(Bundle icicle) { super.onCreate(icicle); - setContentView(R.layout.preferences); + setContentView(R.layout.pubkey); generateButton = (Button) findViewById(R.id.generate); generateButton.setOnClickListener(mGenerateListener); |