mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-24 01:32:16 -05:00
consistent ui
This commit is contained in:
parent
5def251e62
commit
33f41e66a0
@ -306,22 +306,19 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPrepareOptionsMenu(Menu menu) {
|
||||
// show menu only on edit
|
||||
if (mDataUri != null) {
|
||||
return super.onPrepareOptionsMenu(menu);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
super.onCreateOptionsMenu(menu);
|
||||
getMenuInflater().inflate(R.menu.key_edit, menu);
|
||||
mSaveButton = (MenuItem) menu.findItem(R.id.menu_key_edit_save);
|
||||
mSaveButton.setEnabled(needsSaving());
|
||||
//totally get rid of some actions for new keys
|
||||
if (mDataUri == null) {
|
||||
MenuItem mButton = (MenuItem) menu.findItem(R.id.menu_key_edit_export_file);
|
||||
mButton.setVisible(false);
|
||||
mButton = (MenuItem) menu.findItem(R.id.menu_key_edit_delete);
|
||||
mButton.setVisible(false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user