aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResultParcel.java
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2014-07-27 01:22:10 +0200
committerVincent Breitmoser <valodim@mugenguild.com>2014-07-27 01:22:10 +0200
commitf4ee71e3ef0dcacf691def97a94880b277a99496 (patch)
tree20cf9e8252a8efab967322db9f5809b5c1a3b00f /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResultParcel.java
parenta8782272b3db20ba6e88acab1d035d4699aa7166 (diff)
downloadopen-keychain-f4ee71e3ef0dcacf691def97a94880b277a99496.tar.gz
open-keychain-f4ee71e3ef0dcacf691def97a94880b277a99496.tar.bz2
open-keychain-f4ee71e3ef0dcacf691def97a94880b277a99496.zip
introduce EditKeyResult with transient UncachedKeyRing (half-baked!)
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResultParcel.java')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResultParcel.java31
1 files changed, 28 insertions, 3 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResultParcel.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResultParcel.java
index 2c6c29f8d..99cafd3f9 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResultParcel.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/OperationResultParcel.java
@@ -144,20 +144,45 @@ public class OperationResultParcel implements Parcelable {
color = Style.GREEN;
}
- str = activity.getString(R.string.import_error);
+ str = "operation succeeded!";
+ // str = activity.getString(R.string.import_error);
} else {
+
duration = 0;
color = Style.RED;
- str = activity.getString(R.string.import_error);
+
+ str = "operation failed";
+ // str = activity.getString(R.string.import_error);
+
}
+ boolean button = getLog() != null && !getLog().isEmpty();
SuperCardToast toast = new SuperCardToast(activity,
- SuperToast.Type.STANDARD, Style.getStyle(color, SuperToast.Animations.POPUP));
+ button ? SuperToast.Type.BUTTON : SuperToast.Type.STANDARD,
+ Style.getStyle(color, SuperToast.Animations.POPUP));
toast.setText(str);
toast.setDuration(duration);
toast.setIndeterminate(duration == 0);
toast.setSwipeToDismiss(true);
+ // If we have a log and it's non-empty, show a View Log button
+ if (button) {
+ toast.setButtonIcon(R.drawable.ic_action_view_as_list,
+ activity.getResources().getString(R.string.view_log));
+ toast.setButtonTextColor(activity.getResources().getColor(R.color.black));
+ toast.setTextColor(activity.getResources().getColor(R.color.black));
+ toast.setOnClickWrapper(new OnClickWrapper("supercardtoast",
+ new SuperToast.OnClickListener() {
+ @Override
+ public void onClick(View view, Parcelable token) {
+ Intent intent = new Intent(
+ activity, LogDisplayActivity.class);
+ intent.putExtra(LogDisplayFragment.EXTRA_RESULT, OperationResultParcel.this);
+ activity.startActivity(intent);
+ }
+ }
+ ));
+ }
return toast;