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:
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

View File

@ -286,6 +286,7 @@
<string name="error_nfc_needed">NFC is not available on your device!</string>
<string name="error_nothing_import">Nothing to import!</string>
<string name="error_expiry_must_come_after_creation">expiry date must come after creation date</string>
<string name="error_save_first">please save the keyring first</string>
<!-- progress dialogs, usually ending in '…' -->
<string name="progress_done">done.</string>