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

Commit c65f54d3 authored by Vincent Breitmoser's avatar Vincent Breitmoser
Browse files

ask for confirmation on "mark all as read" (closes #1509)

parent a58ca462
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -53,7 +53,6 @@ import com.fsck.k9.search.SearchSpecification;
import com.fsck.k9.search.SearchSpecification.Attribute;
import com.fsck.k9.search.SearchSpecification.SearchCondition;
import com.fsck.k9.search.SearchSpecification.SearchField;
import com.fsck.k9.ui.messageview.CryptoInfoDialog.OnClickShowCryptoKeyListener;
import com.fsck.k9.ui.messageview.MessageViewFragment;
import com.fsck.k9.ui.messageview.MessageViewFragment.MessageViewFragmentListener;
import com.fsck.k9.view.MessageHeader;
@@ -837,7 +836,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>