mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-15 05:15:03 -05:00
Simplify delete key dialog
This commit is contained in:
parent
8230fb1179
commit
b90335f901
@ -184,7 +184,6 @@ public class ViewKeyActivity extends BaseActivity implements
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Prepare the loaders. Either re-connect with an existing ones,
|
||||
// or start new ones.
|
||||
getSupportLoaderManager().initLoader(LOADER_ID_UNIFIED, null, this);
|
||||
@ -447,7 +446,6 @@ public class ViewKeyActivity extends BaseActivity implements
|
||||
startActivityForResult(safeSlingerIntent, 0);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load QR Code asynchronously and with a fade in animation
|
||||
*
|
||||
|
@ -33,6 +33,7 @@ import android.widget.TextView;
|
||||
|
||||
import org.sufficientlysecure.keychain.Constants;
|
||||
import org.sufficientlysecure.keychain.R;
|
||||
import org.sufficientlysecure.keychain.pgp.KeyRing;
|
||||
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
|
||||
import org.sufficientlysecure.keychain.provider.ProviderHelper;
|
||||
import org.sufficientlysecure.keychain.service.KeychainIntentService;
|
||||
@ -100,14 +101,20 @@ public class DeleteKeyDialogFragment extends DialogFragment {
|
||||
ProviderHelper.FIELD_TYPE_INTEGER
|
||||
}
|
||||
);
|
||||
String userId = (String) data.get(KeyRings.USER_ID);
|
||||
String name;
|
||||
String[] mainUserId = KeyRing.splitUserId((String) data.get(KeyRings.USER_ID));
|
||||
if (mainUserId[0] != null) {
|
||||
name = mainUserId[0];
|
||||
} else {
|
||||
name = getString(R.string.user_id_no_name);
|
||||
}
|
||||
hasSecret = ((Long) data.get(KeyRings.HAS_ANY_SECRET)) == 1;
|
||||
|
||||
// Set message depending on which key it is.
|
||||
mMainMessage.setText(getString(
|
||||
hasSecret ? R.string.secret_key_deletion_confirmation
|
||||
: R.string.public_key_deletetion_confirmation,
|
||||
userId
|
||||
name
|
||||
));
|
||||
} catch (ProviderHelper.NotFoundException e) {
|
||||
dismiss();
|
||||
|
Loading…
Reference in New Issue
Block a user