diff --git a/res/values/strings.xml b/res/values/strings.xml
index 1361e3aaf..3cc393c03 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -342,6 +342,7 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin
Show a dialog whenever you perform selected actions
Archive
Delete (message view only)
+ Delete Starred (message view only)
Spam
Mark all as read
Send
diff --git a/src/com/fsck/k9/K9.java b/src/com/fsck/k9/K9.java
index 6b8212295..6c88024b0 100644
--- a/src/com/fsck/k9/K9.java
+++ b/src/com/fsck/k9/K9.java
@@ -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;
}
diff --git a/src/com/fsck/k9/activity/MessageView.java b/src/com/fsck/k9/activity/MessageView.java
index f969b9d55..8625d3e00 100644
--- a/src/com/fsck/k9/activity/MessageView.java
+++ b/src/com/fsck/k9/activity/MessageView.java
@@ -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();
diff --git a/src/com/fsck/k9/activity/setup/Prefs.java b/src/com/fsck/k9/activity/setup/Prefs.java
index 86baa13fd..38c2d9396 100644
--- a/src/com/fsck/k9/activity/setup/Prefs.java
+++ b/src/com/fsck/k9/activity/setup/Prefs.java
@@ -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());
diff --git a/src/com/fsck/k9/preferences/AccountSettings.java b/src/com/fsck/k9/preferences/AccountSettings.java
index 07e3a9164..167d9c914 100644
--- a/src/com/fsck/k9/preferences/AccountSettings.java
+++ b/src/com/fsck/k9/preferences/AccountSettings.java
@@ -55,7 +55,7 @@ public class AccountSettings {
R.array.account_settings_message_age_values));
s.put("messageFormat",
new EnumSetting(Account.MessageFormat.class, Account.DEFAULT_MESSAGE_FORMAT));
- //s.put("messageFormatAuto", new BooleanSetting(Account.DEFAULT_MESSAGE_FORMAT_AUTO)); // added to version 2
+ s.put("messageFormatAuto", new BooleanSetting(Account.DEFAULT_MESSAGE_FORMAT_AUTO)); // added to version 2
s.put("messageReadReceipt", new BooleanSetting(Account.DEFAULT_MESSAGE_READ_RECEIPT));
s.put("notificationUnreadCount", new BooleanSetting(true));
s.put("notifyMailCheck", new BooleanSetting(false));
@@ -66,7 +66,7 @@ public class AccountSettings {
s.put("quoteStyle",
new EnumSetting(Account.QuoteStyle.class, Account.DEFAULT_QUOTE_STYLE));
s.put("replyAfterQuote", new BooleanSetting(Account.DEFAULT_REPLY_AFTER_QUOTE));
- //s.put("stripSignature", new BooleanSetting(Account.DEFAULT_STRIP_SIGNATURE)); // added to version 2
+ s.put("stripSignature", new BooleanSetting(Account.DEFAULT_STRIP_SIGNATURE)); // added to version 2
s.put("ring", new BooleanSetting(true));
s.put("ringtone", new RingtoneSetting("content://settings/system/notification_sound"));
s.put("saveAllHeaders", new BooleanSetting(true));
diff --git a/src/com/fsck/k9/preferences/GlobalSettings.java b/src/com/fsck/k9/preferences/GlobalSettings.java
index 746d96dbd..4554890e1 100644
--- a/src/com/fsck/k9/preferences/GlobalSettings.java
+++ b/src/com/fsck/k9/preferences/GlobalSettings.java
@@ -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));
diff --git a/src/com/fsck/k9/preferences/Settings.java b/src/com/fsck/k9/preferences/Settings.java
index 8b2b00ace..60da58266 100644
--- a/src/com/fsck/k9/preferences/Settings.java
+++ b/src/com/fsck/k9/preferences/Settings.java
@@ -32,7 +32,7 @@ public class Settings {
*
* @see SettingsExporter
*/
- public static final int VERSION = 1;
+ public static final int VERSION = 2;
public static Map validate(Map settings,
Map importedSettings, boolean useDefaultValues) {