Use proper ImportKeysProxyActivity to scan QR Codes

This commit is contained in:
Dominik Schürmann 2016-04-29 23:14:24 +02:00
parent 67607933ad
commit b4af7a06a5
2 changed files with 8 additions and 7 deletions

View file

@ -1,4 +1,6 @@
/*
* Copyright (C) 2016 Dominik Schürmann <dominik@dominikschuermann.de>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@ -20,7 +22,6 @@ import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.ui.base.BaseActivity;
@ -34,15 +35,16 @@ public class RedirectImportKeysActivity extends BaseActivity {
}
private void startQrCodeCaptureActivity() {
final Intent intent = new Intent(this, QrCodeCaptureActivity.class);
final Intent scanQrCode = new Intent(this, ImportKeysProxyActivity.class);
scanQrCode.setAction(ImportKeysProxyActivity.ACTION_QR_CODE_API);
new AlertDialog.Builder(this)
.setTitle(R.string.redirect_import_key_title)
.setMessage(R.string.redirect_import_key_message)
.setPositiveButton(R.string.redirect_import_key_yes, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// intent directly to ImportKeyChain activity
startActivity(intent);
// directly scan with OpenKeychain
startActivity(scanQrCode);
finish();
}
})
@ -52,7 +54,6 @@ public class RedirectImportKeysActivity extends BaseActivity {
finish();
}
})
.setIcon(android.R.drawable.ic_dialog_alert)
.show();
}
}

View file

@ -1752,8 +1752,8 @@
<item>50 EUR</item>
<item>100 EUR</item>
</string-array>
<string name="redirect_import_key_title">"Import key attempt"</string>
<string name="redirect_import_key_message">"You scanned a fingerprint with another app, please scan with Openkeychain directly to be safe"</string>
<string name="redirect_import_key_title">"Scan with OpenKeychain!"</string>
<string name="redirect_import_key_message">"You scanned a OpenPGP QR Code with another app, please scan with Openkeychain directly to be safe."</string>
<string name="redirect_import_key_yes">"Scan again"</string>
<string name="redirect_import_key_no">"Close"</string>
<string name="title_activity_redirect_key">"Key import redirection"</string>