diff options
author | Andreas Straub <andy@strb.org> | 2015-07-19 23:35:03 +0200 |
---|---|---|
committer | Andreas Straub <andy@strb.org> | 2015-07-19 23:35:03 +0200 |
commit | 480b1cde810e0ed2afc6ea424fb36fd973ae24b9 (patch) | |
tree | 3811628d5bfac6ac2c0b0c96fb3ebfebbed01531 /src/main/java/eu/siacs | |
parent | 14010bf5a6198e4e53ba3f86328d061cf20b8da1 (diff) |
Add clear devices to overflow menu in EditAccount
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java index 77ca2a679..1f5b76a3c 100644 --- a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java @@ -363,6 +363,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate final MenuItem showBlocklist = menu.findItem(R.id.action_show_block_list); final MenuItem showMoreInfo = menu.findItem(R.id.action_server_info_show_more); final MenuItem changePassword = menu.findItem(R.id.action_change_password_on_server); + final MenuItem clearDevices = menu.findItem(R.id.action_clear_devices); if (mAccount != null && mAccount.isOnlineAndConnected()) { if (!mAccount.getXmppConnection().getFeatures().blocking()) { showBlocklist.setVisible(false); @@ -370,6 +371,10 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate if (!mAccount.getXmppConnection().getFeatures().register()) { changePassword.setVisible(false); } + Set<Integer> otherDevices = mAccount.getAxolotlService().getOwnDeviceIds(); + if (otherDevices == null || otherDevices.isEmpty()) { + clearDevices.setVisible(false); + } } else { showQrCode.setVisible(false); showBlocklist.setVisible(false); @@ -440,6 +445,9 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate changePasswordIntent.putExtra("account", mAccount.getJid().toString()); startActivity(changePasswordIntent); break; + case R.id.action_clear_devices: + showWipePepDialog(); + break; } return super.onOptionsItemSelected(item); } @@ -621,11 +629,11 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate public void showWipePepDialog() { Builder builder = new Builder(this); - builder.setTitle("Wipe PEP"); + builder.setTitle(getString(R.string.clear_other_devices)); builder.setIconAttribute(android.R.attr.alertDialogIcon); - builder.setMessage("Are you sure you want to wipe all other devices from the PEP device ID list?"); + builder.setMessage(getString(R.string.clear_other_devices_desc)); builder.setNegativeButton(getString(R.string.cancel), null); - builder.setPositiveButton("Yes", + builder.setPositiveButton(getString(R.string.accept), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { |