Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8f5de00 authored by cketti's avatar cketti Committed by GitHub
Browse files

Merge pull request #1522 from k9mail/confirm-mark-all-as-read

Ask for confirmation on "mark all as read"
parents 7826febe c65f54d3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -837,7 +837,7 @@ public class MessageList extends K9Activity implements MessageListFragmentListen
                return true;
            }
            case R.id.mark_all_as_read: {
                mMessageListFragment.markAllAsRead();
                mMessageListFragment.confirmMarkAllAsRead();
                return true;
            }
            case R.id.show_folder_list: {
+18 −0
Original line number Diff line number Diff line
@@ -1261,6 +1261,16 @@ public class MessageListFragment extends Fragment implements OnItemClickListener
                        confirmText, cancelText);
                break;
            }
            case R.id.dialog_confirm_mark_all_as_read: {
                String title = getString(R.string.dialog_confirm_mark_all_as_read_title);
                String message = getString(R.string.dialog_confirm_mark_all_as_read_message);

                String confirmText = getString(R.string.dialog_confirm_mark_all_as_read_confirm_button);
                String cancelText = getString(R.string.dialog_confirm_mark_all_as_read_cancel_button);

                fragment = ConfirmationDialogFragment.newInstance(dialogId, title, message, confirmText, cancelText);
                break;
            }
            default: {
                throw new RuntimeException("Called showDialog(int) with unknown dialog id.");
            }
@@ -2797,6 +2807,10 @@ public class MessageListFragment extends Fragment implements OnItemClickListener
                mActiveMessage = null;
                break;
            }
            case R.id.dialog_confirm_mark_all_as_read: {
                markAllAsRead();
                break;
            }
        }
    }

@@ -3509,6 +3523,10 @@ public class MessageListFragment extends Fragment implements OnItemClickListener
        return (isSingleAccountMode() && isSingleFolderMode());
    }

    public void confirmMarkAllAsRead() {
        showDialog(R.id.dialog_confirm_mark_all_as_read);
    }

    public void markAllAsRead() {
        if (isMarkAllAsReadSupported()) {
            mController.markAllMessagesRead(mAccount, mFolderName);
+1 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <item type="id" name="dialog_confirm_mark_all_as_read"/>
    <item type="id" name="dialog_confirm_delete"/>
    <item type="id" name="dialog_confirm_spam"/>
    <item type="id" name="dialog_attachment_progress"/>
+6 −0
Original line number Diff line number Diff line
@@ -939,6 +939,12 @@ Please submit bug reports, contribute new features and ask questions at
    <string name="dialog_confirm_delete_confirm_button">Yes</string>
    <string name="dialog_confirm_delete_cancel_button">No</string>

    <string name="dialog_confirm_mark_all_as_read_title">Confirm mark all as read</string>
    <string name="dialog_confirm_mark_all_as_read_message">Do you want to mark all messages as read?</string>

    <string name="dialog_confirm_mark_all_as_read_confirm_button">Yes</string>
    <string name="dialog_confirm_mark_all_as_read_cancel_button">No</string>

    <string name="dialog_confirm_spam_title">Confirm move to spam folder</string>
    <plurals name="dialog_confirm_spam_message">
        <item quantity="one">Do you really want to move this message to the spam folder?</item>