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

More safely delete files #2569

Merged
merged 4 commits into from
Feb 21, 2017
Merged

More safely delete files #2569

merged 4 commits into from
Feb 21, 2017

Conversation

stefan-kolb
Copy link
Member

See #245

  • confirmation before file deletion
  • change language strings so the user knows this action is permanent

# Conflicts:
#	src/main/java/net/sf/jabref/gui/fieldeditors/FileListEditor.java
@stefan-kolb stefan-kolb added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Feb 19, 2017

int userConfirm = JOptionPane.showConfirmDialog(null, Localization.lang("Are you sure you want to delete this file?"), Localization.lang("Warning"), JOptionPane.YES_NO_OPTION);
if (userConfirm == JOptionPane.YES_OPTION) {
Copy link
Member

Choose a reason for hiding this comment

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

Please don't use simple YES/NO Buttons:
http://www.uxdesignedge.com/2010/06/are-you-sure-how-to-write-effective-confirmations/

Better add explicit named Buttons Delete file permanently and Cancel:
As I just did this yesterday for another case, here is a sample code:

String[] options = {Localization.lang("Move file"), Localization.lang("Cancel")}; 
int dialogResult = JOptionPane.showOptionDialog(frame, "Move file to file directory" + fileDir.get(),
              "Move",
                   JOptionPane.INFORMATION_MESSAGE, JOptionPane.YES_NO_CANCEL_OPTION, null, options, options[0]);
            if (dialogResult == JOptionPane.YES_OPTION) {

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm, one can argue if this really adds so much value. I think the functionality is clear with the question Do you really want to delete this file?. It just adds more Strings that need to be translated. However, I'm OK with implementing this.

In general, what do @JabRef/developers think about this?

Copy link
Member

Choose a reason for hiding this comment

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

There are just a few more Strings, but it really helps to improve usability a lot! Here is a more detailed explanation . http://ux.stackexchange.com/questions/756/what-are-some-alternatives-to-the-phrase-are-you-sure-you-want-to-xyz-in-confi

See also JabRef#149

Copy link
Member Author

Choose a reason for hiding this comment

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

I understand it, tho not sure if I really agree 😄

@Siedlerchr Siedlerchr merged commit 9418cd5 into master Feb 21, 2017
@Siedlerchr Siedlerchr deleted the file-deletion branch February 21, 2017 11:44
Siedlerchr added a commit that referenced this pull request Feb 21, 2017
* upstream/master:
  Fix failng tets (Medline,  ISBN, L10N) (#2578)
  Removed groups edit mode
  More safely delete files (#2569)
  Fix NPE on tab switching in EntryEditor between Mr Dlib and File Annotations (#2567)
  Fix medline fetcher test (#2568)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants