diff options
author | Kenny Root <kenny@the-b.org> | 2007-11-26 06:35:49 +0000 |
---|---|---|
committer | Kenny Root <kenny@the-b.org> | 2007-11-26 06:35:49 +0000 |
commit | c9c36c1e2aa66708c8cff728e2e4b02de1ec08a7 (patch) | |
tree | b80bf40a4a932a09fcad3eb032eae1c11e26e95b | |
parent | 1c4ff63a55947db1cd730fb40856185e22bb47c6 (diff) | |
download | connectbot-c9c36c1e2aa66708c8cff728e2e4b02de1ec08a7.tar.gz connectbot-c9c36c1e2aa66708c8cff728e2e4b02de1ec08a7.tar.bz2 connectbot-c9c36c1e2aa66708c8cff728e2e4b02de1ec08a7.zip |
refactored preferences into a submenu
-rw-r--r-- | AndroidManifest.xml | 5 | ||||
-rw-r--r-- | res/layout/pubkey.xml (renamed from res/layout/preferences.xml) | 0 | ||||
-rw-r--r-- | res/values/strings.xml | 4 | ||||
-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 |
5 files changed, 17 insertions, 13 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 406d965..2537545 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -69,11 +69,8 @@ android:theme="@android:style/Theme.Dialog"> </activity> - <activity class="Preferences" android:label="@string/title_preferences" + <activity class="Pubkey" android:label="@string/title_pubkey" android:theme="@android:style/Theme.Dialog"> - <intent-filter android:label="@string/title_preferences"> - <action android:value="org.theb.ssh.action.SETTINGS_ACTION"/> - </intent-filter> </activity> </application> </manifest>
\ No newline at end of file diff --git a/res/layout/preferences.xml b/res/layout/pubkey.xml index d22fc5c..d22fc5c 100644 --- a/res/layout/preferences.xml +++ b/res/layout/pubkey.xml diff --git a/res/values/strings.xml b/res/values/strings.xml index faa1f18..66a3b50 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -6,7 +6,7 @@ <string name="title_host">Host</string> <string name="title_shell">Secure Shell</string> <string name="title_password">Input Password</string> - <string name="title_preferences">Preferences</string> + <string name="title_pubkey">Public Keys</string> <string name="title_entropy">Gathering Entropy</string> <string name="resolve_edit">Edit Host</string> @@ -15,6 +15,8 @@ <string name="menu_insert">Add Host</string> <string name="menu_delete">Delete Host</string> <string name="menu_preferences">Preferences</string> + <string name="menu_pubkey">Public Keys</string> + <string name="menu_about">About</string> <string name="prompt_touch">Please touch the screen.</string> 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); |