diff options
author | Jeffrey Sharkey <jsharkey@jsharkey.org> | 2008-10-27 19:05:01 +0000 |
---|---|---|
committer | Jeffrey Sharkey <jsharkey@jsharkey.org> | 2008-10-27 19:05:01 +0000 |
commit | d92d47b5cae3d1b60920a33f24e0fd23fe0054ec (patch) | |
tree | 86fe6e68a609474be410fe8db6e12f5f6457bbb6 /src/org | |
parent | c394e79b95caaa2b0eb21241dacf5b7373cef887 (diff) | |
download | connectbot-d92d47b5cae3d1b60920a33f24e0fd23fe0054ec.tar.gz connectbot-d92d47b5cae3d1b60920a33f24e0fd23fe0054ec.tar.bz2 connectbot-d92d47b5cae3d1b60920a33f24e0fd23fe0054ec.zip |
* added better keyboard shortcut into to wizard
* moved a large chunk of strings into strings.xml, still need to think harder about how to handle in TerminalBridge because it needs a Resources object
* udpated version strings in manifest to 1.1 and 110
* removed R.java file to help svn-build-bot
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/connectbot/ConsoleActivity.java | 18 | ||||
-rw-r--r-- | src/org/connectbot/HostListActivity.java | 28 | ||||
-rw-r--r-- | src/org/connectbot/R.java | 105 | ||||
-rw-r--r-- | src/org/connectbot/WizardActivity.java | 6 | ||||
-rw-r--r-- | src/org/connectbot/util/HostDatabase.java | 4 | ||||
-rw-r--r-- | src/org/connectbot/util/UpdateHelper.java | 7 |
6 files changed, 32 insertions, 136 deletions
diff --git a/src/org/connectbot/ConsoleActivity.java b/src/org/connectbot/ConsoleActivity.java index d7be9de..bab9c8f 100644 --- a/src/org/connectbot/ConsoleActivity.java +++ b/src/org/connectbot/ConsoleActivity.java @@ -511,7 +511,7 @@ public class ConsoleActivity extends Activity { } clipboard.setText(buffer.toString()); - Toast.makeText(ConsoleActivity.this, String.format("Copied %d bytes to clipboard", buffer.length()), Toast.LENGTH_LONG).show(); + Toast.makeText(ConsoleActivity.this, getString(R.string.console_copy_done, buffer.length()), Toast.LENGTH_LONG).show(); case MotionEvent.ACTION_CANCEL: // make sure we clear any highlighted area @@ -589,7 +589,7 @@ public class ConsoleActivity extends Activity { if(activeTerminal) authenticated = ((TerminalView)view).bridge.fullyConnected; - disconnect = menu.add("Disconnect"); + disconnect = menu.add(R.string.console_menu_disconnect); disconnect.setEnabled(activeTerminal); disconnect.setIcon(android.R.drawable.ic_menu_close_clear_cancel); disconnect.setOnMenuItemClickListener(new OnMenuItemClickListener() { @@ -604,7 +604,7 @@ public class ConsoleActivity extends Activity { } }); - copy = menu.add("Copy"); + copy = menu.add(R.string.console_menu_copy); copy.setIcon(android.R.drawable.ic_menu_set_as); copy.setEnabled(activeTerminal && authenticated); copy.setOnMenuItemClickListener(new OnMenuItemClickListener() { @@ -614,13 +614,13 @@ public class ConsoleActivity extends Activity { copySource = (TerminalView)view; copySource.resetSelected(); - Toast.makeText(ConsoleActivity.this, "Touch and drag to select area to copy", Toast.LENGTH_LONG).show(); + Toast.makeText(ConsoleActivity.this, getString(R.string.console_copy_start), Toast.LENGTH_LONG).show(); return true; } }); - paste = menu.add("Paste"); + paste = menu.add(R.string.console_menu_paste); paste.setIcon(android.R.drawable.ic_menu_edit); paste.setEnabled(clipboard.hasText() && activeTerminal && authenticated); paste.setOnMenuItemClickListener(new OnMenuItemClickListener() { @@ -637,7 +637,7 @@ public class ConsoleActivity extends Activity { }); - tunnel = menu.add("Tunnel"); + tunnel = menu.add(R.string.console_menu_tunnel); tunnel.setIcon(android.R.drawable.ic_menu_manage); tunnel.setEnabled(activeTerminal && authenticated); tunnel.setOnMenuItemClickListener(new OnMenuItemClickListener() { @@ -683,14 +683,14 @@ public class ConsoleActivity extends Activity { if(local) { target.bridge.connection.createLocalPortForwarder(sourcePort, destHost, destPort); - summary = String.format("Successfully created tunnel -L%d:%s:%d", sourcePort, destHost, destPort); + summary = getString(R.string.tunnel_done_local, sourcePort, destHost, destPort); } else { target.bridge.connection.requestRemotePortForwarding("", sourcePort, destHost, destPort); - summary = String.format("Successfully created tunnel -R%d:%s:%d", sourcePort, destHost, destPort); + summary = getString(R.string.tunnel_done_remote, sourcePort, destHost, destPort); } } catch(Exception e) { Log.e(TAG, "Problem trying to create tunnel", e); - summary = "Problem creating tunnel, maybe you're using ports under 1024?"; + summary = getString(R.string.tunnel_problem); } Toast.makeText(ConsoleActivity.this, summary, Toast.LENGTH_LONG).show(); diff --git a/src/org/connectbot/HostListActivity.java b/src/org/connectbot/HostListActivity.java index d9bc586..0e6c915 100644 --- a/src/org/connectbot/HostListActivity.java +++ b/src/org/connectbot/HostListActivity.java @@ -252,7 +252,7 @@ public class HostListActivity extends ListActivity { // show error if poorly formed if (!hostmask.matcher(text.getText().toString()).find()) { - text.setError("Use the format 'username@hostname:port'"); + text.setError(getString(R.string.list_format_error)); return false; } @@ -326,7 +326,7 @@ public class HostListActivity extends ListActivity { if(makingShortcut) return true; // add host, ssh keys, about - sortcolor = menu.add("Sort by color"); + sortcolor = menu.add(R.string.list_menu_sortcolor); sortcolor.setIcon(android.R.drawable.ic_menu_share); sortcolor.setOnMenuItemClickListener(new OnMenuItemClickListener() { public boolean onMenuItemClick(MenuItem item) { @@ -336,7 +336,7 @@ public class HostListActivity extends ListActivity { } }); - sortlast = menu.add("Sort by name"); + sortlast = menu.add(R.string.list_menu_sortname); sortlast.setIcon(android.R.drawable.ic_menu_share); sortlast.setOnMenuItemClickListener(new OnMenuItemClickListener() { public boolean onMenuItemClick(MenuItem item) { @@ -346,15 +346,15 @@ public class HostListActivity extends ListActivity { } }); - MenuItem keys = menu.add("Manage keys"); - keys.setIcon(android.R.drawable.ic_lock_lock); - keys.setEnabled(false); + //MenuItem keys = menu.add("Manage keys"); + //keys.setIcon(android.R.drawable.ic_lock_lock); + //keys.setEnabled(false); - MenuItem settings = menu.add("Settings"); + MenuItem settings = menu.add(R.string.list_menu_settings); settings.setIcon(android.R.drawable.ic_menu_preferences); settings.setIntent(new Intent(HostListActivity.this, SettingsActivity.class)); - MenuItem about = menu.add("About"); + MenuItem about = menu.add(R.string.list_menu_about); about.setIcon(android.R.drawable.ic_menu_help); about.setIntent(new Intent(HostListActivity.this, WizardActivity.class)); @@ -377,7 +377,7 @@ public class HostListActivity extends ListActivity { final int id = cursor.getInt(COL_ID); // edit, disconnect, delete - MenuItem connect = menu.add("Disconnect"); + MenuItem connect = menu.add(R.string.list_host_disconnect); final TerminalBridge bridge = bound.findBridge(nickname); connect.setEnabled((bridge != null)); connect.setOnMenuItemClickListener(new OnMenuItemClickListener() { @@ -388,7 +388,7 @@ public class HostListActivity extends ListActivity { } }); - MenuItem edit = menu.add("Edit host"); + MenuItem edit = menu.add(R.string.list_host_edit); edit.setOnMenuItemClickListener(new OnMenuItemClickListener() { public boolean onMenuItemClick(MenuItem item) { Intent intent = new Intent(HostListActivity.this, HostEditorActivity.class); @@ -398,13 +398,13 @@ public class HostListActivity extends ListActivity { } }); - MenuItem delete = menu.add("Delete host"); + MenuItem delete = menu.add(R.string.list_host_delete); delete.setOnMenuItemClickListener(new OnMenuItemClickListener() { public boolean onMenuItemClick(MenuItem item) { // prompt user to make sure they really want this new AlertDialog.Builder(HostListActivity.this) - .setMessage(String.format("Are you sure you want to delete '%s'?", nickname)) - .setPositiveButton("Yes, delete", new DialogInterface.OnClickListener() { + .setMessage(getString(R.string.delete_message, nickname)) + .setPositiveButton(R.string.delete_pos, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { // make sure we disconnect if(bridge != null) @@ -414,7 +414,7 @@ public class HostListActivity extends ListActivity { updateHandler.sendEmptyMessage(-1); } }) - .setNegativeButton("Cancel", null).create().show(); + .setNegativeButton(R.string.delete_neg, null).create().show(); return true; } diff --git a/src/org/connectbot/R.java b/src/org/connectbot/R.java deleted file mode 100644 index d33398a..0000000 --- a/src/org/connectbot/R.java +++ /dev/null @@ -1,105 +0,0 @@ -/* AUTO-GENERATED FILE. DO NOT MODIFY. - * - * This class was automatically generated by the - * aapt tool from the resource data it found. It - * should not be modified by hand. - */ - -package org.connectbot; - -public final class R { - public static final class anim { - public static final int fade_out=0x7f040000; - public static final int fade_stay_hidden=0x7f040001; - public static final int slide_left_in=0x7f040002; - public static final int slide_left_out=0x7f040003; - public static final int slide_right_in=0x7f040004; - public static final int slide_right_out=0x7f040005; - } - public static final class array { - public static final int list_colors=0x7f060001; - public static final int list_emulation_modes=0x7f060000; - public static final int list_keymode=0x7f060002; - } - public static final class attr { - } - public static final class color { - public static final int blue=0x7f080000; - public static final int green=0x7f080001; - public static final int red=0x7f080002; - } - public static final class drawable { - public static final int blue=0x7f020006; - public static final int connected=0x7f020000; - public static final int even_stripe=0x7f020007; - public static final int highlight_disabled_pressed=0x7f020001; - public static final int ic_btn_back=0x7f020002; - public static final int ic_btn_next=0x7f020003; - public static final int icon=0x7f020004; - public static final int icon_older=0x7f020005; - public static final int odd_stripe=0x7f020008; - } - public static final class id { - public static final int action_next=0x7f090008; - public static final int action_prev=0x7f090007; - public static final int console_flip=0x7f090000; - public static final int console_password=0x7f090001; - public static final int console_prompt=0x7f090002; - public static final int console_prompt_no=0x7f090003; - public static final int console_prompt_yes=0x7f090004; - public static final int front_quickconnect=0x7f090005; - public static final int terminal_overlay=0x7f09000d; - public static final int tunnel_destination=0x7f09000c; - public static final int tunnel_local=0x7f090009; - public static final int tunnel_remote=0x7f09000a; - public static final int tunnel_source=0x7f09000b; - public static final int wizard_flipper=0x7f090006; - } - public static final class layout { - public static final int act_console=0x7f030000; - public static final int act_hostlist=0x7f030001; - public static final int act_wizard=0x7f030002; - public static final int dia_tunnel=0x7f030003; - public static final int item_host=0x7f030004; - public static final int item_terminal=0x7f030005; - public static final int wiz_eula=0x7f030006; - public static final int wiz_features=0x7f030007; - } - public static final class string { - public static final int alert_disconnect_msg=0x7f070015; - public static final int app_desc=0x7f070001; - public static final int app_name=0x7f070000; - public static final int bind_days=0x7f07001e; - public static final int bind_hours=0x7f07001d; - public static final int bind_minutes=0x7f07001c; - public static final int button_add=0x7f070011; - public static final int button_cancel=0x7f070012; - public static final int button_change=0x7f070013; - public static final int button_generate=0x7f070014; - public static final int button_ok=0x7f070010; - public static final int menu_about=0x7f07000e; - public static final int menu_delete=0x7f07000b; - public static final int menu_insert=0x7f07000a; - public static final int menu_preferences=0x7f07000c; - public static final int menu_pubkey=0x7f07000d; - public static final int msg_copyright=0x7f070016; - public static final int msg_version=0x7f070017; - public static final int pref_emulation=0x7f070018; - public static final int pref_keepalive=0x7f07001a; - public static final int pref_keymode=0x7f07001b; - public static final int pref_scrollback=0x7f070019; - public static final int prompt_touch=0x7f07000f; - public static final int resolve_connect=0x7f070009; - public static final int resolve_edit=0x7f070008; - public static final int title_entropy=0x7f070007; - public static final int title_host=0x7f070003; - public static final int title_hosts_list=0x7f070002; - public static final int title_password=0x7f070005; - public static final int title_pubkey=0x7f070006; - public static final int title_shell=0x7f070004; - } - public static final class xml { - public static final int host_prefs=0x7f050000; - public static final int preferences=0x7f050001; - } -} diff --git a/src/org/connectbot/WizardActivity.java b/src/org/connectbot/WizardActivity.java index e1570a5..4758fb5 100644 --- a/src/org/connectbot/WizardActivity.java +++ b/src/org/connectbot/WizardActivity.java @@ -38,7 +38,7 @@ public class WizardActivity extends Activity { /** * In-order list of wizard steps to present to user. These are layout resource ids. */ - public final static int[] STEPS = new int[] { R.layout.wiz_eula, R.layout.wiz_features }; + public final static int[] STEPS = new int[] { R.layout.wiz_eula, R.layout.wiz_features, R.layout.wiz_keyboard }; protected ViewFlipper flipper = null; protected Button next, prev; @@ -102,8 +102,8 @@ public class WizardActivity extends Activity { protected void updateButtons() { boolean eula = (flipper.getDisplayedChild() == 0); - next.setText(eula ? "Agree" : "Next"); - prev.setText(eula ? "Cancel" : "Back"); + next.setText(eula ? getString(R.string.wizard_agree) : getString(R.string.wizard_next)); + prev.setText(eula ? getString(R.string.wizard_cancel) : getString(R.string.wizard_back)); } diff --git a/src/org/connectbot/util/HostDatabase.java b/src/org/connectbot/util/HostDatabase.java index 7ed1a9a..3cbc866 100644 --- a/src/org/connectbot/util/HostDatabase.java +++ b/src/org/connectbot/util/HostDatabase.java @@ -77,8 +77,8 @@ public class HostDatabase extends SQLiteOpenHelper { + FIELD_HOST_POSTLOGIN + ")"); // insert a few sample hosts, none of which probably connect - this.createHost(db, "connectbot@bravo", "connectbot", "192.168.254.230", 22, COLOR_GRAY); - this.createHost(db, "cron@server.example.com", "cron", "server.example.com", 22, COLOR_BLUE); + //this.createHost(db, "connectbot@bravo", "connectbot", "192.168.254.230", 22, COLOR_GRAY); + this.createHost(db, "cron@server.example.com", "cron", "server.example.com", 22, COLOR_GRAY); this.createHost(db, "backup@example.net", "backup", "example.net", 22, COLOR_BLUE); } diff --git a/src/org/connectbot/util/UpdateHelper.java b/src/org/connectbot/util/UpdateHelper.java index b74676f..fc8233e 100644 --- a/src/org/connectbot/util/UpdateHelper.java +++ b/src/org/connectbot/util/UpdateHelper.java @@ -23,6 +23,7 @@ import java.io.InputStream; import java.net.URL; import java.net.URLConnection; +import org.connectbot.R; import org.json.JSONObject; import android.app.AlertDialog; @@ -136,15 +137,15 @@ public class UpdateHelper implements Runnable { // build dialog to prompt user about updating new AlertDialog.Builder(context) - .setTitle("New version") + .setTitle(R.string.upgrade) .setMessage(features) - .setPositiveButton("Yes, upgrade", new DialogInterface.OnClickListener() { + .setPositiveButton(R.string.upgrade_pos, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(target)); context.startActivity(intent); } }) - .setNegativeButton("Not right now", null).create().show(); + .setNegativeButton(R.string.upgrade_neg, null).create().show(); } |