Merge pull request #435 from sreeram-boyapati/change_passphrase

Button Text changes to Change Passphrase if Passphrase is set
This commit is contained in:
Dominik Schürmann 2014-03-18 16:30:42 +01:00
commit fe3d6bafc3

View File

@ -370,9 +370,8 @@ public class EditKeyActivity extends ActionBarActivity {
}
mCurrentPassphrase = "";
buildLayout();
mIsPassPhraseSet = PassphraseCacheService.hasPassphrase(this, masterKeyId);
buildLayout();
if (!mIsPassPhraseSet) {
// check "no passphrase" checkbox and remove button
mNoPassphrase.setChecked(true);
@ -427,11 +426,14 @@ public class EditKeyActivity extends ActionBarActivity {
// find views
mChangePassphrase = (BootstrapButton) findViewById(R.id.edit_key_btn_change_passphrase);
mNoPassphrase = (CheckBox) findViewById(R.id.edit_key_no_passphrase);
// Build layout based on given userIds and keys
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LinearLayout container = (LinearLayout) findViewById(R.id.edit_key_container);
if(mIsPassPhraseSet){
mChangePassphrase.setText(getString(R.string.btn_change_passphrase));
}
mUserIdsView = (SectionView) inflater.inflate(R.layout.edit_key_section, container, false);
mUserIdsView.setType(Id.type.user_id);
mUserIdsView.setCanEdit(mMasterCanSign);