Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Do not ask again" for empty entry confirmation #8767

Closed
wants to merge 3 commits into from

Conversation

LIM0000
Copy link
Contributor

@LIM0000 LIM0000 commented May 9, 2022

Previous discussion about add "Do not ask again" for empty entry confirmation in JabRef #8296, related to #8096

add checkbox for do not ask for this kind of issue again for empty entry confirmations

Proposed solution:

Fixes #8296

  • Add a checkbox for Do not ask again in dialog box when user closes a tab or quit.
  • After the Do not ask again checkbox is ticked and:
    • user clicks on "Delete" button, all empty entries will be deleted in future without showing confirmation dialog
    • user clicks on "Cancel" button, all empty entries will retain in future without showing confirmation dialog
  • User able to turn on confirmation dialog by ticking Show confirmation dialog when deleting empty entries (Options -> Preferences -> General)

1 1
1 2

PR Checklist:

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

…n check box, add checkbox for dialog service do not ask again in Preference tab, change certain logic in closeTab()
Copy link
Member

@koppor koppor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What an effort for a simple check box.

I think, the setting "deleteEmptyEntries" is not necessary to solve the issue.

Localization.lang("Empty entries"),
Localization.lang("Library '%0' has empty entries. Do you want to delete them?", filename),
Localization.lang("Delete"),
Localization.lang("Cancel"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about this one. Should this be "Keep" or "Keep empty entries"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @koppor , you are right.
It makes much more sense to popup a dialog asking about keeping empty entries instead of deletion.
Please keep me updated if changes needed here.

Localization.lang("Cancel"),
Localization.lang("Do not ask again"),
(optOut) -> prefs.getGeneralPreferences().setConfirmDeleteEmptyEntries(!optOut));
prefs.getGeneralPreferences().setDeleteEmptyEntries(response);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the user's preferences. The PR did not show a screenshot of that setting.

If I (as user) am asked whether I want to delete empty entries, what happens the next time I press on save? Is my last setting preserved?

I this is used only for the current call of write, this should be done differently (maybe as it was before)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @koppor , I am not too sure about your question.

  1. If user does not tick on "Do not ask again" checkbox, system will keep popping the confirmation dialog about empty entries deletion.
  2. If user does tick on "Do not ask again" checkbox, prefs.getGeneralPreferences().setConfirmDeleteEmptyEntries used to store the value and no longer show the confirmation dialog in future
  3. If user clicks on "Delete" button and tick on "Do not ask again" checkbox, prefs.getGeneralPreferences().setDeleteEmptyEntries(response) always delete empty entries in future.
  4. If user does not click on "Delete" button but tick on "Do not ask again" checkbox, prefs.getGeneralPreferences().setDeleteEmptyEntries(response) always does not delete empty entries in future.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the explanation. I read that the preference is always saved, independent of the checkbox "Do not ask again". This is IMHO the first occasion where during a usage of JabRef the preferences are changed. (Side note: It is OK for me, because I used that concept a decade ago. However, we removed that approx. 5 years ago not to confuse users)

With "did not show a screenshot" I meant that "Always delete entries" is not showing up at https://user-images.githubusercontent.com/49628911/167340402-3bde988e-d67e-4734-bf8f-3b4992ed219d.png - or do I miss something?

Copy link
Contributor Author

@LIM0000 LIM0000 May 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your review @koppor.
In my humble opinion, "Always delete entries" preference relies on the empty entries deletion confirmation dialog. Therefore, I have only added "Show confirmation dialog when deleting empty entries" for user to access the preference of confirmation dialog.

Could you please advice if "Always delete entries" is needed at https://user-images.githubusercontent.com/49628911/167340402-3bde988e-d67e-4734-bf8f-3b4992ed219d.png?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@koppor Not sure, we have a couple of confirmation dialogs where the choice is stored in the preferences

@koppor
Copy link
Member

koppor commented May 31, 2022

I put the devcall label to get this PR decided (and to discuss #8296 (comment))

@koppor
Copy link
Member

koppor commented Jun 6, 2022

We had a discussion in today's developer's call and decided to go a different way. See #8645 (comment). Thus, this PR is obsolete. We hope you learned something about Java and Open Source nevertheless.

@koppor koppor closed this Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "Do not ask again" for empty entry confirmation in JabRef
4 participants