mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-23 18:02:15 -05:00
Option to have confirmation on deleting starred messages.
This commit is contained in:
parent
ab46209b53
commit
3ffb5021e1
@ -342,6 +342,7 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin
|
||||
<string name="global_settings_confirm_actions_summary">Show a dialog whenever you perform selected actions</string>
|
||||
<string name="global_settings_confirm_action_archive">Archive</string>
|
||||
<string name="global_settings_confirm_action_delete">Delete (message view only)</string>
|
||||
<string name="global_settings_confirm_action_delete_starred">Delete Starred (message view only)</string>
|
||||
<string name="global_settings_confirm_action_spam">Spam</string>
|
||||
<string name="global_settings_confirm_action_mark_all_as_read">Mark all as read</string>
|
||||
<string name="global_settings_confirm_action_send">Send</string>
|
||||
|
@ -153,6 +153,7 @@ public class K9 extends Application {
|
||||
private static boolean mAnimations = true;
|
||||
|
||||
private static boolean mConfirmDelete = false;
|
||||
private static boolean mConfirmDeleteStarred = false;
|
||||
private static boolean mConfirmSpam = false;
|
||||
private static boolean mConfirmMarkAllAsRead = true;
|
||||
private static boolean mKeyguardPrivacy = false;
|
||||
@ -443,6 +444,7 @@ public class K9 extends Application {
|
||||
editor.putBoolean("useGalleryBugWorkaround", useGalleryBugWorkaround);
|
||||
|
||||
editor.putBoolean("confirmDelete", mConfirmDelete);
|
||||
editor.putBoolean("confirmDeleteStarred", mConfirmDeleteStarred);
|
||||
editor.putBoolean("confirmSpam", mConfirmSpam);
|
||||
editor.putBoolean("confirmMarkAllAsRead", mConfirmMarkAllAsRead);
|
||||
|
||||
@ -571,6 +573,7 @@ public class K9 extends Application {
|
||||
useGalleryBugWorkaround = sprefs.getBoolean("useGalleryBugWorkaround", K9.isGalleryBuggy());
|
||||
|
||||
mConfirmDelete = sprefs.getBoolean("confirmDelete", false);
|
||||
mConfirmDeleteStarred = sprefs.getBoolean("confirmDeleteStarred", false);
|
||||
mConfirmSpam = sprefs.getBoolean("confirmSpam", false);
|
||||
mConfirmMarkAllAsRead = sprefs.getBoolean("confirmMarkAllAsRead", true);
|
||||
|
||||
@ -951,6 +954,14 @@ public class K9 extends Application {
|
||||
mConfirmDelete = confirm;
|
||||
}
|
||||
|
||||
public static boolean confirmDeleteStarred() {
|
||||
return mConfirmDeleteStarred;
|
||||
}
|
||||
|
||||
public static void setConfirmDeleteStarred(final boolean confirm) {
|
||||
mConfirmDeleteStarred = confirm;
|
||||
}
|
||||
|
||||
public static boolean confirmSpam() {
|
||||
return mConfirmSpam;
|
||||
}
|
||||
|
@ -649,7 +649,7 @@ public class MessageView extends K9Activity implements OnClickListener {
|
||||
* Called from UI thread when user select Delete
|
||||
*/
|
||||
private void onDelete() {
|
||||
if (K9.confirmDelete()) {
|
||||
if (K9.confirmDelete() || (K9.confirmDeleteStarred() && mMessage.isSet(Flag.FLAGGED))) {
|
||||
showDialog(R.id.dialog_confirm_delete);
|
||||
} else {
|
||||
delete();
|
||||
|
@ -193,11 +193,13 @@ public class Prefs extends K9PreferenceActivity {
|
||||
mConfirmActions = (CheckBoxListPreference) findPreference(PREFERENCE_CONFIRM_ACTIONS);
|
||||
mConfirmActions.setItems(new CharSequence[] {
|
||||
getString(R.string.global_settings_confirm_action_delete),
|
||||
getString(R.string.global_settings_confirm_action_delete_starred),
|
||||
getString(R.string.global_settings_confirm_action_spam),
|
||||
getString(R.string.global_settings_confirm_action_mark_all_as_read)
|
||||
});
|
||||
mConfirmActions.setCheckedItems(new boolean[] {
|
||||
K9.confirmDelete(),
|
||||
K9.confirmDeleteStarred(),
|
||||
K9.confirmSpam(),
|
||||
K9.confirmMarkAllAsRead()
|
||||
});
|
||||
@ -356,8 +358,9 @@ public class Prefs extends K9PreferenceActivity {
|
||||
K9.setManageBack(mManageBack.isChecked());
|
||||
K9.setStartIntegratedInbox(!mHideSpecialAccounts.isChecked() && mStartIntegratedInbox.isChecked());
|
||||
K9.setConfirmDelete(mConfirmActions.getCheckedItems()[0]);
|
||||
K9.setConfirmSpam(mConfirmActions.getCheckedItems()[1]);
|
||||
K9.setConfirmMarkAllAsRead(mConfirmActions.getCheckedItems()[2]);
|
||||
K9.setConfirmDeleteStarred(mConfirmActions.getCheckedItems()[1]);
|
||||
K9.setConfirmSpam(mConfirmActions.getCheckedItems()[2]);
|
||||
K9.setConfirmMarkAllAsRead(mConfirmActions.getCheckedItems()[3]);
|
||||
K9.setKeyguardPrivacy(mPrivacyMode.isChecked());
|
||||
K9.setMeasureAccounts(mMeasureAccounts.isChecked());
|
||||
K9.setCountSearchMessages(mCountSearch.isChecked());
|
||||
|
@ -29,6 +29,7 @@ public class GlobalSettings {
|
||||
s.put("changeRegisteredNameColor", new BooleanSetting(false));
|
||||
s.put("compactLayouts", new BooleanSetting(false));
|
||||
s.put("confirmDelete", new BooleanSetting(false));
|
||||
s.put("confirmDeleteStarred", new BooleanSetting(false)); // added to version 2
|
||||
s.put("confirmMarkAllAsRead", new BooleanSetting(false));
|
||||
s.put("confirmSpam", new BooleanSetting(false));
|
||||
s.put("countSearchMessages", new BooleanSetting(false));
|
||||
|
Loading…
Reference in New Issue
Block a user