aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/com/zeapo
diff options
context:
space:
mode:
authorknuthy <knuthy@gmail.com>2014-09-29 22:04:47 +0200
committerknuthy <knuthy@gmail.com>2014-09-29 22:04:47 +0200
commit2fd688bd27431bb60248701f43dbab0fcec4f0c2 (patch)
tree08b26555b1190b8218805824671c483ebcdd2380 /app/src/main/java/com/zeapo
parent2c929441a791889b9fdd2342702118563442ef7d (diff)
show toast on copy and dismiss dialog if error on openkeychain
Diffstat (limited to 'app/src/main/java/com/zeapo')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java12
1 files changed, 12 insertions, 0 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 78902d8a..efeabc3e 100644
--- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java
+++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java
@@ -147,6 +147,9 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB
case R.id.copy_password:
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 "
+ + Integer.parseInt(settings.getString("general_show_time", "45"))
+ + " seconds to paste it somewhere.");
}
return super.onOptionsItemSelected(item);
}
@@ -387,10 +390,19 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB
break;
}
case OpenPgpApi.RESULT_CODE_ERROR: {
+ // TODO show what kind of error it is
+ /* For example:
+ * No suitable key found -> no key in OpenKeyChain
+ *
+ * Check in open-pgp-lib how their definitions and error code
+ */
showToast("ERROR");
OpenPgpError error = result.getParcelableExtra(OpenPgpApi.RESULT_ERROR);
handleError(error);
+
+ // close the dialog
+ bindingDialog.dismiss();
break;
}