aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/values/arrays.xml33
-rw-r--r--res/xml/host_prefs.xml2
-rw-r--r--res/xml/preferences.xml24
-rw-r--r--src/org/connectbot/ConsoleActivity.java10
-rw-r--r--src/org/connectbot/service/TerminalBridge.java9
-rw-r--r--src/org/connectbot/util/UpdateHelper.java7
6 files changed, 57 insertions, 28 deletions
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 5893a0e..1cf14fa 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -17,6 +17,13 @@
<item>@string/list_rotation_auto</item>
</string-array>
+ <string-array name="list_rotation_values">
+ <item>default</item>
+ <item>landscape</item>
+ <item>portrait</item>
+ <item>automatic</item>
+ </string-array>
+
<string-array name="list_camera">
<item>@string/list_camera_ctrlaspace</item>
<item>@string/list_camera_ctrla</item>
@@ -24,6 +31,13 @@
<item>@string/list_camera_none</item>
</string-array>
+ <string-array name="list_camera_values">
+ <item>ctrl+a space</item>
+ <item>ctrl+a</item>
+ <item>esc</item>
+ <item>none</item>
+ </string-array>
+
<string-array name="list_colors">
<item>@string/color_red</item>
<item>@string/color_green</item>
@@ -31,18 +45,37 @@
<item>@string/color_gray</item>
</string-array>
+ <string-array name="list_color_values">
+ <item>red</item>
+ <item>green</item>
+ <item>blue</item>
+ <item>gray</item>
+ </string-array>
+
<string-array name="list_update">
<item>@string/list_update_daily</item>
<item>@string/list_update_weekly</item>
<item>@string/list_update_never</item>
</string-array>
+ <string-array name="list_update_values">
+ <item>daily</item>
+ <item>weekly</item>
+ <item>never</item>
+ </string-array>
+
<string-array name="list_keymode">
<item>@string/list_keymode_right</item>
<item>@string/list_keymode_left</item>
<item>@string/list_keymode_none</item>
</string-array>
+ <string-array name="list_keymode_values">
+ <item>Use right-side keys</item>
+ <item>Use left-side keys</item>
+ <item>none</item>
+ </string-array>
+
<string-array name="list_pubkeyids">
<item>@string/list_pubkeyids_none</item>
<item>@string/list_pubkeyids_any</item>
diff --git a/res/xml/host_prefs.xml b/res/xml/host_prefs.xml
index 8060e8a..d57f2ef 100644
--- a/res/xml/host_prefs.xml
+++ b/res/xml/host_prefs.xml
@@ -28,7 +28,7 @@
android:key="color"
android:title="@string/hostpref_color_title"
android:entries="@array/list_colors"
- android:entryValues="@array/list_colors"
+ android:entryValues="@array/list_color_values"
/>
<!--
<CheckBoxPreference
diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml
index ef384f1..5836d33 100644
--- a/res/xml/preferences.xml
+++ b/res/xml/preferences.xml
@@ -30,8 +30,8 @@
android:title="@string/pref_update_title"
android:summary="@string/pref_update_summary"
android:entries="@array/list_update"
- android:entryValues="@array/list_update"
- android:defaultValue="@string/list_update_daily"
+ android:entryValues="@array/list_update_values"
+ android:defaultValue="Daily"
/>
<PreferenceCategory
@@ -42,8 +42,8 @@
android:title="@string/pref_emulation_title"
android:summary="@string/pref_emulation_summary"
android:entries="@array/list_emulation_modes"
- android:defaultValue="screen"
android:entryValues="@array/list_emulation_modes"
+ android:defaultValue="screen"
/>
<EditTextPreference
@@ -64,8 +64,8 @@
android:title="@string/pref_rotation_title"
android:summary="@string/pref_rotation_summary"
android:entries="@array/list_rotation"
- android:entryValues="@array/list_rotation"
- android:defaultValue="@string/list_rotation_land"
+ android:entryValues="@array/list_rotation_values"
+ android:defaultValue="Default"
/>
<CheckBoxPreference
@@ -74,23 +74,23 @@
android:summary="@string/pref_fullscreen_summary"
android:defaultValue="false"
/>
-
+
<ListPreference
android:key="keymode"
android:title="@string/pref_keymode_title"
android:summary="@string/pref_keymode_summary"
android:entries="@array/list_keymode"
- android:entryValues="@array/list_keymode"
- android:defaultValue="@string/list_keymode_right"
+ android:entryValues="@array/list_keymode_values"
+ android:defaultValue="Use right-side keys"
/>
-
+
<ListPreference
android:key="camera"
android:title="@string/pref_camera_title"
android:summary="@string/pref_camera_summary"
android:entries="@array/list_camera"
- android:entryValues="@array/list_camera"
- android:defaultValue="@string/list_camera_ctrlaspace"
+ android:entryValues="@array/list_camera_values"
+ android:defaultValue="Ctrl+A then Space"
/>
<CheckBoxPreference
@@ -99,7 +99,7 @@
android:summary="@string/pref_keepalive_summary"
android:defaultValue="true"
/>
-
+
<CheckBoxPreference
android:key="wifilock"
android:title="@string/pref_wifilock_title"
diff --git a/src/org/connectbot/ConsoleActivity.java b/src/org/connectbot/ConsoleActivity.java
index dcd2488..9f13a36 100644
--- a/src/org/connectbot/ConsoleActivity.java
+++ b/src/org/connectbot/ConsoleActivity.java
@@ -307,18 +307,18 @@ public class ConsoleActivity extends Activity {
String rotateDefault;
if (Resources.getSystem().getConfiguration().keyboard == Configuration.KEYBOARD_NOKEYS)
- rotateDefault = getString(R.string.list_rotation_port);
+ rotateDefault = "Force portrait";
else
- rotateDefault = getString(R.string.list_rotation_land);
+ rotateDefault = "Force landscape";
String rotate = prefs.getString(getString(R.string.pref_rotation), rotateDefault);
- if (getString(R.string.list_rotation_default).equals(rotate))
+ if ("Default".equals(rotate))
rotate = rotateDefault;
// request a forced orientation if requested by user
- if (getString(R.string.list_rotation_land).equals(rotate))
+ if ("Force landscape".equals(rotate))
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
- else if (getString(R.string.list_rotation_port).equals(rotate))
+ else if ("Force portrait".equals(rotate))
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
// TODO find proper way to disable volume key beep if it exists.
diff --git a/src/org/connectbot/service/TerminalBridge.java b/src/org/connectbot/service/TerminalBridge.java
index e0d48a7..4a023c1 100644
--- a/src/org/connectbot/service/TerminalBridge.java
+++ b/src/org/connectbot/service/TerminalBridge.java
@@ -1064,16 +1064,13 @@ public class TerminalBridge implements VDUDisplay, OnKeyListener, InteractiveCal
// check to see which shortcut the camera button triggers
String camera = manager.prefs.getString(manager.res.getString(R.string.pref_camera), manager.res.getString(R.string.list_camera_ctrlaspace));
- if(manager.res.getString(R.string.list_camera_ctrlaspace).equals(camera)) {
+ if("Ctrl+A then Space".equals(camera)) {
stdin.write(0x01);
stdin.write(' ');
-
- } else if(manager.res.getString(R.string.list_camera_ctrla).equals(camera)) {
+ } else if("Ctrl+A".equals(camera)) {
stdin.write(0x01);
-
- } else if(manager.res.getString(R.string.list_camera_esc).equals(camera)) {
+ } else if("Esc".equals(camera)) {
((vt320)buffer).keyTyped(vt320.KEY_ESCAPE, ' ', 0);
-
}
break;
diff --git a/src/org/connectbot/util/UpdateHelper.java b/src/org/connectbot/util/UpdateHelper.java
index 733bcde..33d0322 100644
--- a/src/org/connectbot/util/UpdateHelper.java
+++ b/src/org/connectbot/util/UpdateHelper.java
@@ -94,22 +94,21 @@ public final class UpdateHelper implements Runnable {
} catch(Exception e) {
Log.e(TAG, "Couldn't find package information in PackageManager", e);
return;
-
}
// decide if we really need to check for update
Resources res = context.getResources();
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
- String frequency = prefs.getString(res.getString(R.string.pref_update), res.getString(R.string.list_update_daily));
+ String frequency = prefs.getString(res.getString(R.string.pref_update), "Daily");
long lastChecked = prefs.getLong(res.getString(R.string.pref_lastchecked), 0);
long now = (System.currentTimeMillis() / 1000);
long passed = now - lastChecked;
boolean shouldCheck = false;
- if(frequency.equals(res.getString(R.string.list_update_daily))) {
+ if ("Daily".equals(frequency)) {
shouldCheck = (passed > 60 * 60 * 24);
- } else if(frequency.equals(res.getString(R.string.list_update_weekly))) {
+ } else if ("Weekly".equals(frequency)) {
shouldCheck = (passed > 60 * 60 * 24 * 7);
}