disable export if unsaved

This commit is contained in:
Ashley Hughes
2014-02-08 15:35:44 +00:00
parent cd2b493ea8
commit b74ed46434
2 changed files with 7 additions and 2 deletions

View File

@@ -332,8 +332,12 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener
cancelClicked();
return true;
case R.id.menu_key_edit_export_file:
mExportHelper.showExportKeysDialog(mDataUri, Id.type.secret_key, Constants.path.APP_DIR
+ "/secexport.asc");
if (needsSaving()) {
Toast.makeText(this, R.string.error_save_first, Toast.LENGTH_LONG).show();
} else {
mExportHelper.showExportKeysDialog(mDataUri, Id.type.secret_key, Constants.path.APP_DIR
+ "/secexport.asc");
}
return true;
case R.id.menu_key_edit_delete: {
// Message is received after key is deleted