mirror of
https://github.com/deltachat/deltachat-android.git
synced 2025-10-03 17:59:39 +02:00
refine QR reset wording
This commit is contained in:
parent
d17bed02e6
commit
7eaaf3bbb4
5 changed files with 28 additions and 30 deletions
|
@ -113,9 +113,12 @@ public class QrActivity extends BaseActionBarActivity implements View.OnClickLis
|
|||
menu.clear();
|
||||
getMenuInflater().inflate(R.menu.qr_show, menu);
|
||||
menu.findItem(R.id.new_classic_contact).setVisible(!DcHelper.getContext(this).isChatmail());
|
||||
|
||||
Util.redMenuItem(menu, R.id.withdraw);
|
||||
if(tabLayout.getSelectedTabPosition() == TAB_SCAN) {
|
||||
menu.findItem(R.id.withdraw).setVisible(false);
|
||||
}
|
||||
|
||||
return super.onPrepareOptionsMenu(menu);
|
||||
}
|
||||
|
||||
|
|
|
@ -115,35 +115,25 @@ public class QrCodeHandler {
|
|||
break;
|
||||
|
||||
case DcContext.DC_QR_WITHDRAW_VERIFYCONTACT:
|
||||
builder.setMessage(activity.getString(R.string.withdraw_verifycontact_explain));
|
||||
builder.setPositiveButton(R.string.withdraw_qr_code, (dialog, which) -> {
|
||||
case DcContext.DC_QR_WITHDRAW_VERIFYGROUP:
|
||||
String message = qrParsed.getState() == DcContext.DC_QR_WITHDRAW_VERIFYCONTACT ? activity.getString(R.string.withdraw_verifycontact_explain)
|
||||
: activity.getString(R.string.withdraw_verifygroup_explain, qrParsed.getText1());
|
||||
builder.setTitle(R.string.qrshow_title);
|
||||
builder.setMessage(message);
|
||||
builder.setNeutralButton(R.string.reset, (dialog, which) -> {
|
||||
dcContext.setConfigFromQr(rawString);
|
||||
});
|
||||
builder.setNegativeButton(R.string.cancel, null);
|
||||
builder.setPositiveButton(R.string.ok, null);
|
||||
break;
|
||||
|
||||
case DcContext.DC_QR_REVIVE_VERIFYCONTACT:
|
||||
builder.setMessage(activity.getString(R.string.revive_verifycontact_explain));
|
||||
builder.setPositiveButton(R.string.revive_qr_code, (dialog, which) -> {
|
||||
dcContext.setConfigFromQr(rawString);
|
||||
});
|
||||
builder.setNegativeButton(R.string.cancel, null);
|
||||
break;
|
||||
|
||||
case DcContext.DC_QR_WITHDRAW_VERIFYGROUP:
|
||||
builder.setMessage(activity.getString(R.string.withdraw_verifygroup_explain, qrParsed.getText1()));
|
||||
builder.setPositiveButton(R.string.withdraw_qr_code, (dialog, which) -> {
|
||||
dcContext.setConfigFromQr(rawString);
|
||||
});
|
||||
builder.setNegativeButton(R.string.cancel, null);
|
||||
break;
|
||||
|
||||
case DcContext.DC_QR_REVIVE_VERIFYGROUP:
|
||||
builder.setMessage(activity.getString(R.string.revive_verifygroup_explain, qrParsed.getText1()));
|
||||
builder.setPositiveButton(R.string.revive_qr_code, (dialog, which) -> {
|
||||
builder.setTitle(R.string.qrshow_title);
|
||||
builder.setMessage(activity.getString(R.string.revive_verifycontact_explain));
|
||||
builder.setNeutralButton(R.string.revive_qr_code, (dialog, which) -> {
|
||||
dcContext.setConfigFromQr(rawString);
|
||||
});
|
||||
builder.setNegativeButton(R.string.cancel, null);
|
||||
builder.setPositiveButton(R.string.ok, null);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.thoughtcrime.securesms.R;
|
|||
import org.thoughtcrime.securesms.connect.DcEventCenter;
|
||||
import org.thoughtcrime.securesms.connect.DcHelper;
|
||||
import org.thoughtcrime.securesms.util.DynamicTheme;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
|
||||
public class QrShowActivity extends AppCompatActivity {
|
||||
|
||||
|
@ -68,6 +69,7 @@ public class QrShowActivity extends AppCompatActivity {
|
|||
menu.findItem(R.id.new_classic_contact).setVisible(false);
|
||||
menu.findItem(R.id.paste).setVisible(false);
|
||||
menu.findItem(R.id.load_from_image).setVisible(false);
|
||||
Util.redMenuItem(menu, R.id.withdraw);
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
|
|
|
@ -138,15 +138,19 @@ public class QrShowFragment extends Fragment implements DcEventCenter.DcEventDel
|
|||
|
||||
public void withdrawQr() {
|
||||
Activity activity = getActivity();
|
||||
String message = chatId == 0 ? activity.getString(R.string.withdraw_verifycontact_explain)
|
||||
: activity.getString(R.string.withdraw_verifygroup_explain, dcContext.getChat(chatId).getName());
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||
builder.setMessage(activity.getString(R.string.withdraw_verifycontact_explain));
|
||||
builder.setPositiveButton(R.string.withdraw_qr_code, (dialog, which) -> {
|
||||
builder.setTitle(R.string.withdraw_qr_code);
|
||||
builder.setMessage(message);
|
||||
builder.setPositiveButton(R.string.reset, (dialog, which) -> {
|
||||
DcContext dcContext = DcHelper.getContext(activity);
|
||||
dcContext.setConfigFromQr(dcContext.getSecurejoinQr(chatId));
|
||||
activity.finish();
|
||||
});
|
||||
builder.setNegativeButton(R.string.cancel, null);
|
||||
builder.create().show();
|
||||
AlertDialog dialog = builder.show();
|
||||
Util.redPositiveButton(dialog);
|
||||
}
|
||||
|
||||
public void showInviteLinkDialog() {
|
||||
|
|
|
@ -985,12 +985,11 @@
|
|||
<string name="qrscan_contains_text">Scanned QR code text:\n\n%1$s</string>
|
||||
<string name="qrscan_contains_url">Scanned QR code URL:\n\n%1$s</string>
|
||||
<string name="qrscan_fingerprint_label">Fingerprint</string>
|
||||
<string name="withdraw_verifycontact_explain">This QR code can be scanned by others to contact you.\n\nYou can deactivate the QR code here and reactivate it by scanning it again.</string>
|
||||
<string name="withdraw_verifygroup_explain">This QR code can be scanned by others to join the group \"%1$s\".\n\nYou can deactivate the QR code here and reactivate it by scanning it again.</string>
|
||||
<string name="withdraw_qr_code">Deactivate QR Code</string>
|
||||
<!-- "could" in the meaning of "possible at some point in the past, but no longer possible today" -->
|
||||
<string name="revive_verifycontact_explain">This QR code could be scanned by others to contact you.\n\nThe QR code is not active on this device.</string>
|
||||
<!-- "could" in the meaning of "possible at some point in the past, but no longer possible today" -->
|
||||
<string name="withdraw_verifycontact_explain">This QR code can be scanned by others to contact you.\n\nYou can reset it, so that the existing QR code or invite link will no longer work.</string>
|
||||
<string name="withdraw_verifygroup_explain">This QR code can be scanned by others to join the group \"%1$s\".\n\nYou can reset it, so that the existing QR code or invite link will no longer work.</string>
|
||||
<string name="withdraw_qr_code">Reset QR Code</string>
|
||||
<string name="revive_verifycontact_explain">This QR code has been reset and is no longer active.</string>
|
||||
<!-- deprecated, use revive_verifycontact_explain -->
|
||||
<string name="revive_verifygroup_explain">This QR code could be scanned by others to join the group \"%1$s\".\n\nThe QR code is not active on this device.</string>
|
||||
<string name="revive_qr_code">Activate QR Code</string>
|
||||
<string name="qrshow_title">QR Invite Code</string>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue