mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-24 02:12:15 -05:00
Merge branch 'issue3508'
This commit is contained in:
commit
7eccc1701d
@ -1525,7 +1525,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
|
|
||||||
private void saveIfNeeded() {
|
private void saveIfNeeded() {
|
||||||
if (!mDraftNeedsSaving || mPreventDraftSaving || mPgpData.hasEncryptionKeys() ||
|
if (!mDraftNeedsSaving || mPreventDraftSaving || mPgpData.hasEncryptionKeys() ||
|
||||||
mEncryptCheckbox.isChecked()) {
|
mEncryptCheckbox.isChecked() || isDraftsFolderDisabled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2009,6 +2009,11 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
super.onCreateOptionsMenu(menu);
|
super.onCreateOptionsMenu(menu);
|
||||||
getMenuInflater().inflate(R.menu.message_compose_option, menu);
|
getMenuInflater().inflate(R.menu.message_compose_option, menu);
|
||||||
|
|
||||||
|
// Disable the 'Save' menu option if Drafts folder is set to -NONE-
|
||||||
|
if (isDraftsFolderDisabled()) {
|
||||||
|
menu.findItem(R.id.save).setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Show the menu items "Add attachment (Image)" and "Add attachment (Video)"
|
* Show the menu items "Add attachment (Image)" and "Add attachment (Video)"
|
||||||
* if the work-around for the Gallery bug is enabled (see Issue 1186).
|
* if the work-around for the Gallery bug is enabled (see Issue 1186).
|
||||||
@ -2034,14 +2039,18 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
if (mEncryptCheckbox.isChecked()) {
|
if (mEncryptCheckbox.isChecked()) {
|
||||||
showDialog(DIALOG_REFUSE_TO_SAVE_DRAFT_MARKED_ENCRYPTED);
|
showDialog(DIALOG_REFUSE_TO_SAVE_DRAFT_MARKED_ENCRYPTED);
|
||||||
}
|
} else if (!mDraftNeedsSaving || isDraftsFolderDisabled()) {
|
||||||
else if (mDraftNeedsSaving) {
|
Toast.makeText(MessageCompose.this, getString(R.string.message_discarded_toast), Toast.LENGTH_LONG).show();
|
||||||
showDialog(DIALOG_SAVE_OR_DISCARD_DRAFT_MESSAGE);
|
|
||||||
} else {
|
|
||||||
super.onBackPressed();
|
super.onBackPressed();
|
||||||
|
} else {
|
||||||
|
showDialog(DIALOG_SAVE_OR_DISCARD_DRAFT_MESSAGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isDraftsFolderDisabled() {
|
||||||
|
return mAccount.getDraftsFolderName().equals(K9.FOLDER_NONE);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Dialog onCreateDialog(int id) {
|
public Dialog onCreateDialog(int id) {
|
||||||
switch (id) {
|
switch (id) {
|
||||||
|
Loading…
Reference in New Issue
Block a user