1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-25 00:58:50 -05:00

Merge branch 'star-confirm' of https://github.com/ashleywillis/k-9 into pull-101

* 'star-confirm' of https://github.com/ashleywillis/k-9:
  Option to have confirmation on deleting starred messages.
  incremented preferences/Settings.VERSION for new settings
This commit is contained in:
Andrew Chen 2011-11-15 11:21:27 -08:00
commit 97bfb5e229
7 changed files with 22 additions and 6 deletions

View File

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

View File

@ -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;
}

View File

@ -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();

View File

@ -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());

View File

@ -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));

View File

@ -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));

View File

@ -32,7 +32,7 @@ public class Settings {
*
* @see SettingsExporter
*/
public static final int VERSION = 1;
public static final int VERSION = 2;
public static Map<String, String> validate(Map<String, SettingsDescription> settings,
Map<String, String> importedSettings, boolean useDefaultValues) {