summaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorAdam Smith <adam.smith18@ntlworld.com>2014-10-31 13:54:38 +0000
committerAdam Smith <adam.smith18@ntlworld.com>2014-10-31 13:54:38 +0000
commit73bf555ba0e46e9b4542002542eec7eada30bbb1 (patch)
treeabf1700c4e3bc7d62d7f5fbd56c27b16c2f56f7e /app/src
parentd5e4ddc939abfea29852558a8a85409fef9eaf5a (diff)
PGPHandler Strings replaced
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java22
-rw-r--r--app/src/main/res/values/strings.xml11
2 files changed, 22 insertions, 11 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java
index f2908ebd..850070fd 100644
--- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java
+++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java
@@ -91,7 +91,7 @@ public class PgpHandler extends ActionBarActivity implements OpenPgpServiceConne
registered = false;
if (TextUtils.isEmpty(providerPackageName)) {
- Toast.makeText(this, "No OpenPGP Provider selected!", Toast.LENGTH_LONG).show();
+ Toast.makeText(this, this.getResources().getString(R.string.provider_toast_text), Toast.LENGTH_LONG).show();
Intent intent = new Intent(this, UserPreference.class);
startActivity(intent);
// a small hack to avoid eternal loop later, have to be solved via a startactivityforresult()
@@ -106,7 +106,7 @@ public class PgpHandler extends ActionBarActivity implements OpenPgpServiceConne
mServiceConnection.bindToService();
bindingDialog = new ProgressDialog(this);
- bindingDialog.setMessage("Waiting for OpenKeychain...");
+ bindingDialog.setMessage(this.getResources().getString(R.string.okc_progress_text));
bindingDialog.setCancelable(false);
bindingDialog.show();
@@ -153,9 +153,9 @@ public class PgpHandler extends ActionBarActivity implements OpenPgpServiceConne
public void copyToClipBoard() {
ClipData clip = ClipData.newPlainText("pgp_handler_result_pm", ((TextView) findViewById(R.id.crypto_password_show)).getText());
clipboard.setPrimaryClip(clip);
- showToast("Password copied to clipboard, you have "
+ showToast(this.getResources().getString(R.string.clipboard_beginning_toast_text)
+ Integer.parseInt(settings.getString("general_show_time", "45"))
- + " seconds to paste it somewhere.");
+ + this.getResources().getString(R.string.clipboard_ending_toast_text));
}
public void handleClick(View view) {
@@ -424,7 +424,7 @@ public class PgpHandler extends ActionBarActivity implements OpenPgpServiceConne
public void getKeyIds(Intent data) {
accountName = settings.getString("openpgp_account_name", "");
if (accountName.isEmpty())
- showToast("Please set your account name in settings whenever you can");
+ showToast(this.getResources().getString(R.string.name_settings_toast_text));
data.setAction(OpenPgpApi.ACTION_GET_KEY_IDS);
data.putExtra(OpenPgpApi.EXTRA_USER_IDS, new String[]{accountName.isEmpty() ? "default" : accountName});
@@ -456,9 +456,9 @@ public class PgpHandler extends ActionBarActivity implements OpenPgpServiceConne
if (accountName.isEmpty()) {
new AlertDialog.Builder(this)
- .setMessage("Please set your OpenKeychain account (email) in the preferences")
- .setTitle("Account name empty!")
- .setPositiveButton("OK", new DialogInterface.OnClickListener() {
+ .setMessage(this.getResources().getString(R.string.account_settings_dialog_text))
+ .setTitle(this.getResources().getString(R.string.account_settings_dialog_title))
+ .setPositiveButton(this.getResources().getString(R.string.dialog_ok), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
try {
@@ -469,7 +469,7 @@ public class PgpHandler extends ActionBarActivity implements OpenPgpServiceConne
e.printStackTrace();
}
}
- }).setNegativeButton("No thanks", new DialogInterface.OnClickListener() {
+ }).setNegativeButton(this.getResources().getString(R.string.dialog_no), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
// Do nothing...
@@ -486,12 +486,12 @@ public class PgpHandler extends ActionBarActivity implements OpenPgpServiceConne
String extra = ((EditText) findViewById(R.id.crypto_extra_edit)).getText().toString();
if (name.isEmpty()) {
- showToast("Please provide a file name");
+ showToast(this.getResources().getString(R.string.file_toast_text));
return;
}
if (pass.isEmpty() && extra.isEmpty()) {
- showToast("You cannot use an empty password or empty extra content");
+ showToast(this.getResources().getString(R.string.empty_toast_text));
return;
}
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 7fc3cbac..bf3460b1 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -26,6 +26,17 @@
<string name="add_commit_text">[ANDROID PwdStore] Add </string>
<string name="remove_commit_text">[ANDROID PwdStore] Remove </string>
<string name="from_store"> from store.</string>
+
+ <!-- PGPHandler -->
+ <string name="provider_toast_text">No OpenPGP Provider selected!</string>
+ <string name="okc_progress_text">Waiting for OpenKeychain...</string>
+ <string name="clipboard_beginning_toast_text">Password copied to clipboard, you have </string>
+ <string name="clipboard_ending_toast_text"> seconds to paste it somewhere.</string>
+ <string name="name_settings_toast_text">Please set your account name in settings whenever you can</string>
+ <string name="account_settings_dialog_text">Please set your OpenKeychain account (email) in the preferences</string>
+ <string name="account_settings_dialog_title">Account name empty!</string>
+ <string name="file_toast_text">Please provide a file name</string>
+ <string name="empty_toast_text">You cannot use an empty password or empty extra content</string>
<!-- Clone fragment -->
<string name="clone_fragment_text">Welcome to Password Store\n\n In this screen you can either create a new repository or clone your git repository onto your device.</string>