Disallow name change when editing password

This commit is contained in:
Matthew Wong
2015-08-26 03:49:36 -04:00
parent 540349542b
commit c54d28af8a

View File

@@ -160,16 +160,20 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne
((EditText) findViewById(R.id.crypto_extra_edit)).setTypeface(monoTypeface);
((TextView) findViewById(R.id.crypto_password_category)).setText(category);
((TextView) findViewById(R.id.crypto_password_file_edit)).setText(file);
((EditText) findViewById(R.id.crypto_password_file_edit)).setText(file);
((EditText) findViewById(R.id.crypto_password_edit)).setText(password);
((EditText) findViewById(R.id.crypto_extra_edit)).setText(extra);
// strictly editing only i.e. can't save this password's info to another file by changing name
findViewById(R.id.crypto_password_file_edit).setEnabled(false);
// the original intent was to decrypt so FILE_PATH will have the file, not enclosing dir
// PgpCallback expects the dir when encrypting
String filePath = getIntent().getExtras().getString("FILE_PATH");
String directoryPath = filePath.substring(0, filePath.lastIndexOf(File.separator));
Intent intent = new Intent(this, PgpHandler.class);
intent.putExtra("FILE_PATH", directoryPath);
intent.putExtra("Operation", "ENCRYPT");
setIntent(intent);
}