aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain
diff options
context:
space:
mode:
authorAshley Hughes <spirit.returned@gmail.com>2014-04-01 00:37:18 +0100
committerAshley Hughes <spirit.returned@gmail.com>2014-04-01 00:37:18 +0100
commit9283205ea8a0dfb57320ec0387bc9c9f89f03dc2 (patch)
treef2a151f740caff65966d4ed597097923c1f67268 /OpenPGP-Keychain
parent5bc902dbb1834cc07e9f6712d7a43450028ef459 (diff)
downloadopen-keychain-9283205ea8a0dfb57320ec0387bc9c9f89f03dc2.tar.gz
open-keychain-9283205ea8a0dfb57320ec0387bc9c9f89f03dc2.tar.bz2
open-keychain-9283205ea8a0dfb57320ec0387bc9c9f89f03dc2.zip
don't disable save button, show message if nothing needs to be done
Diffstat (limited to 'OpenPGP-Keychain')
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java7
-rw-r--r--OpenPGP-Keychain/src/main/res/values/strings.xml1
2 files changed, 5 insertions, 3 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java
index db0fae9b3..9df84065f 100644
--- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java
+++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java
@@ -42,6 +42,8 @@ import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.LinearLayout;
import android.widget.Toast;
import com.beardedhen.androidbootstrap.BootstrapButton;
+import com.devspark.appmsg.AppMsg;
+
import org.spongycastle.openpgp.PGPSecretKey;
import org.spongycastle.openpgp.PGPSecretKeyRing;
import org.sufficientlysecure.keychain.Constants;
@@ -105,7 +107,6 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener
private boolean mIsPassPhraseSet;
private boolean mNeedsSaving;
private boolean mIsBrandNewKeyring = false;
- private MenuItem mSaveButton;
private BootstrapButton mChangePassphrase;
@@ -323,8 +324,6 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
getMenuInflater().inflate(R.menu.key_edit, menu);
- mSaveButton = 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 = menu.findItem(R.id.menu_key_edit_export_file);
@@ -569,6 +568,8 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener
Toast.makeText(this, getString(R.string.error_message, e.getMessage()),
Toast.LENGTH_SHORT).show();
}
+ } else {
+ AppMsg.makeText(this, R.string.error_change_something_first, AppMsg.STYLE_ALERT).show();
}
}
diff --git a/OpenPGP-Keychain/src/main/res/values/strings.xml b/OpenPGP-Keychain/src/main/res/values/strings.xml
index 5d325d5ec..cbfd0a194 100644
--- a/OpenPGP-Keychain/src/main/res/values/strings.xml
+++ b/OpenPGP-Keychain/src/main/res/values/strings.xml
@@ -327,6 +327,7 @@
<item quantity="one">part of the loaded file is a valid OpenPGP object but not a OpenPGP key</item>
<item quantity="other">parts of the loaded file are valid OpenPGP objects but not OpenPGP keys</item>
</plurals>
+ <string name="error_change_something_first">You must make changes to the keyring before you can save it</string>
<!-- progress dialogs, usually ending in '…' -->
<string name="progress_done">Done.</string>