commit 76fc2cd01477c15f53f4d025263c2fd62a094e1a Author: Nathan Freitas nathan@freitas.net Date: Mon Nov 14 04:18:33 2011 -0500
more string work, this time on service notifications --- res/values/strings.xml | 5 +++++ src/org/torproject/android/service/TorService.java | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/res/values/strings.xml b/res/values/strings.xml index 0cbd848..30db5d5 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -242,4 +242,9 @@ <string name="privoxy_version">Privoxy v3.0.12: http://www.privoxy.org</string> <string name="iptables_version">Iptables v1.4.7: http://www.netfilter.org</string> <string name="hidden_service_request">An app wants to open hidden server port %S to the Tor network. This is safe if you trust the app.</string> +<string name="found_existing_tor_process">found existing Tor process...</string> +<string name="something_bad_happened">Something bad happened. Check the log</string> +<string name="hidden_service_on">hidden service on:</string> +<string name="unable_to_read_hidden_service_name">unable to read hidden service name</string> +<string name="unable_to_start_tor">Unable to start Tor:</string> </resources> diff --git a/src/org/torproject/android/service/TorService.java b/src/org/torproject/android/service/TorService.java index 1828d8f..25d415b 100644 --- a/src/org/torproject/android/service/TorService.java +++ b/src/org/torproject/android/service/TorService.java @@ -96,7 +96,7 @@ public class TorService extends Service implements TorServiceConstants, TorConst { logNotice("Found existing Tor process"); - sendCallbackLogMessage ("found existing Tor process..."); + sendCallbackLogMessage (getString(R.string.found_existing_tor_process));
try { currentStatus = STATUS_CONNECTING; @@ -281,7 +281,7 @@ public class TorService extends Service implements TorServiceConstants, TorConst { Log.d(TAG, "An error occured stopping Tor",e); logNotice("An error occured stopping Tor: " + e.getMessage()); - sendCallbackStatusMessage("Something bad happened. Check the log"); + sendCallbackStatusMessage(getString(R.string.something_bad_happened));
} } @@ -326,7 +326,7 @@ public class TorService extends Service implements TorServiceConstants, TorConst { try { String onionHostname = Utils.readString(new FileInputStream(file)); - showToolbarNotification("hidden service on: " + onionHostname, NOTIFY_ID, R.drawable.tornotification); + showToolbarNotification(getString(R.string.hidden_service_on) + ' ' + onionHostname, NOTIFY_ID, R.drawable.tornotification); Editor pEdit = prefs.edit(); pEdit.putString("pref_hs_hostname",onionHostname); pEdit.commit(); @@ -334,13 +334,13 @@ public class TorService extends Service implements TorServiceConstants, TorConst } catch (FileNotFoundException e) { logException("unable to read onion hostname file",e); - showToolbarNotification("unable to read hidden service name", NOTIFY_ID, R.drawable.tornotificationerr); + showToolbarNotification(getString(R.string.unable_to_read_hidden_service_name), NOTIFY_ID, R.drawable.tornotificationerr); return; } } else { - showToolbarNotification("unable to read hidden service name", NOTIFY_ID, R.drawable.tornotificationerr); + showToolbarNotification(getString(R.string.unable_to_read_hidden_service_name), NOTIFY_ID, R.drawable.tornotificationerr); } @@ -501,7 +501,7 @@ public class TorService extends Service implements TorServiceConstants, TorConst
} catch (Exception e) { logException("Unable to start Tor: " + e.getMessage(),e); - sendCallbackStatusMessage("Unable to start Tor: " + e.getMessage()); + sendCallbackStatusMessage(getString(R.string.unable_to_start_tor) + ' ' + e.getMessage()); } @@ -889,7 +889,7 @@ public class TorService extends Service implements TorServiceConstants, TorConst if (profile == PROFILE_ON) { currentStatus = STATUS_CONNECTING; - sendCallbackStatusMessage ("starting..."); + sendCallbackStatusMessage (getString(R.string.status_starting_up));
Thread thread = new Thread(this); thread.start(); @@ -898,7 +898,7 @@ public class TorService extends Service implements TorServiceConstants, TorConst else if (profile == PROFILE_OFF) { currentStatus = STATUS_OFF; - sendCallbackStatusMessage ("shutting down..."); + sendCallbackStatusMessage (getString(R.string.status_shutting_down)); _torInstance.stopTor();
tor-commits@lists.torproject.org