added restart button to openkeychain dialog

Daniel Gultsch created

Change summary

res/values/strings.xml                                         | 2 
src/eu/siacs/conversations/services/XmppConnectionService.java | 1 
src/eu/siacs/conversations/ui/XmppActivity.java                | 9 +++
3 files changed, 9 insertions(+), 3 deletions(-)

Detailed changes

res/values/strings.xml πŸ”—

@@ -80,7 +80,7 @@
     <string name="send_unencrypted">Send unencrypted</string>
     <string name="decryption_failed">Decrpytion failed. Maybe you don’t have the proper private key.</string>
     <string name="openkeychain_required">OpenKeychain</string>
-    <string name="openkeychain_required_long">Conversations utilizes a third party called <b>OpenKeychain</b> to encrypt and decrypt messages and to mange your public keys.\n\nOpenKeychain is licensed under GPLv3 and available on F-Droid and Google Play.\n\nTo use openPGP please install the app and then restart Conversations.</string>
+    <string name="openkeychain_required_long">Conversations utilizes a third party app called <b>OpenKeychain</b> to encrypt and decrypt messages and to mange your public keys.\n\nOpenKeychain is licensed under GPLv3 and available on F-Droid and Google Play.\n\n<small>(Please restart Conversations afterwards.)</small></string>
     <string name="restart">Restart</string>
     <string name="install">Install</string>
 </resources>

src/eu/siacs/conversations/ui/XmppActivity.java πŸ”—

@@ -95,8 +95,12 @@ public abstract class XmppActivity extends Activity {
 				
 				@Override
 				public void onClick(DialogInterface dialog, int which) {
-					// TODO Auto-generated method stub
-					
+					if (xmppConnectionServiceBound) {
+						unbindService(mConnection);
+						xmppConnectionServiceBound = false;
+					}
+					stopService(new Intent(XmppActivity.this, XmppConnectionService.class));
+					finish();
 				}
 			});
 			builder.setPositiveButton(getString(R.string.install), new OnClickListener() {
@@ -106,6 +110,7 @@ public abstract class XmppActivity extends Activity {
 					Uri uri = Uri.parse("market://details?id=org.sufficientlysecure.keychain");
 					Intent intent = new Intent(Intent.ACTION_VIEW, uri);
 					startActivity(intent);
+					finish();
 				}
 			});
 			builder.create().show();