From: gmungoc Date: Thu, 28 Feb 2019 15:51:18 +0000 (+0000) Subject: Merge branch 'feature/JAL-3169cancelOverwrite' into develop X-Git-Tag: Release_2_11_0~17^2~95 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=0e96750ac13c49fe43f97d4929d2a5e4520eb141;p=jalview.git Merge branch 'feature/JAL-3169cancelOverwrite' into develop Conflicts: src/jalview/io/JalviewFileChooser.java --- 0e96750ac13c49fe43f97d4929d2a5e4520eb141 diff --cc src/jalview/io/JalviewFileChooser.java index 8deaa33,6b0eba8..7fbe801 --- a/src/jalview/io/JalviewFileChooser.java +++ b/src/jalview/io/JalviewFileChooser.java @@@ -48,7 -44,8 +48,9 @@@ import javax.swing.JList import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.SpringLayout; + import javax.swing.SwingUtilities; + import javax.swing.border.TitledBorder; +import javax.swing.filechooser.FileFilter; import javax.swing.plaf.basic.BasicFileChooserUI; /** @@@ -431,26 -358,20 +452,20 @@@ public class JalviewFileChooser extend } } - // TODO: ENSURE THAT FILES SAVED WITH A ':' IN THE NAME ARE REFUSED AND THE - // USER PROMPTED FOR A NEW FILENAME. - // DO NOT need to confirm file overwrite if using backup files (the files - // aren't being overwritten!) - if ((ret == JalviewFileChooser.APPROVE_OPTION) - && ourselectedFile.exists() && (!BackupFiles.getEnabled())) + if (ourselectedFile.exists()) - { - int confirm = JvOptionPane.showConfirmDialog(this, - MessageManager.getString("label.overwrite_existing_file"), - MessageManager.getString("label.file_already_exists"), - JvOptionPane.YES_NO_OPTION); + { - int confirm = JvOptionPane.showConfirmDialog(parent, ++ int confirm = JvOptionPane.showConfirmDialog(this, + MessageManager.getString("label.overwrite_existing_file"), + MessageManager.getString("label.file_already_exists"), + JvOptionPane.YES_NO_OPTION); - if (confirm != JvOptionPane.YES_OPTION) - { - return; - } + if (confirm != JvOptionPane.YES_OPTION) + { - ret = JalviewFileChooser.CANCEL_OPTION; ++ return; } - + } - return ret; + super.approveSelection(); } void recentListSelectionChanged(Object selection)