diff options
author | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-05-02 12:02:18 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-05-02 12:02:18 +0200 |
commit | 82bccedf7001d08c6ee93dc713a94434ed2f7ab4 (patch) | |
tree | 671416408d53ec99c106af096d5250ef13b65927 /src/eu | |
parent | 37c8e157d0030c478ea00fbc407c8365b400af1a (diff) |
nicer dialog screen if openkeychain is not installed
Diffstat (limited to '')
-rw-r--r-- | src/eu/siacs/conversations/ui/ConversationFragment.java | 2 | ||||
-rw-r--r-- | src/eu/siacs/conversations/ui/XmppActivity.java | 25 |
2 files changed, 24 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/ui/ConversationFragment.java b/src/eu/siacs/conversations/ui/ConversationFragment.java index e7a5ccf8..c2373cf1 100644 --- a/src/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/eu/siacs/conversations/ui/ConversationFragment.java @@ -271,7 +271,7 @@ public class ConversationFragment extends Fragment { if (item.getType() == Message.TYPE_IMAGE) { String[] fileParams = item.getBody().split(","); - if (fileParams.length>=1) { + if ((fileParams.length>=1)&&(item.getStatus() != Message.STATUS_PREPARING)) { long size = Long.parseLong(fileParams[0]); filesize = size/1024+" KB \u00B7 "; } diff --git a/src/eu/siacs/conversations/ui/XmppActivity.java b/src/eu/siacs/conversations/ui/XmppActivity.java index 4d15addb..1f9c678a 100644 --- a/src/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/eu/siacs/conversations/ui/XmppActivity.java @@ -10,8 +10,11 @@ import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.content.ComponentName; import android.content.Context; +import android.content.DialogInterface; +import android.content.DialogInterface.OnClickListener; import android.content.Intent; import android.content.ServiceConnection; +import android.net.Uri; import android.os.Bundle; import android.os.IBinder; import android.view.MenuItem; @@ -84,9 +87,27 @@ public abstract class XmppActivity extends Activity { return true; } else { Builder builder = new AlertDialog.Builder(this); - builder.setTitle("OpenKeychain not found"); + builder.setTitle(getString(R.string.openkeychain_required)); builder.setIconAttribute(android.R.attr.alertDialogIcon); - builder.setMessage("Please make sure you have installed OpenKeychain"); + builder.setMessage(getText(R.string.openkeychain_required_long)); + builder.setNegativeButton(getString(R.string.cancel), null); + builder.setNeutralButton(getString(R.string.restart), new OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, int which) { + // TODO Auto-generated method stub + + } + }); + builder.setPositiveButton(getString(R.string.install), new OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, int which) { + Uri uri = Uri.parse("market://details?id=org.sufficientlysecure.keychain"); + Intent intent = new Intent(Intent.ACTION_VIEW, uri); + startActivity(intent); + } + }); builder.create().show(); return false; } |